";
$result = $dbh->query("SELECT User, Host FROM mysql.user ORDER BY Host, User");
if (!$result) {
- //! utilize information_schema.USER_PRIVILEGES in MySQL 5
?>
query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
}
echo "
\n";
diff --git a/adminer/user.inc.php b/adminer/user.inc.php
index 6cb43f84..48aa1337 100644
--- a/adminer/user.inc.php
+++ b/adminer/user.inc.php
@@ -113,7 +113,7 @@ if ($_POST) {
$row = $_POST;
$grants = $new_grants;
} else {
- $row = $_GET + array("host" => "localhost"); // create user on localhost by default
+ $row = $_GET + array("host" => $dbh->result($dbh->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', -1)"))); // create user on the same domain by default
$row["pass"] = $old_pass;
if (strlen($old_pass)) {
$row["hashed"] = true;
diff --git a/todo.txt b/todo.txt
index ca0e59bd..e6422877 100644
--- a/todo.txt
+++ b/todo.txt
@@ -12,6 +12,7 @@ IE6 -