Line 21 | Line 21 |
---|
*/ class acp_database {
|
*/ class acp_database {
|
| var $db_tools;
|
var $u_action;
function main($id, $mode) { global $cache, $db, $user, $auth, $template, $table_prefix; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
var $u_action;
function main($id, $mode) { global $cache, $db, $user, $auth, $template, $table_prefix; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
| if (!class_exists('phpbb_db_tools')) { require($phpbb_root_path . 'includes/db/db_tools.' . $phpEx); } $this->db_tools = new phpbb_db_tools($db);
|
$user->add_lang('acp/database');
| $user->add_lang('acp/database');
|
Line 50 | Line 57 |
---|
{ case 'download': $type = request_var('type', '');
|
{ case 'download': $type = request_var('type', '');
|
$table = request_var('table', array(''));
| $table = array_intersect($this->db_tools->sql_list_tables(), request_var('table', array('')));
|
$format = request_var('method', ''); $where = request_var('where', '');
| $format = request_var('method', ''); $where = request_var('where', '');
|
Line 173 | Line 180 |
---|
break;
default:
|
break;
default:
|
include($phpbb_root_path . 'includes/functions_install.' . $phpEx); $tables = get_tables($db);
| $tables = $this->db_tools->sql_list_tables();
|
asort($tables); foreach ($tables as $table_name) {
| asort($tables); foreach ($tables as $table_name) {
|
Line 221 | Line 227 |
---|
case 'submit': $delete = request_var('delete', ''); $file = request_var('file', '');
|
case 'submit': $delete = request_var('delete', ''); $file = request_var('file', '');
|
| $download = request_var('download', '');
|
if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) {
| if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) {
|
Line 247 | Line 254 |
---|
confirm_box(false, $user->lang['DELETE_SELECTED_BACKUP'], build_hidden_fields(array('delete' => $delete, 'file' => $file))); } }
|
confirm_box(false, $user->lang['DELETE_SELECTED_BACKUP'], build_hidden_fields(array('delete' => $delete, 'file' => $file))); } }
|
else
| else if ($download || confirm_box(true))
|
{
|
{
|
$download = request_var('download', '');
| |
if ($download) { $name = $matches[0];
| if ($download) { $name = $matches[0];
|
Line 410 | Line 415 |
---|
add_log('admin', 'LOG_DB_RESTORE'); trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action)); break;
|
add_log('admin', 'LOG_DB_RESTORE'); trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action)); break;
|
| } else if (!$download) { confirm_box(false, $user->lang['RESTORE_SELECTED_BACKUP'], build_hidden_fields(array('file' => $file)));
|
}
default:
| }
default:
|