]> git.joonet.de Git - adminer.git/commitdiff
Save bytes
authorJakub Vrana <jakub@vrana.cz>
Sat, 4 Jun 2011 02:28:17 +0000 (04:28 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sat, 4 Jun 2011 02:28:17 +0000 (04:28 +0200)
adminer/include/adminer.inc.php
adminer/privileges.inc.php
adminer/user.inc.php

index 69d3df426cd867b40cd779890aa2f5953bd533be..5fe3c9020aac0e6a91eeddd0e5f44e4a16556010 100644 (file)
@@ -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 " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
        }
        
index 12cef6a9fb937944eb81ee335568722eeda82ef4..638254d21afcf374598746eefb51b0fdcd3070ed 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 page_header(lang('Privileges'));
 
-$result = $connection->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) {
        ?>
 <form action=""><p>
index ef8f41f203c7603cb7c4470dbab911ccfb2a641e..4cabe8f7ff75e3d6156b9160d36c7081c5b2aee4 100644 (file)
@@ -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();
 }
 
 ?>