mirror of
https://github.com/vrana/adminer.git
synced 2025-08-30 01:30:12 +02:00
Compare commits
60 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
81e337bed1 | ||
|
18ddbf1d60 | ||
|
e4235d21e5 | ||
|
10dfc54bf4 | ||
|
af3c863be3 | ||
|
6cd5495c1b | ||
|
78ad8381ab | ||
|
87fc82f88e | ||
|
0519a0b985 | ||
|
f61cf1ba0c | ||
|
fc2e025603 | ||
|
659e72b692 | ||
|
123373ca82 | ||
|
e99f2d90cf | ||
|
bdabc5aa13 | ||
|
92f3e0ca00 | ||
|
aa1266e4f2 | ||
|
b7bbd07155 | ||
|
1ff6f246e8 | ||
|
555e2e76b7 | ||
|
7883e0bd99 | ||
|
18e26a3b68 | ||
|
25a1ccf75b | ||
|
b9cdf52ec5 | ||
|
7997331b77 | ||
|
3bb75dc036 | ||
|
441e7f050c | ||
|
c41cb51ede | ||
|
42d92875c5 | ||
|
df0e5b59bb | ||
|
de9f572112 | ||
|
dd9a4a2b65 | ||
|
91d44f4a9f | ||
|
f993acb538 | ||
|
a87b606918 | ||
|
3e81c3871f | ||
|
13752c0498 | ||
|
e378f7d817 | ||
|
6f789eac0a | ||
|
9ed4c859ed | ||
|
62246338bf | ||
|
e5a7f75807 | ||
|
279337aa65 | ||
|
bf1d16cdb7 | ||
|
1de9275f11 | ||
|
0f2e04730f | ||
|
ae629f8ac7 | ||
|
0797cb6a10 | ||
|
dd122a1056 | ||
|
96c0177422 | ||
|
7d6c7998d8 | ||
|
3df88d4a24 | ||
|
2d4b73653b | ||
|
a63fadd503 | ||
|
a494827dc5 | ||
|
8ac486a57c | ||
|
bfcc6d8297 | ||
|
29fd200ef5 | ||
|
b6058368d3 | ||
|
fd38c4261a |
1064
CHANGELOG.md
Normal file
1064
CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
7
LICENSE.md
Normal file
7
LICENSE.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Licenses
|
||||
|
||||
You may use Adminer under the terms of either the Apache License Version 2.0
|
||||
or the GNU General Public License (GPL) version 2.
|
||||
|
||||
- [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
||||
- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html)
|
153
README.md
Normal file
153
README.md
Normal file
@@ -0,0 +1,153 @@
|
||||
# Adminer
|
||||
|
||||
**Adminer** is a full-featured database management tool written in PHP. It consists of a single file ready to deploy to
|
||||
the target server. As a companion, **Adminer Editor** offers data manipulation for end-users.
|
||||
|
||||
Supported database drivers:
|
||||
- MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, MongoDB
|
||||
- With plugin: SimpleDB, Elasticsearch (beta), Firebird (alpha), ClickHouse (alpha)
|
||||
|
||||
## Requirements
|
||||
|
||||
- PHP 5.6+ with enabled sessions.
|
||||
|
||||
## Migration from original Adminer
|
||||
|
||||
No action is needed for now. But please, read 👉 **[What to expect](#what-to-expect)** section before you decide to
|
||||
switch to this project.
|
||||
|
||||
## Usage
|
||||
|
||||
Download one for the latest [release files](https://github.com/pematon/adminer/releases), upload to the HTTP server
|
||||
with PHP and enjoy 😉 If you are not satisfied with any combination of the database driver and language, you can
|
||||
download the source code and compile your own Adminer:
|
||||
|
||||
- Download the source code.
|
||||
- Run `composer install` to install dependencies.
|
||||
- Run compile.php:
|
||||
|
||||
```shell
|
||||
# Adminer
|
||||
php compile.php <driver> <language>
|
||||
|
||||
# Editor
|
||||
php compile.php editor <driver> <language>
|
||||
```
|
||||
|
||||
For example:
|
||||
```shell
|
||||
php compile.php pgsql cs
|
||||
```
|
||||
|
||||
[Available drivers](https://github.com/pematon/adminer/tree/master/adminer/drivers),
|
||||
[languages](https://github.com/pematon/adminer/tree/master/adminer/lang).
|
||||
|
||||
## Security
|
||||
|
||||
Adminer does not allow connecting to databases without a password and it rate-limits the connection attempts to protect
|
||||
against brute-force attacks. Still, it is highly recommended to 🔒 **restrict access to Adminer** 🔒 by whitelisting IP
|
||||
addresses allowed to connect to it, by password-protecting the access in your web server or by enabling security plugins
|
||||
(e.g. to require an OTP).
|
||||
|
||||
## Plugins
|
||||
|
||||
* Download plugins you want and place them into the `plugins` folder.
|
||||
* Create `index.php` file specifying which plugins do you want to use.
|
||||
|
||||
File structure will be:
|
||||
|
||||
```
|
||||
- plugins
|
||||
- drivers
|
||||
- elastic.php
|
||||
- dump-xml.php
|
||||
- tinymce.php
|
||||
- file-upload.php
|
||||
- ...
|
||||
- adminer.php
|
||||
- index.php
|
||||
```
|
||||
|
||||
Index.php:
|
||||
```php
|
||||
<?php
|
||||
function adminer_object() {
|
||||
// Required to run any plugin.
|
||||
include_once "./plugins/plugin.php";
|
||||
|
||||
// Autoloader.
|
||||
foreach (glob("plugins/*.php") as $filename) {
|
||||
include_once "./$filename";
|
||||
}
|
||||
|
||||
// Enable extra drivers just by including them.
|
||||
include_once "./plugins/drivers/elastic.php";
|
||||
|
||||
// Specify enabled plugins.
|
||||
$plugins = [
|
||||
new AdminerDumpXml(),
|
||||
new AdminerTinymce(),
|
||||
new AdminerFileUpload("data/"),
|
||||
// ...
|
||||
];
|
||||
|
||||
// It is possible to combine customization and plugins.
|
||||
// class AdminerCustomization extends AdminerPlugin {
|
||||
// }
|
||||
// return new AdminerCustomization($plugins);
|
||||
|
||||
return new AdminerPlugin($plugins);
|
||||
}
|
||||
|
||||
// Include original Adminer or Adminer Editor.
|
||||
include "./adminer.php";
|
||||
```
|
||||
|
||||
[Available plugins](https://github.com/pematon/adminer/tree/master/plugins).
|
||||
|
||||
## Main project files
|
||||
- adminer/index.php - Run development version of Adminer.
|
||||
- editor/index.php - Run development version of Adminer Editor.
|
||||
- editor/example.php - Example customization.
|
||||
- plugins/readme.txt - Plugins for Adminer and Adminer Editor.
|
||||
- adminer/plugin.php - Plugin demo.
|
||||
- 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.
|
||||
- compile.php - Create a single file version.
|
||||
- lang.php - Update translations.
|
||||
- tests/katalon.html - Katalon Automation Recorder test suite.
|
||||
|
||||
## Project history
|
||||
|
||||
Adminer was originally developed by Jakub Vrana, and it can be still found on [official pages](https://www.adminer.org/).
|
||||
Unfortunately, it is not maintained for several years. In the meantime, I (@peterpp) created for my company a set of
|
||||
custom plugins, modern theme, fixed some bugs and practically rewrote the Elasticsearch driver. I also looked closely
|
||||
and contributed to the [AdminerEvo](https://www.adminerevo.org/) project that looked promising. However, I finally
|
||||
decided to continue working on this fork and fulfill my own vision.
|
||||
|
||||
## What to expect
|
||||
|
||||
Our top priority is fixing the security issues and reported bugs. But we really want to move forward and transform
|
||||
Adminer to a tool that will keep its simplicity, yet looks much better, is even easier to use and can be configured
|
||||
without requirement of additional plugins.
|
||||
|
||||
### Version 4.x
|
||||
Original design and backward compatibility is kept. Many issues were fixed, and we introduced several functional and
|
||||
UI improvements.
|
||||
|
||||
### Version 5
|
||||
Bridges will be burned 🔥🔥🔥. It's in development already, so you [can check](https://github.com/pematon/adminer/tree/version-5)
|
||||
what's going on. Or you can become the early adopter and help us with testing 😉
|
||||
|
||||
Our goals are:
|
||||
|
||||
- **Requirements** - Bump minimal PHP to 7.1, maybe even higher.
|
||||
- **Themes** – Modernize the current old-school theme, add new default theme based on our [Adminer theme](https://github.com/pematon/adminer-theme),
|
||||
support dark mode, configurable color variants for production/devel environment. All current designs will be removed.
|
||||
- **Plugins** - Integrate several basic plugins, enable them by optional configuration.
|
||||
- **Codebase** - Prefer code readability before minimalism, use PER coding style, add namespaces.
|
||||
- **Compilation** - Allow to export selected drivers, themes, languages and plugins into a single adminer.php file.
|
||||
|
||||
We are also thinking to change the project's name, so people will clearly distinguish between original Adminer and
|
||||
other forks. Any suggestions are welcome.
|
14
SECURITY.md
14
SECURITY.md
@@ -1,11 +1,11 @@
|
||||
# Security Policy
|
||||
# Reporting security issues
|
||||
|
||||
## Supported Versions
|
||||
To report a security issue, please [open a draft security advisory](https://github.com/pematon/adminer/security/advisories).
|
||||
|
||||
I support only the last published version and the last development version (last commit).
|
||||
Security issues are handled with top priority. Once acknowledged, a fix should be available and new version released
|
||||
as soon as possible. Security advisories will be made public after a fix and new version have been released,
|
||||
or the advisory has been declined.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
## Supported versions
|
||||
|
||||
To report a vulnerability, create a private bug at https://sourceforge.net/p/adminer/bugs-and-features/new/?private=1.
|
||||
|
||||
I handle security issues with top priority. If you don't hear from me in a week then please ping the bug. Once I accept the bug, the fix should be available and new version released within days. I will mark the bug as public after releasing a new version or declining the bug.
|
||||
Only the last published version and the last development version (last commit) are supported.
|
||||
|
@@ -182,8 +182,8 @@ foreach ($engines as $engine) {
|
||||
<p>
|
||||
<?php if (support("columns") || $TABLE == "") { ?>
|
||||
<?php echo lang('Table name'); ?>: <input name="name" data-maxlength="64" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
|
||||
<?php if ($TABLE == "" && !$_POST) { echo script("focus(qs('#form')['name']);"); } ?>
|
||||
<?php echo ($engines ? "<select name='Engine'>" . optionlist(array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . "</select>" . on_help("getTarget(event).value", 1) . script("qsl('select').onchange = helpClose;") : ""); ?>
|
||||
<?php if ($TABLE == "" && !$_POST) { echo script("focus(gid('form')['name']);"); } ?>
|
||||
<?php echo ($engines ? "<select name='Engine'>" . optionlist(array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . "</select>" . help_script_command("value", true) : ""); ?>
|
||||
<?php echo ($collations && !preg_match("~sqlite|mssql~", $jush) ? html_select("Collation", array("" => "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<?php } ?>
|
||||
@@ -199,7 +199,6 @@ edit_fields($row["fields"], $collations, "TABLE", $foreign_keys);
|
||||
</div>
|
||||
<p>
|
||||
<?php echo lang('Auto Increment'); ?>: <input type="number" name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
|
||||
<?php echo checkbox("defaults", 1, ($_POST ? $_POST["defaults"] : adminer_setting("defaults")), lang('Default values'), "columnShow(this.checked, 5)", "jsonly"); ?>
|
||||
<?php
|
||||
$comments = ($_POST ? $_POST["comments"] : adminer_setting("comments"));
|
||||
echo (support("comment")
|
||||
@@ -222,7 +221,7 @@ if (support("partitioning")) {
|
||||
print_fieldset("partition", lang('Partition by'), $row["partition_by"]);
|
||||
?>
|
||||
<p>
|
||||
<?php echo "<select name='partition_by'>" . optionlist(array("" => "") + $partition_by, $row["partition_by"]) . "</select>" . on_help("getTarget(event).value.replace(/./, 'PARTITION BY \$&')", 1) . script("qsl('select').onchange = partitionByChange;"); ?>
|
||||
<?php echo "<select name='partition_by'>" . optionlist(array("" => "") + $partition_by, $row["partition_by"]) . "</select>" . help_script_command("value.replace(/./, 'PARTITION BY \$&')", true) . script("qsl('select').onchange = partitionByChange;"); ?>
|
||||
(<input name="partition" value="<?php echo h($row["partition"]); ?>">)
|
||||
<?php echo lang('Partitions'); ?>: <input type="number" name="partitions" class="size<?php echo ($partition_table || !$row["partition_by"] ? " hidden" : ""); ?>" value="<?php echo h($row["partitions"]); ?>">
|
||||
<table cellspacing="0" id="partition-table"<?php echo ($partition_table ? "" : " class='hidden'"); ?>>
|
||||
|
@@ -66,7 +66,7 @@ echo ($_POST["add_x"] || strpos($name, "\n")
|
||||
'mariadb' => "supported-character-sets-and-collations/",
|
||||
'mssql' => "ms187963.aspx",
|
||||
)) : "");
|
||||
echo script("focus(qs('#name'));");
|
||||
echo script("focus(gid('name'));");
|
||||
?>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<?php
|
||||
|
@@ -47,7 +47,28 @@ if ($tables_views && !$error && !$_POST["search"]) {
|
||||
page_header(($_GET["ns"] == "" ? lang('Database') . ": " . h(DB) : lang('Schema') . ": " . h($_GET["ns"])), $error, true);
|
||||
|
||||
if ($adminer->homepage()) {
|
||||
if ($_GET["ns"] !== "") {
|
||||
if ($_GET["ns"] === "") {
|
||||
echo "<h3 id='schemas'>" . lang('Schemas') . "</h3>\n";
|
||||
$schemas = schemas();
|
||||
if (!$schemas) {
|
||||
echo "<p class='message'>" . lang('No schemas.') . "\n";
|
||||
} else {
|
||||
// TODO: Checkboxes for batch dropping of schemas.
|
||||
echo "<div class='scrollable'>\n",
|
||||
"<table class='nowrap'>\n",
|
||||
'<thead><tr class="wrap">',
|
||||
'<th>', lang('Schema'), "</th>",
|
||||
'</tr></thead>';
|
||||
|
||||
foreach ($schemas as $name) {
|
||||
echo "<tr", odd(), ">",
|
||||
"<th><a href='", h(ME), "ns=" . urlencode($name), "' title='", lang('Show schema'), "'>" . h($name) . "</a></th>",
|
||||
"</tr>";
|
||||
}
|
||||
|
||||
echo '</table></div>';
|
||||
}
|
||||
} else {
|
||||
echo "<h3 id='tables-views'>" . lang('Tables and views') . "</h3>\n";
|
||||
$tables_list = tables_list();
|
||||
if (!$tables_list) {
|
||||
@@ -59,9 +80,13 @@ if ($adminer->homepage()) {
|
||||
echo "<input type='search' name='query' value='" . h($_POST["query"]) . "'>";
|
||||
echo script("qsl('input').onkeydown = partialArg(bodyKeydown, 'search');", "");
|
||||
echo " <input type='submit' name='search' value='" . lang('Search') . "'>\n";
|
||||
if ($adminer->operator_regexp !== null) {
|
||||
echo "<p><label><input type='checkbox' name='regexp' value='1'" . (empty($_POST['regexp']) ? '' : ' checked') . '>' . lang('as a regular expression') . '</label>';
|
||||
echo doc_link(['sql' => 'regexp.html', 'pgsql' => 'functions-matching.html#FUNCTIONS-POSIX-REGEXP', 'elastic' => "regexp-syntax.html"]) . "</p>\n";
|
||||
}
|
||||
echo "</div></fieldset>\n";
|
||||
if ($_POST["search"] && $_POST["query"] != "") {
|
||||
$_GET["where"][0]["op"] = $driver->convertOperator("LIKE %%");
|
||||
$_GET["where"][0]["op"] = $adminer->operator_regexp !== null && !empty($_POST['regexp']) ? $adminer->operator_regexp : $adminer->operator_like;
|
||||
search_tables();
|
||||
}
|
||||
}
|
||||
@@ -69,7 +94,7 @@ if ($adminer->homepage()) {
|
||||
echo "<table cellspacing='0' class='nowrap checkable'>\n";
|
||||
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
|
||||
echo '<thead><tr class="wrap">';
|
||||
echo '<td><input id="check-all" type="checkbox" class="jsonly">' . script("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/);", "");
|
||||
echo '<td><input id="check-all" type="checkbox" class="jsonly">' . script("gid('check-all').onclick = partial(formCheck, /^(tables|views)\[/);", "");
|
||||
echo '<th>' . lang('Table');
|
||||
echo '<td>' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html'));
|
||||
echo '<td>' . lang('Collation') . doc_link(array('sql' => 'charset-charsets.html', 'mariadb' => 'supported-character-sets-and-collations/'));
|
||||
@@ -122,17 +147,17 @@ if ($adminer->homepage()) {
|
||||
echo "</div>\n";
|
||||
if (!information_schema(DB)) {
|
||||
echo "<div class='footer'><div>\n";
|
||||
$vacuum = "<input type='submit' value='" . lang('Vacuum') . "'> " . on_help("'VACUUM'");
|
||||
$optimize = "<input type='submit' name='optimize' value='" . lang('Optimize') . "'> " . on_help($jush == "sql" ? "'OPTIMIZE TABLE'" : "'VACUUM OPTIMIZE'");
|
||||
$vacuum = "<input type='submit' value='" . lang('Vacuum') . "'> " . help_script("VACUUM");
|
||||
$optimize = "<input type='submit' name='optimize' value='" . lang('Optimize') . "'> " . help_script($jush == "sql" ? "OPTIMIZE TABLE" : "VACUUM OPTIMIZE");
|
||||
echo "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>"
|
||||
. ($jush == "sqlite" ? $vacuum
|
||||
: ($jush == "pgsql" ? $vacuum . $optimize
|
||||
: ($jush == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> " . on_help("'ANALYZE TABLE'") . $optimize
|
||||
. "<input type='submit' name='check' value='" . lang('Check') . "'> " . on_help("'CHECK TABLE'")
|
||||
. "<input type='submit' name='repair' value='" . lang('Repair') . "'> " . on_help("'REPAIR TABLE'")
|
||||
: ($jush == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> " . help_script("ANALYZE TABLE") . $optimize
|
||||
. "<input type='submit' name='check' value='" . lang('Check') . "'> " . help_script("CHECK TABLE")
|
||||
. "<input type='submit' name='repair' value='" . lang('Repair') . "'> " . help_script("REPAIR TABLE")
|
||||
: "")))
|
||||
. "<input type='submit' name='truncate' value='" . lang('Truncate') . "'> " . on_help($jush == "sqlite" ? "'DELETE'" : "'TRUNCATE" . ($jush == "pgsql" ? "'" : " TABLE'")) . confirm()
|
||||
. "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . on_help("'DROP TABLE'") . confirm() . "\n";
|
||||
. "<input type='submit' name='truncate' value='" . lang('Truncate') . "'> " . help_script($jush == "sqlite" ? "DELETE" : ("TRUNCATE" . ($jush == "pgsql" ? "" : " TABLE"))) . confirm()
|
||||
. "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . help_script("DROP TABLE") . confirm() . "\n";
|
||||
$databases = (support("scheme") ? $adminer->schemas() : $adminer->databases());
|
||||
if (count($databases) != 1 && $jush != "sqlite") {
|
||||
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
|
||||
@@ -159,7 +184,7 @@ if ($adminer->homepage()) {
|
||||
echo "<h3 id='routines'>" . lang('Routines') . "</h3>\n";
|
||||
$routines = routines();
|
||||
if ($routines) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<table>\n";
|
||||
echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td></thead>\n";
|
||||
odd('');
|
||||
foreach ($routines as $row) {
|
||||
@@ -182,12 +207,16 @@ if ($adminer->homepage()) {
|
||||
echo "<h3 id='sequences'>" . lang('Sequences') . "</h3>\n";
|
||||
$sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema() ORDER BY sequence_name");
|
||||
if ($sequences) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
|
||||
echo "<table>\n",
|
||||
"<thead><tr><th>", lang('Name'), "</th><td></td></tr></thead>\n";
|
||||
|
||||
odd('');
|
||||
foreach ($sequences as $val) {
|
||||
echo "<tr" . odd() . "><th><a href='" . h(ME) . "sequence=" . urlencode($val) . "'>" . h($val) . "</a>\n";
|
||||
echo "<tr", odd(), ">",
|
||||
"<th>", h($val), "</th>",
|
||||
"<td><a href='", h(ME), "sequence=", urlencode($val), "'>", lang('Alter'), "</a></td>\n";
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
}
|
||||
echo "<p class='links'><a href='" . h(ME) . "sequence='>" . lang('Create sequence') . "</a>\n";
|
||||
@@ -197,12 +226,16 @@ if ($adminer->homepage()) {
|
||||
echo "<h3 id='user-types'>" . lang('User types') . "</h3>\n";
|
||||
$user_types = types();
|
||||
if ($user_types) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
|
||||
echo "<table>\n",
|
||||
"<thead><tr><th>", lang('Name'), "</th><td></td></tr></thead>\n";
|
||||
|
||||
odd('');
|
||||
foreach ($user_types as $val) {
|
||||
echo "<tr" . odd() . "><th><a href='" . h(ME) . "type=" . urlencode($val) . "'>" . h($val) . "</a>\n";
|
||||
echo "<tr", odd(), ">",
|
||||
"<th>", h($val), "</th>",
|
||||
"<td><a href='", h(ME), "type=", urlencode($val), "'>", lang('Alter'), "</a></td>\n";
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
}
|
||||
echo "<p class='links'><a href='" . h(ME) . "type='>" . lang('Create type') . "</a>\n";
|
||||
@@ -212,7 +245,7 @@ if ($adminer->homepage()) {
|
||||
echo "<h3 id='events'>" . lang('Events') . "</h3>\n";
|
||||
$rows = get_rows("SHOW EVENTS");
|
||||
if ($rows) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<table>\n";
|
||||
echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "<td></thead>\n";
|
||||
foreach ($rows as $row) {
|
||||
echo "<tr>";
|
||||
|
@@ -24,7 +24,7 @@ if (isset($_GET["mongo"])) {
|
||||
$this->error = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function query($query) {
|
||||
return false;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ if (isset($_GET["mongo"])) {
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
public $primary = "_id";
|
||||
|
||||
|
||||
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
|
||||
$select = ($select == array("*")
|
||||
? array()
|
||||
@@ -127,7 +127,7 @@ if (isset($_GET["mongo"])) {
|
||||
->skip($page * $limit)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function insert($table, $set) {
|
||||
try {
|
||||
$return = $this->_conn->_db->selectCollection($table)->insert($set);
|
||||
@@ -206,6 +206,7 @@ if (isset($_GET["mongo"])) {
|
||||
}
|
||||
|
||||
$operators = array("=");
|
||||
$operator_regexp = null;
|
||||
|
||||
} elseif (class_exists('MongoDB\Driver\Manager')) {
|
||||
class Min_DB {
|
||||
@@ -219,7 +220,7 @@ if (isset($_GET["mongo"])) {
|
||||
$this->_link = new $class($uri, $options);
|
||||
$this->executeCommand('admin', array('ping' => 1));
|
||||
}
|
||||
|
||||
|
||||
function executeCommand($db, $command) {
|
||||
$class = 'MongoDB\Driver\Command';
|
||||
try {
|
||||
@@ -229,7 +230,7 @@ if (isset($_GET["mongo"])) {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function executeBulkWrite($namespace, $bulk, $counter) {
|
||||
try {
|
||||
$results = $this->_link->executeBulkWrite($namespace, $bulk);
|
||||
@@ -577,7 +578,8 @@ if (isset($_GET["mongo"])) {
|
||||
"(date)>=",
|
||||
"(date)<=",
|
||||
);
|
||||
|
||||
|
||||
$operator_regexp = 'regex';
|
||||
}
|
||||
|
||||
function table($idf) {
|
||||
@@ -734,11 +736,13 @@ if (isset($_GET["mongo"])) {
|
||||
}
|
||||
|
||||
function driver_config() {
|
||||
global $operators;
|
||||
global $operators, $operator_regexp;
|
||||
return array(
|
||||
'possible_drivers' => array("mongo", "mongodb"),
|
||||
'jush' => "mongo",
|
||||
'operators' => $operators,
|
||||
'operator_like' => "LIKE %%", // TODO: LIKE operator is not listed in operators.
|
||||
'operator_regexp' => $operator_regexp,
|
||||
'functions' => array(),
|
||||
'grouping' => array(),
|
||||
'edit_functions' => array(array("json")),
|
||||
|
@@ -40,7 +40,8 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
|
||||
function quote($string) {
|
||||
return "'" . str_replace("'", "''", $string) . "'";
|
||||
$unicode = strlen($string) != strlen(utf8_decode($string));
|
||||
return ($unicode ? "N" : "") . "'" . str_replace("'", "''", $string) . "'";
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
@@ -163,7 +164,8 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
|
||||
function quote($string) {
|
||||
return "'" . str_replace("'", "''", $string) . "'";
|
||||
$unicode = strlen($string) != strlen(utf8_decode($string));
|
||||
return ($unicode ? "N" : "") . "'" . str_replace("'", "''", $string) . "'";
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
@@ -432,7 +434,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
|
||||
|
||||
function error() {
|
||||
global $connection;
|
||||
return nl_br(h(preg_replace('~^(\[[^]]*])+~m', '', $connection->error)));
|
||||
return nl2br(h(preg_replace('~^(\[[^]]*])+~m', '', $connection->error)));
|
||||
}
|
||||
|
||||
function create_database($db, $collation) {
|
||||
@@ -675,6 +677,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)
|
||||
'structured_types' => $structured_types,
|
||||
'unsigned' => array(),
|
||||
'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"),
|
||||
'operator_like' => "LIKE %%",
|
||||
'functions' => array("len", "lower", "round", "upper"),
|
||||
'grouping' => array("avg", "count", "count distinct", "max", "min", "sum"),
|
||||
'edit_functions' => array(
|
||||
|
@@ -14,7 +14,7 @@ if (!defined("DRIVER")) {
|
||||
|
||||
function connect($server = "", $username = "", $password = "", $database = null, $port = null, $socket = null) {
|
||||
global $adminer;
|
||||
mysqli_report(MYSQLI_REPORT_OFF); // stays between requests, not required since PHP 5.3.4
|
||||
mysqli_report(MYSQLI_REPORT_OFF);
|
||||
list($host, $port) = explode(":", $server, 2); // part after : is used for port or socket
|
||||
|
||||
$ssl = $adminer->connectSsl();
|
||||
@@ -34,7 +34,7 @@ if (!defined("DRIVER")) {
|
||||
$database,
|
||||
(is_numeric($port) ? $port : ini_get("mysqli.default_port")),
|
||||
(!is_numeric($port) ? $port : $socket),
|
||||
($ssl ? 64 : 0) // 64 - MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT (not available before PHP 5.6.16)
|
||||
($ssl ? MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT : 0)
|
||||
);
|
||||
$this->options(MYSQLI_OPT_LOCAL_INFILE, false);
|
||||
return $return;
|
||||
@@ -262,7 +262,7 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
function set_charset($charset) {
|
||||
$this->query("SET NAMES $charset"); // charset in DSN is ignored before PHP 5.3.6
|
||||
$this->query("SET NAMES $charset");
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
@@ -375,7 +375,7 @@ if (!defined("DRIVER")) {
|
||||
$connection = new Min_DB;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
$connection->set_charset(charset($connection)); // available in MySQLi since PHP 5.0.5
|
||||
$connection->set_charset(charset($connection));
|
||||
$connection->query("SET sql_quote_show_create = 1, autocommit = 1");
|
||||
if (min_version('5.7.8', 10.2, $connection)) {
|
||||
$structured_types[lang('Strings')][] = "json";
|
||||
@@ -500,11 +500,14 @@ if (!defined("DRIVER")) {
|
||||
* @return array array($name => array("Name" => , "Engine" => , "Comment" => , "Oid" => , "Rows" => , "Collation" => , "Auto_increment" => , "Data_length" => , "Index_length" => , "Data_free" => )) or only inner array with $name
|
||||
*/
|
||||
function table_status($name = "", $fast = false) {
|
||||
$return = array();
|
||||
foreach (get_rows($fast && min_version(5)
|
||||
? "SELECT TABLE_NAME AS Name, ENGINE AS Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() " . ($name != "" ? "AND TABLE_NAME = " . q($name) : "ORDER BY Name")
|
||||
: "SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_\\")) : "")
|
||||
) as $row) {
|
||||
if ($fast && min_version(5)) {
|
||||
$query = "SELECT TABLE_NAME AS Name, ENGINE AS Engine, CREATE_OPTIONS AS Create_options, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() " . ($name != "" ? "AND TABLE_NAME = " . q($name) : "ORDER BY Name");
|
||||
} else {
|
||||
$query = "SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_\\")) : "");
|
||||
}
|
||||
|
||||
$tables = [];
|
||||
foreach (get_rows($query) as $row) {
|
||||
if ($row["Engine"] == "InnoDB") {
|
||||
// ignore internal comment, unnecessary since MySQL 5.1.21
|
||||
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\1', $row["Comment"]);
|
||||
@@ -513,11 +516,15 @@ if (!defined("DRIVER")) {
|
||||
$row["Comment"] = "";
|
||||
}
|
||||
if ($name != "") {
|
||||
// MariaDB: Table name is returned as lowercase on macOS, so we fix it here.
|
||||
$row["Name"] = $name;
|
||||
return $row;
|
||||
}
|
||||
$return[$row["Name"]] = $row;
|
||||
|
||||
$tables[$row["Name"]] = $row;
|
||||
}
|
||||
return $return;
|
||||
|
||||
return $tables;
|
||||
}
|
||||
|
||||
/** Find out whether the identifier is view
|
||||
@@ -1188,6 +1195,8 @@ if (!defined("DRIVER")) {
|
||||
'structured_types' => $structured_types,
|
||||
'unsigned' => array("unsigned", "zerofill", "unsigned zerofill"), ///< @var array number variants
|
||||
'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"), ///< @var array operators used in select
|
||||
'operator_like' => "LIKE %%",
|
||||
'operator_regexp' => 'REGEXP',
|
||||
'functions' => array("char_length", "date", "from_unixtime", "unix_timestamp", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper"), ///< @var array functions used in select
|
||||
'grouping' => array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"), ///< @var array grouping functions used in select
|
||||
'edit_functions' => array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only
|
||||
|
@@ -541,6 +541,7 @@ ORDER BY PROCESS
|
||||
'structured_types' => $structured_types,
|
||||
'unsigned' => array(),
|
||||
'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"),
|
||||
'operator_like' => "LIKE %%",
|
||||
'functions' => array("length", "lower", "round", "upper"),
|
||||
'grouping' => array("avg", "count", "count distinct", "max", "min", "sum"),
|
||||
'edit_functions' => array(
|
||||
|
@@ -488,7 +488,7 @@ ORDER BY connamespace, conname") as $row) {
|
||||
if (preg_match('~^(.*\n)?([^\n]*)\n( *)\^(\n.*)?$~s', $return, $match)) {
|
||||
$return = $match[1] . preg_replace('~((?:[^&]|&[^;]*;){' . strlen($match[3]) . '})(.*)~', '\1<b>\2</b>', $match[2]) . $match[4];
|
||||
}
|
||||
return nl_br($return);
|
||||
return nl2br($return);
|
||||
}
|
||||
|
||||
function create_database($db, $collation) {
|
||||
@@ -946,7 +946,9 @@ AND typelem = 0"
|
||||
'types' => $types,
|
||||
'structured_types' => $structured_types,
|
||||
'unsigned' => array(),
|
||||
'operators' => array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"), // no "SQL" to avoid CSRF
|
||||
'operators' => array("=", "<", ">", "<=", ">=", "!=", "~", "~*", "!~", "!~*", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"), // no "SQL" to avoid CSRF
|
||||
'operator_like' => "LIKE %%",
|
||||
'operator_regexp' => '~*',
|
||||
'functions' => array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper"),
|
||||
'grouping' => array("avg", "count", "count distinct", "max", "min", "sum"),
|
||||
'edit_functions' => array(
|
||||
|
@@ -804,6 +804,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
'structured_types' => array_keys($types),
|
||||
'unsigned' => array(),
|
||||
'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"), // REGEXP can be user defined function
|
||||
'operator_like' => "LIKE %%",
|
||||
'functions' => array("hex", "length", "lower", "round", "unixepoch", "upper"),
|
||||
'grouping' => array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"),
|
||||
'edit_functions' => array(
|
||||
|
@@ -182,8 +182,8 @@ $prefixes = array();
|
||||
if (DB != "") {
|
||||
$checked = ($TABLE != "" ? "" : " checked");
|
||||
echo "<thead><tr>";
|
||||
echo "<th style='text-align: left;'><label class='block'><input type='checkbox' id='check-tables'$checked>" . lang('Tables') . "</label>" . script("qs('#check-tables').onclick = partial(formCheck, /^tables\\[/);", "");
|
||||
echo "<th style='text-align: right;'><label class='block'>" . lang('Data') . "<input type='checkbox' id='check-data'$checked></label>" . script("qs('#check-data').onclick = partial(formCheck, /^data\\[/);", "");
|
||||
echo "<th style='text-align: left;'><label class='block'><input type='checkbox' id='check-tables'$checked>" . lang('Tables') . "</label>" . script("gid('check-tables').onclick = partial(formCheck, /^tables\\[/);", "");
|
||||
echo "<th style='text-align: right;'><label class='block'>" . lang('Data') . "<input type='checkbox' id='check-data'$checked></label>" . script("gid('check-data').onclick = partial(formCheck, /^data\\[/);", "");
|
||||
echo "</thead>\n";
|
||||
|
||||
$views = "";
|
||||
@@ -208,7 +208,7 @@ if (DB != "") {
|
||||
} else {
|
||||
echo "<thead><tr><th style='text-align: left;'>";
|
||||
echo "<label class='block'><input type='checkbox' id='check-databases'" . ($TABLE == "" ? " checked" : "") . ">" . lang('Database') . "</label>";
|
||||
echo script("qs('#check-databases').onclick = partial(formCheck, /^databases\\[/);", "");
|
||||
echo script("gid('check-databases').onclick = partial(formCheck, /^databases\\[/);", "");
|
||||
echo "</thead>\n";
|
||||
$databases = $adminer->databases();
|
||||
if ($databases) {
|
||||
|
@@ -3,7 +3,11 @@
|
||||
|
||||
class Adminer {
|
||||
/** @var array operators used in select, null for all operators */
|
||||
var $operators;
|
||||
var $operators = null;
|
||||
/** @var string operator for LIKE condition */
|
||||
var $operator_like = null;
|
||||
/** @var string operator for regular expression condition */
|
||||
var $operator_regexp = null;
|
||||
|
||||
/** Name in title and navigation
|
||||
* @return string HTML code
|
||||
@@ -25,12 +29,16 @@ class Adminer {
|
||||
function connectSsl() {
|
||||
}
|
||||
|
||||
/** Get key used for permanent login
|
||||
* @param bool
|
||||
* @return string cryptic string which gets combined with password or false in case of an error
|
||||
*/
|
||||
/**
|
||||
* Gets a private key used for permanent login.
|
||||
*
|
||||
* @param bool $create
|
||||
*
|
||||
* @return string|false Cryptic string which gets combined with password or false in case of an error.
|
||||
* @throws \Random\RandomException
|
||||
*/
|
||||
function permanentLogin($create = false) {
|
||||
return password_file($create);
|
||||
return get_private_key($create);
|
||||
}
|
||||
|
||||
/** Return key used to group brute force attacks; behind a reverse proxy, you want to return the last part of X-Forwarded-For
|
||||
@@ -121,7 +129,7 @@ class Adminer {
|
||||
echo "<table cellspacing='0' class='layout'>\n";
|
||||
echo $this->loginFormField('driver', '<tr><th>' . lang('System') . '<td>', html_select("auth[driver]", $drivers, DRIVER, "loginDriver(this);") . "\n");
|
||||
echo $this->loginFormField('server', '<tr><th>' . lang('Server') . '<td>', '<input name="auth[server]" value="' . h(SERVER) . '" title="hostname[:port]" placeholder="localhost" autocapitalize="off">' . "\n");
|
||||
echo $this->loginFormField('username', '<tr><th>' . lang('Username') . '<td>', '<input name="auth[username]" id="username" value="' . h($_GET["username"]) . '" autocomplete="username" autocapitalize="off">' . script("focus(qs('#username')); qs('#username').form['auth[driver]'].onchange();"));
|
||||
echo $this->loginFormField('username', '<tr><th>' . lang('Username') . '<td>', '<input name="auth[username]" id="username" value="' . h($_GET["username"]) . '" autocomplete="username" autocapitalize="off">' . script("focus(gid('username')); gid('username').form['auth[driver]'].onchange();"));
|
||||
echo $this->loginFormField('password', '<tr><th>' . lang('Password') . '<td>', '<input type="password" name="auth[password]" autocomplete="current-password">' . "\n");
|
||||
echo $this->loginFormField('db', '<tr><th>' . lang('Database') . '<td>', '<input name="auth[db]" value="' . h($_GET["db"]) . '" autocapitalize="off">' . "\n");
|
||||
echo "</table>\n";
|
||||
@@ -241,7 +249,7 @@ class Adminer {
|
||||
|
||||
if (!$failed && ($warnings = $driver->warnings())) {
|
||||
$id = "warnings";
|
||||
$result = ($supportSql ? "," : "")
|
||||
$result .= ($supportSql ? "," : "")
|
||||
. " <a href='#$id'>" . lang('Warnings') . "</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "")
|
||||
. "</p>\n"
|
||||
. "<div id='$id' class='hidden'>\n$warnings</div>\n";
|
||||
@@ -310,6 +318,11 @@ class Adminer {
|
||||
* @return string
|
||||
*/
|
||||
function editVal($val, $field) {
|
||||
// Format Elasticsearch boolean value, but do not touch PostgreSQL boolean that use string value 't' or 'f'.
|
||||
if ($field["type"] == "boolean" && is_bool($val)) {
|
||||
return $val ? "true" : "false";
|
||||
}
|
||||
|
||||
return $val;
|
||||
}
|
||||
|
||||
@@ -334,15 +347,40 @@ class Adminer {
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
function tablePartitionsPrint($partition_info) {
|
||||
$showList = $partition_info["partition_by"] == "RANGE" || $partition_info["partition_by"] == "LIST";
|
||||
|
||||
echo "<p>";
|
||||
echo "<code>{$partition_info["partition_by"]} ({$partition_info["partition"]})</code>";
|
||||
if (!$showList) {
|
||||
echo " " . lang('Partitions') . ": " . h($partition_info["partitions"]);
|
||||
}
|
||||
echo "</p>";
|
||||
|
||||
if ($showList) {
|
||||
echo "<table>\n";
|
||||
echo "<thead><tr><th>" . lang('Partition') . "</th><td>" . lang('Values') . "</td></tr></thead>\n";
|
||||
|
||||
foreach ($partition_info["partition_names"] as $key => $name) {
|
||||
echo "<tr><th>" . h($name) . "</th><td>" . h($partition_info["partition_values"][$key]) . "\n";
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
}
|
||||
}
|
||||
|
||||
/** Print list of indexes on table in tabular format
|
||||
* @param array data about all indexes on a table
|
||||
* @return null
|
||||
*/
|
||||
function tableIndexesPrint($indexes) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<table>\n";
|
||||
echo "<thead><tr><th>" . lang('Type') . "</th><td>" . lang('Column (length)') . "</td></tr></thead>\n";
|
||||
|
||||
foreach ($indexes as $name => $index) {
|
||||
ksort($index["columns"]); // enforce correct columns order
|
||||
$print = array();
|
||||
$print = [];
|
||||
|
||||
foreach ($index["columns"] as $key => $val) {
|
||||
$print[] = "<i>" . h($val) . "</i>"
|
||||
. ($index["lengths"][$key] ? "(" . $index["lengths"][$key] . ")" : "")
|
||||
@@ -351,92 +389,127 @@ class Adminer {
|
||||
}
|
||||
echo "<tr title='" . h($name) . "'><th>$index[type]<td>" . implode(", ", $print) . "\n";
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
||||
/** Print columns box in select
|
||||
* @param array result of selectColumnsProcess()[0]
|
||||
* @param array selectable columns
|
||||
* @return null
|
||||
*/
|
||||
/**
|
||||
* Prints columns box in select filter.
|
||||
*
|
||||
* @param array $select result of selectColumnsProcess()[0]
|
||||
* @param array $columns selectable columns
|
||||
*/
|
||||
function selectColumnsPrint($select, $columns) {
|
||||
global $functions, $grouping;
|
||||
print_fieldset("select", lang('Select'), $select);
|
||||
|
||||
print_fieldset("select", lang('Select'), $select, true);
|
||||
|
||||
$_GET["columns"][""] = [];
|
||||
$i = 0;
|
||||
$select[""] = array();
|
||||
foreach ($select as $key => $val) {
|
||||
$val = $_GET["columns"][$key];
|
||||
|
||||
foreach ($_GET["columns"] as $key => $val) {
|
||||
if ($key != "" && $val["col"] == "") continue;
|
||||
|
||||
$column = select_input(
|
||||
" name='columns[$i][col]'",
|
||||
"name='columns[$i][col]'",
|
||||
$columns,
|
||||
$val["col"],
|
||||
($key !== "" ? "selectFieldChange" : "selectAddRow")
|
||||
$key !== "" ? "selectFieldChange" : "selectAddRow"
|
||||
);
|
||||
echo "<div>" . ($functions || $grouping ? "<select name='columns[$i][fun]'>"
|
||||
. optionlist(array(-1 => "") + array_filter(array(lang('Functions') => $functions, lang('Aggregation') => $grouping)), $val["fun"]) . "</select>"
|
||||
. on_help("getTarget(event).value && getTarget(event).value.replace(/ |\$/, '(') + ')'", 1)
|
||||
. script("qsl('select').onchange = function () { helpClose();" . ($key !== "" ? "" : " qsl('select, input', this.parentNode).onchange();") . " };", "")
|
||||
. "($column)" : $column) . "</div>\n";
|
||||
|
||||
echo "<div ", ($key != "" ? "" : "class='no-sort'"), ">",
|
||||
"<span class='jsonly handle'></span>";
|
||||
|
||||
if ($functions || $grouping) {
|
||||
echo "<select name='columns[$i][fun]'>",
|
||||
optionlist([-1 => ""] + array_filter([lang('Functions') => $functions, lang('Aggregation') => $grouping]), $val["fun"]),
|
||||
"</select>",
|
||||
help_script_command("value && value.replace(/ |\$/, '(') + ')'", true),
|
||||
script("qsl('select').onchange = (event) => { " . ($key !== "" ? "" : " qsl('select, input:not(.remove)', event.target.parentNode).onchange();") . " };", ""),
|
||||
"($column)";
|
||||
} else {
|
||||
echo $column;
|
||||
}
|
||||
|
||||
echo " <input type='image' src='../adminer/static/cross.gif' class='jsonly icon remove' title='" . h(lang('Remove')) . "' alt='x'>",
|
||||
script("qsl('#fieldset-select .remove').onclick = selectRemoveRow;", ""),
|
||||
"</div>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo "</div></fieldset>\n";
|
||||
|
||||
echo "</div>", script("initSortable('#fieldset-select');"), "</fieldset>\n";
|
||||
}
|
||||
|
||||
/** Print search box in select
|
||||
* @param array result of selectSearchProcess()
|
||||
* @param array selectable columns
|
||||
* @param array
|
||||
* @return null
|
||||
*/
|
||||
/**
|
||||
* Prints search box in select.
|
||||
*
|
||||
* @param array $where result of selectSearchProcess()
|
||||
* @param array $columns selectable columns
|
||||
*/
|
||||
function selectSearchPrint($where, $columns, $indexes) {
|
||||
print_fieldset("search", lang('Search'), $where);
|
||||
|
||||
foreach ($indexes as $i => $index) {
|
||||
if ($index["type"] == "FULLTEXT") {
|
||||
echo "<div>(<i>" . implode("</i>, <i>", array_map('h', $index["columns"])) . "</i>) AGAINST";
|
||||
echo " <input type='search' name='fulltext[$i]' value='" . h($_GET["fulltext"][$i]) . "'>";
|
||||
echo script("qsl('input').oninput = selectFieldChange;", "");
|
||||
echo checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL");
|
||||
echo "</div>\n";
|
||||
echo "<div>(<i>" . implode("</i>, <i>", array_map('h', $index["columns"])) . "</i>) AGAINST",
|
||||
" <input type='search' name='fulltext[$i]' value='" . h($_GET["fulltext"][$i]) . "'>",
|
||||
script("qsl('input').oninput = selectFieldChange;", ""),
|
||||
checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL"),
|
||||
"</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$change_next = "this.parentNode.firstChild.onchange();";
|
||||
foreach (array_merge((array) $_GET["where"], array(array())) as $i => $val) {
|
||||
if (!$val || ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators))) {
|
||||
echo "<div>" . select_input(
|
||||
" name='where[$i][col]'",
|
||||
$columns,
|
||||
$val["col"],
|
||||
($val ? "selectFieldChange" : "selectAddRow"),
|
||||
"(" . lang('anywhere') . ")"
|
||||
);
|
||||
echo html_select("where[$i][op]", $this->operators, $val["op"], $change_next);
|
||||
echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "'>";
|
||||
echo script("mixin(qsl('input'), {oninput: function () { $change_next }, onkeydown: selectSearchKeydown, onsearch: selectSearchSearch});", "");
|
||||
echo "</div>\n";
|
||||
echo "<div>",
|
||||
select_input(
|
||||
" name='where[$i][col]'",
|
||||
$columns,
|
||||
$val["col"],
|
||||
($val ? "selectFieldChange" : "selectAddRow"),
|
||||
"(" . lang('anywhere') . ")"
|
||||
),
|
||||
html_select("where[$i][op]", $this->operators, $val["op"], $change_next),
|
||||
"<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "'>",
|
||||
script("mixin(qsl('input'), {oninput: function () { $change_next }, onkeydown: selectSearchKeydown, onsearch: selectSearchSearch});", ""),
|
||||
" <input type='image' src='../adminer/static/cross.gif' class='jsonly icon remove' title='" . h(lang('Remove')) . "' alt='x'>",
|
||||
script('qsl("#fieldset-search .remove").onclick = selectRemoveRow;', ""),
|
||||
"</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</div></fieldset>\n";
|
||||
}
|
||||
|
||||
/** Print order box in select
|
||||
* @param array result of selectOrderProcess()
|
||||
* @param array selectable columns
|
||||
* @param array
|
||||
* @return null
|
||||
*/
|
||||
/**
|
||||
* Prints order box in select filter.
|
||||
*
|
||||
* @param array $order result of selectOrderProcess()
|
||||
* @param array $columns selectable columns
|
||||
*/
|
||||
function selectOrderPrint($order, $columns, $indexes) {
|
||||
print_fieldset("sort", lang('Sort'), $order);
|
||||
print_fieldset("sort", lang('Sort'), $order, true);
|
||||
|
||||
$_GET["order"][""] = "";
|
||||
$i = 0;
|
||||
|
||||
foreach ((array) $_GET["order"] as $key => $val) {
|
||||
if ($val != "") {
|
||||
echo "<div>" . select_input(" name='order[$i]'", $columns, $val, "selectFieldChange");
|
||||
echo checkbox("desc[$i]", 1, isset($_GET["desc"][$key]), lang('descending')) . "</div>\n";
|
||||
$i++;
|
||||
}
|
||||
if ($key != "" && $val == "") continue;
|
||||
|
||||
echo "<div ", ($key != "" ? "" : "class='no-sort'"), ">",
|
||||
"<span class='jsonly handle'></span>",
|
||||
select_input("name='order[$i]'", $columns, $val, $key !== "" ? "selectFieldChange" : "selectAddRow"),
|
||||
checkbox("desc[$i]", 1, isset($_GET["desc"][$key]), lang('descending')),
|
||||
" <input type='image' src='../adminer/static/cross.gif' class='jsonly icon remove' title='" . h(lang('Remove')) . "' alt='x'>",
|
||||
script('qsl("#fieldset-sort .remove").onclick = selectRemoveRow;', ""),
|
||||
"</div>\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo "<div>" . select_input(" name='order[$i]'", $columns, "", "selectAddRow");
|
||||
echo checkbox("desc[$i]", 1, false, lang('descending')) . "</div>\n";
|
||||
echo "</div></fieldset>\n";
|
||||
|
||||
echo "</div>", script("initSortable('#fieldset-sort');"), "</fieldset>\n";
|
||||
}
|
||||
|
||||
/** Print limit box in select
|
||||
@@ -484,7 +557,7 @@ class Adminer {
|
||||
json_row($key);
|
||||
}
|
||||
echo ";\n";
|
||||
echo "selectFieldChange.call(qs('#form')['select']);\n";
|
||||
echo "selectFieldChange.call(gid('form')['select']);\n";
|
||||
echo "</script>\n";
|
||||
echo "</div></fieldset>\n";
|
||||
}
|
||||
@@ -582,6 +655,8 @@ class Adminer {
|
||||
&& (preg_match('~^[-\d.' . (preg_match('~IN$~', $op) ? ',' : '') . ']+$~', $val) || !preg_match('~' . number_type() . '|bit~', $field["type"]))
|
||||
&& (!preg_match("~[\x80-\xFF]~", $val) || preg_match('~char|text|enum|set~', $field["type"]))
|
||||
&& (!preg_match('~date|timestamp~', $field["type"]) || preg_match('~^\d+-\d+-\d+~', $val))
|
||||
&& (!preg_match('~^elastic~', DRIVER) || $field["type"] != "boolean" || preg_match('~true|false~', $val)) // Elasticsearch needs boolean value properly formatted.
|
||||
&& (!preg_match('~^elastic~', DRIVER) || strpos($op, "regexp") === false || preg_match('~text|keyword~', $field["type"])) // Elasticsearch can use regexp only on text and keyword fields.
|
||||
) {
|
||||
$cols[] = $prefix . $driver->convertSearch(idf_escape($name), $where, $field) . $cond;
|
||||
}
|
||||
@@ -721,7 +796,7 @@ class Adminer {
|
||||
* @param string
|
||||
* @return string custom input field or empty string for default
|
||||
*/
|
||||
function editInput($table, $field, $attrs, $value) {
|
||||
function editInput($table, $field, $attrs, $value, $function) {
|
||||
if ($field["type"] == "enum") {
|
||||
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
|
||||
. ($field["null"] ? "<label><input type='radio'$attrs value=''" . ($value !== null || isset($_GET["select"]) ? "" : " checked") . "><i>NULL</i></label> " : "")
|
||||
@@ -937,9 +1012,11 @@ class Adminer {
|
||||
return $ext;
|
||||
}
|
||||
|
||||
/** Set the path of the file for webserver load
|
||||
* @return string path of the sql dump file
|
||||
*/
|
||||
/**
|
||||
* Gets the path of the file for webserver load.
|
||||
*
|
||||
* @return string Path of the sql import file.
|
||||
*/
|
||||
function importServerPath() {
|
||||
return "adminer.sql";
|
||||
}
|
||||
@@ -965,8 +1042,12 @@ class Adminer {
|
||||
<h1>
|
||||
<?php echo $this->name(); ?>
|
||||
<?php if ($missing != "auth"): ?>
|
||||
<span class="version"><?php echo $VERSION; ?></span>
|
||||
<a href="https://www.adminer.org/#download"<?php echo target_blank(); ?> id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
|
||||
<span class="version">
|
||||
<?php echo $VERSION; ?>
|
||||
<a href="https://github.com/pematon/adminer/releases"<?php echo target_blank(); ?> id="version">
|
||||
<?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</h1>
|
||||
<?php
|
||||
@@ -978,14 +1059,21 @@ class Adminer {
|
||||
if ($password !== null) {
|
||||
$dbs = $_SESSION["db"][$vendor][$server][$username];
|
||||
foreach (($dbs ? array_keys($dbs) : array("")) as $db) {
|
||||
$output .= "<li><a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>($drivers[$vendor]) " . h($username . ($server != "" ? "@" . $this->serverName($server) : "") . ($db != "" ? " - $db" : "")) . "</a>\n";
|
||||
$output .= "<li><a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>"
|
||||
. h($drivers[$vendor])
|
||||
. ($username != "" || $server != "" ? " - " : "")
|
||||
. h($username)
|
||||
. ($username != "" && $server != "" ? "@" : "")
|
||||
. ($server != "" ? h($this->serverName($server)) : "")
|
||||
. ($db != "" ? h(" - $db") : "")
|
||||
. "</a></li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($output) {
|
||||
echo "<ul id='logins'>\n$output</ul>\n" . script("mixin(qs('#logins'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
echo "<ul id='logins'>\n$output</ul>\n" . script("mixin(gid('logins'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
}
|
||||
} else {
|
||||
$tables = array();
|
||||
@@ -1018,84 +1106,128 @@ bodyLoad('<?php echo (is_object($connection) ? preg_replace('~^(\d\.?\d).*~s', '
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
$this->databasesPrint($missing);
|
||||
|
||||
$actions = [];
|
||||
if (DB == "" || !$missing) {
|
||||
echo "<p class='links'>" . (support("sql") ? "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"]) && !isset($_GET["import"])) . ">" . lang('SQL command') . "</a>\n<a href='" . h(ME) . "import='" . bold(isset($_GET["import"])) . ">" . lang('Import') . "</a>\n" : "") . "";
|
||||
if (support("sql")) {
|
||||
$actions[] = "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"]) && !isset($_GET["import"])) . ">" . lang('SQL command') . "</a>";
|
||||
$actions[] = "<a href='" . h(ME) . "import='" . bold(isset($_GET["import"])) . ">" . lang('Import') . "</a>";
|
||||
}
|
||||
if (support("dump")) {
|
||||
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Export') . "</a>\n";
|
||||
$actions[] = "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Export') . "</a>";
|
||||
}
|
||||
}
|
||||
if ($_GET["ns"] !== "" && !$missing && DB != "") {
|
||||
echo '<a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create table') . "</a>\n";
|
||||
if (!$tables) {
|
||||
echo "<p class='message'>" . lang('No tables.') . "\n";
|
||||
} else {
|
||||
$actions[] = '<a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create table') . "</a>\n";
|
||||
}
|
||||
if ($actions) {
|
||||
echo "<p class='links'>" . implode("\n", $actions) . "</p>";
|
||||
}
|
||||
|
||||
if ($_GET["ns"] !== "" && !$missing && DB != "") {
|
||||
if ($tables) {
|
||||
$this->printTablesFilter();
|
||||
$this->tablesPrint($tables);
|
||||
} else {
|
||||
echo "<p class='message'>" . lang('No tables.') . "</p>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Prints databases list in menu
|
||||
* @param string
|
||||
* @return null
|
||||
*/
|
||||
/**
|
||||
* Prints databases select in menu.
|
||||
*
|
||||
* @param $missing string
|
||||
* @return null
|
||||
*/
|
||||
function databasesPrint($missing) {
|
||||
global $adminer, $connection;
|
||||
|
||||
$databases = $this->databases();
|
||||
if (DB && $databases && !in_array(DB, $databases)) {
|
||||
array_unshift($databases, DB);
|
||||
}
|
||||
?>
|
||||
<form action="">
|
||||
<p id="dbs">
|
||||
<?php
|
||||
|
||||
echo "<form action=''><p id='dbs'>";
|
||||
hidden_fields_get();
|
||||
$db_events = script("mixin(qsl('select'), {onmousedown: dbMouseDown, onchange: dbChange});");
|
||||
echo "<span title='" . lang('database') . "'>" . lang('DB') . "</span>: " . ($databases
|
||||
? "<select name='db'>" . optionlist(array("" => "") + $databases, DB) . "</select>$db_events"
|
||||
: "<input name='db' value='" . h(DB) . "' autocapitalize='off'>\n"
|
||||
);
|
||||
|
||||
if ($databases) {
|
||||
echo "<select id='database-select' name='db'>" . optionlist(["" => lang('Database')] + $databases, DB) . "</select>"
|
||||
. script("mixin(gid('database-select'), {onmousedown: dbMouseDown, onchange: dbChange});");
|
||||
} else {
|
||||
echo "<input id='database-select' name='db' value='" . h(DB) . "' autocapitalize='off'>\n";
|
||||
}
|
||||
echo "<input type='submit' value='" . lang('Use') . "'" . ($databases ? " class='hidden'" : "") . ">\n";
|
||||
if (support("scheme")) {
|
||||
if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
|
||||
echo "<br>" . lang('Schema') . ": <select name='ns'>" . optionlist(array("" => "") + $adminer->schemas(), $_GET["ns"]) . "</select>$db_events";
|
||||
if ($_GET["ns"] != "") {
|
||||
set_schema($_GET["ns"]);
|
||||
}
|
||||
|
||||
if (support("scheme") && $missing != "db" && DB != "" && $connection->select_db(DB)) {
|
||||
echo "<br><select id='scheme-select' name='ns'>" . optionlist(["" => lang('Schema')] + $adminer->schemas(), $_GET["ns"]) . "</select>"
|
||||
. script("mixin(gid('scheme-select'), {onmousedown: dbMouseDown, onchange: dbChange});");
|
||||
|
||||
if ($_GET["ns"] != "") {
|
||||
set_schema($_GET["ns"]);
|
||||
}
|
||||
}
|
||||
foreach (array("import", "sql", "schema", "dump", "privileges") as $val) {
|
||||
|
||||
foreach (["import", "sql", "schema", "dump", "privileges"] as $val) {
|
||||
if (isset($_GET[$val])) {
|
||||
echo "<input type='hidden' name='$val' value=''>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo "</p></form>\n";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Prints table list in menu
|
||||
* @param array result of table_status('', true)
|
||||
* @return null
|
||||
*/
|
||||
function printTablesFilter()
|
||||
{
|
||||
global $adminer;
|
||||
|
||||
echo "<div class='tables-filter jsonly'>"
|
||||
. "<input id='tables-filter' autocomplete='off' placeholder='" . lang('Table') . "'>"
|
||||
. script("initTablesFilter(" . json_encode($adminer->database()) . ");")
|
||||
. "</div>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints table list in menu.
|
||||
*
|
||||
* @param array $tables Result of table_status('', true)
|
||||
* @return null
|
||||
*/
|
||||
function tablesPrint($tables) {
|
||||
echo "<ul id='tables'>" . script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
echo "<ul id='tables'>" . script("mixin(gid('tables'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
|
||||
foreach ($tables as $table => $status) {
|
||||
$name = $this->tableName($status);
|
||||
if ($name != "") {
|
||||
$active = $table == $_GET["select"] || $table == $_GET["edit"];
|
||||
|
||||
echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"'
|
||||
. bold($_GET["select"] == $table || $_GET["edit"] == $table, "select")
|
||||
. " title='" . lang('Select data') . "'>" . lang('select') . "</a> "
|
||||
;
|
||||
echo (support("table") || support("indexes")
|
||||
? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"'
|
||||
. bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), (is_view($status) ? "view" : "structure"))
|
||||
. " title='" . lang('Show structure') . "'>$name</a>"
|
||||
: "<span>$name</span>"
|
||||
) . "\n";
|
||||
. bold($active, "select")
|
||||
. " title='" . lang('Select data') . "'>" . lang('select') . "</a> ";
|
||||
|
||||
if (support("table") || support("indexes")) {
|
||||
$active = in_array($table, [$_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"]]);
|
||||
$class = is_view($status) ? "view" : "structure";
|
||||
|
||||
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($active, $class)
|
||||
. " title='" . lang('Show structure') . "' data-main='true'>$name</a>";
|
||||
} else {
|
||||
echo "<span data-main='true'>$name</span>";
|
||||
}
|
||||
|
||||
echo "</li>\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</ul>\n";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
$connection = '';
|
||||
|
||||
$has_token = $_SESSION["token"];
|
||||
@@ -70,7 +71,7 @@ if (!function_exists('is_server_host_valid')) {
|
||||
*/
|
||||
function build_http_url($server, $username, $password, $defaultServer, $defaultPort = null) {
|
||||
if (!preg_match('~^(https?://)?([^:]*)(:\d+)?$~', rtrim($server, '/'), $matches)) {
|
||||
$this->error = lang('Invalid server or credentials.');
|
||||
auth_error(lang('Invalid server or credentials.'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -82,11 +83,11 @@ function build_http_url($server, $username, $password, $defaultServer, $defaultP
|
||||
|
||||
function add_invalid_login() {
|
||||
global $adminer;
|
||||
$fp = file_open_lock(get_temp_dir() . "/adminer.invalid");
|
||||
if (!$fp) {
|
||||
$file = open_file_with_lock(get_temp_dir() . "/adminer.invalid");
|
||||
if (!$file) {
|
||||
return;
|
||||
}
|
||||
$invalids = unserialize(stream_get_contents($fp));
|
||||
$invalids = unserialize(stream_get_contents($file));
|
||||
$time = time();
|
||||
if ($invalids) {
|
||||
foreach ($invalids as $ip => $val) {
|
||||
@@ -100,13 +101,16 @@ function add_invalid_login() {
|
||||
$invalid = array($time + 30*60, 0); // active for 30 minutes
|
||||
}
|
||||
$invalid[1]++;
|
||||
file_write_unlock($fp, serialize($invalids));
|
||||
write_and_unlock_file($file, serialize($invalids));
|
||||
}
|
||||
|
||||
function check_invalid_login() {
|
||||
global $adminer;
|
||||
$invalids = unserialize(@file_get_contents(get_temp_dir() . "/adminer.invalid")); // @ - may not exist
|
||||
$invalid = ($invalids ? $invalids[$adminer->bruteForceKey()] : array());
|
||||
|
||||
$filename = get_temp_dir() . "/adminer.invalid";
|
||||
$invalids = file_exists($filename) ? unserialize(file_get_contents($filename)) : [];
|
||||
$invalid = ($invalids ? $invalids[$adminer->bruteForceKey()] : []);
|
||||
|
||||
$next_attempt = ($invalid[1] > 29 ? $invalid[0] - time() : 0); // allow 30 invalid attempts
|
||||
if ($next_attempt > 0) { //! do the same with permanent login
|
||||
auth_error(lang('Too many unsuccessful logins, try again in %d minute(s).', ceil($next_attempt / 60)));
|
||||
@@ -168,9 +172,10 @@ function unset_permanent() {
|
||||
}
|
||||
|
||||
/** Renders an error message and a login form
|
||||
* @param string plain text
|
||||
* @return null exits
|
||||
*/
|
||||
* @param string plain text
|
||||
* @return null exits
|
||||
* @throws \Random\RandomException
|
||||
*/
|
||||
function auth_error($error) {
|
||||
global $adminer, $has_token;
|
||||
$session_name = session_name();
|
||||
@@ -195,7 +200,7 @@ function auth_error($error) {
|
||||
$error = lang('Session support must be enabled.');
|
||||
}
|
||||
$params = session_get_cookie_params();
|
||||
cookie("adminer_key", ($_COOKIE["adminer_key"] ? $_COOKIE["adminer_key"] : rand_string()), $params["lifetime"]);
|
||||
cookie("adminer_key", ($_COOKIE["adminer_key"] ?: get_random_string()), $params["lifetime"]);
|
||||
page_header(lang('Login'), $error, null);
|
||||
echo "<form action='' method='post'>\n";
|
||||
echo "<div>";
|
||||
|
@@ -32,9 +32,9 @@ if (isset($_GET["file"])) {
|
||||
}
|
||||
|
||||
if ($_GET["script"] == "version") {
|
||||
$fp = file_open_lock(get_temp_dir() . "/adminer.version");
|
||||
if ($fp) {
|
||||
file_write_unlock($fp, serialize(array("signature" => $_POST["signature"], "version" => $_POST["version"])));
|
||||
$file = open_file_with_lock(get_temp_dir() . "/adminer.version");
|
||||
if ($file) {
|
||||
write_and_unlock_file($file, serialize(["version" => $_POST["version"]]));
|
||||
}
|
||||
exit;
|
||||
}
|
||||
@@ -93,11 +93,16 @@ $types = $config['types'];
|
||||
$structured_types = $config['structured_types'];
|
||||
$unsigned = $config['unsigned'];
|
||||
$operators = $config['operators'];
|
||||
$operator_like = $config['operator_like'];
|
||||
$operator_regexp = $config['operator_regexp'];
|
||||
$functions = $config['functions'];
|
||||
$grouping = $config['grouping'];
|
||||
$edit_functions = $config['edit_functions'];
|
||||
|
||||
if ($adminer->operators === null) {
|
||||
$adminer->operators = $operators;
|
||||
$adminer->operator_like = $operator_like;
|
||||
$adminer->operator_regexp = $operator_regexp;
|
||||
}
|
||||
|
||||
define("SERVER", $_GET[DRIVER]); // read from pgsql=localhost
|
||||
|
@@ -6,7 +6,7 @@
|
||||
* @param string used after colon in title and heading, should be HTML escaped
|
||||
* @return null
|
||||
*/
|
||||
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||
function page_header($title, $error = "", $breadcrumb = [], $title2 = "") {
|
||||
global $LANG, $VERSION, $adminer, $drivers, $jush;
|
||||
page_headers();
|
||||
if (is_ajax() && $error) {
|
||||
@@ -15,15 +15,23 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||
}
|
||||
$title_all = $title . ($title2 != "" ? ": $title2" : "");
|
||||
$title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
|
||||
|
||||
// Load Adminer version from file if cookie is missing.
|
||||
$filename = get_temp_dir() . "/adminer.version";
|
||||
if (!$_COOKIE["adminer_version"] && file_exists($filename) && filemtime($filename) + 86400 > time()) { // 86400 - 1 day in seconds
|
||||
$data = unserialize(file_get_contents($filename));
|
||||
$_COOKIE["adminer_version"] = $data["version"];
|
||||
cookie("adminer_version", $data["version"], 24 * 3600);
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex">
|
||||
<title><?php echo $title_page; ?></title>
|
||||
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
|
||||
<?php echo script_src("../adminer/static/functions.js"); ?>
|
||||
<?php echo script_src("static/editing.js"); ?>
|
||||
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css?<?php echo filemtime("../adminer/static/default.css"); ?>">
|
||||
<?php echo script_src("../adminer/static/functions.js?" . filemtime("../adminer/static/functions.js")); ?>
|
||||
<?php echo script_src("static/editing.js?" . filemtime("../adminer/static/editing.js")); ?>
|
||||
<?php if ($adminer->head()) { ?>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
|
||||
<link rel="apple-touch-icon" href="../adminer/static/favicon.ico">
|
||||
@@ -33,66 +41,64 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||
<?php } ?>
|
||||
|
||||
<body class="<?php echo lang('ltr'); ?> nojs">
|
||||
<?php
|
||||
$filename = get_temp_dir() . "/adminer.version";
|
||||
if (!$_COOKIE["adminer_version"] && function_exists('openssl_verify') && file_exists($filename) && filemtime($filename) + 86400 > time()) { // 86400 - 1 day in seconds
|
||||
$version = unserialize(file_get_contents($filename));
|
||||
$public = "-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwqWOVuF5uw7/+Z70djoK
|
||||
RlHIZFZPO0uYRezq90+7Amk+FDNd7KkL5eDve+vHRJBLAszF/7XKXe11xwliIsFs
|
||||
DFWQlsABVZB3oisKCBEuI71J4kPH8dKGEWR9jDHFw3cWmoH3PmqImX6FISWbG3B8
|
||||
h7FIx3jEaw5ckVPVTeo5JRm/1DZzJxjyDenXvBQ/6o9DgZKeNDgxwKzH+sw9/YCO
|
||||
jHnq1cFpOIISzARlrHMa/43YfeNRAm/tsBXjSxembBPo7aQZLAWHmaj5+K19H10B
|
||||
nCpz9Y++cipkVEiKRGih4ZEvjoFysEOdRLj6WiD/uUNky4xGeA6LaJqh5XpkFkcQ
|
||||
fQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
";
|
||||
if (openssl_verify($version["version"], base64_decode($version["signature"]), $public) == 1) {
|
||||
$_COOKIE["adminer_version"] = $version["version"]; // doesn't need to send to the browser
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script<?php echo nonce(); ?>>
|
||||
mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick<?php
|
||||
echo (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '$VERSION', '" . js_escape(ME) . "', '" . get_token() . "')"); // $token may be empty in auth.inc.php
|
||||
?>});
|
||||
document.body.className = document.body.className.replace(/ nojs/, ' js');
|
||||
var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>';
|
||||
var thousandsSeparator = '<?php echo js_escape(lang(',')); ?>';
|
||||
document.body.onkeydown = bodyKeydown;
|
||||
document.body.onclick = bodyClick;
|
||||
<?php if (!isset($_COOKIE["adminer_version"])): ?>
|
||||
document.body.onload = function () { verifyVersion('<?php echo $VERSION; ?>', '<?php echo js_escape(ME); ?>', '<?php echo get_token(); ?>') };
|
||||
<?php endif; ?>
|
||||
document.body.className = document.body.className.replace(/ nojs/, ' js');
|
||||
|
||||
var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>';
|
||||
var thousandsSeparator = '<?php echo js_escape(lang(',')); ?>';
|
||||
</script>
|
||||
|
||||
<div id="help" class="jush-<?php echo $jush; ?> jsonly hidden"></div>
|
||||
<?php echo script("mixin(qs('#help'), {onmouseover: function () { helpOpen = 1; }, onmouseout: helpMouseout});"); ?>
|
||||
<?php echo script("initHelpPopup();"); ?>
|
||||
|
||||
<div id="content">
|
||||
<?php
|
||||
if ($breadcrumb !== null) {
|
||||
echo '<p id="breadcrumb">';
|
||||
|
||||
$link = substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1);
|
||||
echo '<p id="breadcrumb"><a href="' . h($link ? $link : ".") . '">' . $drivers[DRIVER] . '</a> » ';
|
||||
$link = substr(preg_replace('~\b(db|ns)=[^&]*&~', '', ME), 0, -1);
|
||||
$server = $adminer->serverName(SERVER);
|
||||
$server = ($server != "" ? $server : lang('Server'));
|
||||
echo '<a href="' . h($link ?: ".") . '">' . lang('Home') . '</a> » ';
|
||||
|
||||
$server = "";
|
||||
if ($breadcrumb === false) {
|
||||
echo "$server\n";
|
||||
$server .= h($drivers[DRIVER]) . ": ";
|
||||
}
|
||||
|
||||
$server_name = $adminer->serverName(SERVER);
|
||||
$server .= $server_name != "" ? h($server_name) : lang('Server');
|
||||
|
||||
if ($breadcrumb === false) {
|
||||
echo h($server), "\n";
|
||||
} else {
|
||||
echo "<a href='" . h($link) . "' accesskey='1' title='Alt+Shift+1'>$server</a> » ";
|
||||
$link = substr(preg_replace('~\b(db|ns)=[^&]*&~', '', ME), 0, -1);
|
||||
echo "<a href='" . h($link) . "' accesskey='1' title='Alt+Shift+1'>$server</a> » ";
|
||||
|
||||
if ($_GET["ns"] != "" || (DB != "" && is_array($breadcrumb))) {
|
||||
echo '<a href="' . h($link . "&db=" . urlencode(DB) . (support("scheme") ? "&ns=" : "")) . '">' . h(DB) . '</a> » ';
|
||||
echo '<a href="' . h($link . "&db=" . urlencode(DB) . (support("scheme") ? "&ns=" : "")) . '">' . h(DB) . '</a> » ';
|
||||
}
|
||||
|
||||
if (is_array($breadcrumb)) {
|
||||
if ($_GET["ns"] != "") {
|
||||
echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h($_GET["ns"]) . '</a> » ';
|
||||
echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h($_GET["ns"]) . '</a> » ';
|
||||
}
|
||||
|
||||
foreach ($breadcrumb as $key => $val) {
|
||||
$desc = (is_array($val) ? $val[1] : h($val));
|
||||
if ($desc != "") {
|
||||
echo "<a href='" . h(ME . "$key=") . urlencode(is_array($val) ? $val[0] : $val) . "'>$desc</a> » ";
|
||||
echo "<a href='" . h(ME . "$key=") . urlencode(is_array($val) ? $val[0] : $val) . "'>$desc</a> » ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "$title\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<h2>$title_all</h2>\n";
|
||||
echo "<div id='ajaxstatus' class='jsonly hidden'></div>\n";
|
||||
restart_session();
|
||||
@@ -126,30 +132,40 @@ function page_headers() {
|
||||
$adminer->headers();
|
||||
}
|
||||
|
||||
/** Get Content Security Policy headers
|
||||
* @return array of arrays with directive name in key, allowed sources in value
|
||||
*/
|
||||
/**
|
||||
* Gets Content Security Policy headers.
|
||||
*
|
||||
* @return array of arrays with directive name in key, allowed sources in value
|
||||
* @throws \Random\RandomException
|
||||
*/
|
||||
function csp() {
|
||||
return array(
|
||||
array(
|
||||
"script-src" => "'self' 'unsafe-inline' 'nonce-" . get_nonce() . "' 'strict-dynamic'", // 'self' is a fallback for browsers not supporting 'strict-dynamic', 'unsafe-inline' is a fallback for browsers not supporting 'nonce-'
|
||||
"connect-src" => "'self'",
|
||||
"frame-src" => "https://www.adminer.org",
|
||||
return [
|
||||
[
|
||||
// 'self' is a fallback for browsers not supporting 'strict-dynamic', 'unsafe-inline' is a fallback for browsers not supporting 'nonce-'
|
||||
"script-src" => "'self' 'unsafe-inline' 'nonce-" . get_nonce() . "' 'strict-dynamic'",
|
||||
"connect-src" => "'self' https://api.github.com/repos/pematon/adminer/releases/latest",
|
||||
"frame-src" => "'self'",
|
||||
"object-src" => "'none'",
|
||||
"base-uri" => "'none'",
|
||||
"form-action" => "'self'",
|
||||
),
|
||||
);
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/** Get a CSP nonce
|
||||
* @return string Base64 value
|
||||
*/
|
||||
function get_nonce() {
|
||||
/**
|
||||
* Gets a CSP nonce.
|
||||
*
|
||||
* @return string Base64 value.
|
||||
* @throws \Random\RandomException
|
||||
*/
|
||||
function get_nonce()
|
||||
{
|
||||
static $nonce;
|
||||
|
||||
if (!$nonce) {
|
||||
$nonce = base64_encode(rand_string());
|
||||
$nonce = base64_encode(get_random_string(true));
|
||||
}
|
||||
|
||||
return $nonce;
|
||||
}
|
||||
|
||||
@@ -169,27 +185,38 @@ function page_messages($error) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Print HTML footer
|
||||
* @param string "auth", "db", "ns"
|
||||
* @return null
|
||||
*/
|
||||
function page_footer($missing = "") {
|
||||
/**
|
||||
* Prints HTML footer.
|
||||
*
|
||||
* @param $missing string "auth", "db", "ns"
|
||||
*/
|
||||
function page_footer($missing = "")
|
||||
{
|
||||
global $adminer, $token;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php switch_lang(); ?>
|
||||
<?php if ($missing != "auth") { ?>
|
||||
<form action="" method="post">
|
||||
<p class="logout">
|
||||
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" id="logout">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</p>
|
||||
</form>
|
||||
<?php } ?>
|
||||
<div id="menu">
|
||||
<?php $adminer->navigation($missing); ?>
|
||||
</div>
|
||||
echo "</div>"; // #content
|
||||
|
||||
echo "<div id='footer'>\n";
|
||||
switch_lang();
|
||||
|
||||
if ($missing != "auth") {
|
||||
?>
|
||||
|
||||
<div class="logout">
|
||||
<form action="" method="post">
|
||||
<?php echo h($_GET["username"]); ?>
|
||||
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" id="logout">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
echo "</div>\n";
|
||||
|
||||
echo "<div id='menu'>\n";
|
||||
$adminer->navigation($missing);
|
||||
echo "</div>\n";
|
||||
|
||||
echo script("setupSubmitHighlight(document);");
|
||||
}
|
||||
|
@@ -151,14 +151,6 @@ function get_driver($id) {
|
||||
return $idf;
|
||||
}
|
||||
|
||||
/** Convert operator so it can be used in search
|
||||
* @param string $operator
|
||||
* @return string
|
||||
*/
|
||||
function convertOperator($operator) {
|
||||
return $operator;
|
||||
}
|
||||
|
||||
/** Convert value returned by database to actual value
|
||||
* @param string
|
||||
* @param array
|
||||
|
@@ -274,65 +274,106 @@ function type_class($type) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Print table interior for fields editing
|
||||
* @param array
|
||||
* @param array
|
||||
* @param string TABLE or PROCEDURE
|
||||
* @param array returned by referencable_primary()
|
||||
* @return null
|
||||
*/
|
||||
function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = array()) {
|
||||
/**
|
||||
* Prints table interior for fields editing.
|
||||
*
|
||||
* @param string $type TABLE, FUNCTION or PROCEDURE
|
||||
* @param array $foreign_keys returned by referencable_primary()
|
||||
*/
|
||||
function edit_fields(array $fields, array $collations, $type = "TABLE", $foreign_keys = []) {
|
||||
global $inout;
|
||||
|
||||
$fields = array_values($fields);
|
||||
$default_class = (($_POST ? $_POST["defaults"] : adminer_setting("defaults")) ? "" : " class='hidden'");
|
||||
$comment_class = (($_POST ? $_POST["comments"] : adminer_setting("comments")) ? "" : " class='hidden'");
|
||||
$comment_class = ($_POST ? $_POST["comments"] : adminer_setting("comments")) ? "" : "class='hidden'";
|
||||
?>
|
||||
|
||||
<thead><tr>
|
||||
<?php if ($type == "PROCEDURE") { ?><td><?php } ?>
|
||||
<th id="label-name"><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?>
|
||||
<td id="label-type"><?php echo lang('Type'); ?><textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;"></textarea><?php echo script("qs('#enum-edit').onblur = editingLengthBlur;"); ?>
|
||||
<td id="label-length"><?php echo lang('Length'); ?>
|
||||
<td><?php echo lang('Options'); /* no label required, options have their own label */ ?>
|
||||
<?php if ($type == "TABLE") { ?>
|
||||
<td id="label-null">NULL
|
||||
<td><input type="radio" name="auto_increment_col" value=""><abbr id="label-ai" title="<?php echo lang('Auto Increment'); ?>">AI</abbr><?php echo doc_link(array(
|
||||
'sql' => "example-auto-increment.html",
|
||||
'mariadb' => "auto_increment/",
|
||||
'sqlite' => "autoinc.html",
|
||||
'pgsql' => "datatype-numeric.html#DATATYPE-SERIAL",
|
||||
'mssql' => "ms186775.aspx",
|
||||
)); ?>
|
||||
<td id="label-default"<?php echo $default_class; ?>><?php echo lang('Default value'); ?>
|
||||
<?php echo (support("comment") ? "<td id='label-comment'$comment_class>" . lang('Comment') : ""); ?>
|
||||
<?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) . ";"); ?>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (support("move_col")) {
|
||||
echo "<td class='jsonly'></td>";
|
||||
}
|
||||
if ($type == "PROCEDURE") {
|
||||
echo "<td></td>";
|
||||
}
|
||||
?>
|
||||
<th id="label-name"><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?></th>
|
||||
<td id="label-type"><?php echo lang('Type'); ?><textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;"></textarea><?php echo script("gid('enum-edit').onblur = editingLengthBlur;"); ?></td>
|
||||
<td id="label-length"><?php echo lang('Length'); ?></td>
|
||||
<td><?php echo lang('Options'); /* no label required, options have their own label */ ?></td>
|
||||
<?php if ($type == "TABLE") { ?>
|
||||
<td id="label-null">NULL</td>
|
||||
<td><input type="radio" name="auto_increment_col" value=""><abbr id="label-ai" title="<?php echo lang('Auto Increment'); ?>">AI</abbr><?php echo doc_link([
|
||||
'sql' => "example-auto-increment.html",
|
||||
'mariadb' => "auto_increment/",
|
||||
'sqlite' => "autoinc.html",
|
||||
'pgsql' => "datatype-numeric.html#DATATYPE-SERIAL",
|
||||
'mssql' => "ms186775.aspx",
|
||||
]); ?>
|
||||
</td>
|
||||
<td id="label-default"><?php echo lang('Default value'); ?></td>
|
||||
<?php echo (support("comment") ? "<td id='label-comment' $comment_class>" . lang('Comment') . "</td>" : ""); ?>
|
||||
<?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>
|
||||
</tr></thead>
|
||||
<?php
|
||||
echo script("mixin(qsl('tbody'), {onclick: editingClick, onkeydown: editingKeydown, oninput: editingInput});");
|
||||
echo "<tbody>\n";
|
||||
|
||||
foreach ($fields as $i => $field) {
|
||||
$i++;
|
||||
$orig = $field[($_POST ? "orig" : "field")];
|
||||
$display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !$_POST["drop_col"][$i])) && (support("drop_col") || $orig == "");
|
||||
?>
|
||||
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
|
||||
<?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 } ?>
|
||||
<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") { ?>
|
||||
<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 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 (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'>" : "");
|
||||
|
||||
$style = $display ? "" : "style='display: none;'";
|
||||
echo "<tr $style>\n";
|
||||
|
||||
if (support("move_col")) {
|
||||
echo "<th class='handle jsonly'></th>";
|
||||
}
|
||||
if ($type == "PROCEDURE") {
|
||||
echo "<td>", html_select("fields[$i][inout]", explode("|", $inout), $field["inout"]), "</td>\n";
|
||||
}
|
||||
|
||||
echo "<th>";
|
||||
if ($display) {
|
||||
echo "<input name='fields[$i][field]' value='", h($field["field"]), "' data-maxlength='64' autocapitalize='off' aria-labelledby='label-name'>";
|
||||
}
|
||||
echo "<input type='hidden' name='fields[$i][orig]' value='", h($orig), "'>";
|
||||
edit_type("fields[$i]", $field, $collations, $foreign_keys);
|
||||
echo "</th>\n";
|
||||
|
||||
if ($type == "TABLE") {
|
||||
echo "<td>", checkbox("fields[$i][null]", 1, $field["null"], "", "", "block", "label-null"), "</td>\n";
|
||||
|
||||
$checked = $field["auto_increment"] ? "checked" : "";
|
||||
echo "<td><label class='block'><input type='radio' name='auto_increment_col' value='$i' $checked aria-labelledby='label-ai'></label></td>\n";
|
||||
|
||||
echo "<td>",
|
||||
checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "label-default"),
|
||||
"<input name='fields[$i][default]' value='", h($field["default"]), "' aria-labelledby='label-default'>",
|
||||
"</td>\n";
|
||||
|
||||
if (support("comment")) {
|
||||
$max_length = min_version(5.5) ? 1024 : 255;
|
||||
echo "<td $comment_class>",
|
||||
"<input name='fields[$i][comment]' value='", h($field["comment"]), "' data-maxlength='$max_length' aria-labelledby='label-comment'>",
|
||||
"</td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<td>";
|
||||
echo (support("move_col") ?
|
||||
"<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'> "
|
||||
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='↑' title='" . lang('Move up') . "'> "
|
||||
. "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='↓' title='" . lang('Move down') . "'> "
|
||||
: "");
|
||||
echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "'>" : "");
|
||||
if (support("move_col")) {
|
||||
echo "<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'> ",
|
||||
"<input type='image' class='icon hidden' name='up[$i]' src='../adminer/static/up.gif' alt='↑' title='" . lang('Move up') . "'> ",
|
||||
"<input type='image' class='icon hidden' name='down[$i]' src='../adminer/static/down.gif' alt='↓' title='" . lang('Move down') . "'> ";
|
||||
}
|
||||
if ($orig == "" || support("drop_col")) {
|
||||
echo "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "'>";
|
||||
}
|
||||
echo "</td>\n</tr>\n";
|
||||
}
|
||||
|
||||
echo "</tbody>";
|
||||
echo script("mixin(qs('#edit-fields tbody'), {onclick: editingClick, onkeydown: editingKeydown, oninput: editingInput}); initSortable('#edit-fields tbody');");
|
||||
}
|
||||
|
||||
/** Move fields up and down or add field
|
||||
@@ -556,27 +597,39 @@ function ini_bytes($ini) {
|
||||
return $val;
|
||||
}
|
||||
|
||||
/** Create link to database documentation
|
||||
* @param array $jush => $path
|
||||
* @param string HTML code
|
||||
* @return string HTML code
|
||||
*/
|
||||
function doc_link($paths, $text = "<sup>?</sup>") {
|
||||
/**
|
||||
* Creates link to database documentation.
|
||||
*
|
||||
* @param array $paths $jush => $path
|
||||
* @param string $text HTML code
|
||||
*
|
||||
* @return string HTML code
|
||||
*/
|
||||
function doc_link(array $paths, $text = "<sup>?</sup>") {
|
||||
global $jush, $connection;
|
||||
|
||||
$server_info = $connection->server_info;
|
||||
$version = preg_replace('~^(\d\.?\d).*~s', '\1', $server_info); // two most significant digits
|
||||
$urls = array(
|
||||
|
||||
$urls = [
|
||||
'sql' => "https://dev.mysql.com/doc/refman/$version/en/",
|
||||
'sqlite' => "https://www.sqlite.org/",
|
||||
'pgsql' => "https://www.postgresql.org/docs/$version/",
|
||||
'mssql' => "https://msdn.microsoft.com/library/",
|
||||
'oracle' => "https://www.oracle.com/pls/topic/lookup?ctx=db" . preg_replace('~^.* (\d+)\.(\d+)\.\d+\.\d+\.\d+.*~s', '\1\2', $server_info) . "&id=",
|
||||
);
|
||||
'elastic' => "https://www.elastic.co/guide/en/elasticsearch/reference/$version/",
|
||||
];
|
||||
|
||||
if (preg_match('~MariaDB~', $server_info)) {
|
||||
$urls['sql'] = "https://mariadb.com/kb/en/library/";
|
||||
$urls['sql'] = "https://mariadb.com/kb/en/";
|
||||
$paths['sql'] = (isset($paths['mariadb']) ? $paths['mariadb'] : str_replace(".html", "/", $paths['sql']));
|
||||
}
|
||||
return ($paths[$jush] ? "<a href='" . h($urls[$jush] . $paths[$jush]) . "'" . target_blank() . ">$text</a>" : "");
|
||||
|
||||
if (!isset($paths[$jush]) || !$paths[$jush] ) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return "<a href='" . h($urls[$jush] . $paths[$jush]) . "'" . target_blank() . ">$text</a>";
|
||||
}
|
||||
|
||||
/** Wrap gzencode() for usage in ob_start()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/** Get database connection
|
||||
* @return Min_DB
|
||||
*/
|
||||
@@ -157,14 +158,6 @@ function h($string) {
|
||||
return str_replace("\0", "�", htmlspecialchars($string, ENT_QUOTES, 'utf-8'));
|
||||
}
|
||||
|
||||
/** Convert \n to <br>
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function nl_br($string) {
|
||||
return str_replace("\n", "<br>", $string); // nl2br() uses XHTML before PHP 5.3
|
||||
}
|
||||
|
||||
/** Generate HTML checkbox
|
||||
* @param string
|
||||
* @param string
|
||||
@@ -242,7 +235,7 @@ function html_select($name, $options, $value = "", $onchange = true, $labelled_b
|
||||
*/
|
||||
function select_input($attrs, $options, $value = "", $onchange = "", $placeholder = "") {
|
||||
$tag = ($options ? "select" : "input");
|
||||
return "<$tag$attrs" . ($options
|
||||
return "<$tag $attrs" . ($options
|
||||
? "><option value=''>$placeholder" . optionlist($options, $value, true) . "</select>"
|
||||
: " size='10' value='" . h($value) . "' placeholder='$placeholder'>"
|
||||
) . ($onchange ? script("qsl('$tag').onchange = $onchange;", "") : ""); //! use oninput for input
|
||||
@@ -257,18 +250,17 @@ function confirm($message = "", $selector = "qsl('input')") {
|
||||
return script("$selector.onclick = function () { return confirm('" . ($message ? js_escape($message) : lang('Are you sure?')) . "'); };", "");
|
||||
}
|
||||
|
||||
/** Print header for hidden fieldset (close by </div></fieldset>)
|
||||
* @param string
|
||||
* @param string
|
||||
* @param bool
|
||||
* @return null
|
||||
*/
|
||||
function print_fieldset($id, $legend, $visible = false) {
|
||||
/**
|
||||
* Prints header for hidden fieldset (close by </div></fieldset>)
|
||||
* @param $id string
|
||||
* @param $legend string
|
||||
*/
|
||||
function print_fieldset($id, $legend, $visible = false, $sortable = false) {
|
||||
echo "<fieldset><legend>";
|
||||
echo "<a href='#fieldset-$id'>$legend</a>";
|
||||
echo script("qsl('a').onclick = partial(toggle, 'fieldset-$id');", "");
|
||||
echo "</legend>";
|
||||
echo "<div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
|
||||
echo "<div id='fieldset-$id' class='" . ($visible ? "" : "hidden") . ($sortable ? " sortable" : "") . "'>\n";
|
||||
}
|
||||
|
||||
/** Return class='active' if $bold is true
|
||||
@@ -898,7 +890,7 @@ function hidden_fields_get() {
|
||||
*/
|
||||
function table_status1($table, $fast = false) {
|
||||
$return = table_status($table, $fast);
|
||||
return ($return ? $return : array("Name" => $table));
|
||||
return ($return ?: array("Name" => $table));
|
||||
}
|
||||
|
||||
/** Find out foreign keys for each column
|
||||
@@ -955,7 +947,7 @@ function input($field, $value, $function) {
|
||||
if (version_compare(PHP_VERSION, 5.4) >= 0) {
|
||||
$args[] = JSON_PRETTY_PRINT;
|
||||
}
|
||||
$value = call_user_func_array('json_encode', $args); //! requires PHP 5.2
|
||||
$value = call_user_func_array('json_encode', $args);
|
||||
$function = "json";
|
||||
}
|
||||
$reset = ($jush == "mssql" && $field["auto_increment"]);
|
||||
@@ -970,16 +962,16 @@ function input($field, $value, $function) {
|
||||
echo "<td class='function'>";
|
||||
|
||||
if ($field["type"] == "enum") {
|
||||
echo h($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
|
||||
echo h($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value, $function);
|
||||
} else {
|
||||
$has_function = (in_array($function, $functions) || isset($functions[$function]));
|
||||
echo (count($functions) > 1
|
||||
? "<select name='function[$name]' $disabled>" . optionlist($functions, $function === null || $has_function ? $function : "") . "</select>"
|
||||
. on_help("getTarget(event).value.replace(/^SQL\$/, '')", 1)
|
||||
. help_script_command("value.replace(/^SQL\$/, '')", true)
|
||||
. script("qsl('select').onchange = functionChange;", "")
|
||||
: h(reset($functions))
|
||||
) . '<td>';
|
||||
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
|
||||
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value, $function); // usage in call is without a table
|
||||
if ($input != "") {
|
||||
echo $input;
|
||||
} elseif (preg_match('~bool~', $field["type"])) {
|
||||
@@ -1013,7 +1005,8 @@ function input($field, $value, $function) {
|
||||
// type='date' and type='time' display localized value which may be confusing, type='datetime' uses 'T' as date and time separator
|
||||
echo "<input"
|
||||
. ((!$has_function || $function === "") && preg_match('~(?<!o)int(?!er)~', $field["type"]) && !preg_match('~\[\]~', $field["full_type"]) ? " type='number'" : "")
|
||||
. " value='" . h($value) . "'" . ($maxlength ? " data-maxlength='$maxlength'" : "")
|
||||
. ($function != "now" ? " value='" . h($value) . "'" : " data-last-value='" . h($value) . "'")
|
||||
. ($maxlength ? " data-maxlength='$maxlength'" : "")
|
||||
. (preg_match('~char|binary~', $field["type"]) && $maxlength > 20 ? " size='40'" : "")
|
||||
. "$attrs>"
|
||||
;
|
||||
@@ -1027,9 +1020,7 @@ function input($field, $value, $function) {
|
||||
}
|
||||
$first++;
|
||||
}
|
||||
if ($first) {
|
||||
echo script("mixin(qsl('td'), {onchange: partial(skipOriginal, $first), oninput: function () { this.onchange(); }});");
|
||||
}
|
||||
echo script("mixin(qsl('td'), {onchange: partial(skipOriginal, $first), oninput: function () { this.onchange(); }});");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1215,60 +1206,98 @@ function get_temp_dir() {
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Open and exclusively lock a file
|
||||
* @param string
|
||||
* @return resource or null for error
|
||||
*/
|
||||
function file_open_lock($filename) {
|
||||
$fp = @fopen($filename, "r+"); // @ - may not exist
|
||||
if (!$fp) { // c+ is available since PHP 5.2.6
|
||||
$fp = @fopen($filename, "w"); // @ - may not be writable
|
||||
if (!$fp) {
|
||||
return;
|
||||
}
|
||||
chmod($filename, 0660);
|
||||
/**
|
||||
* Opens and exclusively lock a file.
|
||||
*
|
||||
* @param string $filename
|
||||
* @return resource|null
|
||||
*/
|
||||
function open_file_with_lock($filename)
|
||||
{
|
||||
$file = fopen($filename, "c+");
|
||||
if (!$file) {
|
||||
return null;
|
||||
}
|
||||
flock($fp, LOCK_EX);
|
||||
return $fp;
|
||||
|
||||
chmod($filename, 0660);
|
||||
|
||||
if (!flock($file, LOCK_EX)) {
|
||||
fclose($file);
|
||||
return null;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/** Write and unlock a file
|
||||
* @param resource
|
||||
* @param string
|
||||
*/
|
||||
function file_write_unlock($fp, $data) {
|
||||
rewind($fp);
|
||||
fwrite($fp, $data);
|
||||
ftruncate($fp, strlen($data));
|
||||
flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
/**
|
||||
* Writes and unlocks a file.
|
||||
*
|
||||
* @param resource $file
|
||||
* @param string $data
|
||||
*/
|
||||
function write_and_unlock_file($file, $data)
|
||||
{
|
||||
rewind($file);
|
||||
fwrite($file, $data);
|
||||
ftruncate($file, strlen($data));
|
||||
|
||||
unlock_file($file);
|
||||
}
|
||||
|
||||
/** Read password from file adminer.key in temporary directory or create one
|
||||
* @param bool
|
||||
* @return string or false if the file can not be created
|
||||
*/
|
||||
function password_file($create) {
|
||||
/**
|
||||
* Unlocks and closes the file.
|
||||
*
|
||||
* @param resource $file
|
||||
*/
|
||||
function unlock_file($file)
|
||||
{
|
||||
flock($file, LOCK_UN);
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads password from file adminer.key in temporary directory or create one.
|
||||
*
|
||||
* @param $create bool
|
||||
* @return string|false Returns false if the file can not be created.
|
||||
* @throws \Random\RandomException
|
||||
*/
|
||||
function get_private_key($create)
|
||||
{
|
||||
$filename = get_temp_dir() . "/adminer.key";
|
||||
$return = @file_get_contents($filename); // @ - may not exist
|
||||
if ($return || !$create) {
|
||||
return $return;
|
||||
|
||||
if (!$create && !file_exists($filename)) {
|
||||
return false;
|
||||
}
|
||||
$fp = @fopen($filename, "w"); // @ - can have insufficient rights //! is not atomic
|
||||
if ($fp) {
|
||||
chmod($filename, 0660);
|
||||
$return = rand_string();
|
||||
fwrite($fp, $return);
|
||||
fclose($fp);
|
||||
|
||||
$file = open_file_with_lock($filename);
|
||||
if (!$file) {
|
||||
return false;
|
||||
}
|
||||
return $return;
|
||||
|
||||
$key = stream_get_contents($file);
|
||||
if (!$key) {
|
||||
$key = get_random_string();
|
||||
write_and_unlock_file($file, $key);
|
||||
} else {
|
||||
unlock_file($file);
|
||||
}
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
/** Get a random string
|
||||
* @return string 32 hexadecimal characters
|
||||
*/
|
||||
function rand_string() {
|
||||
return md5(uniqid(mt_rand(), true));
|
||||
/**
|
||||
* Returns a random 32 characters long string.
|
||||
*
|
||||
* @param $binary bool
|
||||
* @return string
|
||||
* @throws \Random\RandomException
|
||||
*/
|
||||
function get_random_string($binary = false)
|
||||
{
|
||||
$bytes = function_exists('random_bytes') ? random_bytes(32) : uniqid(mt_rand(), true);
|
||||
|
||||
return $binary ? $bytes : md5($bytes);
|
||||
}
|
||||
|
||||
/** Format value to use in select
|
||||
@@ -1288,7 +1317,7 @@ function select_value($val, $link, $field, $text_length) {
|
||||
. "<td>" . select_value($v, $link, $field, $text_length)
|
||||
;
|
||||
}
|
||||
return "<table cellspacing='0'>$return</table>";
|
||||
return "<table>$return</table>";
|
||||
}
|
||||
if (!$link) {
|
||||
$link = $adminer->selectLink($val, $field);
|
||||
@@ -1457,13 +1486,26 @@ function lzw_decompress($binary) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Return events to display help on mouse over
|
||||
* @param string JS expression
|
||||
* @param bool JS expression
|
||||
* @return string
|
||||
*/
|
||||
function on_help($command, $side = 0) {
|
||||
return script("mixin(qsl('select, input'), {onmouseover: function (event) { helpMouseover.call(this, event, $command, $side) }, onmouseout: helpMouseout});", "");
|
||||
/**
|
||||
* @param string $text Help text.
|
||||
* @param bool $side Side position.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function help_script($text, $side = false)
|
||||
{
|
||||
return script("initHelpFor(qsl('select, input'), '" . h($text) . "', $side);", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $command JS expression for returning the help text.
|
||||
* @param bool $side Side position.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function help_script_command($command, $side = false)
|
||||
{
|
||||
return script("initHelpFor(qsl('select, input'), (value) => { return $command; }, $side);", "");
|
||||
}
|
||||
|
||||
/** Print edit data form
|
||||
@@ -1557,7 +1599,7 @@ function edit_form($table, $fields, $row, $update) {
|
||||
}
|
||||
}
|
||||
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'>" . confirm() . "\n"
|
||||
: ($_POST || !$fields ? "" : script("focus(qsa('td', qs('#form'))[1].firstChild);"))
|
||||
: ($_POST || !$fields ? "" : script("focus(qsa('td', gid('form'))[1].firstChild);"))
|
||||
);
|
||||
if (isset($_GET["select"])) {
|
||||
hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));
|
||||
|
@@ -87,11 +87,11 @@ function lang($idf, $number = null) {
|
||||
|
||||
function switch_lang() {
|
||||
global $LANG, $langs;
|
||||
echo "<form action='' method='post'>\n<div id='lang'>";
|
||||
echo "<div id='lang'><form action='' method='post'>\n";
|
||||
echo lang('Language') . ": " . html_select("lang", $langs, $LANG, "this.form.submit();");
|
||||
echo " <input type='submit' value='" . lang('Use') . "' class='hidden'>\n";
|
||||
echo "<input type='hidden' name='token' value='" . get_token() . "'>\n"; // $token may be empty in auth.inc.php
|
||||
echo "</div>\n</form>\n";
|
||||
echo "</form></div>\n";
|
||||
}
|
||||
|
||||
if (isset($_POST["lang"]) && verify_token()) { // $error not yet available
|
||||
|
@@ -1,2 +1,2 @@
|
||||
<?php
|
||||
$VERSION = "4.9.3";
|
||||
$VERSION = "4.11";
|
||||
|
@@ -1,11 +1,14 @@
|
||||
<?php
|
||||
/** Adminer - Compact database management
|
||||
* @link https://www.adminer.org/
|
||||
* @author Jakub Vrana, https://www.vrana.cz/
|
||||
* @copyright 2007 Jakub Vrana
|
||||
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
||||
*/
|
||||
/**
|
||||
* Adminer - Database management in a single PHP file
|
||||
*
|
||||
* @link https://github.com/pematon/adminer
|
||||
* @author Jakub Vrana (https://www.vrana.cz/)
|
||||
* @author Peter Knut
|
||||
* @copyright 2007-2021 Jakub Vrana, 2024 Peter Knut
|
||||
* @license Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
|
||||
* @license GNU General Public License, version 2 (https://www.gnu.org/licenses/gpl-2.0.html)
|
||||
*/
|
||||
|
||||
include "./include/bootstrap.inc.php";
|
||||
include "./include/tmpfile.inc.php";
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'تسجيل الدخول',
|
||||
'Logout successful.' => 'تم تسجيل الخروج بنجاح.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -188,6 +189,7 @@ $translations = array(
|
||||
'Clone' => 'نسخ',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'لقد تجاوزت العدد الأقصى للحقول. يرجى الرفع من %s.',
|
||||
'Partition by' => 'مقسم بواسطة',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'التقسيمات',
|
||||
'Partition name' => 'اسم التقسيم',
|
||||
'Values' => 'القيم',
|
||||
@@ -223,6 +225,7 @@ $translations = array(
|
||||
'Databases have been dropped.' => 'تم حذف قواعد البيانات.',
|
||||
'Database has been dropped.' => 'تم حذف قاعدة البيانات.',
|
||||
'Search data in tables' => 'بحث في الجداول',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'المخطط',
|
||||
'Alter schema' => 'تعديل المخطط',
|
||||
'Create schema' => 'إنشاء مخطط',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Система',
|
||||
'Server' => 'Сървър',
|
||||
'Username' => 'Потребител',
|
||||
@@ -176,6 +177,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Максималния брой полета е превишен. Моля, увеличете %s.',
|
||||
|
||||
'Partition by' => 'Разделяне на',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Раздели',
|
||||
'Partition name' => 'Име на раздела',
|
||||
'Values' => 'Стойности',
|
||||
@@ -230,6 +232,7 @@ $translations = array(
|
||||
'Search' => 'Търсене',
|
||||
'anywhere' => 'навсякъде',
|
||||
'Search data in tables' => 'Търсене на данни в таблиците',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Сортиране',
|
||||
'descending' => 'низходящо',
|
||||
'Limit' => 'Редове',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'লগইন',
|
||||
'Logout successful.' => 'সফলভাবে লগআউট হয়েছে।',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Clone' => 'ক্লোন',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'অনুমোদিত ফিল্ড এর সর্বাধিক সংখ্যা অতিক্রম করে গেছে। অনুগ্রহপূর্বক %s বৃদ্ধি করুন।',
|
||||
'Partition by' => 'পার্টিশন যার মাধ্যমে',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'পার্টিশন',
|
||||
'Partition name' => 'পার্টিশনের নাম',
|
||||
'Values' => 'মানসমূহ',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'স্থায়ী লগইন',
|
||||
'Databases have been dropped.' => 'ডাটাবেজসমূহ মুছে ফেলা হয়েছে।',
|
||||
'Search data in tables' => 'টেবিলে তথ্য খুঁজুন',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'স্কিমা',
|
||||
'Alter schema' => 'স্কিমা পরিবর্তন করো',
|
||||
'Create schema' => 'স্কিমা তৈরী করো',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Server',
|
||||
'Username' => 'Korisničko ime',
|
||||
@@ -167,6 +168,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Premašen je maksimalni broj dozvoljenih polja. Molim uvećajte %s.',
|
||||
|
||||
'Partition by' => 'Podijeli po',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Podijele',
|
||||
'Partition name' => 'Ime podijele',
|
||||
'Values' => 'Vrijednosti',
|
||||
@@ -221,6 +223,7 @@ $translations = array(
|
||||
'Search' => 'Pretraga',
|
||||
'anywhere' => 'bilo gdje',
|
||||
'Search data in tables' => 'Pretraži podatke u tabelama',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Poređaj',
|
||||
'descending' => 'opadajuće',
|
||||
'Limit' => 'Granica',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Inicia la sessió',
|
||||
'Logout successful.' => 'Desconnexió correcta.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -189,6 +190,7 @@ $translations = array(
|
||||
'Tables have been dropped.' => 'S\'han suprimit les taules.',
|
||||
'Clone' => 'Clona',
|
||||
'Partition by' => 'Fes particions segons',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Particions',
|
||||
'Partition name' => 'Nom de la partició',
|
||||
'Values' => 'Valors',
|
||||
@@ -251,6 +253,7 @@ $translations = array(
|
||||
'Type has been created.' => 'S\'ha creat el tipus.',
|
||||
'Alter type' => 'Modifica el tipus',
|
||||
'Search data in tables' => 'Cerca dades en les taules',
|
||||
'as a regular expression' => null,
|
||||
'From server' => 'En el servidor',
|
||||
'empty' => 'buit',
|
||||
'now' => 'ara',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => 'Domů',
|
||||
'System' => 'Systém',
|
||||
'Server' => 'Server',
|
||||
'Username' => 'Uživatel',
|
||||
@@ -189,6 +190,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s.',
|
||||
|
||||
'Partition by' => 'Rozdělit podle',
|
||||
'Partition' => 'Oddíl',
|
||||
'Partitions' => 'Oddíly',
|
||||
'Partition name' => 'Název oddílu',
|
||||
'Values' => 'Hodnoty',
|
||||
@@ -243,6 +245,7 @@ $translations = array(
|
||||
'Search' => 'Vyhledat',
|
||||
'anywhere' => 'kdekoliv',
|
||||
'Search data in tables' => 'Vyhledat data v tabulkách',
|
||||
'as a regular expression' => 'jako regulární výraz',
|
||||
'Sort' => 'Seřadit',
|
||||
'descending' => 'sestupně',
|
||||
'Limit' => 'Limit',
|
||||
@@ -256,8 +259,8 @@ $translations = array(
|
||||
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
|
||||
'Page' => 'Stránka',
|
||||
'last' => 'poslední',
|
||||
'Load more data' => 'Nahrát další data',
|
||||
'Loading' => 'Nahrává se',
|
||||
'Load more data' => 'Načíst další data',
|
||||
'Loading' => 'Načítá se',
|
||||
'Whole result' => 'Celý výsledek',
|
||||
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtů'),
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'System' => 'System',
|
||||
'Server' => 'Server',
|
||||
'Username' => 'Brugernavn',
|
||||
@@ -151,6 +152,7 @@ $translations = array(
|
||||
'Remove' => 'Fjern',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Maksimum antal feltnavne overskredet - øg venligst %s.',
|
||||
'Partition by' => 'Partition ved',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partitioner',
|
||||
'Partition name' => 'Partitionsnavn',
|
||||
'Values' => 'Værdier',
|
||||
@@ -199,6 +201,7 @@ $translations = array(
|
||||
'Search' => 'Søg',
|
||||
'anywhere' => 'hvorsomhelst',
|
||||
'Search data in tables' => 'Søg data i tabeller',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Sorter',
|
||||
'descending' => 'faldende',
|
||||
'Limit' => 'Limit',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Login',
|
||||
'Logout successful.' => 'Abmeldung erfolgreich.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Danke, dass Sie Adminer genutzt haben. <a href="https://www.adminer.org/de/donation/">Spenden willkommen!</a>',
|
||||
@@ -191,6 +192,7 @@ $translations = array(
|
||||
'Clone' => 'Klonen',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Die maximal erlaubte Anzahl der Felder ist überschritten. Bitte %s erhöhen.',
|
||||
'Partition by' => 'Partitionieren um',
|
||||
'Partition' => 'Partition',
|
||||
'Partitions' => 'Partitionen',
|
||||
'Partition name' => 'Name der Partition',
|
||||
'Values' => 'Werte',
|
||||
@@ -225,6 +227,7 @@ $translations = array(
|
||||
'Permanent login' => 'Passwort speichern',
|
||||
'Databases have been dropped.' => 'Datenbanken wurden entfernt.',
|
||||
'Search data in tables' => 'Suche in Tabellen',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'Schema',
|
||||
'Alter schema' => 'Schema ändern',
|
||||
'Create schema' => 'Schema erstellen',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Σύστημα',
|
||||
'Server' => 'Διακομιστής',
|
||||
'Username' => 'Όνομα Χρήστη',
|
||||
@@ -177,6 +178,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Υπέρβαση μέγιστου επιτρεπόμενου αριθμού πεδίων. Παρακαλώ αυξήστε %s.',
|
||||
|
||||
'Partition by' => 'Τμηματοποίηση ανά',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Τμήματα',
|
||||
'Partition name' => 'Όνομα Τμήματος',
|
||||
'Values' => 'Τιμές',
|
||||
@@ -231,6 +233,7 @@ $translations = array(
|
||||
'Search' => 'Αναζήτηση',
|
||||
'anywhere' => 'παντού',
|
||||
'Search data in tables' => 'Αναζήτηση δεδομένων στους πίνακες',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Ταξινόμηση',
|
||||
'descending' => 'Φθίνουσα',
|
||||
'Limit' => 'Όριο',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Login',
|
||||
'Logout successful.' => 'Sesión finalizada con éxito.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Clone' => 'Clonar',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Excedida la cantidad máxima de campos permitidos. Por favor aumente %s.',
|
||||
'Partition by' => 'Particionar por',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Particiones',
|
||||
'Partition name' => 'Nombre de partición',
|
||||
'Values' => 'Valores',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Guardar contraseña',
|
||||
'Databases have been dropped.' => 'Bases de datos eliminadas.',
|
||||
'Search data in tables' => 'Buscar datos en tablas',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'Esquema',
|
||||
'Alter schema' => 'Modificar esquema',
|
||||
'Create schema' => 'Crear esquema',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Logi sisse',
|
||||
'Logout successful.' => 'Väljalogimine õnnestus.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Clone' => 'Kloon',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Maksimaalne väljade arv ületatud. Palun suurendage %s.',
|
||||
'Partition by' => 'Partitsiooni',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partitsioonid',
|
||||
'Partition name' => 'Partitsiooni nimi',
|
||||
'Values' => 'Väärtused',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Jäta mind meelde',
|
||||
'Databases have been dropped.' => 'Andmebaasid on edukalt kustutatud.',
|
||||
'Search data in tables' => 'Otsi kogu andmebaasist',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'Struktuur',
|
||||
'Alter schema' => 'Muuda struktuuri',
|
||||
'Create schema' => 'Loo struktuur',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'سیستم',
|
||||
'Server' => 'سرور',
|
||||
'Username' => 'نام کاربری',
|
||||
@@ -175,6 +176,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'حداکثر تعداد فیلدهای مجاز اشباع شد. لطفا %s را افزایش دهید.',
|
||||
|
||||
'Partition by' => 'بخشبندی توسط',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'بخشبندیها',
|
||||
'Partition name' => 'نام بخش',
|
||||
'Values' => 'مقادیر',
|
||||
@@ -229,6 +231,7 @@ $translations = array(
|
||||
'Search' => 'جستجو',
|
||||
'anywhere' => 'هرکجا',
|
||||
'Search data in tables' => 'جستجوی داده در جدول',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'مرتب کردن',
|
||||
'descending' => 'نزولی',
|
||||
'Limit' => 'محدودیت',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Järjestelmä',
|
||||
'Server' => 'Palvelin',
|
||||
'Username' => 'Käyttäjänimi',
|
||||
@@ -177,6 +178,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Kenttien sallittu enimmäismäärä ylitetty. Kasvata arvoa %s.',
|
||||
|
||||
'Partition by' => 'Osioi arvolla',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Osiot',
|
||||
'Partition name' => 'Osion nimi',
|
||||
'Values' => 'Arvot',
|
||||
@@ -231,6 +233,7 @@ $translations = array(
|
||||
'Search' => 'Hae',
|
||||
'anywhere' => 'kaikkialta',
|
||||
'Search data in tables' => 'Hae dataa tauluista',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Lajittele',
|
||||
'descending' => 'alenevasti',
|
||||
'Limit' => 'Raja',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Authentification',
|
||||
'Logout successful.' => 'Au revoir !',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -188,6 +189,7 @@ $translations = array(
|
||||
'Clone' => 'Cloner',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Le nombre maximum de champs est dépassé. Veuillez augmenter %s.',
|
||||
'Partition by' => 'Partitionner par',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partitions',
|
||||
'Partition name' => 'Nom de la partition',
|
||||
'Values' => 'Valeurs',
|
||||
@@ -223,6 +225,7 @@ $translations = array(
|
||||
'Databases have been dropped.' => 'Les bases de données ont été supprimées.',
|
||||
'Database has been dropped.' => 'La base de données a été supprimée.',
|
||||
'Search data in tables' => 'Rechercher dans les tables',
|
||||
'as a regular expression' => 'sous forme d\'expression régulière',
|
||||
'Schema' => 'Schéma',
|
||||
'Alter schema' => 'Modifier le schéma',
|
||||
'Create schema' => 'Créer un schéma',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Conectar',
|
||||
'Logout successful.' => 'Pechouse a sesión con éxito.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Clone' => 'Clonar',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Excedida o número máximo de campos permitidos. Por favor aumente %s.',
|
||||
'Partition by' => 'Particionar por',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Particións',
|
||||
'Partition name' => 'Nome da Partición',
|
||||
'Values' => 'Valores',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Permanecer conectado',
|
||||
'Databases have been dropped.' => 'Elimináronse as bases de datos.',
|
||||
'Search data in tables' => 'Buscar datos en táboas',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'Esquema',
|
||||
'Alter schema' => 'Modificar esquema',
|
||||
'Create schema' => 'Crear esquema',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'התחברות',
|
||||
'Logout successful.' => 'ההתחברות הצליחה',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -188,6 +189,7 @@ $translations = array(
|
||||
'Clone' => 'שכפל',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'הגעת למספר השדות המרבי. בבקשה הגדל את %s',
|
||||
'Partition by' => 'מחיצות ע"י',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'מחיצות',
|
||||
'Partition name' => 'שם מחיצה',
|
||||
'Values' => 'ערכים',
|
||||
@@ -223,6 +225,7 @@ $translations = array(
|
||||
'Databases have been dropped.' => 'מסד הנתונים הושלך',
|
||||
'Database has been dropped.' => 'מסד הנתונים הושלך',
|
||||
'Search data in tables' => 'חפש מידע בטבלאות',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'סכמה',
|
||||
'Alter schema' => 'שנה סכמה',
|
||||
'Create schema' => 'צור סכמה',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Belépés',
|
||||
'Logout successful.' => 'Sikeres kilépés.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -189,6 +190,7 @@ $translations = array(
|
||||
'Tables have been dropped.' => 'Táblák eldobva.',
|
||||
'Clone' => 'Klónoz',
|
||||
'Partition by' => 'Particionálás ezzel',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Particiók',
|
||||
'Partition name' => 'Partició neve',
|
||||
'Values' => 'Értékek',
|
||||
@@ -250,6 +252,7 @@ $translations = array(
|
||||
'Type has been created.' => 'Típus létrehozva.',
|
||||
'Alter type' => 'Típus módosítása',
|
||||
'Search data in tables' => 'Keresés a táblákban',
|
||||
'as a regular expression' => null,
|
||||
'From server' => 'Szerverről',
|
||||
'empty' => 'üres',
|
||||
'now' => 'most',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Server',
|
||||
'Username' => 'Pengguna',
|
||||
@@ -167,6 +168,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Sudah lebih dumlah ruas maksimum yang diizinkan. Harap naikkan %s.',
|
||||
|
||||
'Partition by' => 'Partisi menurut',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partisi',
|
||||
'Partition name' => 'Nama partisi',
|
||||
'Values' => 'Nilai',
|
||||
@@ -220,6 +222,7 @@ $translations = array(
|
||||
'Search' => 'Cari',
|
||||
'anywhere' => 'di mana pun',
|
||||
'Search data in tables' => 'Cari data dalam tabel',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Urutkan',
|
||||
'descending' => 'menurun',
|
||||
'Limit' => 'Batas',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Autenticazione',
|
||||
'Logout successful.' => 'Uscita effettuata con successo.',
|
||||
'Invalid server or credentials.' => 'Server o credenziali non valide.',
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Clone' => 'Clona',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Troppi campi. Per favore aumentare %s.',
|
||||
'Partition by' => 'Partiziona per',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partizioni',
|
||||
'Partition name' => 'Nome partizione',
|
||||
'Values' => 'Valori',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Login permanente',
|
||||
'Databases have been dropped.' => 'Database eliminati.',
|
||||
'Search data in tables' => 'Cerca nelle tabelle',
|
||||
'as a regular expression' => 'come espressione regolare',
|
||||
'Schema' => 'Schema',
|
||||
'Alter schema' => 'Modifica schema',
|
||||
'Create schema' => 'Crea schema',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'ログイン',
|
||||
'Logout successful.' => 'ログアウト',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -189,6 +190,7 @@ $translations = array(
|
||||
'Clone' => 'クローン',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => '定義可能な最大フィールド数を越えました。%s を増やしてください。',
|
||||
'Partition by' => 'パーティション',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'パーティション',
|
||||
'Partition name' => 'パーティション名',
|
||||
'Values' => '値',
|
||||
@@ -225,6 +227,7 @@ $translations = array(
|
||||
'Permanent login' => '永続的にログイン',
|
||||
'Databases have been dropped.' => 'データベースを削除しました',
|
||||
'Search data in tables' => 'データを検索する',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'スキーマ',
|
||||
'Alter schema' => 'スキーマ変更',
|
||||
'Create schema' => 'スキーマ追加',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'შესვლა',
|
||||
'Logout successful.' => 'გამოხვედით სისტემიდან.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -187,6 +188,7 @@ $translations = array(
|
||||
'Tables have been dropped.' => 'ცხრილები წაიშალა.',
|
||||
'Clone' => 'კლონირება',
|
||||
'Partition by' => 'დაყოფა',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'დანაყოფები',
|
||||
'Partition name' => 'დანაყოფის სახელი',
|
||||
'Values' => 'პარამეტრები',
|
||||
@@ -220,6 +222,7 @@ $translations = array(
|
||||
'Permanent login' => 'სისტემაში დარჩენა',
|
||||
'Databases have been dropped.' => 'ბაზა წაიშალა.',
|
||||
'Search data in tables' => 'ცხრილებში ძებნა',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'სქემა',
|
||||
'Alter schema' => 'სქემის შეცვლა',
|
||||
'Create schema' => 'ახალი სქემა',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'$1-$3-$5' => '$1-$3-$5',
|
||||
'%.3f s' => '%.3f 초',
|
||||
'%d byte(s)' => '%d 바이트',
|
||||
@@ -172,6 +173,7 @@ $translations = array(
|
||||
'Parameter name' => '매개변수 이름',
|
||||
'Partition by' => '파티션',
|
||||
'Partition name' => '파티션 이름',
|
||||
'Partition' => null,
|
||||
'Partitions' => '파티션',
|
||||
'Password' => '비밀번호',
|
||||
'Permanent link' => '영구적으로 링크',
|
||||
@@ -204,6 +206,7 @@ $translations = array(
|
||||
'Schema has been dropped.' => '스키마를 삭제했습니다.',
|
||||
'Schema' => '스키마',
|
||||
'Search data in tables' => '테이블 내 데이터 검색',
|
||||
'as a regular expression' => null,
|
||||
'Search' => '검색',
|
||||
'Select data' => '데이터를 선택하십시오.',
|
||||
'Select database' => '데이터베이스를 선택하십시오.',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Sistema',
|
||||
'Server' => 'Serveris',
|
||||
'Username' => 'Vartotojas',
|
||||
@@ -166,6 +167,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Viršytas maksimalus leidžiamų stulpelių kiekis. Padidinkite %s.',
|
||||
|
||||
'Partition by' => 'Skirstyti pagal',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Skirsniai',
|
||||
'Partition name' => 'Skirsnio pavadinimas',
|
||||
'Values' => 'Reikšmės',
|
||||
@@ -219,6 +221,7 @@ $translations = array(
|
||||
'Search' => 'Ieškoti',
|
||||
'anywhere' => 'visur',
|
||||
'Search data in tables' => 'Ieškoti duomenų lentelėse',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Rikiuoti',
|
||||
'descending' => 'mažėjimo tvarka',
|
||||
'Limit' => 'Limitas',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Ieiet',
|
||||
'Logout successful.' => 'Jūs veiksmīgi izgājāt no sistēmas.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -189,6 +190,7 @@ $translations = array(
|
||||
'Tables have been dropped.' => 'Tabulas dzēstas.',
|
||||
'Clone' => 'Klonēt',
|
||||
'Partition by' => 'Sadalīt pēc',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partīcijas',
|
||||
'Partition name' => 'Partīcijas nosaukums',
|
||||
'Values' => 'Vērtības',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Atcerēties mani',
|
||||
'Databases have been dropped.' => 'Datubāzes dzēstas.',
|
||||
'Search data in tables' => 'Meklēt tabulās',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'Shēma',
|
||||
'Alter schema' => 'Izmainīt shēmu',
|
||||
'Create schema' => 'Jauna shēma',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Pelayan',
|
||||
'Username' => 'Nama pengguna',
|
||||
@@ -181,6 +182,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Bilangan medan telah melebihi had yang dibenarkan. Sila tingkatkan %s.',
|
||||
|
||||
'Partition by' => 'Partition mengikut',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partition',
|
||||
'Partition name' => 'Nama partition',
|
||||
'Values' => 'Nilai',
|
||||
@@ -235,6 +237,7 @@ $translations = array(
|
||||
'Search' => 'Cari',
|
||||
'anywhere' => 'di mana-mana',
|
||||
'Search data in tables' => 'Cari data dalam jadual',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Susun',
|
||||
'descending' => 'menurun',
|
||||
'Limit' => 'Had',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Aanmelden',
|
||||
'Logout successful.' => 'Successvol afgemeld.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -191,6 +192,7 @@ $translations = array(
|
||||
'Clone' => 'Dupliceer',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Maximum aantal velden bereikt. Verhoog %s.',
|
||||
'Partition by' => 'Partitioneren op',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partities',
|
||||
'Partition name' => 'Partitie naam',
|
||||
'Values' => 'Waarden',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'%d in total' => '%d in totaal',
|
||||
'Permanent login' => 'Blijf aangemeld',
|
||||
'Search data in tables' => 'Zoeken in database',
|
||||
'as a regular expression' => 'als een regular expression',
|
||||
'Schema' => 'Schema',
|
||||
'Alter schema' => 'Schema wijzigen',
|
||||
'Create schema' => 'Schema maken',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'System' => 'System',
|
||||
'Server' => 'Server',
|
||||
'Username' => 'Brukernavn',
|
||||
@@ -151,6 +152,7 @@ $translations = array(
|
||||
'Remove' => 'Fjern',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Maksimum antall feltnavn overskredet - venligst øk %s.',
|
||||
'Partition by' => 'Partisjoner ved',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partisjoner',
|
||||
'Partition name' => 'Partisjonsnavn',
|
||||
'Values' => 'Verdier',
|
||||
@@ -199,6 +201,7 @@ $translations = array(
|
||||
'Search' => 'Søk',
|
||||
'anywhere' => 'hvorsomhelst',
|
||||
'Search data in tables' => 'Søk data i tabeller',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Sorter',
|
||||
'descending' => 'minkende',
|
||||
'Limit' => 'Skranke',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Rodzaj bazy',
|
||||
'Server' => 'Serwer',
|
||||
'Username' => 'Użytkownik',
|
||||
@@ -180,6 +181,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Przekroczono maksymalną liczbę pól. Zwiększ %s.',
|
||||
|
||||
'Partition by' => 'Partycjonowanie',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partycje',
|
||||
'Partition name' => 'Nazwa partycji',
|
||||
'Values' => 'Wartości',
|
||||
@@ -234,6 +236,7 @@ $translations = array(
|
||||
'Search' => 'Szukaj',
|
||||
'anywhere' => 'gdziekolwiek',
|
||||
'Search data in tables' => 'Wyszukaj we wszystkich tabelach',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Sortuj',
|
||||
'descending' => 'malejąco',
|
||||
'Limit' => 'Limit',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Entrar',
|
||||
'Logout successful.' => 'Saída bem sucedida.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Clone' => 'Clonar',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Quantidade máxima de campos permitidos excedidos. Por favor aumente %s.',
|
||||
'Partition by' => 'Particionar por',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partições',
|
||||
'Partition name' => 'Nome da Partição',
|
||||
'Values' => 'Valores',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Login permanente',
|
||||
'Databases have been dropped.' => 'A Base de dados foi apagada.',
|
||||
'Search data in tables' => 'Buscar dados nas Tabelas',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'Esquema',
|
||||
'Alter schema' => 'Alterar esquema',
|
||||
'Create schema' => 'Criar esquema',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Entrar',
|
||||
'Logout successful.' => 'Sessão terminada com sucesso.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Clone' => 'Clonar',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Quantidade máxima de campos permitidos excedidos. Por favor aumente %s.',
|
||||
'Partition by' => 'Particionar por',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partições',
|
||||
'Partition name' => 'Nome da Partição',
|
||||
'Values' => 'Valores',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Memorizar a senha',
|
||||
'Databases have been dropped.' => 'Bases de dados eliminadas.',
|
||||
'Search data in tables' => 'Pesquisar dados nas Tabelas',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'Esquema',
|
||||
'Alter schema' => 'Modificar esquema',
|
||||
'Create schema' => 'Criar esquema',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Intră',
|
||||
'Logout successful.' => 'Ați ieșit cu succes.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -189,6 +190,7 @@ $translations = array(
|
||||
'Tables have been dropped.' => 'Tabelele au fost șterse.',
|
||||
'Clone' => 'Clonează',
|
||||
'Partition by' => 'Împarte',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Secțiuni',
|
||||
'Partition name' => 'Denumirea secțiunii',
|
||||
'Values' => 'Parametru',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Logare permanentă',
|
||||
'Databases have been dropped.' => 'Bazele de date au fost șterse.',
|
||||
'Search data in tables' => 'Caută în tabele',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'Schema',
|
||||
'Alter schema' => 'Modifică schema',
|
||||
'Create schema' => 'Crează o schemă',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'Войти',
|
||||
'Logout successful.' => 'Вы успешно покинули систему.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -189,6 +190,7 @@ $translations = array(
|
||||
'Tables have been dropped.' => 'Таблицы были удалены.',
|
||||
'Clone' => 'Клонировать',
|
||||
'Partition by' => 'Разделить по',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Разделы',
|
||||
'Partition name' => 'Название раздела',
|
||||
'Values' => 'Параметры',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Оставаться в системе',
|
||||
'Databases have been dropped.' => 'Базы данных удалены.',
|
||||
'Search data in tables' => 'Поиск в таблицах',
|
||||
'as a regular expression' => 'как регулярное выражение',
|
||||
'Schema' => 'Схема',
|
||||
'Alter schema' => 'Изменить схему',
|
||||
'Create schema' => 'Новая схема',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => 'Domov',
|
||||
'Login' => 'Prihlásiť sa',
|
||||
'Logout successful.' => 'Odhlásenie prebehlo v poriadku.',
|
||||
'Invalid server or credentials.' => 'Neplatný server alebo prihlasovacie údaje.',
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Whole result' => 'Celý výsledok',
|
||||
'Clone' => 'Klonovať',
|
||||
'Partition by' => 'Rozdeliť podľa',
|
||||
'Partition' => 'Oddiel',
|
||||
'Partitions' => 'Oddiely',
|
||||
'Partition name' => 'Názov oddielu',
|
||||
'Values' => 'Hodnoty',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'Trvalé prihlásenie',
|
||||
'%d in total' => '%d celkom',
|
||||
'Search data in tables' => 'Vyhľadať dáta v tabuľkách',
|
||||
'as a regular expression' => 'ako regulárny výraz',
|
||||
'Alter schema' => 'Pozmeniť schému',
|
||||
'Create schema' => 'Vytvoriť schému',
|
||||
'Schema has been dropped.' => 'Schéma bola odstránená.',
|
||||
@@ -274,8 +277,8 @@ $translations = array(
|
||||
'DB' => 'DB',
|
||||
'File must be in UTF-8 encoding.' => 'Súbor musí byť v kódovaní UTF-8.',
|
||||
'Modify' => 'Zmeniť',
|
||||
'Load more data' => 'Nahráť ďalšie dáta',
|
||||
'Loading' => 'Nahráva sa',
|
||||
'Load more data' => 'Načítať ďalšie dáta',
|
||||
'Loading' => 'Načítava sa',
|
||||
'ATTACH queries are not supported.' => 'Dotazy ATTACH nie sú podporované.',
|
||||
'Warnings' => 'Varovania',
|
||||
'%d / ' => '%d / ',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Strežnik',
|
||||
'Username' => 'Uporabniško ime',
|
||||
@@ -162,6 +163,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Največje število dovoljenih polje je preseženo. Prosimo, povečajte %s.',
|
||||
|
||||
'Partition by' => 'Porazdeli po',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Porazdelitve',
|
||||
'Partition name' => 'Ime porazdelitve',
|
||||
'Values' => 'Vrednosti',
|
||||
@@ -215,6 +217,7 @@ $translations = array(
|
||||
'Search' => 'Išči',
|
||||
'anywhere' => 'kjerkoli',
|
||||
'Search data in tables' => 'Išče podatke po tabelah',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Sortiraj',
|
||||
'descending' => 'padajoče',
|
||||
'Limit' => 'Limita',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Систем',
|
||||
'Server' => 'Сервер',
|
||||
'Username' => 'Корисничко име',
|
||||
@@ -167,6 +168,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Премашен је максимални број дозвољених поља. Молим увећајте %s.',
|
||||
|
||||
'Partition by' => 'Подели по',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Поделе',
|
||||
'Partition name' => 'Име поделе',
|
||||
'Values' => 'Вредности',
|
||||
@@ -220,6 +222,7 @@ $translations = array(
|
||||
'Search' => 'Претрага',
|
||||
'anywhere' => 'било где',
|
||||
'Search data in tables' => 'Претражи податке у табелама',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Поређај',
|
||||
'descending' => 'опадајуће',
|
||||
'Limit' => 'Граница',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'System',
|
||||
'Server' => 'Server',
|
||||
'Username' => 'Användarnamn',
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Högsta nummer tillåtna fält är överskridet. Vänligen höj %s.',
|
||||
|
||||
'Partition by' => 'Partitionera om',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Partitioner',
|
||||
'Partition name' => 'Partition',
|
||||
'Values' => 'Värden',
|
||||
@@ -244,6 +246,7 @@ $translations = array(
|
||||
'Search' => 'Sök',
|
||||
'anywhere' => 'överallt',
|
||||
'Search data in tables' => 'Sök data i tabeller',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Sortera',
|
||||
'descending' => 'Fallande',
|
||||
'Limit' => 'Begränsning',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'நுழை',
|
||||
'Logout successful.' => 'வெற்றிகரமாய் வெளியேறியாயிற்று.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -187,6 +188,7 @@ $translations = array(
|
||||
'Clone' => 'நகலி (Clone)',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'அனுமதிக்கப்பட்ட அதிகபட்ச கோப்புகளின் எண்ணிக்கை மீறப்பட்டது. தயவு செய்து %s மற்றும் %s யை அதிகரிக்கவும்.',
|
||||
'Partition by' => 'பிரித்தது',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'பிரிவுகள்',
|
||||
'Partition name' => 'பிரிவின் பெயர்',
|
||||
'Values' => 'மதிப்புகள்',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Alter schema' => 'அமைப்புமுறையை மாற்று',
|
||||
'Create schema' => 'அமைப்புமுறையை உருவாக்கு',
|
||||
'Search data in tables' => 'தகவலை அட்டவணையில் தேடு',
|
||||
'as a regular expression' => null,
|
||||
'Sequences' => 'வரிசைமுறை',
|
||||
'Create sequence' => 'வரிசைமுறையை உருவாக்கு',
|
||||
'User types' => 'பயனாளர் வகைகள்',
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Home' => null,
|
||||
'Login' => 'เข้าสู่ระบบ',
|
||||
'Logout successful.' => 'ออกจากระบบเรียบร้อยแล้ว.',
|
||||
'Invalid server or credentials.' => null,
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Clone' => 'ทำซ้ำ',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'จำนวนสูงสุดของฟิลด์อนุญาตให้เกิน กรุณาเพิ่มอีก %s.',
|
||||
'Partition by' => 'พาร์ทิชันโดย',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'พาร์ทิชัน',
|
||||
'Partition name' => 'ชื่อของพาร์ทิชัน',
|
||||
'Values' => 'ค่า',
|
||||
@@ -224,6 +226,7 @@ $translations = array(
|
||||
'Permanent login' => 'จดจำการเข้าสู่ระบบตลอดไป',
|
||||
'Databases have been dropped.' => 'ฐานข้อมูลถูกลบแล้ว.',
|
||||
'Search data in tables' => 'ค้นหาในตาราง',
|
||||
'as a regular expression' => null,
|
||||
'Schema' => 'Schema',
|
||||
'Alter schema' => 'เปลี่ยนแปลง schema',
|
||||
'Create schema' => 'สร้าง schema',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Sunucu',
|
||||
'Username' => 'Kullanıcı',
|
||||
@@ -184,6 +185,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'İzin verilen en fazla alan sayısı aşıldı. Lütfen %s değerlerini artırın.',
|
||||
|
||||
'Partition by' => 'Bununla bölümle',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Bölümler',
|
||||
'Partition name' => 'Bölüm adı',
|
||||
'Values' => 'Değerler',
|
||||
@@ -238,6 +240,7 @@ $translations = array(
|
||||
'Search' => 'Ara',
|
||||
'anywhere' => 'hiçbir yerde',
|
||||
'Search data in tables' => 'Tablolarda veri ara',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Sırala',
|
||||
'descending' => 'Azalan',
|
||||
'Limit' => 'Limit',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Система Бази Даних',
|
||||
'Server' => 'Сервер',
|
||||
'Username' => 'Користувач',
|
||||
@@ -167,6 +168,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Досягнута максимальна кількість доступних полів. Будь ласка, збільшіть %s.',
|
||||
|
||||
'Partition by' => 'Розділити по',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Розділи',
|
||||
'Partition name' => 'Назва розділу',
|
||||
'Values' => 'Значення',
|
||||
@@ -220,6 +222,7 @@ $translations = array(
|
||||
'Search' => 'Пошук',
|
||||
'anywhere' => 'будь-де',
|
||||
'Search data in tables' => 'Шукати дані в таблицях',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Сортувати',
|
||||
'descending' => 'по спаданню',
|
||||
'Limit' => 'Обмеження',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => 'Hệ thống',
|
||||
'Server' => 'Máy chủ',
|
||||
'Username' => 'Tên người dùng',
|
||||
@@ -172,6 +173,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Thiết lập %s cần tăng thêm. (Đã vượt giới hạnố trường tối đa cho phép trong một biểu mẫu).',
|
||||
|
||||
'Partition by' => 'Phân chia bằng',
|
||||
'Partition' => null,
|
||||
'Partitions' => 'Phân hoạch',
|
||||
'Partition name' => 'Tên phân hoạch',
|
||||
'Values' => 'Giá trị',
|
||||
@@ -225,6 +227,7 @@ $translations = array(
|
||||
'Search' => 'Tìm kiếm',
|
||||
'anywhere' => 'bất cứ đâu',
|
||||
'Search data in tables' => 'Tìm kiếm dữ liệu trong các bảng',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => 'Sắp xếp',
|
||||
'descending' => 'giảm dần',
|
||||
'Limit' => 'Giới hạn',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => 'Xx',
|
||||
'System' => 'Xx',
|
||||
'Server' => 'Xx',
|
||||
'Username' => 'Xx',
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Xx %s.',
|
||||
|
||||
'Partition by' => 'Xx',
|
||||
'Partition' => 'Xx',
|
||||
'Partitions' => 'Xx',
|
||||
'Partition name' => 'Xx',
|
||||
'Values' => 'Xx',
|
||||
@@ -244,6 +246,7 @@ $translations = array(
|
||||
'Search' => 'Xx',
|
||||
'anywhere' => 'xx',
|
||||
'Search data in tables' => 'Xx',
|
||||
'as a regular expression' => 'xx',
|
||||
'Sort' => 'Xx',
|
||||
'descending' => 'xx',
|
||||
'Limit' => 'Xx',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => '資料庫系統',
|
||||
'Server' => '伺服器',
|
||||
'Username' => '帳號',
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => '超過允許的字段數量的最大值。請增加 %s。',
|
||||
|
||||
'Partition by' => '分區類型',
|
||||
'Partition' => null,
|
||||
'Partitions' => '分區',
|
||||
'Partition name' => '分區名稱',
|
||||
'Values' => '值',
|
||||
@@ -244,6 +246,7 @@ $translations = array(
|
||||
'Search' => '搜尋',
|
||||
'anywhere' => '任意位置',
|
||||
'Search data in tables' => '在資料庫搜尋',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => '排序',
|
||||
'descending' => '降冪 (遞減)',
|
||||
'Limit' => '限定',
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'Home' => null,
|
||||
'System' => '系统',
|
||||
'Server' => '服务器',
|
||||
'Username' => '用户名',
|
||||
@@ -190,6 +191,7 @@ $translations = array(
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => '超过最多允许的字段数量。请增加 %s。',
|
||||
|
||||
'Partition by' => '分区类型',
|
||||
'Partition' => null,
|
||||
'Partitions' => '分区',
|
||||
'Partition name' => '分区名',
|
||||
'Values' => '值',
|
||||
@@ -244,6 +246,7 @@ $translations = array(
|
||||
'Search' => '搜索',
|
||||
'anywhere' => '任意位置',
|
||||
'Search data in tables' => '在表中搜索数据',
|
||||
'as a regular expression' => null,
|
||||
'Sort' => '排序',
|
||||
'descending' => '降序',
|
||||
'Limit' => '范围',
|
||||
|
@@ -14,7 +14,7 @@ echo "<form action=''><p>\n";
|
||||
hidden_fields_get();
|
||||
echo "<input type='hidden' name='db' value='" . h(DB) . "'>\n";
|
||||
echo ($grant ? "" : "<input type='hidden' name='grant' value=''>\n");
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<table>\n";
|
||||
echo "<thead><tr><th>" . lang('Username') . "<th>" . lang('Server') . "<th></thead>\n";
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
|
@@ -39,12 +39,16 @@ $routine_languages = routine_languages();
|
||||
<?php echo ($routine_languages ? lang('Language') . ": " . html_select("language", $routine_languages, $row["language"]) . "\n" : ""); ?>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<div class="scrollable">
|
||||
<table cellspacing="0" class="nowrap">
|
||||
<table cellspacing="0" class="nowrap" id="edit-fields">
|
||||
<?php
|
||||
edit_fields($row["fields"], $collations, $routine);
|
||||
if (isset($_GET["function"])) {
|
||||
echo "<tr><td>" . lang('Return type');
|
||||
echo "<tbody><tr><th></th>",
|
||||
"<th>", lang('Return type'), "</th>";
|
||||
|
||||
edit_type("returns", $row["returns"], $collations, array(), ($jush == "pgsql" ? array("void", "trigger") : array()));
|
||||
|
||||
echo "<td></td></tr></tbody>\n";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
@@ -50,9 +50,9 @@ foreach (table_status('', true) as $table => $table_status) {
|
||||
?>
|
||||
<div id="schema" style="height: <?php echo $top; ?>em;">
|
||||
<script<?php echo nonce(); ?>>
|
||||
qs('#schema').onselectstart = function () { return false; };
|
||||
gid('schema').onselectstart = function () { return false; };
|
||||
var tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
|
||||
var em = qs('#schema').offsetHeight / <?php echo $top; ?>;
|
||||
var em = gid('schema').offsetHeight / <?php echo $top; ?>;
|
||||
document.onmousemove = schemaMousemove;
|
||||
document.onmouseup = partialArg(schemaMouseup, '<?php echo js_escape(DB); ?>');
|
||||
</script>
|
||||
@@ -61,12 +61,12 @@ foreach ($schema as $name => $table) {
|
||||
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;'>";
|
||||
echo '<a href="' . h(ME) . 'table=' . urlencode($name) . '"><b>' . h($name) . "</b></a>";
|
||||
echo script("qsl('div').onmousedown = schemaMousedown;");
|
||||
|
||||
|
||||
foreach ($table["fields"] as $field) {
|
||||
$val = '<span' . type_class($field["type"]) . ' title="' . h($field["full_type"] . ($field["null"] ? " NULL" : '')) . '">' . h($field["field"]) . '</span>';
|
||||
echo "<br>" . ($field["primary"] ? "<i>$val</i>" : $val);
|
||||
}
|
||||
|
||||
|
||||
foreach ((array) $table["references"] as $target_name => $refs) {
|
||||
foreach ($refs as $left => $ref) {
|
||||
$left1 = $left - $table_pos[$name][1];
|
||||
@@ -76,7 +76,7 @@ foreach ($schema as $name => $table) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ((array) $referenced[$name] as $target_name => $refs) {
|
||||
foreach ($refs as $left => $columns) {
|
||||
$left1 = $left - $table_pos[$name][1];
|
||||
@@ -86,7 +86,7 @@ foreach ($schema as $name => $table) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "\n</div>\n";
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ if (!$row) {
|
||||
|
||||
<form action="" method="post">
|
||||
<p><input name="name" id="name" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
|
||||
<?php echo script("focus(qs('#name'));"); ?>
|
||||
<?php echo script("focus(gid('name'));"); ?>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<?php
|
||||
if ($_GET["ns"] != "") {
|
||||
|
@@ -232,14 +232,16 @@ if (is_ajax()) {
|
||||
|
||||
$set = null;
|
||||
if (isset($rights["insert"]) || !support("table")) {
|
||||
$set = "";
|
||||
$params = [];
|
||||
foreach ((array) $_GET["where"] as $val) {
|
||||
if ($foreign_keys[$val["col"]] && count($foreign_keys[$val["col"]]) == 1 && ($val["op"] == "="
|
||||
|| (!$val["op"] && !preg_match('~[_%]~', $val["val"])) // LIKE in Editor
|
||||
if (isset($foreign_keys[$val["col"]]) && count($foreign_keys[$val["col"]]) == 1
|
||||
&& ($val["op"] == "=" || (!$val["op"] && (is_array($val["val"]) || !preg_match('~[_%]~', $val["val"]))) // LIKE in Editor
|
||||
)) {
|
||||
$set .= "&set" . urlencode("[" . bracket_escape($val["col"]) . "]") . "=" . urlencode($val["val"]);
|
||||
$params["set" . "[" . bracket_escape($val["col"]) . "]"] = $val["val"];
|
||||
}
|
||||
}
|
||||
|
||||
$set = $params ? "&" . http_build_query($params) : "";
|
||||
}
|
||||
$adminer->selectLinks($table_status, $set);
|
||||
|
||||
@@ -251,6 +253,7 @@ if (!$columns && support("table")) {
|
||||
hidden_fields_get();
|
||||
echo (DB != "" ? '<input type="hidden" name="db" value="' . h(DB) . '">' . (isset($_GET["ns"]) ? '<input type="hidden" name="ns" value="' . h($_GET["ns"]) . '">' : "") : ""); // not used in Editor
|
||||
echo '<input type="hidden" name="select" value="' . h($TABLE) . '">';
|
||||
echo '<input type="submit" value="' . h(lang('Select')) . '">'; # hidden default submit so filter remove buttons aren't "clicked" on submission from enter key
|
||||
echo "</div>\n";
|
||||
$adminer->selectColumnsPrint($select, $columns);
|
||||
$adminer->selectSearchPrint($where, $search_columns, $indexes);
|
||||
@@ -319,10 +322,10 @@ if (!$columns && support("table")) {
|
||||
|
||||
echo "<div class='scrollable'>";
|
||||
echo "<table id='table' cellspacing='0' class='nowrap checkable'>";
|
||||
echo script("mixin(qs('#table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true), onkeydown: editingKeydown});");
|
||||
echo script("mixin(gid('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true), onkeydown: editingKeydown});");
|
||||
echo "<thead><tr>" . (!$group && $select
|
||||
? ""
|
||||
: "<td><input type='checkbox' id='all-page' class='jsonly'>" . script("qs('#all-page').onclick = partial(formCheck, /check/);", "")
|
||||
: "<td><input type='checkbox' id='all-page' class='jsonly'>" . script("gid('all-page').onclick = partial(formCheck, /check/);", "")
|
||||
. " <a href='" . h($_GET["modify"] ? remove_from_uri("modify") : $_SERVER["REQUEST_URI"] . "&modify=1") . "'>" . lang('Modify') . "</a>");
|
||||
$names = array();
|
||||
$functions = array();
|
||||
@@ -350,10 +353,10 @@ if (!$columns && support("table")) {
|
||||
}
|
||||
echo "<span class='column hidden'>";
|
||||
if ($sortable) {
|
||||
echo "<a href='" . h($href . $desc) . "' title='" . lang('descending') . "' class='text'> ↓</a>";
|
||||
echo "<a href='" . h($href . $desc) . "' title='" . lang('descending') . "' class='text'> ↓</a>";
|
||||
}
|
||||
if (!$val["fun"] && isset($field["privileges"]["where"])) {
|
||||
echo '<a href="#fieldset-search" title="' . lang('Search') . '" class="text jsonly"> =</a>';
|
||||
echo '<a href="#fieldset-search" title="' . lang('Search') . '" class="text jsonly"> =</a>';
|
||||
echo script("qsl('a').onclick = partial(selectSearch, '" . js_escape($key) . "');");
|
||||
}
|
||||
echo "</span>";
|
||||
@@ -446,7 +449,7 @@ if (!$columns && support("table")) {
|
||||
$link .= where_link($i++, $k, $v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$val = select_value($val, $link, $field, $text_length);
|
||||
$id = h("val[$unique_idf][" . bracket_escape($key) . "]");
|
||||
$value = $_POST["val"][$unique_idf][bracket_escape($key)];
|
||||
@@ -507,7 +510,7 @@ if (!$columns && support("table")) {
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "<div class='footer'><div>\n";
|
||||
if ($rows || $page) {
|
||||
if ($pagination) {
|
||||
@@ -539,7 +542,7 @@ if (!$columns && support("table")) {
|
||||
}
|
||||
echo "</fieldset>\n";
|
||||
}
|
||||
|
||||
|
||||
echo "<fieldset>";
|
||||
echo "<legend>" . lang('Whole result') . "</legend>";
|
||||
$display_rows = ($exact_count ? "" : "~ ") . $found_rows;
|
||||
|
@@ -21,12 +21,18 @@ if (!$error && $_POST) {
|
||||
if (!isset($_GET["import"])) {
|
||||
$query = $_POST["query"];
|
||||
} elseif ($_POST["webfile"]) {
|
||||
$sql_file_path = $adminer->importServerPath();
|
||||
$fp = @fopen((file_exists($sql_file_path)
|
||||
? $sql_file_path
|
||||
: "compress.zlib://$sql_file_path.gz"
|
||||
), "rb");
|
||||
$query = ($fp ? fread($fp, 1e6) : false);
|
||||
$import_file_path = $adminer->importServerPath();
|
||||
if (!$import_file_path) {
|
||||
$fp = false;
|
||||
} elseif (file_exists($import_file_path)) {
|
||||
$fp = fopen($import_file_path, "rb");
|
||||
} elseif (file_exists("$import_file_path.gz")) {
|
||||
$fp = fopen("compress.zlib://$import_file_path.gz", "rb");
|
||||
} else {
|
||||
$fp = false;
|
||||
}
|
||||
|
||||
$query = $fp ? fread($fp, 1e6) : false;
|
||||
} else {
|
||||
$query = get_file("sql_file", true);
|
||||
}
|
||||
@@ -237,7 +243,7 @@ if (!isset($_GET["import"])) {
|
||||
}
|
||||
echo "<p>";
|
||||
textarea("query", $q, 20);
|
||||
echo script(($_POST ? "" : "qs('textarea').focus();\n") . "qs('#form').onsubmit = partial(sqlSubmit, qs('#form'), '" . js_escape(remove_from_uri("sql|limit|error_stops|only_errors|history")) . "');");
|
||||
echo script(($_POST ? "" : "qs('textarea').focus();\n") . "gid('form').onsubmit = partial(sqlSubmit, gid('form'), '" . js_escape(remove_from_uri("sql|limit|error_stops|only_errors|history")) . "');");
|
||||
echo "<p>$execute\n";
|
||||
echo lang('Limit rows') . ": <input type='number' name='limit' class='size' value='" . h($_POST ? $_POST["limit"] : $_GET["limit"]) . "'>\n";
|
||||
|
||||
@@ -249,10 +255,10 @@ if (!isset($_GET["import"])) {
|
||||
: lang('File uploads are disabled.')
|
||||
);
|
||||
echo "</div></fieldset>\n";
|
||||
$importServerPath = $adminer->importServerPath();
|
||||
if ($importServerPath) {
|
||||
$import_file_path = $adminer->importServerPath();
|
||||
if ($import_file_path) {
|
||||
echo "<fieldset><legend>" . lang('From server') . "</legend><div>";
|
||||
echo lang('Webserver file %s', "<code>" . h($importServerPath) . "$gz</code>");
|
||||
echo lang('Webserver file %s', "<code>" . h($import_file_path) . "$gz</code>");
|
||||
echo ' <input type="submit" name="webfile" value="' . lang('Run file') . '">';
|
||||
echo "</div></fieldset>\n";
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
/** @author Ondrej Valka, http://valka.info */
|
||||
body { color: #000; background: #fff; font: 90%/1.25 Verdana, Arial, Helvetica, sans-serif; margin: 0; width: -moz-fit-content; width: fit-content; }
|
||||
a { color: blue; text-decoration: none; }
|
||||
a:visited { color: navy; }
|
||||
a:link:hover, a:visited:hover { color: red; text-decoration: underline; }
|
||||
a:link:hover { color: red; text-decoration: underline; }
|
||||
a.text:hover { text-decoration: none; }
|
||||
a.jush-help:hover { color: inherit; }
|
||||
h1 { font-size: 150%; margin: 0; padding: .8em 1em; border-bottom: 1px solid #999; font-weight: normal; color: #777; background: #eee; }
|
||||
@@ -11,7 +10,7 @@ h3 { font-weight: normal; font-size: 130%; margin: 1em 0 0; }
|
||||
form { margin: 0; }
|
||||
td table { width: 100%; margin: 0; }
|
||||
table { margin: 1em 20px 0 0; border-collapse: collapse; font-size: 90%; }
|
||||
td, th { border: 1px solid #999; padding: .2em .3em; }
|
||||
td, th { box-sizing: border-box; border: 1px solid #999; padding: .2em .3em; }
|
||||
th { background: #eee; text-align: left; }
|
||||
thead th { text-align: center; padding: .2em .5em; }
|
||||
thead td, thead th { background: #ddf; } /* position: sticky; causes Firefox to lose borders */
|
||||
@@ -25,17 +24,22 @@ pre { margin: 1em 0 0; }
|
||||
pre code { display: block; font-size: 100%; }
|
||||
pre, textarea { font: 110%/1.25 monospace; }
|
||||
pre.jush { background: #fff; }
|
||||
input, select { vertical-align: middle; }
|
||||
input, textarea, select { box-sizing: border-box; }
|
||||
input[type="image"] { vertical-align: middle; margin-top: -3px; }
|
||||
input[type="number"] { -moz-appearance: textfield; }
|
||||
input::-webkit-inner-spin-button { -webkit-appearance: none; }
|
||||
input.default { box-shadow: 1px 1px 1px #777; }
|
||||
input.required { box-shadow: 1px 1px 1px red; }
|
||||
input.maxlength { box-shadow: 1px 1px 1px red; }
|
||||
input.wayoff { left: -1000px; position: absolute; }
|
||||
input::placeholder { color: #000; opacity: 0.4; }
|
||||
.center { text-align: center; }
|
||||
.block { display: block; }
|
||||
.version { color: #777; font-size: 67%; }
|
||||
.version { color: #777; font-size: 62%; }
|
||||
.js .hidden, .nojs .jsonly { display: none; }
|
||||
.js .column { position: absolute; background: #ddf; padding: .27em 1ex .3em 0; margin-top: -.27em; }
|
||||
.nowrap td, .nowrap th, td.nowrap, p.nowrap { white-space: pre; }
|
||||
.nowrap { white-space: nowrap; }
|
||||
p.nowrap { white-space: pre; }
|
||||
.wrap td { white-space: normal; }
|
||||
.error { color: red; background: #fee; }
|
||||
.error b { background: #fff; font-weight: normal; }
|
||||
@@ -65,8 +69,19 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
.footer > div { background: #fff; padding: 0 0 .5em; }
|
||||
.footer fieldset { margin-top: 0; }
|
||||
.links a { white-space: nowrap; margin-right: 20px; }
|
||||
.logout { margin-top: .5em; position: absolute; top: 0; right: 0; }
|
||||
.logout { margin: .5em 20px 0 0; position: absolute; top: 0; right: 0; }
|
||||
.loadmore { margin-left: 1ex; }
|
||||
.tables-filter { padding: .8em 1em 0; }
|
||||
.handle { cursor: grab; vertical-align: middle; }
|
||||
.handle:before { content: "="; display: inline-block; width: 18px; height: 18px; overflow: hidden; font-size: 130%; text-align: center; line-height: 16px; opacity: 0.2; }
|
||||
span.handle { display: inline-block; width: 18px; height: 18px; padding-right: .3em; }
|
||||
th.handle:before { vertical-align: middle; }
|
||||
.no-sort .handle { cursor: default; }
|
||||
.no-sort .handle:before { content: "•"; font-size: 100%; }
|
||||
.placeholder { opacity: 0; }
|
||||
.dragging { position: absolute; margin: 0; background: #fff; }
|
||||
.dragging * { cursor: grabbing; }
|
||||
table.dragging { background: #eee; }
|
||||
/* .edit used in designs */
|
||||
#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; }
|
||||
#menu p, #logins, #tables { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
|
||||
@@ -78,11 +93,13 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
#lang { position: absolute; top: 0; left: 0; line-height: 1.8em; padding: .3em 1em; }
|
||||
#breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: #eee; height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; }
|
||||
#h1 { color: #777; text-decoration: none; font-style: italic; }
|
||||
#version { font-size: 67%; color: red; }
|
||||
#version { color: red; }
|
||||
#schema { margin-left: 60px; position: relative; -moz-user-select: none; -webkit-user-select: none; }
|
||||
#schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; }
|
||||
#schema .references { position: absolute; }
|
||||
#tables-filter, #database-select, #scheme-select { width: 100%; }
|
||||
#help { position: absolute; border: 1px solid #999; background: #eee; padding: 5px; font-family: monospace; z-index: 1; }
|
||||
#fieldset-select div:last-child > .remove, #fieldset-search div:last-child > .remove, #fieldset-sort div:last-child > .remove { display: none; }
|
||||
|
||||
.rtl h2 { margin: 0 -18px 20px 0; }
|
||||
.rtl p, .rtl table, .rtl .error, .rtl .message { margin: 1em 0 0 20px; }
|
||||
|
@@ -16,17 +16,22 @@ function bodyLoad(version, maria) {
|
||||
if (maria) {
|
||||
for (var i = 1; i < obj.length; i++) {
|
||||
obj[i] = obj[i]
|
||||
.replace(/\.html/, '/')
|
||||
.replace(/-type-syntax/, '-data-types')
|
||||
.replace('.html', '/')
|
||||
.replace('-type-syntax', '-data-types')
|
||||
.replace(/numeric-(data-types)/, '$1-$&')
|
||||
.replace(/#statvar_.*/, '#$$1')
|
||||
.replace(/replication-options-(master|binary-log)\//, 'replication-and-binary-log-system-variables/')
|
||||
.replace('server-options/', 'server-system-variables/')
|
||||
.replace('innodb-parameters/', 'innodb-system-variables/')
|
||||
.replace(/#(statvar|sysvar|option_mysqld)_(.*)/, '#$2')
|
||||
.replace(/#sysvar_(.*)/, '#$1')
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
obj[key] = (maria ? obj[key].replace(/dev\.mysql\.com\/doc\/mysql\/en\//, 'mariadb.com/kb/en/library/') : obj[key]) // MariaDB
|
||||
.replace(/\/doc\/mysql/, '/doc/refman/' + version) // MySQL
|
||||
.replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL
|
||||
|
||||
obj[key] = (maria ? obj[key].replace('dev.mysql.com/doc/mysql/en/', 'mariadb.com/kb/en/') : obj[key]) // MariaDB
|
||||
.replace('/doc/mysql/', '/doc/refman/' + version) // MySQL
|
||||
.replace('/docs/current/', '/docs/' + version) // PostgreSQL
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -83,13 +88,17 @@ function messagesPrint(el) {
|
||||
|
||||
|
||||
|
||||
/** Hide or show some login rows for selected driver
|
||||
* @param HTMLSelectElement
|
||||
*/
|
||||
function loginDriver(driver) {
|
||||
var trs = parentTag(driver, 'table').rows;
|
||||
var disabled = /sqlite/.test(selectValue(driver));
|
||||
alterClass(trs[1], 'hidden', disabled); // 1 - row with server
|
||||
/**
|
||||
* Hides or shows some login rows for selected driver.
|
||||
*
|
||||
* @param {HTMLSelectElement} driverSelect
|
||||
*/
|
||||
function loginDriver(driverSelect) {
|
||||
const trs = parentTag(driverSelect, 'table').rows;
|
||||
const disabled = /sqlite/.test(selectValue(driverSelect));
|
||||
|
||||
// 1 - row with server
|
||||
trs[1].classList.toggle('hidden', disabled);
|
||||
trs[1].getElementsByTagName('input')[0].disabled = disabled;
|
||||
}
|
||||
|
||||
@@ -103,6 +112,11 @@ var dbPrevious = {};
|
||||
* @this HTMLSelectElement
|
||||
*/
|
||||
function dbMouseDown(event) {
|
||||
// Firefox: mouse-down event does not contain pressed key information for OPTION.
|
||||
// Chrome: mouse-down event has inherited key information from SELECT.
|
||||
// So we ignore the event for OPTION to work Ctrl+click correctly everywhere.
|
||||
if (event.target.tagName === "OPTION") return;
|
||||
|
||||
dbCtrl = isCtrl(event);
|
||||
if (dbPrevious[this.name] === undefined) {
|
||||
dbPrevious[this.name] = this.value;
|
||||
@@ -226,11 +240,13 @@ function editFields() {
|
||||
els = qsa('[name$="[type]"]');
|
||||
for (var i = 0; i < els.length; i++) {
|
||||
mixin(els[i], {
|
||||
onfocus: function () { lastType = selectValue(this); },
|
||||
onfocus: () => {
|
||||
lastType = selectValue(this);
|
||||
},
|
||||
onchange: editingTypeChange,
|
||||
onmouseover: function (event) { helpMouseover.call(this, event, getTarget(event).value, 1) },
|
||||
onmouseout: helpMouseout
|
||||
});
|
||||
|
||||
initHelpFor(els[i], (value) => { return value; }, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +255,7 @@ function editFields() {
|
||||
* @return boolean false to cancel action
|
||||
*/
|
||||
function editingClick(event) {
|
||||
var el = getTarget(event);
|
||||
var el = event.target;
|
||||
if (!isTag(el, 'input')) {
|
||||
el = parentTag(el, 'label');
|
||||
el = el && qs('input', el);
|
||||
@@ -248,10 +264,6 @@ function editingClick(event) {
|
||||
var name = el.name;
|
||||
if (/^add\[/.test(name)) {
|
||||
editingAddRow.call(el, 1);
|
||||
} else if (/^up\[/.test(name)) {
|
||||
editingMoveRow.call(el, 1);
|
||||
} else if (/^down\[/.test(name)) {
|
||||
editingMoveRow.call(el);
|
||||
} else if (/^drop_col\[/.test(name)) {
|
||||
editingRemoveRow.call(el, 'fields\$1[field]');
|
||||
} else {
|
||||
@@ -272,7 +284,7 @@ function editingClick(event) {
|
||||
* @param InputEvent
|
||||
*/
|
||||
function editingInput(event) {
|
||||
var el = getTarget(event);
|
||||
var el = event.target;
|
||||
if (/\[default]$/.test(el.name)) {
|
||||
el.previousSibling.checked = true;
|
||||
}
|
||||
@@ -348,7 +360,10 @@ function editingAddRow(focus) {
|
||||
}
|
||||
}
|
||||
tags[0].oninput = editingNameChange;
|
||||
|
||||
initSortableRow(row2);
|
||||
row.parentNode.insertBefore(row2, row.nextSibling);
|
||||
|
||||
if (focus) {
|
||||
input.oninput = editingNameChange;
|
||||
input.focus();
|
||||
@@ -370,22 +385,6 @@ function editingRemoveRow(name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Move table row for field
|
||||
* @param [boolean]
|
||||
* @return boolean false for success
|
||||
* @this HTMLInputElement
|
||||
*/
|
||||
function editingMoveRow(up){
|
||||
var row = parentTag(this, 'tr');
|
||||
if (!('nextElementSibling' in row)) {
|
||||
return true;
|
||||
}
|
||||
row.parentNode.insertBefore(row, up
|
||||
? row.previousElementSibling
|
||||
: row.nextElementSibling ? row.nextElementSibling.nextElementSibling : row.parentNode.firstChild);
|
||||
return false;
|
||||
}
|
||||
|
||||
var lastType = '';
|
||||
|
||||
/** Clear length and hide collation or unsigned
|
||||
@@ -410,26 +409,26 @@ function editingTypeChange() {
|
||||
el.checked = false;
|
||||
}
|
||||
if (el.name === name + '[collation]') {
|
||||
alterClass(el, 'hidden', !/(char|text|enum|set)$/.test(text));
|
||||
el.classList.toggle('hidden', !/(char|text|enum|set)$/.test(text));
|
||||
}
|
||||
if (el.name === name + '[unsigned]') {
|
||||
alterClass(el, 'hidden', !/(^|[^o])int(?!er)|numeric|real|float|double|decimal|money/.test(text));
|
||||
el.classList.toggle('hidden', !/(^|[^o])int(?!er)|numeric|real|float|double|decimal|money/.test(text));
|
||||
}
|
||||
if (el.name === name + '[on_update]') {
|
||||
alterClass(el, 'hidden', !/timestamp|datetime/.test(text)); // MySQL supports datetime since 5.6.5
|
||||
// MySQL supports datetime since 5.6.5.
|
||||
el.classList.toggle('hidden', !/timestamp|datetime/.test(text));
|
||||
}
|
||||
if (el.name === name + '[on_delete]') {
|
||||
alterClass(el, 'hidden', !/`/.test(text));
|
||||
el.classList.toggle('hidden', !/`/.test(text));
|
||||
}
|
||||
}
|
||||
helpClose();
|
||||
}
|
||||
|
||||
/** Mark length as required
|
||||
* @this HTMLInputElement
|
||||
*/
|
||||
function editingLengthChange() {
|
||||
alterClass(this, 'required', !this.value.length && /var(char|binary)$/.test(selectValue(this.parentNode.previousSibling.firstChild)));
|
||||
this.classList.toggle('required', !this.value.length && /var(char|binary)$/.test(selectValue(this.parentNode.previousSibling.firstChild)));
|
||||
}
|
||||
|
||||
/** Edit enum or set
|
||||
@@ -438,7 +437,7 @@ function editingLengthChange() {
|
||||
function editingLengthFocus() {
|
||||
var td = this.parentNode;
|
||||
if (/(enum|set)$/.test(selectValue(td.previousSibling.firstChild))) {
|
||||
var edit = qs('#enum-edit');
|
||||
var edit = gid('enum-edit');
|
||||
edit.value = enumValues(this.value);
|
||||
td.appendChild(edit);
|
||||
this.style.display = 'none';
|
||||
@@ -482,9 +481,9 @@ function editingLengthBlur() {
|
||||
* @param number
|
||||
*/
|
||||
function columnShow(checked, column) {
|
||||
var trs = qsa('tr', qs('#edit-fields'));
|
||||
var trs = qsa('tr', gid('edit-fields'));
|
||||
for (var i=0; i < trs.length; i++) {
|
||||
alterClass(qsa('td', trs[i])[column], 'hidden', !checked);
|
||||
qsa('td', trs[i])[column].classList.toggle('hidden', !checked);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,9 +492,9 @@ function columnShow(checked, column) {
|
||||
*/
|
||||
function partitionByChange() {
|
||||
var partitionTable = /RANGE|LIST/.test(selectValue(this));
|
||||
alterClass(this.form['partitions'], 'hidden', partitionTable || !this.selectedIndex);
|
||||
alterClass(qs('#partition-table'), 'hidden', !partitionTable);
|
||||
helpClose();
|
||||
|
||||
this.form['partitions'].classList.toggle('hidden', partitionTable || !this.selectedIndex);
|
||||
gid('partition-table').classList.toggle('hidden', !partitionTable);
|
||||
}
|
||||
|
||||
/** Add next partition row
|
||||
@@ -515,7 +514,7 @@ function partitionNameChange() {
|
||||
function editingCommentsClick(el, focus) {
|
||||
var comment = el.form['Comment'];
|
||||
columnShow(el.checked, 6);
|
||||
alterClass(comment, 'hidden', !el.checked);
|
||||
comment.classList.toggle('hidden', !el.checked);
|
||||
if (focus && el.checked) {
|
||||
comment.focus();
|
||||
}
|
||||
@@ -528,7 +527,7 @@ function editingCommentsClick(el, focus) {
|
||||
* @this HTMLTableElement
|
||||
*/
|
||||
function dumpClick(event) {
|
||||
var el = parentTag(getTarget(event), 'label');
|
||||
var el = parentTag(event.target, 'label');
|
||||
if (el) {
|
||||
el = qs('input', el);
|
||||
var match = /(.+)\[]$/.exec(el.name);
|
||||
@@ -658,7 +657,7 @@ function triggerChange(tableRe, table, form) {
|
||||
if (tableRe.test(form['Trigger'].value)) {
|
||||
form['Trigger'].value = table + '_' + (selectValue(form['Timing']).charAt(0) + formEvent.charAt(0)).toLowerCase();
|
||||
}
|
||||
alterClass(form['Of'], 'hidden', !/ OF/.test(formEvent));
|
||||
form['Of'].classList.toggle('hidden', !/ OF/.test(formEvent));
|
||||
}
|
||||
|
||||
|
||||
@@ -732,55 +731,114 @@ function schemaMouseup(event, db) {
|
||||
s += '_' + key + ':' + Math.round(tablePos[key][0] * 10000) / 10000 + 'x' + Math.round(tablePos[key][1] * 10000) / 10000;
|
||||
}
|
||||
s = encodeURIComponent(s.substr(1));
|
||||
var link = qs('#schema-link');
|
||||
var link = gid('schema-link');
|
||||
link.href = link.href.replace(/[^=]+$/, '') + s;
|
||||
cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Help.
|
||||
(function() {
|
||||
let openTimeout = null;
|
||||
let closeTimeout = null;
|
||||
let helpVisible = false;
|
||||
|
||||
var helpOpen, helpIgnore; // when mouse outs <option> then it mouse overs border of <select> - ignore it
|
||||
window.initHelpPopup = function () {
|
||||
const help = gid("help");
|
||||
|
||||
/** Display help
|
||||
* @param MouseEvent
|
||||
* @param string
|
||||
* @param bool display on left side (otherwise on top)
|
||||
* @this HTMLElement
|
||||
*/
|
||||
function helpMouseover(event, text, side) {
|
||||
var target = getTarget(event);
|
||||
if (!text) {
|
||||
helpClose();
|
||||
} else if (window.jush && (!helpIgnore || this !== target)) {
|
||||
helpOpen = 1;
|
||||
var help = qs('#help');
|
||||
help.innerHTML = text;
|
||||
jush.highlight_tag([ help ]);
|
||||
alterClass(help, 'hidden');
|
||||
var rect = target.getBoundingClientRect();
|
||||
var body = document.documentElement;
|
||||
help.style.top = (body.scrollTop + rect.top - (side ? (help.offsetHeight - target.offsetHeight) / 2 : help.offsetHeight)) + 'px';
|
||||
help.style.left = (body.scrollLeft + rect.left - (side ? help.offsetWidth : (help.offsetWidth - target.offsetWidth) / 2)) + 'px';
|
||||
}
|
||||
}
|
||||
help.addEventListener("mouseenter", () => {
|
||||
clearTimeout(closeTimeout);
|
||||
closeTimeout = null;
|
||||
});
|
||||
|
||||
/** Close help after timeout
|
||||
* @param MouseEvent
|
||||
* @this HTMLElement
|
||||
*/
|
||||
function helpMouseout(event) {
|
||||
helpOpen = 0;
|
||||
helpIgnore = (this !== getTarget(event));
|
||||
setTimeout(function () {
|
||||
if (!helpOpen) {
|
||||
helpClose();
|
||||
help.addEventListener("mouseleave", hideHelp);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} element
|
||||
* @param {string|function} content
|
||||
* @param {boolean} side Displays on left side (otherwise on top).
|
||||
*/
|
||||
window.initHelpFor = function(element, content, side = false) {
|
||||
const withCallback = typeof content === "function";
|
||||
|
||||
element.addEventListener("mouseenter", (event) => {
|
||||
showHelp(event.target, withCallback ? content(event.target.value) : content, side)
|
||||
});
|
||||
|
||||
element.addEventListener("mouseleave", hideHelp);
|
||||
element.addEventListener("blur", hideHelp);
|
||||
|
||||
if (withCallback) {
|
||||
element.addEventListener("change", hideHelp);
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
};
|
||||
|
||||
/** Close help
|
||||
*/
|
||||
function helpClose() {
|
||||
alterClass(qs('#help'), 'hidden', true);
|
||||
}
|
||||
/**
|
||||
* Displays help popup after a small delay.
|
||||
*
|
||||
* @param {HTMLElement} element
|
||||
* @param {string} text
|
||||
* @param {boolean} side display on left side (otherwise on top)
|
||||
*/
|
||||
function showHelp(element, text, side) {
|
||||
if (!text) {
|
||||
hideHelp();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSorting() || !window.jush) {
|
||||
return;
|
||||
}
|
||||
|
||||
clearTimeout(openTimeout);
|
||||
openTimeout = null;
|
||||
clearTimeout(closeTimeout);
|
||||
closeTimeout = null;
|
||||
|
||||
const help = gid("help");
|
||||
help.innerHTML = text;
|
||||
jush.highlight_tag([help]);
|
||||
|
||||
// Display help briefly to calculate position properly.
|
||||
help.classList.remove("hidden");
|
||||
|
||||
const rect = element.getBoundingClientRect();
|
||||
const root = document.documentElement;
|
||||
|
||||
help.style.top = (root.scrollTop + rect.top - (side ? (help.offsetHeight - element.offsetHeight) / 2 : help.offsetHeight)) + 'px';
|
||||
help.style.left = (root.scrollLeft + rect.left - (side ? help.offsetWidth : (help.offsetWidth - element.offsetWidth) / 2)) + 'px';
|
||||
|
||||
if (helpVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
help.classList.add("hidden");
|
||||
|
||||
openTimeout = setTimeout(() => {
|
||||
gid("help").classList.remove("hidden");
|
||||
|
||||
helpVisible = true;
|
||||
openTimeout = null;
|
||||
}, 600);
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the help popup after a small delay.
|
||||
*/
|
||||
function hideHelp() {
|
||||
if (openTimeout) {
|
||||
clearTimeout(openTimeout);
|
||||
openTimeout = null;
|
||||
return;
|
||||
}
|
||||
|
||||
closeTimeout = setTimeout(() => {
|
||||
gid("help").classList.add("hidden");
|
||||
|
||||
helpVisible = false;
|
||||
closeTimeout = null;
|
||||
}, 200);
|
||||
}
|
||||
})();
|
||||
|
@@ -1,4 +1,15 @@
|
||||
|
||||
/**
|
||||
* Returns the element found by given identifier.
|
||||
*
|
||||
* @param {string} id
|
||||
* @param {?HTMLElement} context Defaults to document.
|
||||
* @return {?HTMLElement}
|
||||
*/
|
||||
function gid(id, context = null) {
|
||||
return (context || document).getElementById(id);
|
||||
}
|
||||
|
||||
/** Get first element by selector
|
||||
* @param string
|
||||
* @param [HTMLElement] defaults to document
|
||||
@@ -62,24 +73,15 @@ function mixin(target, source) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Add or remove CSS class
|
||||
* @param HTMLElement
|
||||
* @param string
|
||||
* @param [bool]
|
||||
*/
|
||||
function alterClass(el, className, enable) {
|
||||
if (el) {
|
||||
el.className = el.className.replace(RegExp('(^|\\s)' + className + '(\\s|$)'), '$2') + (enable ? ' ' + className : '');
|
||||
}
|
||||
}
|
||||
|
||||
/** Toggle visibility
|
||||
* @param string
|
||||
* @return boolean false
|
||||
*/
|
||||
/**
|
||||
* Toggles visibility of element with ID.
|
||||
*
|
||||
* @param {string} id
|
||||
* @return {boolean} Always false.
|
||||
*/
|
||||
function toggle(id) {
|
||||
var el = qs('#' + id);
|
||||
el.className = (el.className === 'hidden' ? '' : 'hidden');
|
||||
gid(id).classList.toggle("hidden");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -94,34 +96,31 @@ function cookie(assign, days) {
|
||||
document.cookie = assign + '; expires=' + date;
|
||||
}
|
||||
|
||||
/** Verify current Adminer version
|
||||
* @param string
|
||||
* @param string own URL base
|
||||
* @param string
|
||||
*/
|
||||
function verifyVersion(current, url, token) {
|
||||
/**
|
||||
* Verifies current Adminer version.
|
||||
*
|
||||
* @param currentVersion string
|
||||
* @param baseUrl string
|
||||
* @param token string
|
||||
*/
|
||||
function verifyVersion(currentVersion, baseUrl, token) {
|
||||
cookie('adminer_version=0', 1);
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.src = 'https://www.adminer.org/version/?current=' + current;
|
||||
iframe.frameBorder = 0;
|
||||
iframe.marginHeight = 0;
|
||||
iframe.scrolling = 'no';
|
||||
iframe.style.width = '7ex';
|
||||
iframe.style.height = '1.25em';
|
||||
if (window.postMessage && window.addEventListener) {
|
||||
iframe.style.display = 'none';
|
||||
addEventListener('message', function (event) {
|
||||
if (event.origin === 'https://www.adminer.org') {
|
||||
var match = /version=(.+)/.exec(event.data);
|
||||
if (match) {
|
||||
cookie('adminer_version=' + match[1], 1);
|
||||
ajax(url + 'script=version', function () {
|
||||
}, event.data + '&token=' + token);
|
||||
}
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
qs('#version').appendChild(iframe);
|
||||
|
||||
ajax('https://api.github.com/repos/pematon/adminer/releases/latest', function (request) {
|
||||
const response = JSON.parse(request.responseText);
|
||||
|
||||
const version = response.tag_name.replace(/^\D*/, '');
|
||||
if (!version) return;
|
||||
|
||||
cookie('adminer_version=' + version, 1);
|
||||
|
||||
const data = 'version=' + version + '&token=' + token;
|
||||
ajax(baseUrl + 'script=version', function () {}, data);
|
||||
|
||||
if (currentVersion !== version) {
|
||||
gid('version').innerText = version;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** Get value of select
|
||||
@@ -163,7 +162,7 @@ function parentTag(el, tag) {
|
||||
*/
|
||||
function trCheck(el) {
|
||||
var tr = parentTag(el, 'tr');
|
||||
alterClass(tr, 'checked', el.checked);
|
||||
tr.classList.toggle('checked', el.checked);
|
||||
if (el.form && el.form['all'] && el.form['all'].onclick) { // Opera treats form.all as document.all
|
||||
el.form['all'].onclick();
|
||||
}
|
||||
@@ -176,7 +175,7 @@ function trCheck(el) {
|
||||
*/
|
||||
function selectCount(id, count) {
|
||||
setHtml(id, (count === '' ? '' : '(' + (count + '').replace(/\B(?=(\d{3})+$)/g, thousandsSeparator) + ')'));
|
||||
var el = qs('#' + id);
|
||||
var el = gid(id);
|
||||
if (el) {
|
||||
var inputs = qsa('input', el.parentNode.parentNode);
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
@@ -249,7 +248,7 @@ function formChecked(el, name) {
|
||||
* @param [boolean] force click
|
||||
*/
|
||||
function tableClick(event, click) {
|
||||
var td = parentTag(getTarget(event), 'td');
|
||||
var td = parentTag(event.target, 'td');
|
||||
var text;
|
||||
if (td && (text = td.getAttribute('data-text'))) {
|
||||
if (selectClick.call(td, event, +text, td.getAttribute('data-warning'))) {
|
||||
@@ -257,7 +256,7 @@ function tableClick(event, click) {
|
||||
}
|
||||
}
|
||||
click = (click || !window.getSelection || getSelection().isCollapsed);
|
||||
var el = getTarget(event);
|
||||
var el = event.target;
|
||||
while (!isTag(el, 'tr')) {
|
||||
if (isTag(el, 'table|a|input|textarea')) {
|
||||
if (el.type !== 'checkbox') {
|
||||
@@ -357,14 +356,85 @@ function pageClick(href, page) {
|
||||
}
|
||||
}
|
||||
|
||||
let tablesFilterTimeout = null;
|
||||
let tablesFilterValue = '';
|
||||
|
||||
function initTablesFilter(dbName) {
|
||||
if (sessionStorage) {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
if (dbName === sessionStorage.getItem('adminer_tables_filter_db') && sessionStorage.getItem('adminer_tables_filter')) {
|
||||
gid('tables-filter').value = sessionStorage.getItem('adminer_tables_filter');
|
||||
filterTables();
|
||||
} else {
|
||||
sessionStorage.removeItem('adminer_tables_filter');
|
||||
}
|
||||
|
||||
sessionStorage.setItem('adminer_tables_filter_db', dbName);
|
||||
});
|
||||
}
|
||||
|
||||
const filterInput = gid('tables-filter');
|
||||
filterInput.addEventListener('input', function () {
|
||||
window.clearTimeout(tablesFilterTimeout);
|
||||
tablesFilterTimeout = window.setTimeout(filterTables, 200);
|
||||
});
|
||||
|
||||
document.body.addEventListener('keydown', function(event) {
|
||||
if (isCtrl(event) && event.shiftKey && event.key.toUpperCase() === 'F') {
|
||||
filterInput.focus();
|
||||
filterInput.select();
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function filterTables() {
|
||||
const value = gid('tables-filter').value.toLowerCase();
|
||||
if (value === tablesFilterValue) {
|
||||
return;
|
||||
}
|
||||
tablesFilterValue = value;
|
||||
|
||||
let reg
|
||||
if (value !== '') {
|
||||
const valueExp = (`${value}`).replace(/[\\.+*?\[^\]$(){}=!<>|:]/g, '\\$&');
|
||||
reg = new RegExp(`(${valueExp})`, 'gi');
|
||||
}
|
||||
|
||||
if (sessionStorage) {
|
||||
sessionStorage.setItem('adminer_tables_filter', value);
|
||||
}
|
||||
|
||||
const tables = qsa('#tables li');
|
||||
for (let i = 0; i < tables.length; i++) {
|
||||
let a = qs('a[data-main="true"], span[data-main="true"]', tables[i]);
|
||||
|
||||
let tableName = tables[i].dataset.tableName;
|
||||
if (tableName == null) {
|
||||
tableName = a.innerHTML.trim();
|
||||
|
||||
tables[i].dataset.tableName = tableName;
|
||||
}
|
||||
|
||||
if (value === "") {
|
||||
tables[i].classList.remove('hidden');
|
||||
a.innerHTML = tableName;
|
||||
} else if (tableName.toLowerCase().indexOf(value) >= 0) {
|
||||
tables[i].classList.remove('hidden');
|
||||
a.innerHTML = tableName.replace(reg, '<strong>$1</strong>');
|
||||
} else {
|
||||
tables[i].classList.add('hidden');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Display items in menu
|
||||
* @param MouseEvent
|
||||
* @this HTMLElement
|
||||
*/
|
||||
function menuOver(event) {
|
||||
var a = getTarget(event);
|
||||
var a = event.target;
|
||||
if (isTag(a, 'a|span') && a.offsetLeft + a.offsetWidth > a.parentNode.offsetWidth - 15) { // 15 - ellipsis
|
||||
this.style.overflow = 'visible';
|
||||
}
|
||||
@@ -379,30 +449,66 @@ function menuOut() {
|
||||
|
||||
|
||||
|
||||
/** Add row in select fieldset
|
||||
* @this HTMLSelectElement
|
||||
*/
|
||||
function selectAddRow() {
|
||||
var field = this;
|
||||
var row = cloneNode(field.parentNode);
|
||||
/**
|
||||
* Adds row in select fieldset.
|
||||
*
|
||||
* @param {Event} event
|
||||
* @this HTMLSelectElement
|
||||
*/
|
||||
function selectAddRow(event) {
|
||||
const field = this;
|
||||
const row = cloneNode(field.parentNode);
|
||||
|
||||
field.onchange = selectFieldChange;
|
||||
field.onchange();
|
||||
var selects = qsa('select', row);
|
||||
for (var i=0; i < selects.length; i++) {
|
||||
selects[i].name = selects[i].name.replace(/[a-z]\[\d+/, '$&1');
|
||||
selects[i].selectedIndex = 0;
|
||||
field.onchange(event);
|
||||
|
||||
const selects = qsa('select', row);
|
||||
for (const select of selects) {
|
||||
select.name = select.name.replace(/[a-z]\[\d+/, '$&1');
|
||||
select.selectedIndex = 0;
|
||||
}
|
||||
var inputs = qsa('input', row);
|
||||
for (var i=0; i < inputs.length; i++) {
|
||||
inputs[i].name = inputs[i].name.replace(/[a-z]\[\d+/, '$&1');
|
||||
inputs[i].className = '';
|
||||
if (inputs[i].type === 'checkbox') {
|
||||
inputs[i].checked = false;
|
||||
|
||||
const inputs = qsa('input', row);
|
||||
for (const input of inputs) {
|
||||
// Skip buttons.
|
||||
if (input.type === 'image') {
|
||||
continue;
|
||||
}
|
||||
|
||||
input.name = input.name.replace(/[a-z]\[\d+/, '$&1');
|
||||
input.className = '';
|
||||
if (input.type === 'checkbox') {
|
||||
input.checked = false;
|
||||
} else {
|
||||
inputs[i].value = '';
|
||||
input.value = '';
|
||||
}
|
||||
}
|
||||
field.parentNode.parentNode.appendChild(row);
|
||||
|
||||
const buttons = qsa('.icon', row);
|
||||
for (const button of buttons) {
|
||||
button.onclick = selectRemoveRow;
|
||||
}
|
||||
|
||||
const parent = field.parentNode.parentNode;
|
||||
if (parent.classList.contains("sortable")) {
|
||||
initSortableRow(field.parentElement);
|
||||
}
|
||||
|
||||
parent.appendChild(row);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a row in select fieldset.
|
||||
*
|
||||
* @this HTMLInputElement
|
||||
* @return {boolean} Always false.
|
||||
*/
|
||||
function selectRemoveRow() {
|
||||
const row = this.parentNode;
|
||||
|
||||
row.parentNode.removeChild(row);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Prevent onsearch handler on Enter
|
||||
@@ -425,6 +531,159 @@ function selectSearchSearch() {
|
||||
}
|
||||
}
|
||||
|
||||
// Sorting.
|
||||
(function() {
|
||||
let placeholderRow = null, nextRow = null, dragHelper = null;
|
||||
let startY, minY, maxY;
|
||||
|
||||
/**
|
||||
* Initializes sortable list of DIV elements.
|
||||
*
|
||||
* @param {string} parentSelector
|
||||
*/
|
||||
window.initSortable = function(parentSelector) {
|
||||
const parent = qs(parentSelector);
|
||||
if (!parent) return;
|
||||
|
||||
for (const row of parent.children) {
|
||||
if (!row.classList.contains("no-sort")) {
|
||||
initSortableRow(row);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializes one row of sortable parent.
|
||||
*
|
||||
* @param {HTMLElement} row
|
||||
*/
|
||||
window.initSortableRow = function(row) {
|
||||
row.classList.remove("no-sort");
|
||||
|
||||
const handle = qs(".handle", row);
|
||||
handle.addEventListener("mousedown", (event) => { startSorting(row, event) });
|
||||
handle.addEventListener("touchstart", (event) => { startSorting(row, event) });
|
||||
};
|
||||
|
||||
window.isSorting = function () {
|
||||
return dragHelper !== null;
|
||||
};
|
||||
|
||||
function startSorting(row, event) {
|
||||
event.preventDefault();
|
||||
|
||||
const pointerY = getPointerY(event);
|
||||
|
||||
const parent = row.parentNode;
|
||||
startY = pointerY - getOffsetTop(row);
|
||||
minY = getOffsetTop(parent);
|
||||
maxY = minY + parent.offsetHeight - row.offsetHeight;
|
||||
|
||||
placeholderRow = row.cloneNode(true);
|
||||
placeholderRow.classList.add("placeholder");
|
||||
parent.insertBefore(placeholderRow, row);
|
||||
|
||||
nextRow = row.nextElementSibling;
|
||||
|
||||
let top = pointerY - startY;
|
||||
let left = getOffsetLeft(row);
|
||||
let width = row.getBoundingClientRect().width;
|
||||
|
||||
if (row.tagName === "TR") {
|
||||
const firstChild = row.firstElementChild;
|
||||
const borderWidth = (firstChild.offsetWidth - firstChild.clientWidth) / 2;
|
||||
const borderHeight = (firstChild.offsetHeight - firstChild.clientHeight) / 2;
|
||||
|
||||
minY -= borderHeight;
|
||||
maxY -= borderHeight;
|
||||
top -= borderHeight;
|
||||
left -= borderWidth;
|
||||
width += 2 * borderWidth;
|
||||
|
||||
for (const child of row.children) {
|
||||
child.style.width = child.getBoundingClientRect().width + "px";
|
||||
}
|
||||
|
||||
dragHelper = document.createElement("table");
|
||||
dragHelper.appendChild(row);
|
||||
} else {
|
||||
dragHelper = row;
|
||||
}
|
||||
|
||||
dragHelper.style.top = `${top}px`;
|
||||
dragHelper.style.left = `${left}px`;
|
||||
dragHelper.style.width = `${width}px`;
|
||||
dragHelper.classList.add("dragging");
|
||||
document.body.appendChild(dragHelper);
|
||||
|
||||
window.addEventListener("mousemove", updateSorting);
|
||||
window.addEventListener("touchmove", updateSorting);
|
||||
|
||||
window.addEventListener("mouseup", finishSorting);
|
||||
window.addEventListener("touchend", finishSorting);
|
||||
window.addEventListener("touchcancel", finishSorting);
|
||||
}
|
||||
|
||||
function updateSorting(event) {
|
||||
const pointerY = getPointerY(event);
|
||||
|
||||
let top = Math.min(Math.max(pointerY - startY, minY), maxY);
|
||||
dragHelper.style.top = `${top}px`;
|
||||
|
||||
const parent = placeholderRow.parentNode;
|
||||
top = top - minY + parent.offsetTop;
|
||||
|
||||
let sibling;
|
||||
if (top > placeholderRow.offsetTop + placeholderRow.offsetHeight / 2) {
|
||||
sibling = !nextRow.classList.contains("no-sort") ? nextRow.nextElementSibling : nextRow;
|
||||
} else if (top + placeholderRow.offsetHeight < placeholderRow.offsetTop + placeholderRow.offsetHeight / 2) {
|
||||
sibling = placeholderRow.previousElementSibling;
|
||||
} else {
|
||||
sibling = nextRow;
|
||||
}
|
||||
|
||||
if (sibling !== nextRow) {
|
||||
const parent = placeholderRow.parentNode;
|
||||
|
||||
nextRow = sibling;
|
||||
if (sibling) {
|
||||
parent.insertBefore(placeholderRow, nextRow);
|
||||
} else {
|
||||
parent.appendChild(placeholderRow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishSorting() {
|
||||
dragHelper.classList.remove("dragging");
|
||||
dragHelper.style.top = null;
|
||||
dragHelper.style.left = null;
|
||||
dragHelper.style.width = null;
|
||||
|
||||
placeholderRow.parentNode.insertBefore(dragHelper.tagName === "TABLE" ? dragHelper.firstChild : dragHelper, placeholderRow);
|
||||
placeholderRow.remove();
|
||||
|
||||
placeholderRow = nextRow = dragHelper = null;
|
||||
|
||||
window.removeEventListener("mousemove", updateSorting);
|
||||
window.removeEventListener("touchmove", updateSorting);
|
||||
|
||||
window.removeEventListener("mouseup", finishSorting);
|
||||
window.removeEventListener("touchend", finishSorting);
|
||||
window.removeEventListener("touchcancel", finishSorting);
|
||||
}
|
||||
|
||||
function getPointerY(event) {
|
||||
if (event.type.includes("touch")) {
|
||||
const touch = event.touches[0] || event.changedTouches[0];
|
||||
return touch.clientY;
|
||||
} else {
|
||||
return event.clientY;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
||||
/** Toggles column context menu
|
||||
@@ -447,7 +706,7 @@ function columnMouse(className) {
|
||||
* @return boolean false
|
||||
*/
|
||||
function selectSearch(name) {
|
||||
var el = qs('#fieldset-search');
|
||||
var el = gid('fieldset-search');
|
||||
el.className = '';
|
||||
var divs = qsa('div', el);
|
||||
for (var i=0; i < divs.length; i++) {
|
||||
@@ -474,16 +733,6 @@ function isCtrl(event) {
|
||||
return (event.ctrlKey || event.metaKey) && !event.altKey; // shiftKey allowed
|
||||
}
|
||||
|
||||
/** Return event target
|
||||
* @param Event
|
||||
* @return HTMLElement
|
||||
*/
|
||||
function getTarget(event) {
|
||||
return event.target || event.srcElement;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Send form by Ctrl+Enter on <select> and <textarea>
|
||||
* @param KeyboardEvent
|
||||
* @param [string]
|
||||
@@ -491,7 +740,7 @@ function getTarget(event) {
|
||||
*/
|
||||
function bodyKeydown(event, button) {
|
||||
eventStop(event);
|
||||
var target = getTarget(event);
|
||||
var target = event.target;
|
||||
if (target.jushTextarea) {
|
||||
target = target.jushTextarea;
|
||||
}
|
||||
@@ -515,7 +764,7 @@ function bodyKeydown(event, button) {
|
||||
* @param MouseEvent
|
||||
*/
|
||||
function bodyClick(event) {
|
||||
var target = getTarget(event);
|
||||
var target = event.target;
|
||||
if ((isCtrl(event) || event.shiftKey) && target.type === 'submit' && isTag(target, 'input')) {
|
||||
target.form.target = '_blank';
|
||||
setTimeout(function () {
|
||||
@@ -533,7 +782,7 @@ function bodyClick(event) {
|
||||
*/
|
||||
function editingKeydown(event) {
|
||||
if ((event.keyCode === 40 || event.keyCode === 38) && isCtrl(event)) { // 40 - Down, 38 - Up
|
||||
var target = getTarget(event);
|
||||
var target = event.target;
|
||||
var sibling = (event.keyCode === 40 ? 'nextSibling' : 'previousSibling');
|
||||
var el = target.parentNode.parentNode[sibling];
|
||||
if (el && (isTag(el, 'tr') || (el = el[sibling])) && isTag(el, 'tr') && (el = el.childNodes[nodePosition(target.parentNode)]) && (el = el.childNodes[nodePosition(target)])) {
|
||||
@@ -547,37 +796,59 @@ function editingKeydown(event) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Disable maxlength for functions
|
||||
* @this HTMLSelectElement
|
||||
*/
|
||||
/**
|
||||
* Disables maxlength for functions and manages value visibility.
|
||||
*
|
||||
* @this HTMLSelectElement
|
||||
*/
|
||||
function functionChange() {
|
||||
var input = this.form[this.name.replace(/^function/, 'fields')];
|
||||
if (input) { // undefined with the set data type
|
||||
if (selectValue(this)) {
|
||||
if (input.origType === undefined) {
|
||||
input.origType = input.type;
|
||||
input.origMaxLength = input.getAttribute('data-maxlength');
|
||||
}
|
||||
input.removeAttribute('data-maxlength');
|
||||
input.type = 'text';
|
||||
} else if (input.origType) {
|
||||
input.type = input.origType;
|
||||
if (input.origMaxLength >= 0) {
|
||||
input.setAttribute('data-maxlength', input.origMaxLength);
|
||||
}
|
||||
}
|
||||
oninput({target: input});
|
||||
const input = this.form[this.name.replace(/^function/, 'fields')];
|
||||
const value = selectValue(this);
|
||||
|
||||
// Undefined with the set data type.
|
||||
if (!input) {
|
||||
return;
|
||||
}
|
||||
helpClose();
|
||||
|
||||
if (value) {
|
||||
if (input.origType === undefined) {
|
||||
input.origType = input.type;
|
||||
input.origMaxLength = input.getAttribute('data-maxlength');
|
||||
}
|
||||
|
||||
input.removeAttribute('data-maxlength');
|
||||
input.type = 'text';
|
||||
} else if (input.origType) {
|
||||
input.type = input.origType;
|
||||
if (input.origMaxLength >= 0) {
|
||||
input.setAttribute('data-maxlength', input.origMaxLength);
|
||||
}
|
||||
}
|
||||
|
||||
// Hide input value if it will be not used by selected function.
|
||||
if (value === "NULL" || value === "now") {
|
||||
if (input.value !== "") {
|
||||
input.dataset.lastValue = input.value;
|
||||
input.value = "";
|
||||
}
|
||||
} else if (input.dataset.lastValue) {
|
||||
input.value = input.dataset.lastValue;
|
||||
}
|
||||
|
||||
oninput({target: input});
|
||||
}
|
||||
|
||||
/** Skip 'original' when typing
|
||||
* @param number
|
||||
* @this HTMLTableCellElement
|
||||
*/
|
||||
/**
|
||||
* Unset 'original', 'NULL' and 'now' functions when typing.
|
||||
*
|
||||
* @param first number
|
||||
* @this HTMLTableCellElement
|
||||
*/
|
||||
function skipOriginal(first) {
|
||||
var fnSelect = this.previousSibling.firstChild;
|
||||
if (fnSelect.selectedIndex < first) {
|
||||
const fnSelect = this.previousSibling.firstChild;
|
||||
const value = selectValue(fnSelect);
|
||||
|
||||
if (fnSelect.selectedIndex < first || value === "NULL" || value === "now") {
|
||||
fnSelect.selectedIndex = first;
|
||||
}
|
||||
}
|
||||
@@ -609,7 +880,7 @@ function fieldChange() {
|
||||
function ajax(url, callback, data, message) {
|
||||
var request = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false));
|
||||
if (request) {
|
||||
var ajaxStatus = qs('#ajaxstatus');
|
||||
var ajaxStatus = gid('ajaxstatus');
|
||||
if (message) {
|
||||
ajaxStatus.innerHTML = '<div class="message">' + message + '</div>';
|
||||
ajaxStatus.className = ajaxStatus.className.replace(/ hidden/g, '');
|
||||
@@ -679,9 +950,9 @@ function ajaxForm(form, message, button) {
|
||||
return ajax(url, function (request) {
|
||||
setHtml('ajaxstatus', request.responseText);
|
||||
if (window.jush) {
|
||||
jush.highlight_tag(qsa('code', qs('#ajaxstatus')), 0);
|
||||
jush.highlight_tag(qsa('code', gid('ajaxstatus')), 0);
|
||||
}
|
||||
messagesPrint(qs('#ajaxstatus'));
|
||||
messagesPrint(gid('ajaxstatus'));
|
||||
}, data, message);
|
||||
}
|
||||
|
||||
@@ -696,7 +967,7 @@ function ajaxForm(form, message, button) {
|
||||
*/
|
||||
function selectClick(event, text, warning) {
|
||||
var td = this;
|
||||
var target = getTarget(event);
|
||||
var target = event.target;
|
||||
if (!isCtrl(event) || isTag(td.firstChild, 'input|textarea') || isTag(target, 'a')) {
|
||||
return;
|
||||
}
|
||||
@@ -716,9 +987,13 @@ function selectClick(event, text, warning) {
|
||||
td.innerHTML = original;
|
||||
}
|
||||
};
|
||||
var pos = event.rangeOffset;
|
||||
var value = (td.firstChild && td.firstChild.alt) || td.textContent || td.innerText;
|
||||
input.style.width = Math.max(td.clientWidth - 14, 20) + 'px'; // 14 = 2 * (td.border + td.padding + input.border)
|
||||
|
||||
let pos = event.rangeOffset;
|
||||
let value = (td.firstChild && td.firstChild.alt) || td.textContent || td.innerText;
|
||||
const tdStyle = window.getComputedStyle(td, null);
|
||||
|
||||
input.style.width = Math.max(td.clientWidth - parseFloat(tdStyle.paddingLeft) - parseFloat(tdStyle.paddingRight), 20) + 'px';
|
||||
|
||||
if (text) {
|
||||
var rows = 1;
|
||||
value.replace(/\n/g, function () {
|
||||
@@ -779,7 +1054,7 @@ function selectLoadMore(limit, loading) {
|
||||
return !ajax(href, function (request) {
|
||||
var tbody = document.createElement('tbody');
|
||||
tbody.innerHTML = request.responseText;
|
||||
qs('#table').appendChild(tbody);
|
||||
gid('table').appendChild(tbody);
|
||||
if (tbody.children.length < limit) {
|
||||
a.parentNode.removeChild(a);
|
||||
} else {
|
||||
@@ -833,9 +1108,9 @@ function setupSubmitHighlightInput(input) {
|
||||
* @this HTMLInputElement
|
||||
*/
|
||||
function inputFocus() {
|
||||
var submit = findDefaultSubmit(this);
|
||||
const submit = findDefaultSubmit(this);
|
||||
if (submit) {
|
||||
alterClass(submit, 'default', true);
|
||||
submit.classList.toggle('default', true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -843,9 +1118,9 @@ function inputFocus() {
|
||||
* @this HTMLInputElement
|
||||
*/
|
||||
function inputBlur() {
|
||||
var submit = findDefaultSubmit(this);
|
||||
const submit = findDefaultSubmit(this);
|
||||
if (submit) {
|
||||
alterClass(submit, 'default');
|
||||
submit.classList.toggle('default', false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -914,8 +1189,22 @@ function cloneNode(el) {
|
||||
return el2;
|
||||
}
|
||||
|
||||
function getOffsetTop(element) {
|
||||
let box = element.getBoundingClientRect();
|
||||
|
||||
return box.top + window.scrollY;
|
||||
}
|
||||
|
||||
function getOffsetLeft(element) {
|
||||
let box = element.getBoundingClientRect();
|
||||
|
||||
return box.left + window.scrollX;
|
||||
}
|
||||
|
||||
oninput = function (event) {
|
||||
var target = event.target;
|
||||
var maxLength = target.getAttribute('data-maxlength');
|
||||
alterClass(target, 'maxlength', target.value && maxLength != null && target.value.length > maxLength); // maxLength could be 0
|
||||
const target = event.target;
|
||||
const maxLength = target.getAttribute('data-maxlength');
|
||||
|
||||
// maxLength could be 0
|
||||
target.classList.toggle('maxlength', target.value && maxLength != null && target.value.length > maxLength);
|
||||
};
|
||||
|
@@ -7,9 +7,19 @@ if (!$fields) {
|
||||
$table_status = table_status1($TABLE, true);
|
||||
$name = $adminer->tableName($table_status);
|
||||
|
||||
$rights = [];
|
||||
foreach ($fields as $key => $field) {
|
||||
$rights += $field["privileges"];
|
||||
}
|
||||
|
||||
page_header(($fields && is_view($table_status) ? $table_status['Engine'] == 'materialized view' ? lang('Materialized view') : lang('View') : lang('Table')) . ": " . ($name != "" ? $name : h($TABLE)), $error);
|
||||
|
||||
$adminer->selectLinks($table_status);
|
||||
$set = null;
|
||||
if (isset($rights["insert"]) || !support("table")) {
|
||||
$set = "";
|
||||
}
|
||||
$adminer->selectLinks($table_status, $set);
|
||||
|
||||
$comment = $table_status["Comment"];
|
||||
if ($comment != "") {
|
||||
echo "<p class='nowrap'>" . lang('Comment') . ": " . h($comment) . "\n";
|
||||
@@ -17,6 +27,22 @@ if ($comment != "") {
|
||||
|
||||
if ($fields) {
|
||||
$adminer->tableStructurePrint($fields);
|
||||
|
||||
if (is_view($table_status)) {
|
||||
$editLink = '<p class="links"><a href="' . h(ME) . 'view=' . urlencode($TABLE) . '">' . lang('Alter view') . "</a>\n";
|
||||
} else {
|
||||
$editLink = '<p class="links"><a href="' . h(ME) . 'create=' . urlencode($TABLE) . '">' . lang('Alter table') . "</a>\n";
|
||||
}
|
||||
echo $editLink;
|
||||
|
||||
if (support("partitioning") && preg_match("~partitioned~", $table_status["Create_options"])) {
|
||||
echo "<h3 id='partition-by'>" . lang('Partition by') . "</h3>\n";
|
||||
|
||||
$partitions_info = get_partitions_info($TABLE);
|
||||
$adminer->tablePartitionsPrint($partitions_info);
|
||||
|
||||
echo $editLink;
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_view($table_status)) {
|
||||
@@ -28,12 +54,12 @@ if (!is_view($table_status)) {
|
||||
}
|
||||
echo '<p class="links"><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n";
|
||||
}
|
||||
|
||||
|
||||
if (fk_support($table_status)) {
|
||||
echo "<h3 id='foreign-keys'>" . lang('Foreign keys') . "</h3>\n";
|
||||
$foreign_keys = foreign_keys($TABLE);
|
||||
if ($foreign_keys) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<table>\n";
|
||||
echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . "<td></thead>\n";
|
||||
foreach ($foreign_keys as $name => $foreign_key) {
|
||||
echo "<tr title='" . h($name) . "'>";
|
||||
@@ -57,9 +83,9 @@ if (support(is_view($table_status) ? "view_trigger" : "trigger")) {
|
||||
echo "<h3 id='triggers'>" . lang('Triggers') . "</h3>\n";
|
||||
$triggers = triggers($TABLE);
|
||||
if ($triggers) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<table>\n";
|
||||
foreach ($triggers as $key => $val) {
|
||||
echo "<tr valign='top'><td>" . h($val[0]) . "<td>" . h($val[1]) . "<th>" . h($key) . "<td><a href='" . h(ME . 'trigger=' . urlencode($TABLE) . '&name=' . urlencode($key)) . "'>" . lang('Alter') . "</a>\n";
|
||||
echo "<tr><td>" . h($val[0]) . "<td>" . h($val[1]) . "<th>" . h($key) . "<td><a href='" . h(ME . 'trigger=' . urlencode($TABLE) . '&name=' . urlencode($key)) . "'>" . lang('Alter') . "</a>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ page_header(($name != "" ? lang('Alter trigger') . ": " . h($name) : lang('Creat
|
||||
<tr><th><?php echo lang('Type'); ?><td><?php echo html_select("Type", $trigger_options["Type"], $row["Type"]); ?>
|
||||
</table>
|
||||
<p><?php echo lang('Name'); ?>: <input name="Trigger" value="<?php echo h($row["Trigger"]); ?>" data-maxlength="64" autocapitalize="off">
|
||||
<?php echo script("qs('#form')['Timing'].onchange();"); ?>
|
||||
<?php echo script("gid('form')['Timing'].onchange();"); ?>
|
||||
<p><?php textarea("Statement", $row["Statement"]); ?>
|
||||
<p>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
|
@@ -126,7 +126,14 @@ if ($_POST) {
|
||||
if ($old_pass != "") {
|
||||
$row["hashed"] = true;
|
||||
}
|
||||
$grants[(DB == "" || $grants ? "" : idf_escape(addcslashes(DB, "%_\\"))) . ".*"] = array();
|
||||
|
||||
if ($grants) {
|
||||
$grants[".*"] = [];
|
||||
} elseif (DB != "") {
|
||||
$grants[idf_escape(addcslashes(DB, "%_\\")) . ".*"] = [];
|
||||
} else {
|
||||
$grants["*.* "] = []; // Space is added to force editing mode.
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -135,20 +142,28 @@ if ($_POST) {
|
||||
<tr><th><?php echo lang('Server'); ?><td><input name="host" data-maxlength="60" value="<?php echo h($row["host"]); ?>" autocapitalize="off">
|
||||
<tr><th><?php echo lang('Username'); ?><td><input name="user" data-maxlength="80" value="<?php echo h($row["user"]); ?>" autocapitalize="off">
|
||||
<tr><th><?php echo lang('Password'); ?><td><input name="pass" id="pass" value="<?php echo h($row["pass"]); ?>" autocomplete="new-password">
|
||||
<?php if (!$row["hashed"]) { echo script("typePassword(qs('#pass'));"); } ?>
|
||||
<?php if (!$row["hashed"]) { echo script("typePassword(gid('pass'));"); } ?>
|
||||
<?php echo (min_version(8) ? "" : checkbox("hashed", 1, $row["hashed"], lang('Hashed'), "typePassword(this.form['pass'], this.checked);")); ?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
//! MAX_* limits, REQUIRE
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<thead><tr><th colspan='2'>" . lang('Privileges') . doc_link(array('sql' => "grant.html#priv_level"));
|
||||
echo "<table>\n";
|
||||
|
||||
echo "<thead><tr><th colspan='2'>" . lang('Privileges') . doc_link(array('sql' => "grant.html#priv_level")) . "</th>";
|
||||
$i = 0;
|
||||
foreach ($grants as $object => $grant) {
|
||||
echo '<th>' . ($object != "*.*" ? "<input name='objects[$i]' value='" . h($object) . "' size='10' autocapitalize='off'>" : "<input type='hidden' name='objects[$i]' value='*.*' size='10'>*.*"); //! separate db, table, columns, PROCEDURE|FUNCTION, routine
|
||||
echo "<th>";
|
||||
//! separate db, table, columns, PROCEDURE|FUNCTION, routine
|
||||
if ($object == "*.*") {
|
||||
echo "<input type='hidden' name='objects[$i]' value='*.*' size='10'>*.*";
|
||||
} else {
|
||||
echo "<input name='objects[$i]' value='" . h(trim($object)) . "' size='10' autocapitalize='off'>";
|
||||
}
|
||||
echo "</th>";
|
||||
$i++;
|
||||
}
|
||||
echo "</thead>\n";
|
||||
echo "</tr></thead>\n";
|
||||
|
||||
foreach ([
|
||||
"" => "",
|
||||
|
@@ -6,7 +6,7 @@ $variables = ($status ? show_status() : show_variables());
|
||||
if (!$variables) {
|
||||
echo "<p class='message'>" . lang('No rows.') . "\n";
|
||||
} else {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<table>\n";
|
||||
foreach ($variables as $key => $val) {
|
||||
echo "<tr>";
|
||||
echo "<th><code class='jush-" . $jush . ($status ? "status" : "set") . "'>" . h($key) . "</code>";
|
||||
|
1009
changes.txt
1009
changes.txt
File diff suppressed because it is too large
Load Diff
@@ -439,13 +439,14 @@ if ($_SESSION["lang"]) {
|
||||
$file = str_replace("<?php switch_lang(); ?>\n", "", $file);
|
||||
$file = str_replace('<?php echo $LANG; ?>', $_SESSION["lang"], $file);
|
||||
}
|
||||
$file = str_replace('<?php echo script_src("static/editing.js"); ?>' . "\n", "", $file);
|
||||
$file = str_replace('<?php echo script_src("static/editing.js?" . filemtime("../adminer/static/editing.js")); ?>' . "\n", "", $file);
|
||||
$file = preg_replace('~\s+echo script_src\("\.\./vendor/vrana/jush/modules/jush-(textarea|txt|js|\$jush)\.js"\);~', '', $file);
|
||||
$file = str_replace('<link rel="stylesheet" type="text/css" href="../vendor/vrana/jush/jush.css">' . "\n", "", $file);
|
||||
$file = preg_replace_callback("~compile_file\\('([^']+)'(?:, '([^']*)')?\\)~", 'compile_file', $file); // integrate static files
|
||||
$replace = 'preg_replace("~\\\\\\\\?.*~", "", ME) . "?file=\1&version=' . substr(md5(microtime()), 0, 8) . '"';
|
||||
$file = preg_replace('~\.\./adminer/static/(default\.css|favicon\.ico)~', '<?php echo h(' . $replace . '); ?>', $file);
|
||||
$file = preg_replace('~"\.\./adminer/static/(functions\.js)"~', $replace, $file);
|
||||
$file = preg_replace('~\.\./adminer/static/(favicon\.ico)~', '<?php echo h(' . $replace . '); ?>', $file);
|
||||
$file = preg_replace('~\.\./adminer/static/(default\.css)\?.*default.css"\);\s+\?>~', '<?php echo h(' . $replace . '); ?>', $file);
|
||||
$file = preg_replace('~"\.\./adminer/static/(functions\.js)\?".*functions.js"\)~', $replace, $file);
|
||||
$file = preg_replace('~\.\./adminer/static/([^\'"]*)~', '" . h(' . $replace . ') . "', $file);
|
||||
$file = preg_replace('~"\.\./vendor/vrana/jush/modules/(jush\.js)"~', $replace, $file);
|
||||
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
|
||||
|
@@ -29,7 +29,7 @@
|
||||
"php": "5.6 - 8.3",
|
||||
"ext-pdo": "*",
|
||||
"ext-json": "*",
|
||||
"vrana/jush": "@dev",
|
||||
"vrana/jush": "2.0.*",
|
||||
"vrana/jsshrink": "@dev"
|
||||
},
|
||||
"suggest": {
|
||||
@@ -57,7 +57,7 @@
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/vrana/jush.git"
|
||||
"url": "https://github.com/pematon/jush.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
|
@@ -62,7 +62,7 @@ if (!extension_loaded("xdebug")) {
|
||||
if (file_exists($coverage_filename)) {
|
||||
// display list of files
|
||||
$coverage = unserialize(file_get_contents($coverage_filename));
|
||||
echo "<table border='1' cellspacing='0'>\n";
|
||||
echo "<table>\n";
|
||||
foreach (array_merge(glob("adminer/*.php"), glob("adminer/include/*.php"), glob("editor/*.php"), glob("editor/include/*.php")) as $filename) {
|
||||
$cov = $coverage[realpath($filename)];
|
||||
$ratio = 0;
|
||||
|
@@ -11,11 +11,11 @@ if ($adminer->homepage()) {
|
||||
echo "<table cellspacing='0' class='nowrap checkable'>\n";
|
||||
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
|
||||
echo '<thead><tr class="wrap">';
|
||||
echo '<td><input id="check-all" type="checkbox" class="jsonly">' . script("qs('#check-all').onclick = partial(formCheck, /^tables\[/);", "");
|
||||
echo '<td><input id="check-all" type="checkbox" class="jsonly">' . script("gid('check-all').onclick = partial(formCheck, /^tables\[/);", "");
|
||||
echo '<th>' . lang('Table');
|
||||
echo '<td>' . lang('Rows');
|
||||
echo "</thead>\n";
|
||||
|
||||
|
||||
foreach (table_status() as $table => $row) {
|
||||
$name = $adminer->tableName($row);
|
||||
if (isset($row["Engine"]) && $name != "") {
|
||||
@@ -25,7 +25,7 @@ if ($adminer->homepage()) {
|
||||
echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "</a>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
echo "</form>\n";
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
class Adminer {
|
||||
var $operators = array("<=", ">=");
|
||||
var $operator_like = null;
|
||||
var $operator_regexp = null;
|
||||
var $_values = array();
|
||||
|
||||
function name() {
|
||||
@@ -16,8 +18,11 @@ class Adminer {
|
||||
function connectSsl() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Random\RandomException
|
||||
*/
|
||||
function permanentLogin($create = false) {
|
||||
return password_file($create);
|
||||
return get_private_key($create);
|
||||
}
|
||||
|
||||
function bruteForceKey() {
|
||||
@@ -72,7 +77,7 @@ class Adminer {
|
||||
|
||||
function loginForm() {
|
||||
echo "<table cellspacing='0' class='layout'>\n";
|
||||
echo $this->loginFormField('username', '<tr><th>' . lang('Username') . '<td>', '<input type="hidden" name="auth[driver]" value="server"><input name="auth[username]" id="username" value="' . h($_GET["username"]) . '" autocomplete="username" autocapitalize="off">' . script("focus(qs('#username'));"));
|
||||
echo $this->loginFormField('username', '<tr><th>' . lang('Username') . '<td>', '<input type="hidden" name="auth[driver]" value="server"><input name="auth[username]" id="username" value="' . h($_GET["username"]) . '" autocomplete="username" autocapitalize="off">' . script("focus(gid('username'));"));
|
||||
echo $this->loginFormField('password', '<tr><th>' . lang('Password') . '<td>', '<input type="password" name="auth[password]" autocomplete="current-password">' . "\n");
|
||||
echo "</table>\n";
|
||||
echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
|
||||
@@ -259,15 +264,20 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||
if (($val["col"] == "" || $columns[$val["col"]]) && "$val[col]$val[val]" != "") {
|
||||
echo "<div><select name='where[$i][col]'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, $val["col"], true) . "</select>";
|
||||
echo html_select("where[$i][op]", array(-1 => "") + $this->operators, $val["op"]);
|
||||
echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "'>" . script("mixin(qsl('input'), {onkeydown: selectSearchKeydown, onsearch: selectSearchSearch});", "") . "</div>\n";
|
||||
echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "'>" . script("mixin(qsl('input'), {onkeydown: selectSearchKeydown, onsearch: selectSearchSearch});", "");
|
||||
echo " <input type='image' src='../adminer/static/cross.gif' class='jsonly icon remove' title='" . h(lang('Remove')) . "' alt='x'>" . script('qsl("#fieldset-search .remove").onclick = selectRemoveRow;', "");
|
||||
echo "</div>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
echo "<div><select name='where[$i][col]'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, null, true) . "</select>";
|
||||
echo script("qsl('select').onchange = selectAddRow;", "");
|
||||
echo html_select("where[$i][op]", array(-1 => "") + $this->operators);
|
||||
echo "<input type='search' name='where[$i][val]'></div>";
|
||||
echo "<input type='search' name='where[$i][val]'>";
|
||||
echo script("mixin(qsl('input'), {onchange: function () { this.parentNode.firstChild.onchange(); }, onsearch: selectSearchSearch});");
|
||||
echo " <input type='image' src='../adminer/static/cross.gif' class='jsonly icon remove' title='" . h(lang('Remove')) . "' alt='x'>";
|
||||
echo script('qsl("#fieldset-search .remove").onclick = selectRemoveRow;', "");
|
||||
echo "</div>";
|
||||
echo "</div></fieldset>\n";
|
||||
}
|
||||
|
||||
@@ -350,10 +360,10 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||
$op = $where["op"];
|
||||
$val = $where["val"];
|
||||
|
||||
if (($key < 0 ? "" : $col) . $val != "") {
|
||||
$conds = array();
|
||||
if (($key >= 0 && $col != "") || $val != "") {
|
||||
$conds = [];
|
||||
|
||||
foreach (($col != "" ? array($col => $fields[$col]) : $fields) as $name => $field) {
|
||||
foreach (($col != "" ? [$col => $fields[$col]] : $fields) as $name => $field) {
|
||||
if ($col != "" || is_numeric($val) || !preg_match(number_type(), $field["type"])) {
|
||||
$name = idf_escape($name);
|
||||
|
||||
@@ -480,7 +490,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||
return $return;
|
||||
}
|
||||
|
||||
function editInput($table, $field, $attrs, $value) {
|
||||
function editInput($table, $field, $attrs, $value, $function) {
|
||||
if ($field["type"] == "enum") {
|
||||
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
|
||||
. enum_input("radio", $attrs, $field, ($value || isset($_GET["select"]) ? $value : 0), ($field["null"] ? "" : null))
|
||||
@@ -508,7 +518,9 @@ qsl('div').onclick = whisperClick;", "")
|
||||
$hint = lang('[yyyy]-mm-dd') . ($hint ? " [$hint]" : "");
|
||||
}
|
||||
if ($hint) {
|
||||
return "<input value='" . h($value) . "'$attrs> ($hint)"; //! maxlength
|
||||
return "<input"
|
||||
. ($function != "now" ? " value='" . h($value) . "'" : " data-last-value='" . h($value) . "'")
|
||||
. "$attrs> ($hint)"; //! maxlength
|
||||
}
|
||||
if (preg_match('~_(md5|sha1)$~i', $field["field"])) {
|
||||
return "<input type='password' value='" . h($value) . "'$attrs>";
|
||||
@@ -579,6 +591,7 @@ qsl('div').onclick = whisperClick;", "")
|
||||
}
|
||||
|
||||
function importServerPath() {
|
||||
return null;
|
||||
}
|
||||
|
||||
function homepage() {
|
||||
@@ -591,8 +604,12 @@ qsl('div').onclick = whisperClick;", "")
|
||||
<h1>
|
||||
<?php echo $this->name(); ?>
|
||||
<?php if ($missing != "auth"): ?>
|
||||
<span class="version"><?php echo $VERSION; ?></span>
|
||||
<a href="https://www.adminer.org/editor/#download"<?php echo target_blank(); ?> id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
|
||||
<span class="version">
|
||||
<?php echo $VERSION; ?>
|
||||
<a href="https://github.com/pematon/adminer/releases"<?php echo target_blank(); ?> id="version">
|
||||
<?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</h1>
|
||||
<?php
|
||||
@@ -603,7 +620,7 @@ qsl('div').onclick = whisperClick;", "")
|
||||
if ($password !== null) {
|
||||
if ($first) {
|
||||
echo "<ul id='logins'>";
|
||||
echo script("mixin(qs('#logins'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
echo script("mixin(gid('logins'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
$first = false;
|
||||
}
|
||||
echo "<li><a href='" . h(auth_url($vendor, "", $username)) . "'>" . ($username != "" ? h($username) : "<i>" . lang('empty') . "</i>") . "</a>\n";
|
||||
@@ -617,6 +634,7 @@ qsl('div').onclick = whisperClick;", "")
|
||||
if (!$table_status) {
|
||||
echo "<p class='message'>" . lang('No tables.') . "\n";
|
||||
} else {
|
||||
$this->printTablesFilter();
|
||||
$this->tablesPrint($table_status);
|
||||
}
|
||||
}
|
||||
@@ -626,19 +644,32 @@ qsl('div').onclick = whisperClick;", "")
|
||||
function databasesPrint($missing) {
|
||||
}
|
||||
|
||||
function printTablesFilter()
|
||||
{
|
||||
global $adminer;
|
||||
|
||||
echo "<div class='tables-filter jsonly'>"
|
||||
. "<input id='tables-filter' autocomplete='off' placeholder='" . lang('Table') . "'>"
|
||||
. script("initTablesFilter(" . json_encode($adminer->database()) . ");")
|
||||
. "</div>\n";
|
||||
}
|
||||
|
||||
function tablesPrint($tables) {
|
||||
echo "<ul id='tables'>";
|
||||
echo script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
echo "<ul id='tables'>" . script("mixin(gid('tables'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
|
||||
foreach ($tables as $row) {
|
||||
echo '<li>';
|
||||
$name = $this->tableName($row);
|
||||
if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name
|
||||
echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'"
|
||||
. bold($_GET["select"] == $row["Name"] || $_GET["edit"] == $row["Name"], "select")
|
||||
. " title='" . lang('Select data') . "'>$name</a>\n"
|
||||
;
|
||||
// Skip views and tables without a name.
|
||||
if (!isset($row["Engine"]) || ($name = $this->tableName($row)) == "") {
|
||||
continue;
|
||||
}
|
||||
|
||||
$active = $_GET["select"] == $row["Name"] || $_GET["edit"] == $row["Name"];
|
||||
|
||||
echo '<li><a href="' . h(ME) . 'select=' . urlencode($row["Name"]) . '"'
|
||||
. bold($active, "select")
|
||||
. " title='" . lang('Select data') . "' data-main='true'>$name</a></li>\n";
|
||||
}
|
||||
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
@@ -652,6 +683,8 @@ qsl('div').onclick = whisperClick;", "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function _foreignKeyOptions($table, $column, $value = null) {
|
||||
|
@@ -17,7 +17,7 @@ function email_header($header) {
|
||||
* @return bool
|
||||
*/
|
||||
function send_mail($email, $subject, $message, $from = "", $files = array()) {
|
||||
$eol = (DIRECTORY_SEPARATOR == "/" ? "\n" : "\r\n"); // PHP_EOL available since PHP 5.0.2
|
||||
$eol = "\r\n";
|
||||
$message = str_replace("\n", $eol, wordwrap(str_replace("\r", "", "$message\n")));
|
||||
$boundary = uniqid("boundary");
|
||||
$attachments = "";
|
||||
|
@@ -1,11 +1,14 @@
|
||||
<?php
|
||||
/** Adminer Editor - Compact database editor
|
||||
* @link https://www.adminer.org/
|
||||
* @author Jakub Vrana, https://www.vrana.cz/
|
||||
* @copyright 2009 Jakub Vrana
|
||||
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
||||
*/
|
||||
/**
|
||||
* Adminer Editor - Compact database editor for end-users
|
||||
*
|
||||
* @link https://github.com/pematon/adminer
|
||||
* @author Jakub Vrana (https://www.vrana.cz/)
|
||||
* @author Peter Knut
|
||||
* @copyright 2009-2021 Jakub Vrana, 2024 Peter Knut
|
||||
* @license Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
|
||||
* @license GNU General Public License, version 2 (https://www.gnu.org/licenses/gpl-2.0.html)
|
||||
*/
|
||||
|
||||
include "../adminer/include/bootstrap.inc.php";
|
||||
$drivers[DRIVER] = lang('Login');
|
||||
|
@@ -6,13 +6,14 @@ function messagesPrint() {
|
||||
function selectFieldChange() {
|
||||
}
|
||||
|
||||
var helpOpen;
|
||||
// Help.
|
||||
(function() {
|
||||
window.initHelpPopup = function () {
|
||||
};
|
||||
|
||||
function helpMouseover() {
|
||||
}
|
||||
|
||||
function helpMouseout() {
|
||||
}
|
||||
window.initHelpFor = function(element, content, side = false) {
|
||||
};
|
||||
})();
|
||||
|
||||
/** Display typeahead
|
||||
* @param string
|
||||
@@ -42,7 +43,7 @@ function whisper(url) {
|
||||
*/
|
||||
function whisperClick(event) {
|
||||
var field = this.previousSibling;
|
||||
var el = getTarget(event);
|
||||
var el = event.target;
|
||||
if (isTag(el, 'a') && !(event.button || event.shiftKey || event.altKey || isCtrl(event))) {
|
||||
field.value = el.firstChild.data;
|
||||
field.previousSibling.value = decodeURIComponent(el.href.replace(/.*=/, ''));
|
||||
|
21
plugins/adminer.js.php
Normal file
21
plugins/adminer.js.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Enables auto-detection and inclusion of adminer.js, like adminer.css
|
||||
*
|
||||
* @author Roy Orbitson, https://github.com/Roy-Orbison
|
||||
*
|
||||
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
||||
*/
|
||||
class AdminerDotJs
|
||||
{
|
||||
const FileName = "adminer.js";
|
||||
|
||||
function head()
|
||||
{
|
||||
if (file_exists(self::FileName)) {
|
||||
echo script_src(self::FileName . "?v=" . crc32(file_get_contents(self::FileName))), "\n";
|
||||
}
|
||||
}
|
||||
}
|
@@ -427,6 +427,7 @@ if (isset($_GET["clickhouse"])) {
|
||||
'structured_types' => $structured_types,
|
||||
'unsigned' => array(),
|
||||
'operators' => array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"),
|
||||
'operator_like' => "LIKE %%",
|
||||
'functions' => array(),
|
||||
'grouping' => array("avg", "count", "count distinct", "max", "min", "sum"),
|
||||
'edit_functions' => array(),
|
||||
|
@@ -155,28 +155,12 @@ if (isset($_GET["elastic"])) {
|
||||
foreach ($where as $val) {
|
||||
if (preg_match('~^\((.+ OR .+)\)$~', $val, $matches)) {
|
||||
$parts = explode(" OR ", $matches[1]);
|
||||
$terms = array();
|
||||
foreach ($parts as $part) {
|
||||
list($col, $op, $val) = explode(" ", $part, 3);
|
||||
$term = array($col => $val);
|
||||
if ($op == "=") {
|
||||
$terms[] = array("term" => $term);
|
||||
} elseif (in_array($op, array("must", "should", "must_not"))) {
|
||||
$data["query"]["bool"][$op][]["match"] = $term;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($terms)) {
|
||||
$data["query"]["bool"]["filter"][]["bool"]["should"] = $terms;
|
||||
foreach ($parts as $part) {
|
||||
$this->addQueryCondition($part, $data);
|
||||
}
|
||||
} else {
|
||||
list($col, $op, $val) = explode(" ", $val, 3);
|
||||
$term = array($col => $val);
|
||||
if ($op == "=") {
|
||||
$data["query"]["bool"]["filter"][] = array("term" => $term);
|
||||
} elseif (in_array($op, array("must", "should", "must_not"))) {
|
||||
$data["query"]["bool"][$op][]["match"] = $term;
|
||||
}
|
||||
$this->addQueryCondition($val, $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,6 +200,33 @@ if (isset($_GET["elastic"])) {
|
||||
return new Min_Result($return);
|
||||
}
|
||||
|
||||
private function addQueryCondition($val, &$data)
|
||||
{
|
||||
list($col, $op, $val) = explode(" ", $val, 3);
|
||||
|
||||
if (!preg_match('~^([^(]+)\(([^)]+)\)$~', $op, $matches)) {
|
||||
return;
|
||||
}
|
||||
$queryType = $matches[1]; // must, should, must_not
|
||||
$matchType = $matches[2]; // term, match, regexp
|
||||
|
||||
if ($matchType == "regexp") {
|
||||
$data["query"]["bool"][$queryType][] = [
|
||||
"regexp" => [
|
||||
$col => [
|
||||
"value" => $val,
|
||||
"flags" => "ALL",
|
||||
"case_insensitive" => true,
|
||||
]
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$data["query"]["bool"][$queryType][] = [
|
||||
$matchType => [$col => $val]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
function update($type, $record, $queryWhere, $limit = 0, $separator = "\n") {
|
||||
//! use $limit
|
||||
$parts = preg_split('~ *= *~', $queryWhere);
|
||||
@@ -265,10 +276,6 @@ if (isset($_GET["elastic"])) {
|
||||
|
||||
return $this->_conn->affected_rows;
|
||||
}
|
||||
|
||||
function convertOperator($operator) {
|
||||
return $operator == "LIKE %%" ? "should" : $operator;
|
||||
}
|
||||
}
|
||||
|
||||
function connect() {
|
||||
@@ -452,18 +459,13 @@ if (isset($_GET["elastic"])) {
|
||||
$result = array(
|
||||
"_id" => array(
|
||||
"field" => "_id",
|
||||
"full_type" => "text",
|
||||
"type" => "text",
|
||||
"full_type" => "_id",
|
||||
"type" => "_id",
|
||||
"privileges" => array("insert" => 1, "select" => 1, "where" => 1, "order" => 1),
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($mappings as $name => $field) {
|
||||
$has_index = !isset($field["index"]) || $field["index"];
|
||||
|
||||
// TODO: privileges: where => $has_index
|
||||
// TODO: privileges: sort => $field["type"] != "text"
|
||||
|
||||
$result[$name] = array(
|
||||
"field" => $name,
|
||||
"full_type" => $field["type"],
|
||||
@@ -568,9 +570,9 @@ if (isset($_GET["elastic"])) {
|
||||
$structured_types = array();
|
||||
|
||||
foreach (array(
|
||||
lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
|
||||
lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21, "boolean" => 1),
|
||||
lang('Date and time') => array("date" => 10),
|
||||
lang('Strings') => array("string" => 65535, "text" => 65535),
|
||||
lang('Strings') => array("string" => 65535, "text" => 65535, "keyword" => 65535),
|
||||
lang('Binary') => array("binary" => 255),
|
||||
) as $key => $val) {
|
||||
$types += $val;
|
||||
@@ -580,7 +582,13 @@ if (isset($_GET["elastic"])) {
|
||||
return array(
|
||||
'possible_drivers' => array("json + allow_url_fopen"),
|
||||
'jush' => "elastic",
|
||||
'operators' => array("=", "must", "should", "must_not"),
|
||||
'operators' => array(
|
||||
"must(term)", "must(match)", "must(regexp)",
|
||||
"should(term)", "should(match)", "should(regexp)",
|
||||
"must_not(term)", "must_not(match)", "must_not(regexp)",
|
||||
),
|
||||
'operator_like' => "should(match)",
|
||||
'operator_regexp' => "should(regexp)",
|
||||
'functions' => array(),
|
||||
'grouping' => array(),
|
||||
'edit_functions' => array(array("json")),
|
||||
|
@@ -154,28 +154,12 @@ if (isset($_GET["elastic5"])) {
|
||||
foreach ($where as $val) {
|
||||
if (preg_match('~^\((.+ OR .+)\)$~', $val, $matches)) {
|
||||
$parts = explode(" OR ", $matches[1]);
|
||||
$terms = array();
|
||||
foreach ($parts as $part) {
|
||||
list($col, $op, $val) = explode(" ", $part, 3);
|
||||
$term = array($col => $val);
|
||||
if ($op == "=") {
|
||||
$terms[] = array("term" => $term);
|
||||
} elseif (in_array($op, array("must", "should", "must_not"))) {
|
||||
$data["query"]["bool"][$op][]["match"] = $term;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($terms)) {
|
||||
$data["query"]["bool"]["filter"][]["bool"]["should"] = $terms;
|
||||
foreach ($parts as $part) {
|
||||
$this->addQueryCondition($part, $data);
|
||||
}
|
||||
} else {
|
||||
list($col, $op, $val) = explode(" ", $val, 3);
|
||||
$term = array($col => $val);
|
||||
if ($op == "=") {
|
||||
$data["query"]["bool"]["filter"][] = array("term" => $term);
|
||||
} elseif (in_array($op, array("must", "should", "must_not"))) {
|
||||
$data["query"]["bool"][$op][]["match"] = $term;
|
||||
}
|
||||
$this->addQueryCondition($val, $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,6 +202,33 @@ if (isset($_GET["elastic5"])) {
|
||||
return new Min_Result($return);
|
||||
}
|
||||
|
||||
private function addQueryCondition($val, &$data)
|
||||
{
|
||||
list($col, $op, $val) = explode(" ", $val, 3);
|
||||
|
||||
if (!preg_match('~^([^(]+)\(([^)]+)\)$~', $op, $matches)) {
|
||||
return;
|
||||
}
|
||||
$queryType = $matches[1]; // must, should, must_not
|
||||
$matchType = $matches[2]; // term, match, regexp
|
||||
|
||||
if ($matchType == "regexp") {
|
||||
$data["query"]["bool"][$queryType][] = [
|
||||
"regexp" => [
|
||||
$col => [
|
||||
"value" => $val,
|
||||
"flags" => "ALL",
|
||||
"case_insensitive" => true,
|
||||
]
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$data["query"]["bool"][$queryType][] = [
|
||||
$matchType => [$col => $val]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
function update($type, $record, $queryWhere, $limit = 0, $separator = "\n") {
|
||||
//! use $limit
|
||||
$parts = preg_split('~ *= *~', $queryWhere);
|
||||
@@ -267,10 +278,6 @@ if (isset($_GET["elastic5"])) {
|
||||
|
||||
return $this->_conn->affected_rows;
|
||||
}
|
||||
|
||||
function convertOperator($operator) {
|
||||
return $operator == "LIKE %%" ? "should" : $operator;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -431,15 +438,13 @@ if (isset($_GET["elastic5"])) {
|
||||
$return = array(
|
||||
"_id" => array(
|
||||
"field" => "_id",
|
||||
"full_type" => "text",
|
||||
"type" => "text",
|
||||
"full_type" => "_id",
|
||||
"type" => "_id",
|
||||
"privileges" => array("insert" => 1, "select" => 1, "where" => 1, "order" => 1),
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($mappings as $name => $field) {
|
||||
if (isset($field["index"]) && !$field["index"]) continue;
|
||||
|
||||
$return[$name] = array(
|
||||
"field" => $name,
|
||||
"full_type" => $field["type"],
|
||||
@@ -548,9 +553,9 @@ if (isset($_GET["elastic5"])) {
|
||||
$structured_types = array();
|
||||
|
||||
foreach (array(
|
||||
lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
|
||||
lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21, "boolean" => 1),
|
||||
lang('Date and time') => array("date" => 10),
|
||||
lang('Strings') => array("string" => 65535, "text" => 65535),
|
||||
lang('Strings') => array("string" => 65535, "text" => 65535, "keyword" => 65535),
|
||||
lang('Binary') => array("binary" => 255),
|
||||
) as $key => $val) {
|
||||
$types += $val;
|
||||
@@ -560,7 +565,13 @@ if (isset($_GET["elastic5"])) {
|
||||
return array(
|
||||
'possible_drivers' => array("json + allow_url_fopen"),
|
||||
'jush' => "elastic",
|
||||
'operators' => array("=", "must", "should", "must_not"),
|
||||
'operators' => array(
|
||||
"must(term)", "must(match)", "must(regexp)",
|
||||
"should(term)", "should(match)", "should(regexp)",
|
||||
"must_not(term)", "must_not(match)", "must_not(regexp)",
|
||||
),
|
||||
'operator_like' => "should(match)",
|
||||
'operator_regexp' => "should(regexp)",
|
||||
'functions' => array(),
|
||||
'grouping' => array(),
|
||||
'edit_functions' => array(array("json")),
|
||||
|
@@ -20,7 +20,7 @@ if (isset($_GET["firebird"])) {
|
||||
;
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
$this->_link = ibase_connect($server, $username, $password);
|
||||
$this->_link = ibase_connect($server, $username, $password);
|
||||
if ($this->_link) {
|
||||
$url_parts = explode(':', $server);
|
||||
$this->service_link = ibase_service_attach($url_parts[0], $username, $password);
|
||||
@@ -109,9 +109,9 @@ if (isset($_GET["firebird"])) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ if (isset($_GET["firebird"])) {
|
||||
}
|
||||
|
||||
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
|
||||
$return = '';
|
||||
$return = '';
|
||||
$return .= ($limit !== null ? $separator . "FIRST $limit" . ($offset ? " SKIP $offset" : "") : "");
|
||||
$return .= " $query$where";
|
||||
return $return;
|
||||
@@ -171,7 +171,7 @@ if (isset($_GET["firebird"])) {
|
||||
while ($row = ibase_fetch_assoc($result)) {
|
||||
$return[$row['RDB$RELATION_NAME']] = 'table';
|
||||
}
|
||||
ksort($return);
|
||||
ksort($return);
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -316,6 +316,7 @@ ORDER BY RDB$INDEX_SEGMENTS.RDB$FIELD_POSITION';
|
||||
'possible_drivers' => array("interbase"),
|
||||
'jush' => "firebird",
|
||||
'operators' => array("="),
|
||||
'operator_like' => "LIKE %%", // TODO: LIKE operator is not listed in operators.
|
||||
'functions' => array(),
|
||||
'grouping' => array(),
|
||||
'edit_functions' => array(),
|
||||
|
@@ -272,7 +272,7 @@ if (isset($_GET["simpledb"])) {
|
||||
function rollback() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function slowQuery($query, $timeout) {
|
||||
$this->_conn->timeout = $timeout;
|
||||
return $query;
|
||||
@@ -437,22 +437,6 @@ if (isset($_GET["simpledb"])) {
|
||||
function last_id() {
|
||||
}
|
||||
|
||||
function hmac($algo, $data, $key, $raw_output = false) {
|
||||
// can use hash_hmac() since PHP 5.1.2
|
||||
$blocksize = 64;
|
||||
if (strlen($key) > $blocksize) {
|
||||
$key = pack("H*", $algo($key));
|
||||
}
|
||||
$key = str_pad($key, $blocksize, "\0");
|
||||
$k_ipad = $key ^ str_repeat("\x36", $blocksize);
|
||||
$k_opad = $key ^ str_repeat("\x5C", $blocksize);
|
||||
$return = $algo($k_opad . pack("H*", $algo($k_ipad . $data)));
|
||||
if ($raw_output) {
|
||||
$return = pack("H*", $return);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function sdb_request($action, $params = array()) {
|
||||
global $adminer, $connection;
|
||||
list($host, $params['AWSAccessKeyId'], $secret) = $adminer->credentials();
|
||||
@@ -467,7 +451,7 @@ if (isset($_GET["simpledb"])) {
|
||||
$query .= '&' . rawurlencode($key) . '=' . rawurlencode($val);
|
||||
}
|
||||
$query = str_replace('%7E', '~', substr($query, 1));
|
||||
$query .= "&Signature=" . urlencode(base64_encode(hmac('sha1', "POST\n" . preg_replace('~^https?://~', '', $host) . "\n/\n$query", $secret, true)));
|
||||
$query .= "&Signature=" . urlencode(base64_encode(hash_hmac('sha1', "POST\n" . preg_replace('~^https?://~', '', $host) . "\n/\n$query", $secret, true)));
|
||||
@ini_set('track_errors', 1); // @ - may be disabled
|
||||
|
||||
$file = @file_get_contents($connection->_url, false, stream_context_create(array('http' => array(
|
||||
@@ -530,6 +514,7 @@ if (isset($_GET["simpledb"])) {
|
||||
'possible_drivers' => array("SimpleXML + allow_url_fopen"),
|
||||
'jush' => "simpledb",
|
||||
'operators' => array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "IS NOT NULL"),
|
||||
'operator_like' => "LIKE %%",
|
||||
'functions' => array(),
|
||||
'grouping' => array("count"),
|
||||
'edit_functions' => array(array("json")),
|
||||
|
@@ -7,36 +7,31 @@
|
||||
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
||||
*/
|
||||
class AdminerPlugin extends Adminer {
|
||||
/** @access protected */
|
||||
var $plugins;
|
||||
|
||||
function _findRootClass($class) { // is_subclass_of(string, string) is available since PHP 5.0.3
|
||||
do {
|
||||
$return = $class;
|
||||
} while ($class = get_parent_class($class));
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Register plugins
|
||||
* @param array object instances or null to register all classes starting by 'Adminer'
|
||||
*/
|
||||
function __construct($plugins) {
|
||||
protected $plugins;
|
||||
|
||||
/**
|
||||
* Registers plugins.
|
||||
* @param array $plugins Object instances or null to register all classes starting by 'Adminer'.
|
||||
*/
|
||||
function __construct(array $plugins = null)
|
||||
{
|
||||
if ($plugins === null) {
|
||||
$plugins = array();
|
||||
$plugins = [];
|
||||
foreach (get_declared_classes() as $class) {
|
||||
if (preg_match('~^Adminer.~i', $class) && strcasecmp($this->_findRootClass($class), 'Adminer')) { //! can use interface
|
||||
if (preg_match('~^Adminer.~i', $class) && !is_subclass_of($class, 'Adminer')) { //! can use interface
|
||||
$plugins[$class] = new $class;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->plugins = $plugins;
|
||||
//! it is possible to use ReflectionObject to find out which plugins defines which methods at once
|
||||
}
|
||||
|
||||
|
||||
function _callParent($function, $args) {
|
||||
return call_user_func_array(array('parent', $function), $args);
|
||||
}
|
||||
|
||||
|
||||
function _applyPlugin($function, $args) {
|
||||
foreach ($this->plugins as $plugin) {
|
||||
if (method_exists($plugin, $function)) {
|
||||
@@ -57,7 +52,7 @@ class AdminerPlugin extends Adminer {
|
||||
}
|
||||
return $this->_callParent($function, $args);
|
||||
}
|
||||
|
||||
|
||||
function _appendPlugin($function, $args) {
|
||||
$return = $this->_callParent($function, $args);
|
||||
foreach ($this->plugins as $plugin) {
|
||||
@@ -70,14 +65,14 @@ class AdminerPlugin extends Adminer {
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
// appendPlugin
|
||||
|
||||
|
||||
function dumpFormat() {
|
||||
$args = func_get_args();
|
||||
return $this->_appendPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
|
||||
function dumpOutput() {
|
||||
$args = func_get_args();
|
||||
return $this->_appendPlugin(__FUNCTION__, $args);
|
||||
@@ -94,7 +89,7 @@ class AdminerPlugin extends Adminer {
|
||||
}
|
||||
|
||||
// applyPlugin
|
||||
|
||||
|
||||
function name() {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
@@ -255,7 +250,7 @@ class AdminerPlugin extends Adminer {
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function selectColumnsPrint($select, $columns) {
|
||||
function selectColumnsPrint($select,$columns) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
@@ -340,7 +335,7 @@ class AdminerPlugin extends Adminer {
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function editInput($table, $field, $attrs, $value) {
|
||||
function editInput($table, $field, $attrs, $value, $function) {
|
||||
$args = func_get_args();
|
||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ class AdminerTableIndexesStructure {
|
||||
* @return bool
|
||||
*/
|
||||
function tableIndexesPrint($indexes) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<table>\n";
|
||||
echo "<thead><tr><th>" . lang('Name') . "<th>" . lang('Type') . "<th>" . lang('Columns') . "</thead>\n";
|
||||
foreach ($indexes as $name => $index) {
|
||||
echo "<tr><th>" . h($name) . "<td>" . $index['type'];
|
||||
|
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
|
||||
/** Use filter in tables list
|
||||
* @link https://www.adminer.org/plugins/#use
|
||||
* @author Jakub Vrana, https://www.vrana.cz/
|
||||
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
||||
*/
|
||||
class AdminerTablesFilter {
|
||||
function tablesPrint($tables) { ?>
|
||||
<script<?php echo nonce(); ?>>
|
||||
var tablesFilterTimeout = null;
|
||||
var tablesFilterValue = '';
|
||||
|
||||
function tablesFilter(){
|
||||
var value = qs('#filter-field').value.toLowerCase();
|
||||
if (value == tablesFilterValue) {
|
||||
return;
|
||||
}
|
||||
tablesFilterValue = value;
|
||||
if (value != '') {
|
||||
var reg = (value + '').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, '\\$1');
|
||||
reg = new RegExp('('+ reg + ')', 'gi');
|
||||
}
|
||||
if (sessionStorage) {
|
||||
sessionStorage.setItem('adminer_tables_filter', value);
|
||||
}
|
||||
var tables = qsa('li', qs('#tables'));
|
||||
for (var i = 0; i < tables.length; i++) {
|
||||
var a = null;
|
||||
var text = tables[i].getAttribute('data-table-name');
|
||||
if (text == null) {
|
||||
a = qsa('a', tables[i])[1];
|
||||
text = a.innerHTML.trim();
|
||||
|
||||
tables[i].setAttribute('data-table-name', text);
|
||||
a.setAttribute('data-link', 'main');
|
||||
} else {
|
||||
a = qs('a[data-link="main"]', tables[i]);
|
||||
}
|
||||
if (value == '') {
|
||||
tables[i].className = '';
|
||||
a.innerHTML = text;
|
||||
} else {
|
||||
tables[i].className = (text.toLowerCase().indexOf(value) == -1 ? 'hidden' : '');
|
||||
a.innerHTML = text.replace(reg, '<strong>$1</strong>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function tablesFilterInput() {
|
||||
window.clearTimeout(tablesFilterTimeout);
|
||||
tablesFilterTimeout = window.setTimeout(tablesFilter, 200);
|
||||
}
|
||||
|
||||
sessionStorage && document.addEventListener('DOMContentLoaded', function () {
|
||||
var db = qs('#dbs').querySelector('select');
|
||||
db = db.options[db.selectedIndex].text;
|
||||
if (db == sessionStorage.getItem('adminer_tables_filter_db') && sessionStorage.getItem('adminer_tables_filter')){
|
||||
qs('#filter-field').value = sessionStorage.getItem('adminer_tables_filter');
|
||||
tablesFilter();
|
||||
}
|
||||
sessionStorage.setItem('adminer_tables_filter_db', db);
|
||||
});
|
||||
</script>
|
||||
<p class="jsonly"><input id="filter-field" autocomplete="off"><?php echo script("qs('#filter-field').oninput = tablesFilterInput;"); ?>
|
||||
<?php
|
||||
}
|
||||
}
|
@@ -65,7 +65,7 @@ tinyMCE.init({
|
||||
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea>" . script("
|
||||
tinyMCE.remove(tinyMCE.get('fields-" . js_escape($field["field"]) . "') || { });
|
||||
tinyMCE.EditorManager.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');
|
||||
qs('#form').onsubmit = function () {
|
||||
gid('form').onsubmit = function () {
|
||||
tinyMCE.each(tinyMCE.editors, function (ed) {
|
||||
ed.remove();
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user