diff -r 7f196509bf78 -r 3700f7124c2b install/upgrade.php --- a/install/upgrade.php Mon Jun 09 20:52:34 2008 -0400 +++ b/install/upgrade.php Tue Jun 10 00:21:34 2008 -0400 @@ -33,59 +33,27 @@ require_once('includes/libenanoinstall.php'); // when the installer's common is loaded, it runs chdir() to the ENANO_ROOT, thus making this Enano's common.php +// PHP5 notice removed in 1.1.4 since the existing common is loaded and that loads lang and json2, which will +// give syntax errors on PHP4. So much for that. The installer will warn about this anyway. require_once('includes/common.php'); @ini_set('display_errors', 'on'); $ui = new Enano_Installer_UI('Enano upgrader', false); -if ( version_compare(PHP_VERSION, '5.0.0', '<') ) -{ - $ui->__construct('Enano upgrader', false); -} + $stg_welcome = $ui->add_stage('Welcome', true); $stg_confirm = $ui->add_stage('Confirmation', true); $stg_upgrade = $ui->add_stage('Perform upgrade', true); $stg_finish = $ui->add_stage('Finish', true); -$stg_php4 = $ui->add_stage('PHP4 compatibility notice', false); -if ( version_compare(PHP_VERSION, '5.0.0', '<') || isset($_GET['debug_warn_php4']) ) -{ - $ui->set_visible_stage($stg_php4); - $ui->step = ''; - - $ui->show_header(); - - // This isn't localized because all localization code is dependent on - // PHP 5 (loading lang.php will throw a parser error under PHP4). This - // one message probably doesn't need to be localized anyway. - - ?> -

- Your server doesn't have support for PHP 5. -

-

- PHP 5 is the latest version of the language on which Enano was built. Its many new features have been available since early 2004, yet - many web hosts have not migrated to it because of the work involved. In 2007, Zend Corporation announced that support for the aging - PHP 4.x would be discontinued at the end of the year. An initiative called GoPHP5 was started to - encourage web hosts to migrate to PHP 5. -

-

- Because of the industry's decision to not support PHP 4 any longer, the Enano team decided that it was time to begin using the powerful - features of PHP 5 at the expense of PHP 4 compatibility. Therefore, this version of Enano cannot be installed on your server until it - is upgraded to at least PHP 5.0.0, and preferably the latest available version. - -

-

- If you need to use Enano but can't upgrade your PHP because you're on a shared or reseller hosting service, you can use the - 1.0.x series of Enano on your site. While the Enano team attempts to make this - older series work on PHP 4, official support is not provided for installations of Enano on PHP 4. -

- show_footer(); - exit(0); -} +// init languages +$lang_id_list = array_keys($languages); +$lang_id = $lang_id_list[0]; +$language_dir = $languages[$lang_id]['dir']; + +// load the language file +$lang = new Language($lang_id); +$lang->load_file(ENANO_ROOT . '/language/' . $language_dir . '/install.json'); +$lang->load_file(ENANO_ROOT . '/language/' . $language_dir . '/user.json'); // Version check if ( enano_version() == installer_enano_version() ) @@ -106,35 +74,57 @@ { $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_MEMBER); } - $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_ADMIN); - if ( $result['success'] ) + if ( !isset($result) || ( isset($result) && $result['success']) ) { - header('HTTP/1.1 302 Some kind of redirect with implied no content'); - header('Location: ' . scriptPath . '/install/' . $session->append_sid('upgrade.php')); - exit(); + $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, USER_LEVEL_ADMIN); + if ( $result['success'] ) + { + header('HTTP/1.1 302 Some kind of redirect with implied no content'); + header('Location: ' . scriptPath . '/install/' . $session->append_sid('upgrade.php')); + exit(); + } } } $ui->show_header(); ?> -

Authentication needed

+

get('upgrade_login_msg_auth_needed_title'); ?>

'; if ( isset($result) ) { - echo 'Session manager returned error:' . '
' . print_r($result, true) . '
'; + echo '' . $lang->get('upgrade_login_err_failed', array('error_code' => $result['error'])) . ''; } ?> -

You need user_logged_in ) echo 'to be logged in and have '; ?>an active admin session to continue.

-

- Username:   
- Password:   
- -

+

user_logged_in ) + { + echo $lang->get('upgrade_login_msg_auth_needed_body_level2'); + } + else + { + echo $lang->get('upgrade_login_msg_auth_needed_body_level1'); + } + ?>

+ + + + + + + + + + + + +
get('user_login_field_username'); ?>:
get('user_login_field_password'); ?>:
+ +
'; @@ -213,7 +203,19 @@ else { ?> -

Nothing's really implemented for now except the actual migration code, which is not very smart. Just do the upgrade and get it over with.

+

get('upgrade_confirm_title'); ?>

+

get('upgrade_confirm_body', array('enano_version' => installer_enano_version())); ?>

+ +
+ + +