]> git.joonet.de Git - adminer.git/commitdiff
Create user on the same domain by default
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 22 Jun 2009 06:11:15 +0000 (06:11 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 22 Jun 2009 06:11:15 +0000 (06:11 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@750 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/privileges.inc.php
adminer/user.inc.php
todo.txt

index 9506aa5fb7c7aac8861f57b0a85c9182e1cdb609..946aa7e1fca5fcbb8bec0656976c08c69a01d486 100644 (file)
@@ -3,7 +3,6 @@ page_header(lang('Privileges'));
 echo '<p><a href="' . htmlspecialchars($SELF) . 'user=">' . lang('Create user') . "</a></p>";
 $result = $dbh->query("SELECT User, Host FROM mysql.user ORDER BY Host, User");
 if (!$result) {
-       //! utilize information_schema.USER_PRIVILEGES in MySQL 5
        ?>
        <form action=""><p>
        <?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
@@ -13,7 +12,7 @@ if (!$result) {
        <input type="submit" value="<?php echo lang('Edit'); ?>" />
        </p></form>
 <?php
-       // list logged user
+       // list logged user, information_schema.USER_PRIVILEGES lists just the current user too
        $result = $dbh->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
 }
 echo "<table cellspacing='0'>\n";
index 6cb43f84418c96a4d69cb1881f89e483261695a2..48aa1337ed0f63aca2690c4b72d24e8666c17151 100644 (file)
@@ -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;
index ca0e59bde62f8f0ecba7c4806cadaadadd3ca49a..e6422877c6693c48ae0d6e184ac566923adbbf1a 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -12,6 +12,7 @@ IE6 - <label for>
 Edit default values directly in table creation
 Single column foreign key definition in table creation
 Offer enum items in search
+Use event $intervals + microseconds in relative date functions
 Ability to select external style - list downloaded by JavaScript
 ? Column and table names auto-completition in SQL textarea
 ? Save token also to cookie - for session expiration and login in other window