mirror of
https://github.com/vrana/adminer.git
synced 2026-03-26 14:20:54 +01:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb43ea3025 | ||
|
|
2ba833409a | ||
|
|
5eaaa498d3 | ||
|
|
746c0a7b0b | ||
|
|
b30526213d | ||
|
|
6819815b88 | ||
|
|
a83626c8af | ||
|
|
d4ddbc0639 | ||
|
|
a6cb91f0d2 | ||
|
|
78d3ce830d | ||
|
|
88099b7dd7 | ||
|
|
8bce359fae | ||
|
|
8ca7066625 | ||
|
|
51bcc2a064 |
@@ -1,3 +1,9 @@
|
||||
## Adminer 5.2.1 (released 2025-04-11)
|
||||
- Fix search anywhere (bug #1004, regression from 5.1.1)
|
||||
- Fix import without primary key (bug #1017, regression from 5.1.1)
|
||||
- PostgreSQL PDO: Fix bytea without primary key (bug #1021)
|
||||
- non-MySQL: Parse '--' without trailing space as comment in SQL command (bug #1025, regression from 5.2.0)
|
||||
|
||||
## Adminer 5.2.0 (released 2025-04-08)
|
||||
- Autocomplete SQL commands
|
||||
- Do not edit NULL values by Modify (bug #967)
|
||||
|
||||
@@ -11,6 +11,7 @@ add_driver("mssql", "MS SQL");
|
||||
|
||||
if (isset($_GET["mssql"])) {
|
||||
define('Adminer\DRIVER', "mssql");
|
||||
|
||||
if (extension_loaded("sqlsrv") && $_GET["ext"] != "pdo") {
|
||||
class Db extends SqlDb {
|
||||
public $extension = "sqlsrv";
|
||||
|
||||
@@ -5,6 +5,7 @@ SqlDriver::$drivers = array("server" => "MySQL / MariaDB") + SqlDriver::$drivers
|
||||
|
||||
if (!defined('Adminer\DRIVER')) {
|
||||
define('Adminer\DRIVER', "server"); // server - backwards compatibility
|
||||
|
||||
// MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable
|
||||
if (extension_loaded("mysqli") && $_GET["ext"] != "pdo") {
|
||||
class Db extends \MySQLi {
|
||||
|
||||
@@ -5,6 +5,7 @@ add_driver("oracle", "Oracle (beta)");
|
||||
|
||||
if (isset($_GET["oracle"])) {
|
||||
define('Adminer\DRIVER', "oracle");
|
||||
|
||||
if (extension_loaded("oci8") && $_GET["ext"] != "pdo") {
|
||||
class Db extends SqlDb {
|
||||
public $extension = "oci8";
|
||||
|
||||
@@ -5,6 +5,7 @@ add_driver("pgsql", "PostgreSQL");
|
||||
|
||||
if (isset($_GET["pgsql"])) {
|
||||
define('Adminer\DRIVER', "pgsql");
|
||||
|
||||
if (extension_loaded("pgsql") && $_GET["ext"] != "pdo") {
|
||||
class PgsqlDb extends SqlDb {
|
||||
public $extension = "PgSQL";
|
||||
@@ -94,8 +95,9 @@ if (isset($_GET["pgsql"])) {
|
||||
*/
|
||||
function copyFrom(string $table, array $rows): bool {
|
||||
$this->error = '';
|
||||
set_error_handler(function ($errno, $error) {
|
||||
set_error_handler(function (int $errno, string $error): bool {
|
||||
$this->error = (ini_bool('html_errors') ? html_entity_decode($error) : $error);
|
||||
return true;
|
||||
});
|
||||
$return = pg_copy_from($this->link, $table, $rows);
|
||||
restore_error_handler();
|
||||
|
||||
@@ -5,8 +5,8 @@ add_driver("sqlite", "SQLite");
|
||||
|
||||
if (isset($_GET["sqlite"])) {
|
||||
define('Adminer\DRIVER', "sqlite");
|
||||
if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
|
||||
|
||||
if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
|
||||
abstract class SqliteDb extends SqlDb {
|
||||
public $extension = "SQLite3";
|
||||
private $link;
|
||||
|
||||
@@ -11,7 +11,7 @@ if (substr(VERSION, -4) != '-dev') {
|
||||
header("Cache-Control: immutable");
|
||||
}
|
||||
|
||||
@ini_set("zlib.output_compression", 1); // @ - may be disabled
|
||||
@ini_set("zlib.output_compression", '1'); // @ - may be disabled
|
||||
|
||||
if ($_GET["file"] == "default.css") {
|
||||
header("Content-Type: text/css; charset=utf-8");
|
||||
|
||||
@@ -538,41 +538,39 @@ class Adminer {
|
||||
}
|
||||
}
|
||||
foreach ((array) $_GET["where"] as $key => $val) {
|
||||
if ("$val[col]$val[val]" != "" && in_array($val["op"], adminer()->operators())) {
|
||||
$prefix = "";
|
||||
$cond = " $val[op]";
|
||||
if (preg_match('~IN$~', $val["op"])) {
|
||||
$in = process_length($val["val"]);
|
||||
$cond .= " " . ($in != "" ? $in : "(NULL)");
|
||||
} elseif ($val["op"] == "SQL") {
|
||||
$cond = " $val[val]"; // SQL injection
|
||||
} elseif ($val["op"] == "LIKE %%") {
|
||||
$cond = " LIKE " . adminer()->processInput(idx($fields, $val["col"], array()), "%$val[val]%"); // this is used by search anywhere which doesn't set $val["col"]
|
||||
} elseif ($val["op"] == "ILIKE %%") {
|
||||
$cond = " ILIKE " . adminer()->processInput($fields[$val["col"]], "%$val[val]%");
|
||||
} elseif ($val["op"] == "FIND_IN_SET") {
|
||||
$prefix = "$val[op](" . q($val["val"]) . ", ";
|
||||
$cond = ")";
|
||||
} elseif (!preg_match('~NULL$~', $val["op"])) {
|
||||
$cond .= " " . adminer()->processInput($fields[$val["col"]], $val["val"]);
|
||||
}
|
||||
if ($val["col"] != "") {
|
||||
$return[] = $prefix . driver()->convertSearch(idf_escape($val["col"]), $val, $fields[$val["col"]]) . $cond;
|
||||
} else {
|
||||
// find anywhere
|
||||
$cols = array();
|
||||
foreach ($fields as $name => $field) {
|
||||
if (
|
||||
isset($field["privileges"]["where"])
|
||||
&& (preg_match('~^[-\d.' . (preg_match('~IN$~', $val["op"]) ? ',' : '') . ']+$~', $val["val"]) || !preg_match('~' . number_type() . '|bit~', $field["type"]))
|
||||
&& (!preg_match("~[\x80-\xFF]~", $val["val"]) || preg_match('~char|text|enum|set~', $field["type"]))
|
||||
&& (!preg_match('~date|timestamp~', $field["type"]) || preg_match('~^\d+-\d+-\d+~', $val["val"]))
|
||||
) {
|
||||
$cols[] = $prefix . driver()->convertSearch(idf_escape($name), $val, $field) . $cond;
|
||||
}
|
||||
$col = $val["col"];
|
||||
if ("$col$val[val]" != "" && in_array($val["op"], adminer()->operators())) {
|
||||
$conds = array();
|
||||
foreach (($col != "" ? array($col => $fields[$col]) : $fields) as $name => $field) {
|
||||
$prefix = "";
|
||||
$cond = " $val[op]";
|
||||
if (preg_match('~IN$~', $val["op"])) {
|
||||
$in = process_length($val["val"]);
|
||||
$cond .= " " . ($in != "" ? $in : "(NULL)");
|
||||
} elseif ($val["op"] == "SQL") {
|
||||
$cond = " $val[val]"; // SQL injection
|
||||
} elseif (preg_match('~^(I?LIKE) %%$~', $val["op"], $match)) {
|
||||
$cond = " $match[1] " . adminer()->processInput($field, "%$val[val]%");
|
||||
} elseif ($val["op"] == "FIND_IN_SET") {
|
||||
$prefix = "$val[op](" . q($val["val"]) . ", ";
|
||||
$cond = ")";
|
||||
} elseif (!preg_match('~NULL$~', $val["op"])) {
|
||||
$cond .= " " . adminer()->processInput($field, $val["val"]);
|
||||
}
|
||||
if ($col != "" || ( // find anywhere
|
||||
isset($field["privileges"]["where"])
|
||||
&& (preg_match('~^[-\d.' . (preg_match('~IN$~', $val["op"]) ? ',' : '') . ']+$~', $val["val"]) || !preg_match('~' . number_type() . '|bit~', $field["type"]))
|
||||
&& (!preg_match("~[\x80-\xFF]~", $val["val"]) || preg_match('~char|text|enum|set~', $field["type"]))
|
||||
&& (!preg_match('~date|timestamp~', $field["type"]) || preg_match('~^\d+-\d+-\d+~', $val["val"]))
|
||||
)) {
|
||||
$conds[] = $prefix . driver()->convertSearch(idf_escape($name), $val, $field) . $cond;
|
||||
}
|
||||
$return[] = ($cols ? "(" . implode(" OR ", $cols) . ")" : "1 = 0");
|
||||
}
|
||||
$return[] =
|
||||
(count($conds) == 1 ? $conds[0] :
|
||||
($conds ? "(" . implode(" OR ", $conds) . ")" :
|
||||
"1 = 0"
|
||||
));
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
@@ -1078,6 +1076,7 @@ class Adminer {
|
||||
function tablesPrint(array $tables): void {
|
||||
echo "<ul id='tables'>" . script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
foreach ($tables as $table => $status) {
|
||||
$table = "$table"; // do not highlight "0" as active everywhere
|
||||
$name = adminer()->tableName($status);
|
||||
if ($name != "") {
|
||||
echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"'
|
||||
|
||||
@@ -89,7 +89,7 @@ if (
|
||||
echo script("tableCheck();");
|
||||
}
|
||||
|
||||
if (isset(adminer()->plugins) && is_array(adminer()->plugins)) {
|
||||
if (!empty(adminer()->plugins)) {
|
||||
echo "<div class='plugins'>\n";
|
||||
echo "<h3>" . lang('Loaded plugins') . "</h3>\n<ul>\n";
|
||||
foreach (adminer()->plugins as $plugin) {
|
||||
|
||||
@@ -197,10 +197,7 @@ abstract class SqlDriver {
|
||||
* @param Field $field
|
||||
*/
|
||||
function value(?string $val, array $field): ?string {
|
||||
return (method_exists($this->conn, 'value')
|
||||
? $this->conn->value($val, $field)
|
||||
: (is_resource($val) ? stream_get_contents($val) : $val)
|
||||
);
|
||||
return (method_exists($this->conn, 'value') ? $this->conn->value($val, $field) : $val);
|
||||
}
|
||||
|
||||
/** Quote binary string */
|
||||
@@ -257,10 +254,12 @@ AND CHECK_CLAUSE NOT LIKE '% IS NOT NULL'", $this->conn); // ignore default IS N
|
||||
*/
|
||||
function allFields(): array {
|
||||
$return = array();
|
||||
foreach (get_rows("SELECT TABLE_NAME AS tab, COLUMN_NAME AS field, IS_NULLABLE AS nullable, DATA_TYPE AS type, CHARACTER_MAXIMUM_LENGTH AS length" . (JUSH == 'sql' ? ", COLUMN_KEY = 'PRI' AS `primary`" : "") . "
|
||||
foreach (
|
||||
get_rows("SELECT TABLE_NAME AS tab, COLUMN_NAME AS field, IS_NULLABLE AS nullable, DATA_TYPE AS type, CHARACTER_MAXIMUM_LENGTH AS length" . (JUSH == 'sql' ? ", COLUMN_KEY = 'PRI' AS `primary`" : "") . "
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = " . q($_GET["ns"] != "" ? $_GET["ns"] : DB) . "
|
||||
ORDER BY TABLE_NAME, ORDINAL_POSITION", $this->conn) as $row) {
|
||||
ORDER BY TABLE_NAME, ORDINAL_POSITION", $this->conn) as $row
|
||||
) {
|
||||
$row["null"] = ($row["nullable"] == "YES");
|
||||
$return[$row["tab"]][] = $row;
|
||||
}
|
||||
|
||||
@@ -595,10 +595,10 @@ function column_foreign_keys(string $table): array {
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Compute fields() from $_POST edit data
|
||||
/** Compute fields() from $_POST edit data; used by Mongo and SimpleDB
|
||||
* @return Field[] same as fields()
|
||||
*/
|
||||
function fields_from_edit(): array { // used by Mongo and SimpleDB
|
||||
function fields_from_edit(): array {
|
||||
$return = array();
|
||||
foreach ((array) $_POST["field_keys"] as $key => $val) {
|
||||
if ($val != "") {
|
||||
|
||||
@@ -71,11 +71,20 @@ if (extension_loaded('pdo')) {
|
||||
public $_offset = 0, $num_rows;
|
||||
|
||||
function fetch_assoc() {
|
||||
return $this->fetch(\PDO::FETCH_ASSOC);
|
||||
return $this->fetch_array(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
function fetch_row() {
|
||||
return $this->fetch(\PDO::FETCH_NUM);
|
||||
return $this->fetch_array(\PDO::FETCH_NUM);
|
||||
}
|
||||
|
||||
private function fetch_array(int $mode) {
|
||||
$return = $this->fetch($mode);
|
||||
return ($return ? array_map(array($this, 'unresource'), $return) : $return);
|
||||
}
|
||||
|
||||
private function unresource($val) {
|
||||
return (is_resource($val) ? stream_get_contents($val) : $val);
|
||||
}
|
||||
|
||||
function fetch_field(): \stdClass {
|
||||
|
||||
@@ -19,7 +19,7 @@ abstract class Plugin {
|
||||
return "";
|
||||
}
|
||||
|
||||
/** Translate a string from static::$translations; use Adminer\lang() for strings used by Adminer
|
||||
/** Translate a string from $this->translations; Adminer\lang() doesn't work for single language versions
|
||||
* @param literal-string $idf
|
||||
* @param float|string $number
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
const VERSION = "5.2.0";
|
||||
const VERSION = "5.2.1";
|
||||
|
||||
@@ -54,7 +54,7 @@ if ($_GET["val"] && is_ajax()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$primary = $unselected = null;
|
||||
$primary = $unselected = array();
|
||||
foreach ($indexes as $index) {
|
||||
if ($index["type"] == "PRIMARY") {
|
||||
$primary = array_flip($index["columns"]);
|
||||
@@ -584,7 +584,7 @@ if (!$columns && support("table")) {
|
||||
}
|
||||
|
||||
if (adminer()->selectImportPrint()) {
|
||||
echo "<div>";
|
||||
echo "<p>";
|
||||
echo "<a href='#import'>" . lang('Import') . "</a>";
|
||||
echo script("qsl('a').onclick = partial(toggle, 'import');", "");
|
||||
echo "<span id='import'" . ($_POST["import"] ? "" : " class='hidden'") . ">: ";
|
||||
@@ -592,7 +592,6 @@ if (!$columns && support("table")) {
|
||||
echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;", "tsv" => "TSV"), $adminer_import["format"]);
|
||||
echo " <input type='submit' name='import' value='" . lang('Import') . "'>";
|
||||
echo "</span>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo input_token();
|
||||
|
||||
@@ -20,6 +20,7 @@ if (!$error && $_POST["clear"]) {
|
||||
stop_session();
|
||||
|
||||
page_header((isset($_GET["import"]) ? lang('Import') : lang('SQL command')), $error);
|
||||
$line_comment = '--' . (JUSH == 'sql' ? ' ' : '');
|
||||
|
||||
if (!$error && $_POST) {
|
||||
$fp = false;
|
||||
@@ -51,7 +52,7 @@ if (!$error && $_POST) {
|
||||
}
|
||||
}
|
||||
|
||||
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";
|
||||
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|$line_comment)[^\n]*\n?|--\r?\n)";
|
||||
$delimiter = ";";
|
||||
$offset = 0;
|
||||
$empty = true;
|
||||
@@ -64,7 +65,7 @@ if (!$error && $_POST) {
|
||||
}
|
||||
$commands = 0;
|
||||
$errors = array();
|
||||
$parse = '[\'"' . (JUSH == "sql" ? '`#' : (JUSH == "sqlite" ? '`[' : (JUSH == "mssql" ? '[' : ''))) . ']|/\*|--' . (JUSH == 'sql' ? ' ' : '') . '|$' . (JUSH == "pgsql" ? '|\$[^$]*\$' : '');
|
||||
$parse = '[\'"' . (JUSH == "sql" ? '`#' : (JUSH == "sqlite" ? '`[' : (JUSH == "mssql" ? '[' : ''))) . ']|/\*|' . $line_comment . '|$' . (JUSH == "pgsql" ? '|\$[^$]*\$' : '');
|
||||
$total_start = microtime(true);
|
||||
$adminer_export = get_settings("adminer_import"); // this doesn't offer SQL export so we match the import/export style at select
|
||||
$dump_format = adminer()->dumpFormat();
|
||||
@@ -94,7 +95,7 @@ if (!$error && $_POST) {
|
||||
$pattern =
|
||||
($found == '/*' ? '\*/' :
|
||||
($found == '[' ? ']' :
|
||||
(preg_match('~^-- |^#~', $found) ? "\n" :
|
||||
(preg_match("~^$line_comment|^#~", $found) ? "\n" :
|
||||
preg_quote($found) . ($c_style_escapes ? '|\\\\.' : ''))))
|
||||
;
|
||||
|
||||
@@ -275,7 +276,7 @@ if (!isset($_GET["import"]) && $history) {
|
||||
list($q, $time, $elapsed) = $val;
|
||||
echo '<a href="' . h(ME . "sql=&history=$key") . '">' . lang('Edit') . "</a>"
|
||||
. " <span class='time' title='" . @date('Y-m-d', $time) . "'>" . @date("H:i:s", $time) . "</span>" // @ - time zone may be not set
|
||||
. " <code class='jush-" . JUSH . "'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $q)))), 80, "</code>")
|
||||
. " <code class='jush-" . JUSH . "'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace("~^(#|$line_comment).*~m", '', $q)))), 80, "</code>")
|
||||
. ($elapsed ? " <span class='time'>($elapsed)</span>" : "")
|
||||
. "<br>\n"
|
||||
;
|
||||
|
||||
14
compile.php
14
compile.php
@@ -199,10 +199,10 @@ function minify_css($file) {
|
||||
}
|
||||
|
||||
function minify_js($file) {
|
||||
$file = preg_replace_callback("~'use strict';~", function ($match) { // keep only the first one
|
||||
$file = preg_replace_callback("~'use strict';~", function ($match) {
|
||||
static $count = 0;
|
||||
$count++;
|
||||
return ($count == 1 ? $match[0] : '');
|
||||
return ($count == 1 ? $match[0] : ''); // keep only the first one
|
||||
}, $file);
|
||||
if (function_exists('jsShrink')) {
|
||||
$file = jsShrink($file);
|
||||
@@ -210,7 +210,8 @@ function minify_js($file) {
|
||||
return lzw_compress($file);
|
||||
}
|
||||
|
||||
function compile_file($match, $callback = '') { // $callback only to match signature
|
||||
// $callback only to match signature
|
||||
function compile_file($match, $callback = '') {
|
||||
global $project;
|
||||
$file = "";
|
||||
list(, $filenames, $callback) = $match;
|
||||
@@ -303,7 +304,12 @@ if ($vendor) {
|
||||
}
|
||||
}
|
||||
if ($project != "editor" && count(Adminer\SqlDriver::$drivers) == 1) {
|
||||
$file = str_replace('html_select("auth[driver]", SqlDriver::$drivers, DRIVER, "loginDriver(this);")', 'input_hidden("auth[driver]", "' . ($vendor == "mysql" ? "server" : $vendor) . '") . "' . reset(Adminer\SqlDriver::$drivers) . '"', $file, $count);
|
||||
$file = str_replace(
|
||||
'html_select("auth[driver]", SqlDriver::$drivers, DRIVER, "loginDriver(this);")',
|
||||
'input_hidden("auth[driver]", "' . ($vendor == "mysql" ? "server" : $vendor) . '") . "' . reset(Adminer\SqlDriver::$drivers) . '"',
|
||||
$file,
|
||||
$count
|
||||
);
|
||||
if (!$count) {
|
||||
echo "auth[driver] form field not found\n";
|
||||
}
|
||||
|
||||
2
externals/PhpShrink
vendored
2
externals/PhpShrink
vendored
Submodule externals/PhpShrink updated: bc2ad3a1d2...10781d1fbf
2
externals/jush
vendored
2
externals/jush
vendored
Submodule externals/jush updated: 9fdd75b3cd...5fa4d1f97e
6
lang.php
6
lang.php
@@ -47,7 +47,8 @@ foreach (glob(__DIR__ . "/adminer/lang/" . ($_SESSION["lang"] ?: "*") . ".inc.ph
|
||||
function update_translations($lang, $messages, $filename, $pattern, $tabs = "\t") {
|
||||
$file = file_get_contents($filename);
|
||||
$file = str_replace("\r", "", $file);
|
||||
$s = preg_replace_callback($pattern, function ($match) use ($lang, $messages, $filename, $file, $tabs) {
|
||||
$start = 0;
|
||||
$s = preg_replace_callback($pattern, function ($match) use ($lang, $messages, $filename, $file, $tabs, &$start) {
|
||||
$prefix = $match[1][0];
|
||||
$start = $match[2][1];
|
||||
preg_match_all("~^(\\s*(?:// [^'].*\\s+)?)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => (.*[^,\n])),?~m", $match[2][0], $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
|
||||
@@ -75,6 +76,7 @@ function update_translations($lang, $messages, $filename, $pattern, $tabs = "\t"
|
||||
}
|
||||
}
|
||||
if ($messages) {
|
||||
$start += strlen($s);
|
||||
foreach ($messages as $idf => $val) {
|
||||
// add new messages
|
||||
if ($val == "," && strpos($idf, "%d")) {
|
||||
@@ -89,6 +91,6 @@ function update_translations($lang, $messages, $filename, $pattern, $tabs = "\t"
|
||||
if ($s != $file) {
|
||||
$s = str_replace("array(\n\t\t\t'' => null,\n\t\t),", "array('' => null),", $s);
|
||||
file_put_contents($filename, $s);
|
||||
echo "$filename updated.\n";
|
||||
echo "$filename:" . (substr_count($s, "\n", 0, $start) + 1) . ":Updated.\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,9 @@
|
||||
|
||||
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
|
||||
<exclude-pattern>adminer/drivers/</exclude-pattern>
|
||||
<exclude-pattern>adminer/include/db.inc.php</exclude-pattern>
|
||||
<exclude-pattern>adminer/include/pdo.inc.php</exclude-pattern>
|
||||
<exclude-pattern>adminer/plugins/foreign-system.php</exclude-pattern>
|
||||
<exclude-pattern>adminer/plugins/drivers/</exclude-pattern>
|
||||
</rule>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class AdminerLoginOtp extends Adminer\Plugin {
|
||||
function loginFormField($name, $heading, $value) {
|
||||
if ($name == 'password') {
|
||||
return $heading . $value . "\n"
|
||||
. "<tr><th><acronym title='One Time Password' lang='en'>OTP</acronym>"
|
||||
. "<tr><th><abbr title='" . $this->lang('One Time Password') . "'>OTP</abbr>"
|
||||
. "<td><input type='number' name='auth[otp]' value='" . Adminer\h($_SESSION["otp"]) . "' size='6' autocomplete='one-time-code' inputmode='numeric' maxlength='6' pattern='\d{6}'>\n"
|
||||
;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class AdminerLoginOtp extends Adminer\Plugin {
|
||||
return;
|
||||
}
|
||||
}
|
||||
return 'Invalid OTP.';
|
||||
return $this->lang('Invalid OTP.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,10 +56,24 @@ class AdminerLoginOtp extends Adminer\Plugin {
|
||||
}
|
||||
|
||||
protected $translations = array(
|
||||
'cs' => array('' => 'Při přihlášení požaduje jednorázové heslo'),
|
||||
'de' => array('' => 'Bei der Anmeldung ist ein Einmalpasswort (Zwei-Faktor-Authentifizierung) erforderlich'),
|
||||
'pl' => array('' => 'Wymagaj jednorazowego hasła przy logowaniu'),
|
||||
'ro' => array('' => 'Cereți o parolă unică la autentificare'),
|
||||
'ja' => array('' => 'ログイン時にワンタイムパスワード (二要素認証) が必要'),
|
||||
'cs' => array(
|
||||
'' => 'Při přihlášení požaduje jednorázové heslo',
|
||||
'One Time Password' => 'Jednorázové heslo',
|
||||
'Invalid OTP.' => 'Neplatné jednorázové heslo.',
|
||||
),
|
||||
'de' => array(
|
||||
'' => 'Bei der Anmeldung ist ein Einmalpasswort (Zwei-Faktor-Authentifizierung) erforderlich',
|
||||
'One Time Password' => 'Einmal-Passwort',
|
||||
'Invalid OTP.' => 'Ungültiger OTP.',
|
||||
),
|
||||
'pl' => array(
|
||||
'' => 'Wymagaj jednorazowego hasła przy logowaniu',
|
||||
),
|
||||
'ro' => array(
|
||||
'' => 'Cereți o parolă unică la autentificare',
|
||||
),
|
||||
'ja' => array(
|
||||
'' => 'ログイン時にワンタイムパスワード (二要素認証) が必要',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ class AdminerMenuLinks extends Adminer\Plugin {
|
||||
|
||||
function config() {
|
||||
$options = array(
|
||||
'select' => Adminer\lang('Select data'),
|
||||
'table' => Adminer\lang('Show structure'),
|
||||
'select' => $this->lang('Select data'),
|
||||
'table' => $this->lang('Show structure'),
|
||||
'' => $this->lang('Both'),
|
||||
'auto' => $this->lang('Auto (select on select page, structure otherwise)'),
|
||||
);
|
||||
@@ -28,19 +28,20 @@ class AdminerMenuLinks extends Adminer\Plugin {
|
||||
function tablesPrint(array $tables) {
|
||||
$menu = Adminer\get_setting("menu", "adminer_config") ?: $this->menu;
|
||||
$titles = array(
|
||||
'select' => Adminer\lang('Select data'),
|
||||
'table' => Adminer\lang('Show structure'),
|
||||
'select' => $this->lang('Select data'),
|
||||
'table' => $this->lang('Show structure'),
|
||||
);
|
||||
// this is copied from Adminer::tablesPrint()
|
||||
echo "<ul id='tables'>" . Adminer\script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
foreach ($tables as $table => $status) {
|
||||
$table = "$table"; // do not highlight "0" as active everywhere
|
||||
$name = Adminer\adminer()->tableName($status);
|
||||
if ($name != "") {
|
||||
echo '<li>';
|
||||
if (!$menu) {
|
||||
echo '<a href="' . Adminer\h(Adminer\ME) . 'select=' . urlencode($table) . '"'
|
||||
. Adminer\bold($_GET["select"] == $table || $_GET["edit"] == $table, "select")
|
||||
. " title='$titles[select]'>" . Adminer\lang('select') . "</a> "
|
||||
. " title='$titles[select]'>" . $this->lang('select') . "</a> "
|
||||
;
|
||||
}
|
||||
$actives = array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"], $_GET["check"], $_GET["view"]);
|
||||
@@ -77,23 +78,39 @@ class AdminerMenuLinks extends Adminer\Plugin {
|
||||
'Menu table links' => 'Odkazy na tabulky v menu',
|
||||
'Both' => 'Oboje',
|
||||
'Auto (select on select page, structure otherwise)' => 'Auto (vypsat na výpisech, jinak struktura)',
|
||||
// this is copied from adminer/lang/
|
||||
'select' => 'vypsat',
|
||||
'Select data' => 'Vypsat data',
|
||||
'Show structure' => 'Zobrazit strukturu',
|
||||
),
|
||||
'pl' => array(
|
||||
'Menu table links' => 'Linki do tabel w menu',
|
||||
'Both' => 'Obie',
|
||||
'Auto (select on select page, structure otherwise)' => 'Auto (pokaż na stronie przeglądania, w przeciwnym razie struktura)',
|
||||
// this is copied from adminer/lang/
|
||||
'select' => 'przeglądaj',
|
||||
'Select data' => 'Pokaż dane',
|
||||
'Show structure' => 'Struktura tabeli',
|
||||
),
|
||||
'de' => array(
|
||||
'' => 'Menü- und Tabellen-Links konfigurieren. Kombinierbar mit AdminerConfig',
|
||||
'Both' => 'Beide',
|
||||
'Auto (select on select page, structure otherwise)' => 'Auto (Auswahl auf der ausgewählten Seite, sonst Struktur)',
|
||||
'Menu table links' => 'Links verwenden in „Tabelle“',
|
||||
// this is copied from adminer/lang/
|
||||
'select' => 'zeigen',
|
||||
'Select data' => 'Daten auswählen',
|
||||
'Show structure' => 'Struktur anzeigen',
|
||||
),
|
||||
'ja' => array(
|
||||
'' => 'メニュー内テーブルへのリンク設定; AdminerConfig との併用可',
|
||||
'Both' => '両方',
|
||||
'Auto (select on select page, structure otherwise)' => '自動 (選択ページでは選択、それ以外では構造)',
|
||||
'Menu table links' => 'メニューテーブルへのリンク',
|
||||
// this is copied from adminer/lang/
|
||||
'select' => '選択',
|
||||
'Select data' => 'データ',
|
||||
'Show structure' => '構造',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
foreach (array(
|
||||
'create' => array(1106, 412),
|
||||
'dark' => array(816, 750),
|
||||
'database' => array(896, 666),
|
||||
'db' => array(1258, 752),
|
||||
'dump' => array(784, 450),
|
||||
'edit' => array(1006, 336),
|
||||
'login' => array(628, 326),
|
||||
'select' => array(924, 810),
|
||||
'schema' => array(690, 406),
|
||||
'sql' => array(870, 788),
|
||||
'table' => array(816, 750),
|
||||
) as $filename => list($w, $h)) {
|
||||
foreach (
|
||||
array(
|
||||
'create' => array(1106, 412),
|
||||
'dark' => array(816, 750),
|
||||
'database' => array(896, 666),
|
||||
'db' => array(1258, 752),
|
||||
'dump' => array(784, 450),
|
||||
'edit' => array(1006, 336),
|
||||
'login' => array(628, 326),
|
||||
'select' => array(924, 810),
|
||||
'schema' => array(690, 406),
|
||||
'sql' => array(870, 788),
|
||||
'table' => array(816, 750),
|
||||
) as $filename => list($w, $h)
|
||||
) {
|
||||
$im = imagecreatefrompng("screenshots/$filename.png");
|
||||
$im2 = imagecreatetruecolor($w, $h);
|
||||
imagecopy($im2, $im, 0, 0, 0, 0, $w, $h);
|
||||
|
||||
Reference in New Issue
Block a user