Databases are server specific
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@155 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
50b85f04eb
commit
e0cce46ede
|
@ -25,6 +25,7 @@ if (isset($_POST["server"])) {
|
||||||
} elseif (isset($_GET["logout"])) {
|
} elseif (isset($_GET["logout"])) {
|
||||||
unset($_SESSION["usernames"][$_GET["server"]]);
|
unset($_SESSION["usernames"][$_GET["server"]]);
|
||||||
unset($_SESSION["passwords"][$_GET["server"]]);
|
unset($_SESSION["passwords"][$_GET["server"]]);
|
||||||
|
unset($_SESSION["databases"][$_GET["server"]]);
|
||||||
$_SESSION["tokens"][$_GET["server"]] = array();
|
$_SESSION["tokens"][$_GET["server"]] = array();
|
||||||
redirect(substr($SELF, 0, -1), lang('Logout successful.'));
|
redirect(substr($SELF, 0, -1), lang('Logout successful.'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
if (!(strlen($_GET["db"]) ? $mysql->select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]))) {
|
if (!(strlen($_GET["db"]) ? $mysql->select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]))) {
|
||||||
unset($_SESSION["databases"]);
|
unset($_SESSION[$_GET["server"]]["databases"]);
|
||||||
page_header(lang('Select database'));
|
page_header(lang('Select database'));
|
||||||
if (strlen($_GET["db"])) {
|
if (strlen($_GET["db"])) {
|
||||||
echo "<p class='error'>" . lang('Invalid database.') . "</p>\n";
|
echo "<p class='error'>" . lang('Invalid database.') . "</p>\n";
|
||||||
|
|
|
@ -6,7 +6,7 @@ if ($_POST && !$error) {
|
||||||
}
|
}
|
||||||
} elseif ($_GET["db"] !== $_POST["name"]) {
|
} elseif ($_GET["db"] !== $_POST["name"]) {
|
||||||
if ($mysql->query("CREATE DATABASE " . idf_escape($_POST["name"]) . ($_POST["collation"] ? " COLLATE '" . $mysql->escape_string($_POST["collation"]) . "'" : ""))) {
|
if ($mysql->query("CREATE DATABASE " . idf_escape($_POST["name"]) . ($_POST["collation"] ? " COLLATE '" . $mysql->escape_string($_POST["collation"]) . "'" : ""))) {
|
||||||
unset($_SESSION["databases"]);
|
unset($_SESSION[$_GET["server"]]["databases"]);
|
||||||
if (!strlen($_GET["db"])) {
|
if (!strlen($_GET["db"])) {
|
||||||
redirect(preg_replace('~db=[^&]*&~', '', $SELF) . "db=" . urlencode($_POST["name"]), lang('Database has been created.'));
|
redirect(preg_replace('~db=[^&]*&~', '', $SELF) . "db=" . urlencode($_POST["name"]), lang('Database has been created.'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ function page_header($title) {
|
||||||
echo "<p class='message'>$_SESSION[message]</p>\n";
|
echo "<p class='message'>$_SESSION[message]</p>\n";
|
||||||
$_SESSION["message"] = "";
|
$_SESSION["message"] = "";
|
||||||
}
|
}
|
||||||
if (isset($_SESSION["databases"])) {
|
if (isset($_SESSION[$_GET["server"]]["databases"])) {
|
||||||
session_write_close();
|
session_write_close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,10 +51,10 @@ function page_footer($missing = false) {
|
||||||
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option>
|
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option>
|
||||||
<?php
|
<?php
|
||||||
flush();
|
flush();
|
||||||
if (!isset($_SESSION["databases"])) {
|
if (!isset($_SESSION[$_GET["server"]]["databases"])) {
|
||||||
$_SESSION["databases"] = get_vals("SHOW DATABASES");
|
$_SESSION[$_GET["server"]]["databases"] = get_vals("SHOW DATABASES");
|
||||||
}
|
}
|
||||||
echo optionlist($_SESSION["databases"], $_GET["db"]);
|
echo optionlist($_SESSION[$_GET["server"]]["databases"], $_GET["db"]);
|
||||||
?>
|
?>
|
||||||
</select><?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?></p>
|
</select><?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?></p>
|
||||||
<noscript><p><input type="submit" value="<?php echo lang('Use'); ?>" /></p></noscript>
|
<noscript><p><input type="submit" value="<?php echo lang('Use'); ?>" /></p></noscript>
|
||||||
|
|
Loading…
Reference in a new issue