diff options
Diffstat (limited to 'inc/poche/Tools.class.php')
-rw-r--r-- | inc/poche/Tools.class.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 0eb0d9ea..1baf745d 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -233,4 +233,30 @@ class Tools | |||
233 | 233 | ||
234 | return $minutes; | 234 | return $minutes; |
235 | } | 235 | } |
236 | |||
237 | |||
238 | public static function createMyConfig() | ||
239 | { | ||
240 | $myconfig_file = './inc/poche/myconfig.inc.php'; | ||
241 | |||
242 | if (version_compare(POCHE_VERSION, '1.0-beta3') == 1) { | ||
243 | # $myconfig_file is only created with poche > 1.0-beta3 | ||
244 | # in 1.0-beta3, the update script creates $myconfig_file | ||
245 | |||
246 | if (!is_writable('./inc/poche/')) { | ||
247 | self::logm('you don\'t have write access to create ./inc/poche/myconfig.inc.php'); | ||
248 | die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); | ||
249 | } | ||
250 | |||
251 | if (!file_exists($myconfig_file)) | ||
252 | { | ||
253 | $fp = fopen($myconfig_file, 'w'); | ||
254 | fwrite($fp, '<?php'."\r\n"); | ||
255 | fwrite($fp, "define ('POCHE_VERSION', '1.0-beta3');" . "\r\n"); | ||
256 | fwrite($fp, "define ('SALT', '" . md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand()) . "');" . "\r\n"); | ||
257 | fwrite($fp, "define ('LANG', 'en_EN.utf8');" . "\r\n"); | ||
258 | fclose($fp); | ||
259 | } | ||
260 | } | ||
261 | } | ||
236 | } \ No newline at end of file | 262 | } \ No newline at end of file |