Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@749 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information
jakubvrana committed Jun 22, 2009
1 parent 7b57b5d commit 97807b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion adminer/user.inc.php
Expand Up @@ -54,7 +54,7 @@ function grant($grant, $columns) {

if ($_POST && !$error) {
$old_user = (isset($_GET["host"]) ? $dbh->quote($_GET["user"]) . "@" . $dbh->quote($_GET["host"]) : "''");
$new_user = $dbh->quote($_POST["user"]) . "@" . $dbh->quote($_POST["host"]);
$new_user = $dbh->quote($_POST["user"]) . "@" . $dbh->quote($_POST["host"]); // if $_GET["host"] is not set then $new_user is always different
$pass = $dbh->quote($_POST["pass"]);
if ($_POST["drop"]) {
query_redirect("DROP USER $old_user", $SELF . "privileges=", lang('User has been dropped.'));
Expand Down Expand Up @@ -102,6 +102,7 @@ function grant($grant, $columns) {
}
query_redirect(queries(), $SELF . "privileges=", (isset($_GET["host"]) ? lang('User has been altered.') : lang('User has been created.')), !$error, false, $error);
if ($old_user != $new_user) {
// delete new user in case of an error
$dbh->query("DROP USER $new_user");
}
}
Expand Down

0 comments on commit 97807b0

Please sign in to comment.