Upgrader: UX: Added welcome page, different between Caoineag and Banshee
authorDan
Sun, 19 Apr 2009 19:01:08 -0400
changeset 941 9be6dba92adf
parent 940 645727469415
child 942 18db38c70a41
Upgrader: UX: Added welcome page, different between Caoineag and Banshee
includes/sessions.php
install/upgrade.php
language/english/install.json
--- 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);
--- 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 '<h3>' . $lang->get('upgrade_welcome_banshee_heading', array('enano_version' => installer_enano_version())) . '</h3>';
+    echo '<p>' . $lang->get('upgrade_welcome_banshee_para1') . '</p>';
+    echo '<p>' . $lang->get('upgrade_welcome_banshee_para2') . '</p>';
+  }
+  else
+  {
+    // Upgrading from 1.1.x/1.2.x
+    echo '<h3>' . $lang->get('upgrade_welcome_caoineag_heading', array('enano_version' => installer_enano_version())) . '</h3>';
+    echo '<p>' . $lang->get('upgrade_welcome_caoineag_para1') . '</p>';
+  }
+  
+  echo '<div style="font-size: x-large; text-align: center; margin: 20px 0;">';
+  echo '<a class="abutton" href="' . $session->append_sid('upgrade.php?stage=confirm') . '" style="text-decoration: none;">' . $lang->get('upgrade_welcome_btn_continue') . ' &raquo;</a>';
+  echo '</div>';
+  
+  $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 @@
   <h3><?php echo $lang->get('upgrade_login_msg_auth_needed_title'); ?></h3>
   <?php
   
-  echo '<form action="upgrade.php" method="post">';
+  echo '<form action="upgrade.php?stage=login" method="post">';
   
   if ( isset($result) )
   {
@@ -277,9 +307,9 @@
     <li><?php echo $lang->get('upgrade_confirm_objective_backup_db', array('dbname' => $dbname)); ?></li>
   </ul>
   <?php
-  if ( $do_langimport ):
+  if ( $do_langimport && !preg_match('/1\.0/', enano_version()) ):
   ?>
-  <div class="warning-box">
+  <div class="warning-box" style="margin: 10px 0;">
     <?php echo $lang->get('upgrade_confirm_warning_langimport'); ?>
   </div>
   <?php
@@ -287,8 +317,8 @@
   ?>
   <form method="get" action="upgrade.php" style="text-align: center;">
     <input type="hidden" name="auth" value="<?php echo $session->sid_super; ?>" />
-    <button name="stage" value="pimpmyenano" class="submit">
-      <img src="images/icons/pimp.png" />
+    <button name="stage" value="pimpmyenano" class="submit" style="padding-bottom: 8px;">
+    <img src="images/icons/pimp.png" style="position: relative; top: 6px;" />
       <?php echo $lang->get('upgrade_confirm_btn_upgrade'); ?>
     </button>
   </form>
--- 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 <a href="http://forum.enanocms.org/">Enano forums</a>.',
+      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.',