Changeset 1739
- Timestamp:
- 09/03/2008 03:53:30 PM (3 months ago)
- Files:
-
- trunk/admin/update.php (modified) (1 diff)
- trunk/scripts/JlogUpdater.php (modified) (6 diffs)
- trunk/scripts/prepend.inc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/admin/update.php
r1738 r1739 7 7 // load prepend.inc.php 8 8 require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php'); 9 10 if (!defined(JLOG_LANGUAGE)) { 11 define('JLOG_LANGUAGE', 'de'); 12 } 13 9 14 10 include(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR.'lang.'.JLOG_LANGUAGE.'.inc.php'); 15 11 include(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR.'lang-admin.'.JLOG_LANGUAGE.'.inc.php'); trunk/scripts/JlogUpdater.php
r1738 r1739 15 15 ); 16 16 17 function JlogUpdater() { 18 /** 19 * If there is no version information available we think of the installation 20 * as of Jlog 1.0.2, which means that it will be impossible to upgrade from any 21 * version earlier as 1.0.2 - you MUST upgrade to 1.0.2 before 22 * you can install this version of Jlog. 23 */ 24 if (!defined('JLOG_INSTALLED_VERSION')) { 25 define('JLOG_INSTALLED_VERSION', '1.0.2'); 26 } 27 if (!defined('JLOG_UPDATE')) { 28 define('JLOG_UPDATE', true); 29 } 17 function JlogUpdater() 18 { 19 // nothing to do here now 30 20 } 31 21 32 function getOldVersion() { 22 function getOldVersion() 23 { 33 24 return JLOG_INSTALLED_VERSION; 34 25 } 35 26 36 function getNewVersion() { 27 function getNewVersion() 28 { 37 29 return JLOG_SOFTWARE_VERSION; 38 30 } 39 31 40 function isUp2Date() { 32 function isUp2Date() 33 { 41 34 if (version_compare($this->getOldVersion(), $this->getNewVersion(), '<')) { 42 35 return false; … … 45 38 } 46 39 47 function prepareForm($l) { 40 function prepareForm($l) 41 { 48 42 $html = '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post">' 49 43 . '<p>' . $l['admin']['e_admin_password'] . ': ' … … 62 56 } 63 57 64 function performUpdate($l) { 58 function performUpdate($l) 59 { 65 60 if (JLOG_AMDIN_PASSWORD !== md5($_POST['jlog_password']) and JLOG_ADMIN_PASSWORD !== md5(utf8_decode($_POST['jlog_password']))) { 66 61 return '<p>' . $l['admin']['login_false_pw'] . '</p>'; … … 92 87 } 93 88 94 function _getUpdateFile($oldver, $newver) { 89 function _getUpdateFile($oldver, $newver) 90 { 95 91 $oldver = str_replace('.', '', $oldver); 96 92 $newver = str_replace('.', '', $newver); … … 98 94 } 99 95 100 function _getUpdateClass($oldver, $newver) { 96 function _getUpdateClass($oldver, $newver) 97 { 101 98 $oldver = str_replace('.', '', $oldver); 102 99 $newver = str_replace('.', '', $newver); … … 104 101 } 105 102 106 function _loadUpdateClass($oldver, $newver) { 103 function _loadUpdateClass($oldver, $newver) 104 { 107 105 $file = $this->_getUpdateFile($oldver, $newver); 108 106 $class = $this->_getUpdateClass($oldver, $newver); trunk/scripts/prepend.inc.php
r1736 r1739 29 29 require_once(JLOG_BASEPATH."scripts".DIRECTORY_SEPARATOR."version.inc.php"); 30 30 31 // these two constants did not exist in Jlog 1.0.2 32 if (!defined('JLOG_INSTALLED_VERSION')) { 33 define('JLOG_INSTALLED_VERSION', '1.0.2'); 34 } 35 if (!defined('JLOG_LANGUAGE')) { 36 define('JLOG_LANGUAGE', 'de'); 37 } 38 31 39 // redirect to update-script if new jlog version was installed 32 if((!defined('JLOG_INSTALLED_VERSION') 33 OR version_compare(JLOG_INSTALLED_VERSION, JLOG_SOFTWARE_VERSION, '<')) 40 if(version_compare(JLOG_INSTALLED_VERSION, JLOG_SOFTWARE_VERSION, '<') 34 41 AND substr($_SERVER['SCRIPT_FILENAME'], -17) !== '/admin/update.php') 35 42 {
