| 9 | | * Wir brauchen alle Konstanten aus settings.inc.php, können diese |
|---|
| 10 | | * Datei aber nicht inkluden, weil dann ebenfalls prepenc.inc.php |
|---|
| 11 | | * eingebunden wÃŒrde - dies darf aber im Update-Script nicht passieren |
|---|
| 12 | | * |
|---|
| 13 | | * Deshalb lesen wir die Konstanten auf etwas umstÀndlichere Weise |
|---|
| 14 | | * von Hand aus der Datei aus |
|---|
| 15 | | */ |
|---|
| 16 | | $lines = file("..".DIRECTORY_SEPARATOR."personal".DIRECTORY_SEPARATOR."settings.inc.php"); |
|---|
| 17 | | $password_hash = ''; |
|---|
| 18 | | foreach($lines as $line) { |
|---|
| 19 | | if(preg_match("/define\('(JLOG_[A-Z_]+)', ('[^']*'|true|false|\d+)\);/", $line, $result)) { |
|---|
| 20 | | switch($result[2]) { |
|---|
| | 9 | * In earlier Jlog versions, there used to be an require_once(prepend.inc.php) in |
|---|
| | 10 | * the settings.inc.php. Therefore, we need to check against this inclusion, as |
|---|
| | 11 | * we MUST NOT include prepend.inc.php. |
|---|
| | 12 | */ |
|---|
| | 13 | $config = file_get_contents('..'.DIRECTORY_SEPARATOR.'personal'.DIRECTORY_SEPARATOR.'settings.inc.php'); |
|---|
| | 14 | if(strpos($config, 'require_once') !== false) { |
|---|
| | 15 | // there is require_once in settings.inc.php, so we need to parse that file manually |
|---|
| | 16 | preg_match_all("/define\('(JLOG_[A-Z_]+)', ('[^']*'|true|false|\d+)\);/", $config, $result, PREG_SET_ORDER); |
|---|
| | 17 | // only finds constants that start with JLOG_ and have a boolean, numeric or single-quoted value |
|---|
| | 18 | foreach($result as $constant) { |
|---|
| | 19 | switch($constant[2]) { |
|---|
| 44 | | /** |
|---|
| 45 | | * Die Konstante JLOG_LANGUAGE wurde mit Jlog 1.1.0 neu eingefÃŒhrt, |
|---|
| 46 | | * folglich wurde das Update-Script auf 1.1.0 bereits ausgefÃŒhrt, wenn |
|---|
| 47 | | * diese Konstante existiert. |
|---|
| 48 | | */ |
|---|
| 49 | | if(defined('JLOG_LANGUAGE')) { |
|---|
| 50 | | die('Das Update-Script kann nur einmal ausgefÃŒhrt werden.'); |
|---|
| | 50 | // get version information |
|---|
| | 51 | require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'version.inc.php'); |
|---|
| | 52 | |
|---|
| | 53 | /** |
|---|
| | 54 | * If there is no version information available we think of the installation |
|---|
| | 55 | * as of Jlog 1.0.2, which means that it will be impossible to update from any |
|---|
| | 56 | * version earlier as 1.0.2 to this version - you MUST upgrade to 1.0.2 before |
|---|
| | 57 | * you can install this version of Jlog. |
|---|
| | 58 | */ |
|---|
| | 59 | if(!defined('JLOG_INSTALLED_VERSION')) { |
|---|
| | 60 | define('JLOG_INSTALLED_VERSION', '1.0.2'); |
|---|
| | 61 | } |
|---|
| | 62 | /** |
|---|
| | 63 | * If we are already at the version we want to upgrade to this means that the |
|---|
| | 64 | * upgrade script did already do its job. |
|---|
| | 65 | */ |
|---|
| | 66 | if(version_compare(JLOG_SOFTWARE_VERSION, JLOG_INSTALLED_VERSION, '==')) { |
|---|
| | 67 | header('Content-Type: text/plain'); |
|---|
| | 68 | echo 'The update script must only be runend once.' . "\n"; |
|---|
| | 69 | echo 'Das Update-Skript darf nur einmal ausgefÃŒhrt werden.'; |
|---|
| | 70 | exit; |
|---|