From 36d6864a1077b1db964845e7657fe7cec90614ef Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Mon, 20 Jul 2009 12:12:55 +0000 Subject: [PATCH] Whitespace git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@853 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/create.inc.php | 6 +++++- adminer/database.inc.php | 6 +++++- adminer/event.inc.php | 1 + adminer/foreign.inc.php | 1 + adminer/indexes.inc.php | 1 + adminer/privileges.inc.php | 1 + adminer/procedure.inc.php | 1 + adminer/processlist.inc.php | 1 + adminer/table.inc.php | 1 + adminer/trigger.inc.php | 1 + adminer/user.inc.php | 5 +++-- adminer/view.inc.php | 1 + 12 files changed, 22 insertions(+), 4 deletions(-) diff --git a/adminer/create.inc.php b/adminer/create.inc.php index f728bdc7..dc408f8c 100644 --- a/adminer/create.inc.php +++ b/adminer/create.inc.php @@ -65,7 +65,10 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] $partitions[] = "\nPARTITION " . idf_escape($val) . " VALUES " . ($_POST["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . (strlen($value) ? " ($value)" : " MAXVALUE"); //! SQL injection } } - $status .= "\nPARTITION BY $_POST[partition_by]($_POST[partition])" . ($partitions ? " (" . implode(",", $partitions) . "\n)" : ($_POST["partitions"] ? " PARTITIONS " . intval($_POST["partitions"]) : "")); // $_POST["partition"] can be expression, not only column + $status .= "\nPARTITION BY $_POST[partition_by]($_POST[partition])" . ($partitions // $_POST["partition"] can be expression, not only column + ? " (" . implode(",", $partitions) . "\n)" + : ($_POST["partitions"] ? " PARTITIONS " . intval($_POST["partitions"]) : "") + ); } elseif ($dbh->server_info >= 5.1 && strlen($_GET["create"])) { $status .= "\nREMOVE PARTITIONING"; } @@ -79,6 +82,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] } } } + page_header((strlen($_GET["create"]) ? lang('Alter table') : lang('Create table')), $error, array("table" => $_GET["create"]), $_GET["create"]); $engines = array(); diff --git a/adminer/database.inc.php b/adminer/database.inc.php index e6bcd398..f807da57 100644 --- a/adminer/database.inc.php +++ b/adminer/database.inc.php @@ -38,6 +38,7 @@ if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP c query_redirect("ALTER DATABASE " . idf_escape($_POST["name"]) . " COLLATE " . $dbh->quote($_POST["collation"]), substr($SELF, 0, -1), lang('Database has been altered.')); } } + page_header(strlen($_GET["db"]) ? lang('Alter database') : lang('Create database'), $error, array(), $_GET["db"]); $collations = collations(); @@ -70,7 +71,10 @@ if ($_POST) {

-' . htmlspecialchars($name) . '
' : '') . "\n"; ?> +' . htmlspecialchars($name) . '
' + : '' +) . "\n"; ?> diff --git a/adminer/event.inc.php b/adminer/event.inc.php index a18bd55b..6ada53ff 100644 --- a/adminer/event.inc.php +++ b/adminer/event.inc.php @@ -22,6 +22,7 @@ if ($_POST && !$error) { , substr($SELF, 0, -1), (strlen($_GET["event"]) ? lang('Event has been altered.') : lang('Event has been created.'))); } } + page_header((strlen($_GET["event"]) ? lang('Alter event') . ": " . htmlspecialchars($_GET["event"]) : lang('Create event')), $error); $row = array(); diff --git a/adminer/foreign.inc.php b/adminer/foreign.inc.php index 0e64f481..342c13a0 100644 --- a/adminer/foreign.inc.php +++ b/adminer/foreign.inc.php @@ -18,6 +18,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change- $error = lang('Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exists.') . "
$error"; } } + page_header(lang('Foreign key'), $error, array("table" => $_GET["foreign"]), $_GET["foreign"]); if ($_POST) { diff --git a/adminer/indexes.inc.php b/adminer/indexes.inc.php index b316bba5..555d2286 100644 --- a/adminer/indexes.inc.php +++ b/adminer/indexes.inc.php @@ -38,6 +38,7 @@ if ($_POST && !$error && !$_POST["add"]) { } query_redirect("ALTER TABLE " . idf_escape($_GET["indexes"]) . implode(",", $alter), $SELF . "table=" . urlencode($_GET["indexes"]), lang('Indexes has been altered.')); } + page_header(lang('Indexes'), $error, array("table" => $_GET["indexes"]), $_GET["indexes"]); $fields = array_keys(fields($_GET["indexes"])); diff --git a/adminer/privileges.inc.php b/adminer/privileges.inc.php index 2c4caa13..3dbaa8b3 100644 --- a/adminer/privileges.inc.php +++ b/adminer/privileges.inc.php @@ -1,6 +1,7 @@ ' . lang('Create user') . ""; + $result = $dbh->query("SELECT User, Host FROM mysql.user ORDER BY Host, User"); if (!$result) { ?> diff --git a/adminer/procedure.inc.php b/adminer/procedure.inc.php index 653433d7..e59226c2 100644 --- a/adminer/procedure.inc.php +++ b/adminer/procedure.inc.php @@ -22,6 +22,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] , substr($SELF, 0, -1), (strlen($_GET["procedure"]) ? lang('Routine has been altered.') : lang('Routine has been created.'))); } } + page_header((strlen($_GET["procedure"]) ? (isset($_GET["function"]) ? lang('Alter function') : lang('Alter procedure')) . ": " . htmlspecialchars($_GET["procedure"]) : (isset($_GET["function"]) ? lang('Create function') : lang('Create procedure'))), $error); $collations = get_vals("SHOW CHARACTER SET"); diff --git a/adminer/processlist.inc.php b/adminer/processlist.inc.php index c7bdb926..76d29955 100644 --- a/adminer/processlist.inc.php +++ b/adminer/processlist.inc.php @@ -8,6 +8,7 @@ if ($_POST && !$error) { } query_redirect(queries(), $SELF . "processlist=", lang('%d process(es) has been killed.', $killed), $killed || !$_POST["kill"], false, !$killed && $_POST["kill"]); } + page_header(lang('Process list'), $error); ?> diff --git a/adminer/table.inc.php b/adminer/table.inc.php index c0d03c38..5751e465 100644 --- a/adminer/table.inc.php +++ b/adminer/table.inc.php @@ -3,6 +3,7 @@ $result = $dbh->query("SHOW COLUMNS FROM " . idf_escape($_GET["table"])); if (!$result) { $error = htmlspecialchars($dbh->error); } + page_header(lang('Table') . ": " . htmlspecialchars($_GET["table"]), $error); if ($result) { diff --git a/adminer/trigger.inc.php b/adminer/trigger.inc.php index e79ba959..b178fc2a 100644 --- a/adminer/trigger.inc.php +++ b/adminer/trigger.inc.php @@ -13,6 +13,7 @@ if ($_POST && !$error) { } } } + page_header((strlen($_GET["name"]) ? lang('Alter trigger') . ": " . htmlspecialchars($_GET["name"]) : lang('Create trigger')), $error, array("table" => $_GET["trigger"])); $row = array("Trigger" => "$_GET[trigger]_bi"); diff --git a/adminer/user.inc.php b/adminer/user.inc.php index 502a49e9..3ce8d0b8 100644 --- a/adminer/user.inc.php +++ b/adminer/user.inc.php @@ -26,8 +26,8 @@ function grant($grant, $privileges, $columns, $on) { if ($privileges == array("ALL PRIVILEGES", "GRANT OPTION")) { // can't be granted or revoked together return ($grant == "GRANT" - ? queries("$grant ALL PRIVILEGES$on WITH GRANT OPTION") - : queries("$grant ALL PRIVILEGES$on") && queries("$grant GRANT OPTION$on") + ? queries("$grant ALL PRIVILEGES$on WITH GRANT OPTION") + : queries("$grant ALL PRIVILEGES$on") && queries("$grant GRANT OPTION$on") ); } return queries("$grant " . preg_replace('~(GRANT OPTION)\\([^)]*\\)~', '\\1', implode("$columns, ", $privileges) . $columns) . $on); @@ -113,6 +113,7 @@ if ($_POST && !$error) { } } } + page_header((isset($_GET["host"]) ? lang('Username') . ": " . htmlspecialchars("$_GET[user]@$_GET[host]") : lang('Create user')), $error, array("privileges" => array('', lang('Privileges')))); if ($_POST) { diff --git a/adminer/view.inc.php b/adminer/view.inc.php index ab99929a..7540dae5 100644 --- a/adminer/view.inc.php +++ b/adminer/view.inc.php @@ -1,5 +1,6 @@ " . htmlspecialchars($view["select"]) . "\n"; echo '

' . lang('Alter view') . "\n";