diff --git a/adminer/call.inc.php b/adminer/call.inc.php index 2e449523..5c1ba945 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -29,7 +29,7 @@ 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";
+ echo "
" . h($query) . "
" . lang('Edit') . "\n";
if (!$connection->multi_query($query)) {
echo "
" . error() . "\n"; } else { diff --git a/adminer/database.inc.php b/adminer/database.inc.php index 0761609e..1ce45531 100644 --- a/adminer/database.inc.php +++ b/adminer/database.inc.php @@ -40,7 +40,7 @@ if ($_POST) { $collate = $_POST["collation"]; } elseif (DB != "") { $collate = db_collation(DB, $collations); -} elseif ($driver == "sql") { +} elseif ($jush == "sql") { // propose database name with limited privileges foreach (get_vals("SHOW GRANTS") as $grant) { if (preg_match('~ ON (`(([^\\\\`]|``|\\\\.)*)%`\\.\\*)?~', $grant, $match) && $match[1]) { diff --git a/adminer/db.inc.php b/adminer/db.inc.php index 131514d4..41fbc3bc 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -4,7 +4,7 @@ $tables_views = array_merge((array) $_POST["tables"], (array) $_POST["views"]); if ($tables_views && !$error && !$_POST["search"]) { $result = true; $message = ""; - if ($driver == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"])) { + if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"])) { queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once } if ($_POST["truncate"]) { @@ -75,9 +75,9 @@ if ($_GET["ns"] !== "") { } echo "\n"; if (!information_schema(DB)) { - echo "
" . ($driver == "sql" ? " " : "") . " \n"; + echo "
" . ($jush == "sql" ? " " : "") . " \n"; $dbs = (support("scheme") ? schemas() : get_databases()); - if (count($dbs) != 1 && $driver != "sqlite") { + if (count($dbs) != 1 && $jush != "sqlite") { $db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB)); echo "
" . lang('Move to other database') . ($dbs ? ": " . html_select("target", $dbs, $db) : ': ') . " \n"; } diff --git a/adminer/drivers/mssql.inc.php b/adminer/drivers/mssql.inc.php index c5e6933e..301c24b5 100644 --- a/adminer/drivers/mssql.inc.php +++ b/adminer/drivers/mssql.inc.php @@ -493,7 +493,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . $connection->quote($table) return ereg('^(trigger|drop_col)$', $feature); //! view|routine|scheme| } - $driver = "mssql"; + $jush = "mssql"; $types = array(); $structured_types = array(); foreach (array( diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 928332b5..54dbf623 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -849,7 +849,7 @@ if (!defined("DRIVER")) { return !ereg("scheme|sequence" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|view|routine|trigger" : "") : ""), $feature); } - $driver = "sql"; ///< @var string JUSH identifier + $jush = "sql"; ///< @var string JUSH identifier $types = array(); ///< @var array ($type => $maximum_unsigned_length, ...) $structured_types = array(); ///< @var array ($description => array($type, ...), ...) foreach (array( diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 63c69947..00e8c41f 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -492,7 +492,7 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . $connection->qu return ereg('^(comment|view|scheme|sequence|trigger|variables|drop_col)$', $feature); //! routine| } - $driver = "pgsql"; + $jush = "pgsql"; $types = array(); $structured_types = array(); foreach (array( //! arrays diff --git a/adminer/drivers/sqlite.inc.php b/adminer/drivers/sqlite.inc.php index 06186bc8..5ad85500 100644 --- a/adminer/drivers/sqlite.inc.php +++ b/adminer/drivers/sqlite.inc.php @@ -549,7 +549,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) { return ereg('^(view|trigger|variables|status)$', $feature); } - $driver = "sqlite"; + $jush = "sqlite"; $types = array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0); $structured_types = array_keys($types); $unsigned = array(); diff --git a/adminer/dump.inc.php b/adminer/dump.inc.php index 22d66807..17d14773 100644 --- a/adminer/dump.inc.php +++ b/adminer/dump.inc.php @@ -11,7 +11,7 @@ if ($_POST) { if ($_POST["format"] == "sql") { echo "-- Adminer $VERSION " . $drivers[DRIVER] . " dump -" . ($driver != "sql" ? "" : "SET NAMES utf8; +" . ($jush != "sql" ? "" : "SET NAMES utf8; SET foreign_key_checks = 0; SET time_zone = " . $connection->quote($connection->result("SELECT @@time_zone")) . "; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; @@ -158,7 +158,7 @@ page_header(lang('Export'), "", ($_GET["export"] != "" ? array("table" => $_GET[ $db_style = array('', 'USE', 'DROP+CREATE', 'CREATE'); $table_style = array('', 'DROP+CREATE', 'CREATE'); $data_style = array('', 'TRUNCATE+INSERT', 'INSERT', 'INSERT+UPDATE'); -if ($driver == "sql") { +if ($jush == "sql") { $db_style[] = 'CREATE+ALTER'; $table_style[] = 'CREATE+ALTER'; } diff --git a/adminer/foreign.inc.php b/adminer/foreign.inc.php index 200d3a03..4c01e4fe 100644 --- a/adminer/foreign.inc.php +++ b/adminer/foreign.inc.php @@ -2,7 +2,7 @@ $TABLE = $_GET["foreign"]; if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-js"]) { if ($_POST["drop"]) { - query_redirect("ALTER TABLE " . idf_escape($TABLE) . "\nDROP " . ($driver == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($_GET["name"]), ME . "table=" . urlencode($TABLE), lang('Foreign key has been dropped.')); + query_redirect("ALTER TABLE " . idf_escape($TABLE) . "\nDROP " . ($jush == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($_GET["name"]), ME . "table=" . urlencode($TABLE), lang('Foreign key has been dropped.')); } else { $source = array_filter($_POST["source"], 'strlen'); ksort($source); // enforce input order diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index c8d23cc4..90f17368 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -122,8 +122,8 @@ document.getElementById('username').focus(); * @return string */ function selectQuery($query) { - global $driver; - return "
" . h(str_replace("\n", " ", $query)) . "
" . lang('Edit') . "\n";
+ global $jush;
+ return "
" . h(str_replace("\n", " ", $query)) . "
" . lang('Edit') . "\n";
}
/** Description of a row in a table
@@ -383,12 +383,12 @@ document.getElementById('username').focus();
* @return string
*/
function messageQuery($query) {
- global $driver;
+ global $jush;
restart_session();
$id = "sql-" . count($_SESSION["messages"]);
$history = &get_session("history");
$history[DB][] = (strlen($query) > 1e6 ? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." : $query); // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
- return " " . lang('SQL command') . "
" . shorten_utf8($query, 1000) . '
" . shorten_utf8($query, 1000) . '
\n";
$first = false;
}
- echo "($drivers[$key]) " . h($username . ($server != "" ? "@$server" : "")) . "
\n";
+ echo "($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "")) . "
\n";
}
}
}
@@ -539,9 +539,9 @@ document.getElementById('username').focus();
$links[] = preg_quote($table, '/');
}
echo "\n";
}
diff --git a/adminer/include/auth.inc.php b/adminer/include/auth.inc.php
index 25593257..4ffb42cb 100644
--- a/adminer/include/auth.inc.php
+++ b/adminer/include/auth.inc.php
@@ -43,8 +43,8 @@ if (isset($_POST["server"])) {
redirect(substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.'));
}
} elseif ($_COOKIE["adminer_permanent"]) {
- list($server, $username, $cipher, $system) = array_map('base64_decode', explode(":", $_COOKIE["adminer_permanent"])); // $driver is a global variable
- if ($server == SERVER && $username === $_GET["username"] && $system == DRIVER) {
+ list($server, $username, $cipher, $driver) = array_map('base64_decode', explode(":", $_COOKIE["adminer_permanent"]));
+ if ($server == SERVER && $username === $_GET["username"] && $driver == DRIVER) {
session_regenerate_id(); // defense against session fixation
set_session("passwords", decrypt_string($cipher, $adminer->permanentLogin()));
}
diff --git a/adminer/include/export.inc.php b/adminer/include/export.inc.php
index 6cfa41a8..892dce53 100644
--- a/adminer/include/export.inc.php
+++ b/adminer/include/export.inc.php
@@ -100,8 +100,8 @@ DROP PROCEDURE adminer_alter;
}
function dump_data($table, $style, $select = "") {
- global $connection, $driver;
- $max_packet = ($driver == "sqlite" ? 0 : 1048576); // default, minimum is 1024
+ global $connection, $jush;
+ $max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
if ($style) {
if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
echo "TRUNCATE " . idf_escape($table) . ";\n";
diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index 818121a0..1441d30f 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -517,7 +517,7 @@ function enum_input($type, $name, $field, $value) {
* @return null
*/
function input($field, $value, $function) {
- global $types, $adminer, $driver;
+ global $types, $adminer, $jush;
$name = h(bracket_escape($field["field"]));
echo "
" . error() . "\n"; } else { - if ($driver == "mssql") { + if ($jush == "mssql") { $result->seek($limit * $page); } $email_fields = array(); @@ -217,7 +217,7 @@ if (!$columns) { // use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest) if ($_GET["page"] != "last") { $found_rows = (intval($limit) && $group && count($group) < count($select) - ? ($driver == "sql" ? $connection->result(" SELECT FOUND_ROWS()") : $connection->result("SELECT COUNT(*) FROM ($query) x")) // space to allow mysql.trace_mode + ? ($jush == "sql" ? $connection->result(" SELECT FOUND_ROWS()") : $connection->result("SELECT COUNT(*) FROM ($query) x")) // space to allow mysql.trace_mode : count($rows) ); } diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index c8b1232c..dc8eb49a 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -59,7 +59,7 @@ if (!$error && $_POST) { $empty = false; $q = substr($query, 0, $match[0][1]); $queries++; - echo "
" . shorten_utf8(trim($q), 1000) . "\n"; + echo "
" . shorten_utf8(trim($q), 1000) . "\n"; ob_flush(); flush(); // can take a long time - show the running query $start = explode(" ", microtime()); // microtime(true) is available since PHP 5 @@ -167,7 +167,7 @@ if ($history) { print_fieldset("history", lang('History'), $_GET["history"] != ""); foreach ($history as $key => $val) { //! save and display timestamp - echo '' . lang('Edit') . "
" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $val)))), 80, "
") . "" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $val)))), 80, "
") . "" . lang('Source') . " | " . lang('Target') . " | " . lang('ON DELETE') . " | " . lang('ON UPDATE') . ($driver != "sqlite" ? " | " : "") . " |
---|---|---|---|---|
" . lang('Source') . " | " . lang('Target') . " | " . lang('ON DELETE') . " | " . lang('ON UPDATE') . ($jush != "sqlite" ? " | " : "") . " |
$foreign_key[on_delete]\n"; echo " | $foreign_key[on_update]\n"; - if ($driver != "sqlite") { + if ($jush != "sqlite") { echo ' | ' . lang('Alter') . ''; } } echo " |
' . lang('Add foreign key') . "\n"; } } diff --git a/adminer/trigger.inc.php b/adminer/trigger.inc.php index 3855758a..3915f39e 100644 --- a/adminer/trigger.inc.php +++ b/adminer/trigger.inc.php @@ -8,8 +8,8 @@ if ($_POST && !$error && in_array($_POST["Timing"], $trigger_options["Timing"]) $timing_event = " $_POST[Timing] $_POST[Event]"; $on = " ON " . idf_escape($TABLE); $dropped = drop_create( - "DROP TRIGGER " . idf_escape($_GET["name"]) . ($driver == "pgsql" ? " ON " . idf_escape($TABLE) : ""), - "CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . ($driver == "mssql" ? $on . $timing_event : $timing_event . $on) . " $_POST[Type]\n$_POST[Statement]", + "DROP TRIGGER " . idf_escape($_GET["name"]) . ($jush == "pgsql" ? " ON " . idf_escape($TABLE) : ""), + "CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . ($jush == "mssql" ? $on . $timing_event : $timing_event . $on) . " $_POST[Type]\n$_POST[Statement]", ME . "table=" . urlencode($TABLE), lang('Trigger has been dropped.'), lang('Trigger has been altered.'), diff --git a/adminer/variables.inc.php b/adminer/variables.inc.php index 3c117024..901109e0 100644 --- a/adminer/variables.inc.php +++ b/adminer/variables.inc.php @@ -9,7 +9,7 @@ if (!$variables) { echo "
" . h($key) . " ";
+ echo " | " . h($key) . " ";
echo " | " . nbsp($val); } echo " |
---|