# HG changeset patch # User Dan Fuhry # Date 1278031913 14400 # Node ID cd72bcd834017b090ad6758606c0983218189d7e # Parent 49db7495f6b812b523b8da9ad0d6822371ab6ac6 Fixed the (rather expected) 1.0.x migration issues db revision system diff -r 49db7495f6b8 -r cd72bcd83401 includes/common.php --- a/includes/common.php Thu Jul 01 20:24:19 2010 -0400 +++ b/includes/common.php Thu Jul 01 20:51:53 2010 -0400 @@ -288,7 +288,7 @@ } // If we made it here, DB is up to date. -if ( getConfig('enano_version') !== $version && !preg_match('/^upg-/', getConfig('enano_version')) ) +if ( getConfig('enano_version') !== $version && !preg_match('/^upg-/', getConfig('enano_version')) && !defined('IN_ENANO_UPGRADE') ) { setConfig('enano_version', $version); setConfig('newly_upgraded', 1); diff -r 49db7495f6b8 -r cd72bcd83401 includes/sessions.php --- a/includes/sessions.php Thu Jul 01 20:24:19 2010 -0400 +++ b/includes/sessions.php Thu Jul 01 20:51:53 2010 -0400 @@ -833,10 +833,20 @@ if($sess) { - if($level > USER_LEVEL_MEMBER) - $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,author_uid,edit_summary,page_text) VALUES(\'security\', \'admin_auth_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', ' . $row['user_id'] . ', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', ' . intval($level) . ')'); + if ( getConfig('db_version') >= 1125 ) + { + if($level > USER_LEVEL_MEMBER) + $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,author_uid,edit_summary,page_text) VALUES(\'security\', \'admin_auth_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', ' . $row['user_id'] . ', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', ' . intval($level) . ')'); + else + $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,author_uid,edit_summary) VALUES(\'security\', \'auth_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', ' . $row['user_id'] . ', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\')'); + } else - $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,author_uid,edit_summary) VALUES(\'security\', \'auth_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', ' . $row['user_id'] . ', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\')'); + { + if($level > USER_LEVEL_MEMBER) + $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'admin_auth_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', ' . intval($level) . ')'); + else + $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'auth_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\')'); + } $code = $plugins->setHook('login_success'); foreach ( $code as $cmd ) diff -r 49db7495f6b8 -r cd72bcd83401 install/includes/libenanoinstall.php --- a/install/includes/libenanoinstall.php Thu Jul 01 20:24:19 2010 -0400 +++ b/install/includes/libenanoinstall.php Thu Jul 01 20:51:53 2010 -0400 @@ -174,6 +174,13 @@ } } + // cap to target rev + foreach ( $upg_queue as $i => $ver ) + { + if ( $ver > $target_rev ) + unset($upg_queue[$i]); + } + // Perform upgrade foreach ( $upg_queue as $version ) { diff -r 49db7495f6b8 -r cd72bcd83401 language/english/install.json --- a/language/english/install.json Thu Jul 01 20:24:19 2010 -0400 +++ b/language/english/install.json Thu Jul 01 20:51:53 2010 -0400 @@ -422,7 +422,7 @@ 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_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 encounter 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',