Add confirmation when dropping databases
This commit is contained in:
@@ -16,6 +16,8 @@ $Source$
|
||||
2003-05-12 Michal Cihar <nijel@users.sourceforge.net>
|
||||
* index.php3: Better fix for #736003.
|
||||
* libraries/common.lib.php3: Light tabs were displayed wrong, bug #736590.
|
||||
* mult_submits.inc.php3, server_databases.php: Add confirmation when
|
||||
dropping databases (bug #736238).
|
||||
|
||||
2003-05-11 Michal Cihar <nijel@users.sourceforge.net>
|
||||
* Documentation.html, config.inc.php3,
|
||||
|
@@ -19,6 +19,9 @@ if (!empty($submit_mult)
|
||||
} else {
|
||||
$selected = $selected_tbl;
|
||||
switch ($submit_mult) {
|
||||
case 'drop_db':
|
||||
$what = 'drop_db';
|
||||
break;
|
||||
case $strDrop:
|
||||
$what = 'drop_tbl';
|
||||
break;
|
||||
@@ -70,7 +73,7 @@ if (!empty($submit_mult) && !empty($what)) {
|
||||
$url_query .= '&goto=tbl_properties.php3&back=tbl_properties.php3';
|
||||
include('./tbl_properties_table_info.php3');
|
||||
}
|
||||
else {
|
||||
elseif (!empty($db)) {
|
||||
include('./db_details_common.php3');
|
||||
include('./db_details_db_info.php3');
|
||||
}
|
||||
@@ -131,6 +134,8 @@ if (!empty($submit_mult) && !empty($what)) {
|
||||
echo PMA_generate_common_hidden_inputs($db);
|
||||
} else if (strpos(' ' . $action, 'tbl_properties') == 1) {
|
||||
echo PMA_generate_common_hidden_inputs($db,$table);
|
||||
} else {
|
||||
echo PMA_generate_common_hidden_inputs();
|
||||
}
|
||||
for ($i = 0; $i < $selected_cnt; $i++) {
|
||||
echo ' <input type="hidden" name="selected[]" value="' . htmlspecialchars($selected[$i]) . '" />' . "\n";
|
||||
@@ -210,6 +215,7 @@ else if ($mult_btn == $strYes) {
|
||||
&& $query_type != 'analyze_tbl'
|
||||
&& $query_type != 'optimize_tbl'
|
||||
&& $query_type != 'check_tbl') {
|
||||
|
||||
$sql_query .= $a_query . ';' . "\n";
|
||||
|
||||
if ($query_type != 'drop_db') {
|
||||
|
@@ -54,23 +54,15 @@ if ($server > 0 && empty($dblist)) {
|
||||
/**
|
||||
* Drops multiple databases
|
||||
*/
|
||||
if (!empty($drop_selected_dbs) && ($is_superuser || $cfg['AllowUserDropDatabase'])) {
|
||||
if (empty($selected_db)) {
|
||||
if ((!empty($drop_selected_dbs) || isset($query_type)) && ($is_superuser || $cfg['AllowUserDropDatabase'])) {
|
||||
if (empty($selected_db) && ! (isset($query_type) && !empty($selected))) {
|
||||
$message = $strNoDatabasesSelected;
|
||||
} else {
|
||||
$sql_query = array();
|
||||
while (list(, $current_db) = each($selected_db)) {
|
||||
$current_query = 'DROP DATABASE ' . PMA_backquote($current_db) . ';';
|
||||
$sql_query[] = $current_query;
|
||||
PMA_mysql_query($current_query, $userlink)
|
||||
// rabus: in case of an error, we display the full query in
|
||||
// order to let the user know which databases have already been
|
||||
// dropped.
|
||||
or PMA_mysqlDie(PMA_mysql_error($userlink), join("\n", $sql_query));
|
||||
}
|
||||
// PMA_showMessage() needs a string...
|
||||
$sql_query = join("\n", $sql_query);
|
||||
$message = sprintf($strDatabasesDropped, count($selected_db));
|
||||
$action = 'server_databases.php3';
|
||||
$submit_mult = 'drop_db' ;
|
||||
$err_url = 'server_databases.php3?' . PMA_generate_common_url();
|
||||
include('./mult_submits.inc.php3');
|
||||
$message = sprintf($strDatabasesDropped, count($selected));
|
||||
// we need to reload the database list now.
|
||||
PMA_availableDatabases();
|
||||
$reload = 1;
|
||||
|
Reference in New Issue
Block a user