1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 17:44:07 +02:00

Revert drop removal (r887, r1195)

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1336 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2010-03-01 22:59:08 +00:00
parent 254ba4a134
commit 5d89dc60c8
12 changed files with 108 additions and 88 deletions

View File

@@ -1,8 +1,11 @@
<?php
if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP changes add.x to add_x
if (DB !== $_POST["name"]) {
restart_session();
if ($_POST["drop"]) {
unset($_SESSION["databases"][$_GET["server"]]);
query_redirect("DROP DATABASE " . idf_escape(DB), remove_from_uri("db|database"), lang('Database has been dropped.'));
} elseif (DB !== $_POST["name"]) {
// create or rename database
restart_session();
unset($_SESSION["databases"][$_GET["server"]]); // clear cache
$dbs = explode("\n", str_replace("\r", "", $_POST["name"]));
$failed = false;
@@ -70,7 +73,9 @@ if ($_POST) {
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
if (!$_POST["add_x"] && $_GET["db"] == "") {
if (strlen(DB)) {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
} elseif (!$_POST["add_x"] && $_GET["db"] == "") {
echo "<input type='image' name='add' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>\n";
}
?>