From ca716517676cff9e66ebd301bf771891d0cb0962 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sat, 3 Aug 2002 23:52:33 +0000 Subject: Various updates git-svn-id: file:///svn/phpbb/trunk@2816 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_database.php | 142 +++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 75 deletions(-) (limited to 'phpBB/admin/admin_database.php') 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'] : "" ); + $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 ); + $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']); ?>

-
"> +">
- - + + - - + + - - - - - - + + + - + + @@ -180,7 +171,7 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) else if ( !isset($HTTP_POST_VARS['startdownload']) && !isset($HTTP_GET_VARS['startdownload']) ) { $template->assign_vars(array( - "META" => "", + "META" => "", "MESSAGE_TITLE" => $lang['Database_Utilities'] . " : " . $lang['Backup'], "MESSAGE_TEXT" => $lang['Backup_download']) @@ -229,14 +220,15 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) echo "#\n# DATE : " . gmdate("d-m-Y H:i:s", time()) . " GMT\n"; echo "#\n"; - if(SQL_LAYER == 'postgresql') + if ( SQL_LAYER == 'postgresql' ) { echo "\n" . pg_get_sequences("\n", $backup_type); } + for($i = 0; $i < count($tables); $i++) { $table_name = $tables[$i]; - if(SQL_LAYER != 'mysql4') + if ( SQL_LAYER != 'mysql4' ) { $table_def_function = "get_table_def_" . SQL_LAYER; $table_content_function = "get_table_content_" . SQL_LAYER; @@ -247,19 +239,19 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) $table_content_function = "get_table_content_mysql"; } - if($backup_type != 'data') + if ( $backup_type != 'data' ) { echo "#\n# TABLE: " . $table_prefix . $table_name . "\n#\n"; echo $table_def_function($table_prefix . $table_name, "\n") . "\n"; } - if($backup_type != 'structure') + if ( $backup_type != 'structure' ) { $table_content_function($table_prefix . $table_name, "output_table_content"); } } - if($do_gzip_compress) + if ( $do_gzip_compress ) { $Size = ob_get_length(); $Crc = crc32(ob_get_contents()); @@ -275,9 +267,9 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) if ( !isset($restore_start) ) { - $s_hidden_fields = ''; + $s_hidden_fields = ''; - page_header($lang['DB']); + page_header($lang['DB_Restore']); ?> @@ -285,14 +277,21 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) )

-">
     

  

    
+">
+ + - + + - + + -
:
    :
+ + + + - - - - - - \ No newline at end of file -- cgit v1.2.1