diff --git a/adminer/call.inc.php b/adminer/call.inc.php index 8feb3293..09592544 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -28,8 +28,10 @@ if (!$error && $_POST) { } $call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val); } + $query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")"; echo "
" . h($query) . "
" . lang('Edit') . "\n";
+
if (!$connection->multi_query($query)) {
echo "
" . error() . "\n"; } else { @@ -37,6 +39,7 @@ if (!$error && $_POST) { if (is_object($connection2)) { $connection2->select_db(DB); } + do { $result = $connection->store_result(); if (is_object($result)) { @@ -45,6 +48,7 @@ if (!$error && $_POST) { echo "
'; echo ' | ' . lang('Table'); echo ' | ' . lang('Engine'); @@ -68,6 +71,7 @@ if ($adminer->homepage()) { echo ' | ' . lang('Rows'); echo (support("comment") ? ' | ' . lang('Comment') : ''); echo " |
---|---|---|---|---|
' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');"); @@ -90,12 +94,14 @@ if ($adminer->homepage()) { } echo (support("comment") ? " | " : ""); } + echo " | |||
" . lang('%d in total', count($tables_list)); echo " | " . nbsp($jush == "sql" ? $connection->result("SELECT @@storage_engine") : ""); echo " | " . nbsp(db_collation(DB, collations())); foreach (array("Data_length", "Index_length", "Data_free") as $key) { echo " | "; } + echo " |
" . lang('You have no privileges to update this table.') . "\n"; } else { echo "
" . $adminer->fieldName($field); $default = $_GET["set"][bracket_escape($name)]; @@ -105,6 +109,7 @@ if (!$fields) { input($field, $value, $function); echo "\n"; } + echo " |
---|
" . lang('Error in query') . ": " . implode("", $errors) . "\n"; } //! MS SQL - SET SHOWPLAN_ALL OFF + } else { echo "
" . upload_error($query) . "\n"; } @@ -178,6 +194,7 @@ if ($_POST) { $q = $history[$_GET["history"]][0]; } textarea("query", $q, 20); + echo ($_POST ? "" : "\n"); echo "
" . (ini_bool("file_uploads") ? lang('File upload') . ': selectLinks($table_status); $comment = $table_status["Comment"]; if ($comment != "") { @@ -79,5 +80,6 @@ if ($fields) { } echo '
' . lang('Add trigger') . "\n"; } + } } diff --git a/adminer/user.inc.php b/adminer/user.inc.php index 873bf427..ec4663b7 100644 --- a/adminer/user.inc.php +++ b/adminer/user.inc.php @@ -26,6 +26,7 @@ if ($_POST) { } $grants = array(); $old_pass = ""; + if (isset($_GET["host"]) && ($result = $connection->query("SHOW GRANTS FOR " . q($USER) . "@" . q($_GET["host"])))) { //! use information_schema for MySQL 5 - column names in column privileges are not escaped while ($row = $result->fetch_row()) { if (preg_match('~GRANT (.*) ON (.*) TO ~', $row[0], $match) && preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~', $match[1], $matches, PREG_SET_ORDER)) { //! escape the part between ON and TO @@ -56,6 +57,7 @@ if ($_POST && !$error) { $pass = $connection->result("SELECT PASSWORD(" . q($pass) . ")"); $error = !$pass; } + $created = false; if (!$error) { if ($old_user != $new_user) { @@ -65,6 +67,7 @@ if ($_POST && !$error) { queries("SET PASSWORD FOR $new_user = " . q($pass)); } } + if (!$error) { $revoke = array(); foreach ($new_grants as $object => $grant) { @@ -90,6 +93,7 @@ if ($_POST && !$error) { } } } + if (!$error && isset($_GET["host"])) { if ($old_user != $new_user) { queries("DROP USER $old_user"); @@ -101,7 +105,9 @@ if ($_POST && !$error) { } } } + queries_redirect(ME . "privileges=", (isset($_GET["host"]) ? lang('User has been altered.') : lang('User has been created.')), !$error); + if ($created) { // delete new user in case of an error $connection->query("DROP USER $new_user"); @@ -143,6 +149,7 @@ foreach ($grants as $object => $grant) { $i++; } echo "\n"; + foreach (array( "" => "", "Server Admin" => lang('Server'), @@ -168,6 +175,7 @@ foreach (array( } } } + echo "\n"; ?>
diff --git a/editor/db.inc.php b/editor/db.inc.php index 3eaac332..d3625f5a 100644 --- a/editor/db.inc.php +++ b/editor/db.inc.php @@ -9,6 +9,7 @@ if ($adminer->homepage()) { } echo "
' . lang('Table') . ' | ' . lang('Rows') . " | " . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . ""; } } + echo " |
---|