diff --git a/adminer/user.inc.php b/adminer/user.inc.php index b3f044d1..6b4d2e19 100644 --- a/adminer/user.inc.php +++ b/adminer/user.inc.php @@ -126,7 +126,14 @@ if ($_POST) { if ($old_pass != "") { $row["hashed"] = true; } - $grants[(DB == "" || $grants ? "" : idf_escape(addcslashes(DB, "%_\\"))) . ".*"] = array(); + + if ($grants) { + $grants[".*"] = []; + } elseif (DB != "") { + $grants[idf_escape(addcslashes(DB, "%_\\")) . ".*"] = []; + } else { + $grants["*.* "] = []; // Space is added to force editing mode. + } } ?> @@ -142,13 +149,21 @@ if ($_POST) { \n"; -echo "" . lang('Privileges') . doc_link(array('sql' => "grant.html#priv_level")); + +echo "" . lang('Privileges') . doc_link(array('sql' => "grant.html#priv_level")) . ""; $i = 0; foreach ($grants as $object => $grant) { - echo '' . ($object != "*.*" ? "" : "*.*"); //! separate db, table, columns, PROCEDURE|FUNCTION, routine + echo ""; + //! separate db, table, columns, PROCEDURE|FUNCTION, routine + if ($object == "*.*") { + echo "*.*"; + } else { + echo ""; + } + echo ""; $i++; } -echo "\n"; +echo "\n"; foreach ([ "" => "",