Permalink
Browse files

Shortcut for database privileges

  • Loading branch information...
1 parent 98e410f commit 16a72b4521944ea468db605dda1308bac9e9e542 @vrana committed Jun 3, 2011
Showing with 4 additions and 2 deletions.
  1. +1 −0 adminer/include/adminer.inc.php
  2. +1 −1 adminer/privileges.inc.php
  3. +1 −1 adminer/user.inc.php
  4. +1 −0 changes.txt
@@ -721,6 +721,7 @@ function homepage() {
echo '<p>' . ($_GET["ns"] == "" ? '<a href="' . h(ME) . 'database=">' . lang('Alter database') . "</a>\n" : "");
echo (support("scheme") ? "<a href='" . h(ME) . "scheme='>" . ($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema')) . "</a>\n" : "");
echo '<a href="' . h(ME) . 'schema=">' . lang('Database schema') . "</a>\n";
+ echo (support("privileges") ? "<a href='" . h(ME) . "privileges='>" . lang('Privileges') . "</a>\n" : "");
return true;
}
@@ -1,7 +1,7 @@
<?php
page_header(lang('Privileges'));
-$result = $connection->query("SELECT User, Host FROM mysql.user ORDER BY Host, User");
+$result = $connection->query("SELECT User, Host FROM mysql." . ($_GET["db"] == "" ? "user" : "db WHERE " . q($_GET["db"]) . " LIKE Db") . " ORDER BY Host, User");
if (!$result) {
?>
<form action=""><p>
View
@@ -111,7 +111,7 @@
if ($old_pass != "") {
$row["hashed"] = true;
}
- $grants[""] = true;
+ $grants[$_GET["db"] != "" ? idf_escape($_GET["db"]) . ".*" : ""] = true;
}
?>
View
@@ -1,6 +1,7 @@
Adminer 3.3.0-dev:
Use Esc to disable in-place edit
Highlight SQL code in textarea
+Shortcut for database privileges
Append new index with auto index selection (bug #3282127)
Bit type default value
Display foreign key name in tooltip

0 comments on commit 16a72b4

Please sign in to comment.