# HG changeset patch # User Dan # Date 1240182068 14400 # Node ID 9be6dba92adff27f54fe2a1768cff3b8979e44f5 # Parent 64572746941527d4966b899b6b741ee9e6603142 Upgrader: UX: Added welcome page, different between Caoineag and Banshee diff -r 645727469415 -r 9be6dba92adf includes/sessions.php --- a/includes/sessions.php Sun Apr 19 18:42:21 2009 -0400 +++ b/includes/sessions.php Sun Apr 19 19:01:08 2009 -0400 @@ -777,7 +777,7 @@ $success = true; } } - else if ( $row['old_encryption'] == 2 || ( defined('ENANO_UPGRADE_USE_AES_PASSWORDS') ) ) + else if ( $row['old_encryption'] == 2 || ( defined('ENANO_UPGRADE_USE_AES_PASSWORDS') ) && strlen($row['password']) != 40 ) { // Our password field uses the 1.0RC1-1.1.5 encryption format $real_pass = $aes->decrypt($row['password'], $this->private_key); diff -r 645727469415 -r 9be6dba92adf install/upgrade.php --- a/install/upgrade.php Sun Apr 19 18:42:21 2009 -0400 +++ b/install/upgrade.php Sun Apr 19 19:01:08 2009 -0400 @@ -46,13 +46,6 @@ if ( in_array(enano_version(), array('1.0RC1', '1.0RC2', '1.0RC3', '1.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4', '1.0.5', '1.0.6', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5')) ) define('ENANO_UPGRADE_USE_AES_PASSWORDS', 1); -$ui = new Enano_Installer_UI('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); - // init languages $lang_id_list = array_keys($languages); $lang_id = $lang_id_list[0]; @@ -63,6 +56,14 @@ $lang->load_file(ENANO_ROOT . '/language/' . $language_dir . '/install.json'); $lang->load_file(ENANO_ROOT . '/language/' . $language_dir . '/user.json'); +$ui = new Enano_Installer_UI($lang->get('upgrade_system_title'), false); + +$stg_welcome = $ui->add_stage($lang->get('upgrade_stg_welcome'), true); +$stg_login = $ui->add_stage($lang->get('upgrade_stg_login'), true); +$stg_confirm = $ui->add_stage($lang->get('upgrade_stg_confirm'), true); +$stg_upgrade = $ui->add_stage($lang->get('upgrade_stg_upgrade'), true); +$stg_finish = $ui->add_stage($lang->get('upgrade_stg_finish'), true); + // Version check if ( enano_version() == installer_enano_version() ) { @@ -77,8 +78,37 @@ // Start session manager $session->start(); + +// Welcome page +if ( !isset($_GET['stage']) ) +{ + $ui->show_header(); + + if ( preg_match('/1\.0/', enano_version()) ) + { + // Migrating from 1.0.x + echo '

' . $lang->get('upgrade_welcome_banshee_heading', array('enano_version' => installer_enano_version())) . '

'; + echo '

' . $lang->get('upgrade_welcome_banshee_para1') . '

'; + echo '

' . $lang->get('upgrade_welcome_banshee_para2') . '

'; + } + else + { + // Upgrading from 1.1.x/1.2.x + echo '

' . $lang->get('upgrade_welcome_caoineag_heading', array('enano_version' => installer_enano_version())) . '

'; + echo '

' . $lang->get('upgrade_welcome_caoineag_para1') . '

'; + } + + echo '
'; + echo '' . $lang->get('upgrade_welcome_btn_continue') . ' »'; + echo '
'; + + $ui->show_footer(); + exit; +} + if ( !$session->user_logged_in || ( $session->user_logged_in && $session->auth_level < USER_LEVEL_ADMIN ) ) { + $ui->set_visible_stage($stg_login); if ( isset($_POST['do_login']) ) { if ( !$session->user_logged_in ) @@ -91,7 +121,7 @@ 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')); + header('Location: ' . scriptPath . '/install/' . $session->append_sid('upgrade.php?stage=confirm')); exit(); } } @@ -103,7 +133,7 @@

get('upgrade_login_msg_auth_needed_title'); ?>

'; + echo '
'; if ( isset($result) ) { @@ -277,9 +307,9 @@
  • get('upgrade_confirm_objective_backup_db', array('dbname' => $dbname)); ?>
  • -
    +
    get('upgrade_confirm_warning_langimport'); ?>
    - diff -r 645727469415 -r 9be6dba92adf language/english/install.json --- a/language/english/install.json Sun Apr 19 18:42:21 2009 -0400 +++ b/language/english/install.json Sun Apr 19 19:01:08 2009 -0400 @@ -416,6 +416,20 @@ btn_close_window: 'Close window', }, upgrade: { + system_title: 'Enano upgrade tool', + stg_welcome: 'Welcome', + stg_login: 'Login', + stg_confirm: 'Confirmation', + stg_upgrade: 'Perform upgrade', + stg_finish: 'Finish', + + welcome_banshee_heading: 'Welcome to Enano %enano_version%.', + welcome_banshee_para1: 'Enano 1.2 features support for multiple languages, better security, faster page loading, more tools, a revamped page editor, and much more. This migration tool will automatically make the changes to your database required for Enano 1.2.', + welcome_banshee_para2: 'The migration tool has been tested under many different installation scenarios, but isn\'t fully guaranteed to work. The Enano team can\'t be responsible if the migration fails. If you encounted problems, please be sure to post on the Enano forums.', + welcome_caoineag_heading: 'Welcome to the Enano upgrade tool.', + welcome_caoineag_para1: 'To use this version of Enano, some parts of your database need to be upgraded. This tool will automatically perform the upgrade for you.', + welcome_btn_continue: 'Start upgrade', + login_msg_auth_needed_title: 'Authentication needed', login_msg_auth_needed_body_level1: 'To continue, you need to log in. Please enter an administrator username and password below.', login_msg_auth_needed_body_level2: 'To confirm the upgrade, you need to re-enter your login information. Please enter your username and password below.',