diff --git a/phpBB/admin/admin_database.php b/phpBB/admin/admin_database.php index 2a5c36ab82..2fde6824d9 100644 --- a/phpBB/admin/admin_database.php +++ b/phpBB/admin/admin_database.php @@ -18,17 +18,9 @@ * (at your option) any later version. * ***************************************************************************/ - -/*************************************************************************** -* We will attempt to create a file based backup of all of the data in the -* users phpBB database. The resulting file should be able to be imported by -* the db_restore.php function, or by using the mysql command_line -* -* Some functions are adapted from the upgrade_20.php script and others -* adapted from the unoficial phpMyAdmin 2.2.0. -***************************************************************************/ - -define('IN_PHPBB', 1); +// +// Some functions are adapted phpMyAdmin 2.2.0. +// if ( !empty($setmodules) ) { @@ -38,26 +30,29 @@ if ( !empty($setmodules) ) } $filename = basename(__FILE__); - $module['DB']['DB_Backup'] = $filename . "$SID&perform=backup"; + $module['DB']['DB_Backup'] = $filename . "$SID&mode=backup"; $file_uploads = @ini_get('file_uploads'); if( ( $file_uploads != 0 || empty($file_uploads) ) && strtolower($file_uploads) != 'off' && @phpversion() != '4.0.4pl1' ) { - $module['DB']['DB_Restore'] = $filename . "$SID&perform=restore"; + $module['DB']['DB_Restore'] = $filename . "$SID&mode=restore"; } return; } +define('IN_PHPBB', 1); // // Load default header // -$no_page_header = TRUE; -$phpbb_root_path = "../"; +$phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); +// +// +// if ( !$acl->get_acl_admin('general') ) { message_die(MESSAGE, $lang['No_admin']); @@ -73,11 +68,11 @@ if ( !$acl->get_acl_admin('general') ) // Begin program proper // -if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) +if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) { - $perform = ( isset($HTTP_POST_VARS['perform']) ) ? $HTTP_POST_VARS['perform'] : $HTTP_GET_VARS['perform']; + $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; - switch($perform) + switch($mode) { case 'backup': @@ -96,77 +91,73 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) break; } - include('page_header_admin.'.$phpEx); - - $template->assign_vars(array( - "MESSAGE_TITLE" => $lang['Information'], - "MESSAGE_TEXT" => $lang['Backups_not_supported']) - ); - + message_die(MESSAGE, $lang['Backups_not_supported']); break; } - $tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words'); + $tables = array('search_wordlist', 'search_wordmatch', 'auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_results', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words'); - $additional_tables = (isset($HTTP_POST_VARS['additional_tables'])) ? $HTTP_POST_VARS['additional_tables'] : ( ( isset($HTTP_GET_VARS['additional_tables']) ) ? $HTTP_GET_VARS['additional_tables'] : "" ); + $additional_tables = ( isset($HTTP_POST_VARS['additional_tables']) ) ? $HTTP_POST_VARS['additional_tables'] : ( ( isset($HTTP_GET_VARS['additional_tables']) ) ? $HTTP_GET_VARS['additional_tables'] : '' ); - $backup_type = (isset($HTTP_POST_VARS['backup_type'])) ? $HTTP_POST_VARS['backup_type'] : ( ( isset($HTTP_GET_VARS['backup_type']) ) ? $HTTP_GET_VARS['backup_type'] : "" ); + $backup_type = ( isset($HTTP_POST_VARS['backup_type']) ) ? $HTTP_POST_VARS['backup_type'] : ( ( isset($HTTP_GET_VARS['backup_type']) ) ? $HTTP_GET_VARS['backup_type'] : '' ); - $gzipcompress = (!empty($HTTP_POST_VARS['gzipcompress'])) ? $HTTP_POST_VARS['gzipcompress'] : ( ( !empty($HTTP_GET_VARS['gzipcompress']) ) ? $HTTP_GET_VARS['gzipcompress'] : 0 ); + $ignoresearch = ( !empty($HTTP_POST_VARS['ignoresearch']) ) ? $HTTP_POST_VARS['ignoresearch'] : ( ( !empty($HTTP_GET_VARS['ignoresearch']) ) ? $HTTP_GET_VARS['ignoresearch'] : 0 ); + + $gzipcompress = ( !empty($HTTP_POST_VARS['gzipcompress']) ) ? $HTTP_POST_VARS['gzipcompress'] : ( ( !empty($HTTP_GET_VARS['gzipcompress']) ) ? $HTTP_GET_VARS['gzipcompress'] : 0 ); if ( !empty($additional_tables) ) { - if ( ereg(",", $additional_tables)) - { - $additional_tables = split(",", $additional_tables); + $additional_tables = explode(', ', $additional_tables); - for($i = 0; $i < count($additional_tables); $i++) - { - $tables[] = trim($additional_tables[$i]); - } - - } - else + for($i = 0; $i < count($additional_tables); $i++) { - $tables[] = trim($additional_tables); + $tables[] = trim($additional_tables[$i]); } + unset($additional_tables); } if ( !isset($HTTP_POST_VARS['backupstart']) && !isset($HTTP_GET_VARS['backupstart'])) { - $s_hidden_fields = ''; + $s_hidden_fields = ''; - page_header($lang['DB']); + page_header($lang['DB_Backup']); ?>
-