mirror of
https://github.com/vrana/adminer.git
synced 2025-09-02 10:53:09 +02:00
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
190146672f | ||
|
d6e71b5c53 | ||
|
0618429bce | ||
|
b0a217abdd | ||
|
35bfaa7506 | ||
|
e0a3205676 | ||
|
50bb83dbf2 | ||
|
697eedc6a1 | ||
|
d94adc09cc | ||
|
4e2a448e28 | ||
|
ac40be998d | ||
|
6a2de873e1 | ||
|
a9c1004232 | ||
|
37fa4de650 | ||
|
1d1f11504c | ||
|
3f38b61366 | ||
|
9ab205776d | ||
|
681b5e7b7a | ||
|
9c5efb9f8c | ||
|
2373409631 | ||
|
ad16cb8581 | ||
|
0293613c21 | ||
|
fe9ea18d2e | ||
|
6d39f290cc | ||
|
1bfffbf26b | ||
|
f09003ea4b | ||
|
2f7f0df09f | ||
|
5da5b75536 |
@@ -48,7 +48,9 @@ if (!$error && $_POST) {
|
|||||||
if (is_object($result)) {
|
if (is_object($result)) {
|
||||||
select($result, $connection2);
|
select($result, $connection2);
|
||||||
} else {
|
} else {
|
||||||
echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $affected) . "\n";
|
echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $affected)
|
||||||
|
. " <span class='time'>" . @date("H:i:s") . "</span>\n" // @ - time zone may be not set
|
||||||
|
;
|
||||||
}
|
}
|
||||||
} while ($connection->next_result());
|
} while ($connection->next_result());
|
||||||
|
|
||||||
|
@@ -180,6 +180,7 @@ foreach ($engines as $engine) {
|
|||||||
edit_fields($row["fields"], $collations, "TABLE", $foreign_keys);
|
edit_fields($row["fields"], $collations, "TABLE", $foreign_keys);
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
|
<?php echo script("editFields();"); ?>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<?php echo lang('Auto Increment'); ?>: <input type="number" name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
|
<?php echo lang('Auto Increment'); ?>: <input type="number" name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
|
||||||
@@ -220,4 +221,3 @@ foreach ($row["partition_names"] as $key => $val) {
|
|||||||
?>
|
?>
|
||||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||||
</form>
|
</form>
|
||||||
<?php echo script("qs('#form')['defaults'].onclick();" . (support("comment") ? " editingCommentsClick(qs('#form')['comments']);" : "")); ?>
|
|
||||||
|
@@ -112,7 +112,7 @@ if ($adminer->homepage()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "<tr><td><th>" . lang('%d in total', count($tables_list));
|
echo "<tr><td><th>" . lang('%d in total', count($tables_list));
|
||||||
echo "<td>" . h($jush == "sql" ? $connection->result("SELECT @@storage_engine") : "");
|
echo "<td>" . h($jush == "sql" ? $connection->result("SELECT @@default_storage_engine") : "");
|
||||||
echo "<td>" . h(db_collation(DB, collations()));
|
echo "<td>" . h(db_collation(DB, collations()));
|
||||||
foreach (array("Data_length", "Index_length", "Data_free") as $key) {
|
foreach (array("Data_length", "Index_length", "Data_free") as $key) {
|
||||||
echo "<td align='right' id='sum-$key'>";
|
echo "<td align='right' id='sum-$key'>";
|
||||||
|
@@ -267,7 +267,7 @@ if (!defined("DRIVER")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function query($query, $unbuffered = false) {
|
function query($query, $unbuffered = false) {
|
||||||
$this->setAttribute(1000, !$unbuffered); // 1000 - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY
|
$this->pdo->setAttribute(1000, !$unbuffered); // 1000 - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY
|
||||||
return parent::query($query, $unbuffered);
|
return parent::query($query, $unbuffered);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -711,6 +711,10 @@ AND typelem = 0"
|
|||||||
$sequences = array();
|
$sequences = array();
|
||||||
|
|
||||||
$status = table_status($table);
|
$status = table_status($table);
|
||||||
|
if (is_view($status)) {
|
||||||
|
$view = view($table);
|
||||||
|
return rtrim("CREATE VIEW " . idf_escape($table) . " AS $view[select]", ";");
|
||||||
|
}
|
||||||
$fields = fields($table);
|
$fields = fields($table);
|
||||||
$indexes = indexes($table);
|
$indexes = indexes($table);
|
||||||
ksort($indexes);
|
ksort($indexes);
|
||||||
|
@@ -18,8 +18,8 @@ if ($_POST && !$error) {
|
|||||||
if ($jush == "sql") {
|
if ($jush == "sql") {
|
||||||
echo "SET NAMES utf8;
|
echo "SET NAMES utf8;
|
||||||
SET time_zone = '+00:00';
|
SET time_zone = '+00:00';
|
||||||
" . ($_POST["data_style"] ? "SET foreign_key_checks = 0;
|
SET foreign_key_checks = 0;
|
||||||
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
|
" . ($_POST["data_style"] ? "SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
|
||||||
" : "") . "
|
" : "") . "
|
||||||
";
|
";
|
||||||
$connection->query("SET time_zone = '+00:00';");
|
$connection->query("SET time_zone = '+00:00';");
|
||||||
|
@@ -162,7 +162,7 @@ stop_session(true);
|
|||||||
|
|
||||||
if (isset($_GET["username"]) && is_string(get_password())) {
|
if (isset($_GET["username"]) && is_string(get_password())) {
|
||||||
list($host, $port) = explode(":", SERVER, 2);
|
list($host, $port) = explode(":", SERVER, 2);
|
||||||
if (is_numeric($port) && $port < 1024) {
|
if (+$port && ($port < 1024 || $port > 65535)) {
|
||||||
auth_error(lang('Connecting to privileged ports is not allowed.'));
|
auth_error(lang('Connecting to privileged ports is not allowed.'));
|
||||||
}
|
}
|
||||||
check_invalid_login();
|
check_invalid_login();
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
error_reporting(6135); // errors and warnings
|
error_reporting(6133); // errors
|
||||||
|
|
||||||
include "../adminer/include/coverage.inc.php";
|
include "../adminer/include/coverage.inc.php";
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ if (!defined("SID")) {
|
|||||||
|
|
||||||
// disable magic quotes to be able to use database escaping function
|
// disable magic quotes to be able to use database escaping function
|
||||||
remove_slashes(array(&$_GET, &$_POST, &$_COOKIE), $filter);
|
remove_slashes(array(&$_GET, &$_POST, &$_COOKIE), $filter);
|
||||||
if (get_magic_quotes_runtime()) {
|
if (function_exists("get_magic_quotes_runtime") && get_magic_quotes_runtime()) {
|
||||||
set_magic_quotes_runtime(false);
|
set_magic_quotes_runtime(false);
|
||||||
}
|
}
|
||||||
@set_time_limit(0); // @ - can be disabled
|
@set_time_limit(0); // @ - can be disabled
|
||||||
@@ -84,7 +84,7 @@ include "../adminer/drivers/mysql.inc.php"; // must be included as last driver
|
|||||||
|
|
||||||
define("SERVER", $_GET[DRIVER]); // read from pgsql=localhost
|
define("SERVER", $_GET[DRIVER]); // read from pgsql=localhost
|
||||||
define("DB", $_GET["db"]); // for the sake of speed and size
|
define("DB", $_GET["db"]); // for the sake of speed and size
|
||||||
define("ME", str_replace(":", "%3a", preg_replace('~^[^?]*/([^?]*).*~', '\1', $_SERVER["REQUEST_URI"])) . '?'
|
define("ME", preg_replace('~\?.*~', '', relative_uri()) . '?'
|
||||||
. (sid() ? SID . '&' : '')
|
. (sid() ? SID . '&' : '')
|
||||||
. (SERVER !== null ? DRIVER . "=" . urlencode(SERVER) . '&' : '')
|
. (SERVER !== null ? DRIVER . "=" . urlencode(SERVER) . '&' : '')
|
||||||
. (isset($_GET["username"]) ? "username=" . urlencode($_GET["username"]) . '&' : '')
|
. (isset($_GET["username"]) ? "username=" . urlencode($_GET["username"]) . '&' : '')
|
||||||
|
@@ -177,9 +177,7 @@ if ($foreign_keys) {
|
|||||||
$structured_types[lang('Foreign keys')] = $foreign_keys;
|
$structured_types[lang('Foreign keys')] = $foreign_keys;
|
||||||
}
|
}
|
||||||
echo optionlist(array_merge($extra_types, $structured_types), $type);
|
echo optionlist(array_merge($extra_types, $structured_types), $type);
|
||||||
?></select><?php echo on_help("getTarget(event).value", 1); ?>
|
?></select><td><input name="<?php echo h($key); ?>[length]" value="<?php echo h($field["length"]); ?>" size="3"<?php echo (!$field["length"] && preg_match('~var(char|binary)$~', $type) ? " class='required'" : ""); //! type="number" with enabled JavaScript ?> aria-labelledby="label-length"><td class="options"><?php
|
||||||
<?php echo script("mixin(qsl('select'), {onfocus: function () { lastType = selectValue(this); }, onchange: editingTypeChange});", ""); ?>
|
|
||||||
<td><input name="<?php echo h($key); ?>[length]" value="<?php echo h($field["length"]); ?>" size="3"<?php echo (!$field["length"] && preg_match('~var(char|binary)$~', $type) ? " class='required'" : ""); //! type="number" with enabled JavaScript ?> aria-labelledby="label-length"><?php echo script("mixin(qsl('input'), {onfocus: editingLengthFocus, oninput: editingLengthChange});", ""); ?><td class="options"><?php
|
|
||||||
echo "<select name='" . h($key) . "[collation]'" . (preg_match('~(char|text|enum|set)$~', $type) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
|
echo "<select name='" . h($key) . "[collation]'" . (preg_match('~(char|text|enum|set)$~', $type) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
|
||||||
echo ($unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match(number_type(), $type) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
|
echo ($unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match(number_type(), $type) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
|
||||||
echo (isset($field['on_update']) ? "<select name='" . h($key) . "[on_update]'" . (preg_match('~timestamp|datetime~', $type) ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), (preg_match('~^CURRENT_TIMESTAMP~i', $field["on_update"]) ? "CURRENT_TIMESTAMP" : $field["on_update"])) . '</select>' : '');
|
echo (isset($field['on_update']) ? "<select name='" . h($key) . "[on_update]'" . (preg_match('~timestamp|datetime~', $type) ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), (preg_match('~^CURRENT_TIMESTAMP~i', $field["on_update"]) ? "CURRENT_TIMESTAMP" : $field["on_update"])) . '</select>' : '');
|
||||||
@@ -265,6 +263,8 @@ function type_class($type) {
|
|||||||
function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = array()) {
|
function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = array()) {
|
||||||
global $inout;
|
global $inout;
|
||||||
$fields = array_values($fields);
|
$fields = array_values($fields);
|
||||||
|
$default_class = (($_POST ? $_POST["defaults"] : adminer_setting("defaults")) ? "" : " class='hidden'");
|
||||||
|
$comment_class = (($_POST ? $_POST["comments"] : adminer_setting("comments")) ? "" : " class='hidden'");
|
||||||
?>
|
?>
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
<?php if ($type == "PROCEDURE") { ?><td><?php } ?>
|
<?php if ($type == "PROCEDURE") { ?><td><?php } ?>
|
||||||
@@ -281,8 +281,8 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
|
|||||||
'pgsql' => "datatype.html#DATATYPE-SERIAL",
|
'pgsql' => "datatype.html#DATATYPE-SERIAL",
|
||||||
'mssql' => "ms186775.aspx",
|
'mssql' => "ms186775.aspx",
|
||||||
)); ?>
|
)); ?>
|
||||||
<td id="label-default"><?php echo lang('Default value'); ?>
|
<td id="label-default"<?php echo $default_class; ?>><?php echo lang('Default value'); ?>
|
||||||
<?php echo (support("comment") ? "<td id='label-comment'>" . lang('Comment') : ""); ?>
|
<?php echo (support("comment") ? "<td id='label-comment'$comment_class>" . lang('Comment') : ""); ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<td><?php echo "<input type='image' class='icon' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>" . script("row_count = " . count($fields) . ";"); ?>
|
<td><?php echo "<input type='image' class='icon' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>" . script("row_count = " . count($fields) . ";"); ?>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -296,13 +296,13 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
|
|||||||
?>
|
?>
|
||||||
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
|
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
|
||||||
<?php echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", explode("|", $inout), $field["inout"]) : ""); ?>
|
<?php echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", explode("|", $inout), $field["inout"]) : ""); ?>
|
||||||
<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" data-maxlength="64" autocapitalize="off" aria-labelledby="label-name"><?php echo script("qsl('input').oninput = function () { editingNameChange.call(this);" . ($field["field"] != "" || count($fields) > 1 ? "" : " editingAddRow.call(this);") . " };", ""); ?><?php } ?>
|
<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" data-maxlength="64" autocapitalize="off" aria-labelledby="label-name"><?php } ?>
|
||||||
<input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>"><?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
|
<input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>"><?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
|
||||||
<?php if ($type == "TABLE") { ?>
|
<?php if ($type == "TABLE") { ?>
|
||||||
<td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block", "label-null"); ?>
|
<td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block", "label-null"); ?>
|
||||||
<td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> aria-labelledby="label-ai"></label><td><?php
|
<td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> aria-labelledby="label-ai"></label><td<?php echo $default_class; ?>><?php
|
||||||
echo checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "label-default"); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" aria-labelledby="label-default"><?php
|
echo checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "label-default"); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" aria-labelledby="label-default"><?php
|
||||||
echo (support("comment") ? "<td><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' data-maxlength='" . (min_version(5.5) ? 1024 : 255) . "' aria-labelledby='label-comment'>" : "");
|
echo (support("comment") ? "<td$comment_class><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' data-maxlength='" . (min_version(5.5) ? 1024 : 255) . "' aria-labelledby='label-comment'>" : "");
|
||||||
}
|
}
|
||||||
echo "<td>";
|
echo "<td>";
|
||||||
echo (support("move_col") ?
|
echo (support("move_col") ?
|
||||||
|
@@ -62,7 +62,7 @@ function number_type() {
|
|||||||
* @return null modified in place
|
* @return null modified in place
|
||||||
*/
|
*/
|
||||||
function remove_slashes($process, $filter = false) {
|
function remove_slashes($process, $filter = false) {
|
||||||
if (get_magic_quotes_gpc()) {
|
if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
|
||||||
while (list($key, $val) = each($process)) {
|
while (list($key, $val) = each($process)) {
|
||||||
foreach ($val as $k => $v) {
|
foreach ($val as $k => $v) {
|
||||||
unset($process[$key][$k]);
|
unset($process[$key][$k]);
|
||||||
@@ -721,12 +721,19 @@ function format_time($start) {
|
|||||||
return lang('%.3f s', max(0, microtime(true) - $start));
|
return lang('%.3f s', max(0, microtime(true) - $start));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Get relative REQUEST_URI
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function relative_uri() {
|
||||||
|
return str_replace(":", "%3a", preg_replace('~^[^?]*/([^?]*)~', '\1', $_SERVER["REQUEST_URI"]));
|
||||||
|
}
|
||||||
|
|
||||||
/** Remove parameter from query string
|
/** Remove parameter from query string
|
||||||
* @param string
|
* @param string
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function remove_from_uri($param = "") {
|
function remove_from_uri($param = "") {
|
||||||
return substr(preg_replace("~(?<=[?&])($param" . (SID ? "" : "|" . session_name()) . ")=[^&]*&~", '', "$_SERVER[REQUEST_URI]&"), 0, -1);
|
return substr(preg_replace("~(?<=[?&])($param" . (SID ? "" : "|" . session_name()) . ")=[^&]*&~", '', relative_uri() . "&"), 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Generate page number for pagination
|
/** Generate page number for pagination
|
||||||
@@ -842,19 +849,18 @@ function friendly_url($val) {
|
|||||||
/** Print hidden fields
|
/** Print hidden fields
|
||||||
* @param array
|
* @param array
|
||||||
* @param array
|
* @param array
|
||||||
|
* @param string
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function hidden_fields($process, $ignore = array()) {
|
function hidden_fields($process, $ignore = array(), $prefix = '') {
|
||||||
$return = false;
|
$return = false;
|
||||||
while (list($key, $val) = each($process)) {
|
foreach ($process as $key => $val) {
|
||||||
if (!in_array($key, $ignore)) {
|
if (!in_array($key, $ignore)) {
|
||||||
if (is_array($val)) {
|
if (is_array($val)) {
|
||||||
foreach ($val as $k => $v) {
|
hidden_fields($val, array(), $key);
|
||||||
$process[$key . "[$k]"] = $v;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$return = true;
|
$return = true;
|
||||||
echo '<input type="hidden" name="' . h($key) . '" value="' . h($val) . '">';
|
echo '<input type="hidden" name="' . h($prefix ? $prefix . "[$key]" : $key) . '" value="' . h($val) . '">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
// PDO can be used in several database drivers
|
// PDO can be used in several database drivers
|
||||||
if (extension_loaded('pdo')) {
|
if (extension_loaded('pdo')) {
|
||||||
/*abstract*/ class Min_PDO extends PDO {
|
/*abstract*/ class Min_PDO {
|
||||||
var $_result, $server_info, $affected_rows, $errno, $error;
|
var $_result, $server_info, $affected_rows, $errno, $error, $pdo;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
global $adminer;
|
global $adminer;
|
||||||
@@ -14,21 +14,26 @@ if (extension_loaded('pdo')) {
|
|||||||
|
|
||||||
function dsn($dsn, $username, $password, $options = array()) {
|
function dsn($dsn, $username, $password, $options = array()) {
|
||||||
try {
|
try {
|
||||||
parent::__construct($dsn, $username, $password, $options);
|
$this->pdo = new PDO($dsn, $username, $password, $options);
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
auth_error(h($ex->getMessage()));
|
auth_error(h($ex->getMessage()));
|
||||||
}
|
}
|
||||||
$this->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS
|
$this->pdo->setAttribute(3, 1); // 3 - PDO::ATTR_ERRMODE, 1 - PDO::ERRMODE_WARNING
|
||||||
$this->server_info = @$this->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
|
$this->pdo->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS
|
||||||
|
$this->server_info = @$this->pdo->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
/*abstract function select_db($database);*/
|
/*abstract function select_db($database);*/
|
||||||
|
|
||||||
|
function quote($string) {
|
||||||
|
return $this->pdo->quote($string);
|
||||||
|
}
|
||||||
|
|
||||||
function query($query, $unbuffered = false) {
|
function query($query, $unbuffered = false) {
|
||||||
$result = parent::query($query);
|
$result = $this->pdo->query($query);
|
||||||
$this->error = "";
|
$this->error = "";
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
list(, $this->errno, $this->error) = $this->errorInfo();
|
list(, $this->errno, $this->error) = $this->pdo->errorInfo();
|
||||||
if (!$this->error) {
|
if (!$this->error) {
|
||||||
$this->error = lang('Unknown error.');
|
$this->error = lang('Unknown error.');
|
||||||
}
|
}
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
<?php
|
<?php
|
||||||
$VERSION = "4.7.5";
|
$VERSION = "4.7.8";
|
||||||
|
@@ -234,7 +234,7 @@ $translations = array(
|
|||||||
'Sort' => 'Ταξινόμηση',
|
'Sort' => 'Ταξινόμηση',
|
||||||
'descending' => 'Φθίνουσα',
|
'descending' => 'Φθίνουσα',
|
||||||
'Limit' => 'Όριο',
|
'Limit' => 'Όριο',
|
||||||
'Limit rows' => 'Περιοριμός σειρών',
|
'Limit rows' => 'Περιορισμός σειρών',
|
||||||
'Text length' => 'Μήκος κειμένου',
|
'Text length' => 'Μήκος κειμένου',
|
||||||
'Action' => 'Ενέργεια',
|
'Action' => 'Ενέργεια',
|
||||||
'Full table scan' => 'Πλήρης σάρωση πινάκων',
|
'Full table scan' => 'Πλήρης σάρωση πινάκων',
|
||||||
|
@@ -333,4 +333,18 @@ $translations = array(
|
|||||||
'Type has been dropped.' => 'Tyyppi poistettiin.',
|
'Type has been dropped.' => 'Tyyppi poistettiin.',
|
||||||
'Type has been created.' => 'Tyyppi luotiin.',
|
'Type has been created.' => 'Tyyppi luotiin.',
|
||||||
'Alter type' => 'Muuta tyyppiä',
|
'Alter type' => 'Muuta tyyppiä',
|
||||||
|
|
||||||
|
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Kiitos, kun käytät Admineriä, voit <a href="https://www.adminer.org/en/donation/">tehdä lahjoituksen tästä</a>.',
|
||||||
|
'Drop %s?' => 'Poistetaanko %s?',
|
||||||
|
'overwrite' => 'kirjoittaen päälle',
|
||||||
|
'DB' => 'TK',
|
||||||
|
'ATTACH queries are not supported.' => 'ATTACH-komennolla tehtyjä kyselyjä ei tueta.',
|
||||||
|
'Warnings' => 'Varoitukset',
|
||||||
|
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer ei tue pääsyä tietokantaan ilman salasanaa, katso tarkemmin <a href="https://www.adminer.org/en/password/"%s>täältä</a>.',
|
||||||
|
'The action will be performed after successful login with the same credentials.' => 'Toiminto suoritetaan sen jälkeen, kun on onnistuttu kirjautumaan samoilla käyttäjätunnuksilla uudestaan.',
|
||||||
|
'Connecting to privileged ports is not allowed.' => 'Yhteydet etuoikeutettuihin portteihin eivät ole sallittuja.',
|
||||||
|
'There is a space in the input password which might be the cause.' => 'Syynä voi olla syötetyssä salasanassa oleva välilyönti.',
|
||||||
|
'Unknown error.' => 'Tuntematon virhe.',
|
||||||
|
'Database does not support password.' => 'Tietokanta ei tue salasanaa.',
|
||||||
|
'Disable %s or enable %s or %s extensions.' => 'Poista käytöstä %s tai ota käyttöön laajennus %s tai %s.',
|
||||||
);
|
);
|
||||||
|
@@ -48,6 +48,7 @@ if (isset($_GET["function"])) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
|
<?php echo script("editFields();"); ?>
|
||||||
</div>
|
</div>
|
||||||
<p><?php textarea("definition", $row["definition"]); ?>
|
<p><?php textarea("definition", $row["definition"]); ?>
|
||||||
<p>
|
<p>
|
||||||
|
@@ -207,6 +207,33 @@ function idfEscape(s) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** Set up event handlers for edit_fields().
|
||||||
|
*/
|
||||||
|
function editFields() {
|
||||||
|
var els = qsa('[name$="[field]"]');
|
||||||
|
for (var i = 0; i < els.length; i++) {
|
||||||
|
els[i].oninput = function () {
|
||||||
|
editingNameChange.call(this);
|
||||||
|
if (!this.defaultValue) {
|
||||||
|
editingAddRow.call(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
els = qsa('[name$="[length]"]');
|
||||||
|
for (var i = 0; i < els.length; i++) {
|
||||||
|
mixin(els[i], {onfocus: editingLengthFocus, oninput: editingLengthChange});
|
||||||
|
}
|
||||||
|
els = qsa('[name$="[type]"]');
|
||||||
|
for (var i = 0; i < els.length; i++) {
|
||||||
|
mixin(els[i], {
|
||||||
|
onfocus: function () { lastType = selectValue(this); },
|
||||||
|
onchange: editingTypeChange,
|
||||||
|
onmouseover: function (event) { helpMouseover.call(this, event, getTarget(event).value, 1) },
|
||||||
|
onmouseout: helpMouseout
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Handle clicks on fields editing
|
/** Handle clicks on fields editing
|
||||||
* @param MouseEvent
|
* @param MouseEvent
|
||||||
* @return boolean false to cancel action
|
* @return boolean false to cancel action
|
||||||
@@ -214,7 +241,7 @@ function idfEscape(s) {
|
|||||||
function editingClick(event) {
|
function editingClick(event) {
|
||||||
var el = getTarget(event);
|
var el = getTarget(event);
|
||||||
if (!isTag(el, 'input')) {
|
if (!isTag(el, 'input')) {
|
||||||
el = parentTag(target, 'label');
|
el = parentTag(el, 'label');
|
||||||
el = el && qs('input', el);
|
el = el && qs('input', el);
|
||||||
}
|
}
|
||||||
if (el) {
|
if (el) {
|
||||||
@@ -289,7 +316,7 @@ function editingNameChange() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Add table row for next field
|
/** Add table row for next field
|
||||||
* @param boolean
|
* @param [boolean]
|
||||||
* @return boolean false
|
* @return boolean false
|
||||||
* @this HTMLInputElement
|
* @this HTMLInputElement
|
||||||
*/
|
*/
|
||||||
|
@@ -444,7 +444,8 @@ function selectSearch(name) {
|
|||||||
var divs = qsa('div', el);
|
var divs = qsa('div', el);
|
||||||
for (var i=0; i < divs.length; i++) {
|
for (var i=0; i < divs.length; i++) {
|
||||||
var div = divs[i];
|
var div = divs[i];
|
||||||
if (isTag(div.firstChild, 'select') && selectValue(div.firstChild) == name) {
|
var el = qs('[name$="[col]"]', div);
|
||||||
|
if (el && selectValue(el) == name) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
18
changes.txt
18
changes.txt
@@ -1,3 +1,19 @@
|
|||||||
|
Adminer 4.7.8 (released 2020-12-06):
|
||||||
|
Support PHP 8
|
||||||
|
Disallow connecting to privileged ports (bug #769)
|
||||||
|
|
||||||
|
Adminer 4.7.7 (released 2020-05-11):
|
||||||
|
Fix open redirect if Adminer is accessible at //adminer.php%2F@
|
||||||
|
|
||||||
|
Adminer 4.7.6 (released 2020-01-31):
|
||||||
|
Speed up alter table form (regression from 4.4.0)
|
||||||
|
Fix clicking on non-input fields in alter table (regression from 4.6.2)
|
||||||
|
Display time of procedure execution
|
||||||
|
Disallow connecting to ports > 65535 (bug #730)
|
||||||
|
MySQL: Always set foreign_key_checks in export
|
||||||
|
PostgreSQL: Support exporting views
|
||||||
|
Editor: Fix focusing foreign key search in select
|
||||||
|
|
||||||
Adminer 4.7.5 (released 2019-11-13):
|
Adminer 4.7.5 (released 2019-11-13):
|
||||||
Add id="" to cells with failed inline edit (bug #708)
|
Add id="" to cells with failed inline edit (bug #708)
|
||||||
PostgreSQL: Fix getting default value in PostgreSQL 12 (bug #719)
|
PostgreSQL: Fix getting default value in PostgreSQL 12 (bug #719)
|
||||||
@@ -681,7 +697,7 @@ Print ALTER export instead of executing it
|
|||||||
Click on row selects it
|
Click on row selects it
|
||||||
Fix Editor date format
|
Fix Editor date format
|
||||||
Fix long SQL query crash (bug #2839231)
|
Fix long SQL query crash (bug #2839231)
|
||||||
Speedup of simple alter table
|
Speed up simple alter table
|
||||||
Traditional Chinese translation
|
Traditional Chinese translation
|
||||||
|
|
||||||
Adminer 2.0.0 (released 2009-08-06):
|
Adminer 2.0.0 (released 2009-08-06):
|
||||||
|
12
compile.php
12
compile.php
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
error_reporting(6135); // errors and warnings
|
error_reporting(6133); // errors
|
||||||
include dirname(__FILE__) . "/adminer/include/version.inc.php";
|
include dirname(__FILE__) . "/adminer/include/version.inc.php";
|
||||||
include dirname(__FILE__) . "/externals/JsShrink/jsShrink.php";
|
include dirname(__FILE__) . "/externals/JsShrink/jsShrink.php";
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ function php_shrink($input) {
|
|||||||
$short_variables[$key] = short_identifier($number, $chars); // could use also numbers and \x7f-\xff
|
$short_variables[$key] = short_identifier($number, $chars); // could use also numbers and \x7f-\xff
|
||||||
}
|
}
|
||||||
|
|
||||||
$set = array_flip(preg_split('//', '!"#$%&\'()*+,-./:;<=>?@[\]^`{|}'));
|
$set = array_flip(preg_split('//', '!"#$%&\'()*+,-./:;<=>?@[]^`{|}'));
|
||||||
$space = '';
|
$space = '';
|
||||||
$output = '';
|
$output = '';
|
||||||
$in_echo = false;
|
$in_echo = false;
|
||||||
@@ -315,6 +315,14 @@ function compile_file($match) {
|
|||||||
return '"' . add_quo_slashes($file) . '"';
|
return '"' . add_quo_slashes($file) . '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists("each")) {
|
||||||
|
function each(&$arr) {
|
||||||
|
$key = key($arr);
|
||||||
|
next($arr);
|
||||||
|
return $key === null ? false : array($key, $arr[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function min_version() {
|
function min_version() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
21
editor/sqlite.php
Normal file
21
editor/sqlite.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
function adminer_object() {
|
||||||
|
include_once "../plugins/plugin.php";
|
||||||
|
include_once "../plugins/login-password-less.php";
|
||||||
|
|
||||||
|
class AdminerCustomization extends AdminerPlugin {
|
||||||
|
function loginFormField($name, $heading, $value) {
|
||||||
|
return parent::loginFormField($name, $heading, str_replace('value="server"', 'value="sqlite"', $value));
|
||||||
|
}
|
||||||
|
function database() {
|
||||||
|
return "PATH_TO_YOUR_SQLITE_HERE";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new AdminerCustomization(array(
|
||||||
|
// TODO: inline the result of password_hash() so that the password is not visible in source codes
|
||||||
|
new AdminerLoginPasswordLess(password_hash("YOUR_PASSWORD_HERE", PASSWORD_DEFAULT)),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
include "./index.php";
|
@@ -23,13 +23,13 @@ class AdminerLoginIp {
|
|||||||
|
|
||||||
function login($login, $password) {
|
function login($login, $password) {
|
||||||
foreach ($this->ips as $ip) {
|
foreach ($this->ips as $ip) {
|
||||||
if (strncasecmp($_SERVER["REMOTE_ADDR"], $ip, strlen($ip))) {
|
if (strncasecmp($_SERVER["REMOTE_ADDR"], $ip, strlen($ip)) == 0) {
|
||||||
if (!$this->forwarded_for) {
|
if (!$this->forwarded_for) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ($_SERVER["HTTP_X_FORWARDED_FOR"]) {
|
if ($_SERVER["HTTP_X_FORWARDED_FOR"]) {
|
||||||
foreach ($this->forwarded_for as $forwarded_for) {
|
foreach ($this->forwarded_for as $forwarded_for) {
|
||||||
if (strncasecmp(preg_replace('~.*, *~', '', $_SERVER["HTTP_X_FORWARDED_FOR"]), $forwarded_for, strlen($forwarded_for))) {
|
if (strncasecmp(preg_replace('~.*, *~', '', $_SERVER["HTTP_X_FORWARDED_FOR"]), $forwarded_for, strlen($forwarded_for)) == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,6 +12,7 @@ editor/example.php - Example customization
|
|||||||
plugins/readme.txt - Plugins for Adminer and Adminer Editor
|
plugins/readme.txt - Plugins for Adminer and Adminer Editor
|
||||||
adminer/plugin.php - Plugin demo
|
adminer/plugin.php - Plugin demo
|
||||||
adminer/sqlite.php - Development version of Adminer with SQLite allowed
|
adminer/sqlite.php - Development version of Adminer with SQLite allowed
|
||||||
|
editor/sqlite.php - Development version of Editor with SQLite allowed
|
||||||
adminer/designs.php - Development version of Adminer with adminer.css switcher
|
adminer/designs.php - Development version of Adminer with adminer.css switcher
|
||||||
compile.php - Create a single file version
|
compile.php - Create a single file version
|
||||||
lang.php - Update translations
|
lang.php - Update translations
|
||||||
|
Reference in New Issue
Block a user