# HG changeset patch # User Dan # Date 1215837104 14400 # Node ID 460e483987ab06152bbf6f3f43ec60a434325654 # Parent be0e904eec174c1ef731e6adea388074ecd1178e Fixed a few more upgrader glitches and polished things a bit more. diff -r be0e904eec17 -r 460e483987ab install/includes/libenanoinstall.php --- a/install/includes/libenanoinstall.php Sat Jul 12 00:07:53 2008 -0400 +++ b/install/includes/libenanoinstall.php Sat Jul 12 00:31:44 2008 -0400 @@ -126,11 +126,21 @@ global $ui; // This is needed for upgrade abstraction global $dbdriver; + + // see if we're actually supposed to be in post-upgrade + if ( getConfig('enano_version') == 'upg-' . installer_enano_version() ) + { + // yep, fall out here to avoid errors + return true; + } + // Main upgrade stage // Init vars list($major_version, $minor_version) = explode('.', installer_enano_version()); $installer_branch = "$major_version.$minor_version"; + $installer_branch = preg_replace('/^upg-/', '', $installer_branch); + $target_branch = preg_replace('/^upg-/', '', $target_branch); $version_flipped = array_flip($enano_versions[$target_branch]); $version_curr = enano_version(); diff -r be0e904eec17 -r 460e483987ab install/includes/payload.php --- a/install/includes/payload.php Sat Jul 12 00:07:53 2008 -0400 +++ b/install/includes/payload.php Sat Jul 12 00:31:44 2008 -0400 @@ -474,10 +474,10 @@ function stg_set_version() { - global $db; + global $db, $session, $paths, $template, $plugins; // Common objects // log the upgrade $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,page_text,edit_summary) VALUES' - . '(\'security\', \'upgrade_enano\', ' . time() . ', \'[DEPRECATED]\', \'' . $db->escape($session->username) . '\', \'' . $db->escape($this_version) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');'); + . '(\'security\', \'upgrade_enano\', ' . time() . ', \'[DEPRECATED]\', \'' . $db->escape($session->username) . '\', \'' . $db->escape(installer_enano_version()) . '\', \'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\');'); if ( !$q ) { $db->_die(); diff -r be0e904eec17 -r 460e483987ab install/upgrade.php --- 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 '

Already upgraded

' . '

You don\'t need to migrate, you\'re already on crack the 1.1 platform.

'; + $link_home = makeUrl(getConfig('main_page'), false, true); + echo '

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

' . + '

' . $lang->get('upgrade_err_current_body', array('mainpage_link' => $link_home)) . '

' . + '

' . $lang->get('upgrade_err_current_body_para2', array('mainpage_link' => $link_home)) . '

'; $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 @@

-

@@ -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 '

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

'; echo '

' . $lang->get('upgrade_post_status_finish_body', array('mainpage_link' => $link_home)) . '

'; diff -r be0e904eec17 -r 460e483987ab language/english/install.json --- a/language/english/install.json Sat Jul 12 00:07:53 2008 -0400 +++ b/language/english/install.json Sat Jul 12 00:31:44 2008 -0400 @@ -374,12 +374,19 @@ confirm_objective_backup_db: 'Back up Enano database, including non-Enano tables if any (%dbname%)', confirm_btn_upgrade: 'Pimp my Enano!', + msg_schema_complete_title: 'Database upgrades complete', + msg_schema_complete_body: 'You\'re past the hard part - all of the modifications to your database were successful. We need to perform a few final steps to finish the upgrade; just click the button below to finish everything up.', + btn_continue: 'Finish upgrade', + + err_current_title: 'Already running current version', + err_current_body: 'No database upgrades are needed right now, you\'re already running the Enano version set in this installer. Try heading back to your site. Think there\'s a mistake somewhere? Let the Enano team know about it.', + err_current_body_para2: 'You might also want to use the administration panel to check for updates, or download the latest release of Enano.', err_post_not_available: 'You\'re trying to run the post-upgrade process, but your site isn\'t in the correct state for this.', post_status_title: 'Finishing upgrade', post_status_body: 'Enano is cleaning up some data and finalizing the upgrade.', post_status_finish_title: 'All done!', - post_status_finish_body: 'That\'s it - Enano has been upgraded. You should go back to your site now and make sure that everything works right. If you find a problem, be sure to report it to the Enano development team. (Make sure you disable any plugins first, since we can\'t easily tell if your problem is caused by the Enano core or by a plugin.)', + post_status_finish_body: 'That\'s it - Enano has been upgraded. You should go back to your site now and make sure that everything works right. If you find a problem, be sure to report it to the Enano development team. (Make sure you disable any plugins first, since we can\'t easily tell if your problem is caused by the Enano core or by a plugin, unless all of your non-system plugins are disabled.)', stg_flushcache_title: 'Flush caches', stg_flushcache_body: 'The upgrader failed to delete some cached data. You may experience some problems with file corruption or badly drawn pages until the caches expire, which is often no longer than 20 minutes.',