Changeset 6110
- Timestamp:
- May 8, 2010, 1:08:51 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_upgrade.php
r5982 r6110 113 113 114 114 // Check access rights 115 function check_upgrade_access_rights($current_release, $username, $password) 116 { 117 global $conf, $page; 115 function check_upgrade_access_rights() 116 { 117 global $conf, $page, $current_release; 118 119 if (version_compare($current_release, '2.0', '>=') and isset($_COOKIE[session_name()])) 120 { 121 // Check if user is already connected as webmaster 122 session_start(); 123 if (!empty($_SESSION['pwg_uid'])) 124 { 125 $query = ' 126 SELECT status 127 FROM '.USER_INFOS_TABLE.' 128 WHERE user_id = '.$_SESSION['pwg_uid'].' 129 ;'; 130 pwg_query($query); 131 132 $row = pwg_db_fetch_assoc(pwg_query($query)); 133 if (isset($row['status']) and $row['status'] == 'webmaster') 134 { 135 define('PHPWG_IN_UPGRADE', true); 136 return; 137 } 138 } 139 } 140 141 if (!isset($_POST['username']) or !isset($_POST['password'])) 142 { 143 return; 144 } 145 146 $username = $_POST['password']; 147 $password = $_POST['password']; 118 148 119 149 if(!@get_magic_quotes_gpc()) … … 231 261 } 232 262 } 233 234 /**235 * Get languages defined in the language directory236 */237 function get_fs_languages($target_charset = null)238 {239 if ( empty($target_charset) )240 {241 $target_charset = get_pwg_charset();242 }243 $target_charset = strtolower($target_charset);244 245 $dir = opendir(PHPWG_ROOT_PATH.'language');246 247 while ($file = readdir($dir))248 {249 $path = PHPWG_ROOT_PATH.'language/'.$file;250 if (!is_link($path) and is_dir($path) and file_exists($path.'/iso.txt'))251 {252 list($language_name) = @file($path.'/iso.txt');253 254 $languages[$file] = convert_charset($language_name, $target_charset);255 }256 }257 closedir($dir);258 @asort($languages);259 260 return $languages;261 }262 263 263 ?> -
trunk/upgrade.php
r5982 r6110 37 37 } 38 38 39 include_once(PHPWG_ROOT_PATH.'include/functions.inc.php');40 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');41 42 39 include(PHPWG_ROOT_PATH.'local/config/database.inc.php'); 43 40 include(PHPWG_ROOT_PATH . 'include/config_default.inc.php'); … … 49 46 define('PREFIX_TABLE', $prefixeTable); 50 47 define('UPGRADES_PATH', PHPWG_ROOT_PATH.'install/db'); 48 49 include_once(PHPWG_ROOT_PATH.'include/functions.inc.php'); 50 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 51 51 52 52 // +-----------------------------------------------------------------------+ … … 280 280 $mysql_changes = array(); 281 281 282 if (isset($_POST['username']) and isset($_POST['password'])) 283 { 284 check_upgrade_access_rights($current_release, $_POST['username'], $_POST['password']); 285 } 286 287 if (isset($_POST['submit']) and check_upgrade()) 282 check_upgrade_access_rights(); 283 284 if ((isset($_POST['submit']) or isset($_GET['now'])) 285 and check_upgrade()) 288 286 { 289 287 $upgrade_file = PHPWG_ROOT_PATH.'install/upgrade_'.$current_release.'.php';
Note: See TracChangeset
for help on using the changeset viewer.