From 26bb3bbb6824166d05362f5516009fdf3477195f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 9 Jul 2009 13:28:25 +0000 Subject: [PATCH] print out error if users try to update phpBB versions no longer supported with the used database update script git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9743 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 53 ++++++++++++++++--------------- phpBB/language/en/install.php | 1 + 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index d7398ea953..249b0a8f69 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -11,7 +11,7 @@ $updates_to_version = '3.0.6-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. -$debug_from_version = '3.0.5'; +$debug_from_version = false; // Which oldest version does this updater supports? $oldest_from_version = '3.0.0'; @@ -249,28 +249,25 @@ if ($db->sql_layer == 'mysql' || $db->sql_layer == 'mysql4' || $db->sql_layer == echo '

' . $lang['ERROR'] . '


'; echo '

' . sprintf($lang['MYSQL_SCHEMA_UPDATE_REQUIRED'], $config['dbms_version'], $db->sql_server_info(true)) . '

'; -?> - - - - - - - - - - - -

' . $lang['ERROR'] . '


'; + echo '

' . sprintf($lang['DB_UPDATE_NOT_SUPPORTED'], $oldest_from_version, $current_version) . '

'; + + _print_footer(); + exit_handler(); + exit; +} + // If the latest version and the current version are 'unequal', we will update the version_update_from, else we do not update anything. if ($inline_update) { @@ -455,8 +452,21 @@ add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $updates_to_version); // Now we purge the session table as well as all cache files $cache->purge(); -?> +_print_footer(); +garbage_collection(); + +if (function_exists('exit_handler')) +{ + exit_handler(); +} + +/** +* Print out footer +*/ +function _print_footer() +{ + echo << @@ -471,14 +481,7 @@ $cache->purge(); - - 'Database password', 'DB_PORT' => 'Database server port', 'DB_PORT_EXPLAIN' => 'Leave this blank unless you know the server operates on a non-standard port.', + 'DB_UPDATE_NOT_SUPPORTED' => 'Sorry, but you are not able to update your phpBB database with this script. This update script updates the phpBB database from at least version ā€œ%1$sā€, but your version is ā€œ%2$sā€. Please try to update to an older version of phpBB first or post within our support forums to get more help.', 'DB_USERNAME' => 'Database username', 'DB_TEST' => 'Test connection', 'DEFAULT_LANG' => 'Default board language',