diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 69d3df42..5fe3c902 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -433,7 +433,7 @@ username.form['driver'].onchange(); if (strlen($query) > 1e6) { // not DB - reset in drop database $query = ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment } - $history[$_GET["db"]][] = $query; //! respect $_GET["ns"] + $history[$_GET["db"]][] = $query; // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"] return " " . lang('SQL command') . "'; } diff --git a/adminer/privileges.inc.php b/adminer/privileges.inc.php index 12cef6a9..638254d2 100644 --- a/adminer/privileges.inc.php +++ b/adminer/privileges.inc.php @@ -1,7 +1,7 @@ query("SELECT User, Host FROM mysql." . ($_GET["db"] == "" ? "user" : "db WHERE " . q($_GET["db"]) . " LIKE Db") . " ORDER BY Host, User"); +$result = $connection->query("SELECT User, Host FROM mysql." . (DB == "" ? "user" : "db WHERE " . q($_GET["db"]) . " LIKE Db") . " ORDER BY Host, User"); if (!$result) { ?>

diff --git a/adminer/user.inc.php b/adminer/user.inc.php index ef8f41f2..4cabe8f7 100644 --- a/adminer/user.inc.php +++ b/adminer/user.inc.php @@ -111,7 +111,7 @@ if ($_POST) { if ($old_pass != "") { $row["hashed"] = true; } - $grants[$_GET["db"] != "" && $_GET["user"] == "" ? idf_escape($_GET["db"]) . ".*" : ""] = array(); + $grants[DB != "" && !isset($_GET["host"]) ? idf_escape($_GET["db"]) . ".*" : ""] = array(); } ?>