install/upgrade.php
changeset 627 460e483987ab
parent 626 be0e904eec17
child 685 17ebe24cdf85
--- a/install/upgrade.php	Sat Jul 12 00:07:53 2008 -0400
+++ b/install/upgrade.php	Sat Jul 12 00:31:44 2008 -0400
@@ -59,7 +59,10 @@
 if ( enano_version() == installer_enano_version() )
 {
   $ui->show_header();
-  echo '<h3>Already upgraded</h3>' . '<p>You don\'t need to migrate, you\'re already on <del>crack</del> the 1.1 platform.</p>';
+  $link_home = makeUrl(getConfig('main_page'), false, true);
+  echo '<h3>' . $lang->get('upgrade_err_current_title') . '</h3>' .
+       '<p>' . $lang->get('upgrade_err_current_body', array('mainpage_link' => $link_home)) . '</p>' .
+       '<p>' . $lang->get('upgrade_err_current_body_para2', array('mainpage_link' => $link_home)) . '</p>';
   $ui->show_footer();
   exit();
 }
@@ -175,7 +178,7 @@
    */
   
   // Do we need to run the migration first?
-  list($major_version, $minor_version) = explode('.', enano_version());
+  list($major_version, $minor_version) = explode('.', preg_replace('/^upg-/', '', enano_version()));
   $current_branch = "$major_version.$minor_version";
   
   list($major_version, $minor_version) = explode('.', installer_enano_version());
@@ -213,8 +216,8 @@
   <form action="upgrade.php" method="get" style="text-align: center;">
     <input type="hidden" name="auth" value="<?php echo $session->sid_super; ?>" />
     <p style="text-align: center;">
-      <button name="stage" value="postpimp">
-        <?php echo $lang->get('etc_continue'); ?>
+      <button name="stage" value="postpimp" class="submit">
+        <?php echo $lang->get('upgrade_btn_continue'); ?>
       </button>
     </p>
   </form>
@@ -249,6 +252,9 @@
   run_installer_stage('setversion', $lang->get('upgrade_stg_setversion_title'), 'stg_set_version', $lang->get('upgrade_stg_setversion_body'));
   close_install_table();
   
+  // demote privileges
+  $session->logout(USER_LEVEL_ADMIN);
+  
   $link_home = makeUrl(getConfig('main_page'), false, true);
   echo '<h3>' . $lang->get('upgrade_post_status_finish_title') . '</h3>';
   echo '<p>' . $lang->get('upgrade_post_status_finish_body', array('mainpage_link' => $link_home)) . '</p>';