1
0
mirror of https://github.com/vrana/adminer.git synced 2025-09-05 20:02:54 +02:00

Compare commits

..

252 Commits

Author SHA1 Message Date
Jakub Vrana
536999d4dc Release 4.5.0 2018-01-24 21:55:47 +01:00
Jakub Vrana
827a2b8a54 Fix tests after 95d02bb9 2018-01-24 20:52:44 +01:00
Jakub Vrana
a954f7d4b4 Simplify drop object confirmation questions 2018-01-24 18:36:19 +01:00
Jakub Vrana
a137f248f7 Translate message added in 4.4.0 2018-01-24 18:22:20 +01:00
Jakub Vrana
95d02bb924 Display name of the object in confirmation when dropping it 2018-01-24 18:13:05 +01:00
Jakub Vrana
921e57b9aa Display error when getting row to edit 2018-01-24 17:37:35 +01:00
Jakub Vrana
25f9655a38 Avoid CONVERT() except in MySQL (bug #509) 2018-01-24 17:37:14 +01:00
Jakub Vrana
919204dd38 Bump version 2018-01-24 16:51:53 +01:00
Jakub Vrana
34f25afe90 MySQL: Support routines with comments in parameters (bug #460) 2018-01-24 16:37:38 +01:00
Jakub Vrana
8b29ae910f Verify if adminer.version was created on www.adminer.org 2018-01-24 15:10:44 +01:00
Jakub Vrana
6c96b060e7 Store current Adminer version server-side to avoid excessive requests 2018-01-24 15:09:11 +01:00
Jakub Vrana
f4662d5e27 Send token as last param 2018-01-24 13:44:31 +01:00
Jakub Vrana
b15618fcfd Allow using adminer.invalid by other users in a group 2018-01-24 12:11:26 +01:00
Jakub Vrana
03e3f517a8 Extract file_open_lock and file_write_unlock 2018-01-24 12:04:53 +01:00
Jakub Vrana
f0d2af329a Display boolean values as code (bug #562) 2018-01-24 10:53:25 +01:00
Jakub Vrana
452b9ad7f1 MariaDB: Support fulltext and spatial indexes in InnoDB (bug #583) 2018-01-24 09:18:19 +01:00
Jakub Vrana
fb18e814de PostgreSQL: Display foreign tables (bug #576) 2018-01-23 15:03:53 +01:00
Jakub Vrana
75413c56d2 Add designs.php 2018-01-23 14:36:32 +01:00
Jakub Vrana
c3d83d5412 Fix compiled version after 5cc831c1 2018-01-23 14:10:21 +01:00
Jakub Vrana
b14aa75a98 Hide window.opener from pages opened in a new window (bug #561) 2018-01-23 12:53:22 +01:00
Jakub Vrana
dbc76a2b1e Fix GPL version 2018-01-23 12:21:42 +01:00
Jakub Vrana
6d774794c8 Add plugin for switching designs 2018-01-23 12:15:38 +01:00
Jakub Vrana
81be5edb97 Display bold parts of error (bug #565) 2018-01-23 11:16:28 +01:00
Jakub Vrana
e30e5dd059 Add bottom border to last cells 2018-01-23 11:11:41 +01:00
Jakub Vrana
0cdd8beab1 Editor: Fix displaying of false values in PostgreSQL (bug #568) 2018-01-23 11:02:15 +01:00
Jakub Vrana
7b9d5a29aa Decrease float precision (bug #578) 2018-01-23 10:52:57 +01:00
Andrea Giacobino
5cc831c1e1 Add ability to override file name (path) when loading dump from webserver 2018-01-23 09:24:57 +01:00
Jakub Vrana
72aa3c5127 Support current_timestamp() as default of time fields (bug #572) 2018-01-23 08:36:11 +01:00
Jakub Vrana
43ccfcef8f Display newlines in column comments (bug #573) 2018-01-22 21:05:56 +01:00
Jakub Vrana
c789c147b7 MySQL: Support geometry in MySQL 8 (bug #574) 2018-01-22 20:56:35 +01:00
Uherkovich Péter
a2adb67d2f MSSQL driver fixed for freetds drivers. See bug #167, #291 2018-01-22 18:35:08 +01:00
Jakub Vrana
34e2f47761 Fix search focus (regression from 4.4.0) 2018-01-22 18:34:16 +01:00
Jakub Vrana
0d2b232bd7 Compatibility with PHP < 5.3 2018-01-22 17:30:12 +01:00
Jakub Vrana
83e16e059f Add mongodb as a possible driver 2018-01-22 17:12:48 +01:00
Jakub Vrana
6e4dc3911f Save bytes 2018-01-22 17:05:49 +01:00
Vladimir Goncharov
2a08a11e89 php7 support with minimal changes of original code 2018-01-22 16:59:55 +01:00
Jakub Vrana
993dce398d PostgreSQL: Export DROP SEQUENCE if dropping table 2018-01-22 14:33:21 +01:00
Jakub Vrana
eee9a62c8f PostgreSQL: Do not export triggers if not requested 2018-01-22 14:25:27 +01:00
Jakub Vrana
ce17b6cf46 Ignore removed CREATE+ALTER mode in trigger_sql() 2018-01-22 14:14:42 +01:00
Jakub Vrana
923c0ffc87 Fix whitespace 2018-01-22 13:51:47 +01:00
Jakub Vrana
48ed20323f CSP: Allow any CSS 2018-01-22 12:22:25 +01:00
Troy
9a4cd8936d adminer-theme-mancave2-2.0.alpha 2018-01-22 12:20:33 +01:00
Jáchym Toušek
019ada8da5 Fix NULL value in edit form with Postgres 2018-01-22 12:06:15 +01:00
Jakub Vrana
6a95b71164 Do not warn about MySQL specific functions 2018-01-22 12:00:38 +01:00
Jakub Vrana
3b4ce4a0b4 Fix single driver non-MySQL compiled versions (regression from 150301ed) 2018-01-22 11:42:17 +01:00
Jakub Vrana
a414896885 Hide driver selection in single-driver version (regression from e762a6aa) 2018-01-22 11:34:25 +01:00
Peter Knut
47734d8ff4 Unify HTML for list of tables in Editor according to Adminer 2018-01-22 10:57:20 +01:00
Peter Knut
fef1808288 Encapsulate fulltext part in search box into <div> 2018-01-22 10:53:50 +01:00
Fabio Montefuscolo
d2c82fdeca Enhance ElasticSearch integration 2018-01-19 18:32:41 +01:00
Jakub Vrana
e657cdbc3a Allow PHP 5.6 in Travis 2018-01-19 18:20:02 +01:00
Jakub Vrana
bc14e8432f Select numeric database name in DB list (bug #580) 2018-01-19 17:39:27 +01:00
Jakub Vrana
34b03ef835 SQLite: Enable foreign key checks 2018-01-19 14:57:58 +01:00
Jakub Vrana
329b7de9cc CSP: Allow any images, media and fonts, disallow base-uri 2018-01-19 11:05:26 +01:00
Jakub Vrana
2dcad1f284 Define JS functions in AdminerTablesFilter sooner 2018-01-19 10:55:51 +01:00
Jakub Vrana
1b98a10100 Adminer: Fix Search data in tables 2018-01-19 10:46:35 +01:00
Jakub Vrana
187dd56b1c Release 4.4.0 2018-01-17 12:41:38 +01:00
Jakub Vrana
ba9099f084 Allow sending multiple CSP headers 2018-01-17 11:05:59 +01:00
Jakub Vrana
16e05167a4 Use __construct for constructor 2018-01-16 20:05:07 +01:00
Jakub Vrana
756e304c92 Set session cache limiter only without session.auto_start (bug #586) 2018-01-16 16:56:14 +01:00
Jakub Vrana
e762a6aa95 Add missing newline 2018-01-16 16:44:49 +01:00
Jakub Vrana
b3d5c9affe Require specifying credentials in login-sqlite plugin 2018-01-16 16:37:59 +01:00
Jakub Vrana
0268aba85a Avoid count(null) 2018-01-16 16:22:24 +01:00
Jakub Vrana
9ca92309a1 Disallow PHP 5.3 in Travis 2018-01-16 13:51:02 +01:00
Jakub Vrana
0fae40fb61 Disallow connecting to privileged ports (thanks to hyp3rlinx) 2018-01-16 11:18:32 +01:00
Jakub Vrana
0e5df34ea8 Rate limit password-less login attempts from the same IP address (thanks to hyp3rlinx) 2018-01-16 11:17:25 +01:00
Jakub Vrana
f3938c1a66 Use HTTPS 2018-01-14 11:03:54 +01:00
Jakub Vrana
07aa80048a Use HTTPS in doc_link() 2018-01-14 10:38:01 +01:00
Jakub Vrana
c57e7ac3e3 Do not set '' for empty enum 2018-01-14 10:19:56 +01:00
Jakub Vrana
6d14b47d02 Fix select function onchange 2018-01-14 10:18:38 +01:00
Jakub Vrana
ef3b468626 Clone all event handlers in cloneNode() 2018-01-14 10:04:53 +01:00
Jakub Vrana
4d38c09db5 Use border-collapse to prevent unnecessary wrapping in Chrome 2018-01-14 09:35:13 +01:00
Jakub Vrana
3ba99a1c2a Fix whitespace 2018-01-14 08:52:22 +01:00
Jakub Vrana
9cbdb6262b Fix selectCount() in information_schema 2018-01-14 08:36:10 +01:00
Jakub Vrana
cc268428b8 Fix SQL command toggle 2018-01-14 00:10:42 +01:00
Jakub Vrana
80d030f51a Disallow scripts without nonce 2018-01-13 22:19:16 +01:00
Jakub Vrana
e23da5da0e Fix wrapping in Create table 2018-01-13 17:40:21 +01:00
Jakub Vrana
9d532fc0a1 Use script_src for <script src> 2018-01-13 16:25:11 +01:00
Jakub Vrana
144c7de27f Fix typo in script() 2018-01-13 15:23:47 +01:00
Jakub Vrana
b7fcebfba8 Do not send empty CSP 2018-01-13 14:21:54 +01:00
Jakub Vrana
d39a6e59c7 Move inline event handlers to <script> 2018-01-13 09:34:01 +01:00
Jakub Vrana
fc559a1cf6 Move inline event handlers to <script> 2018-01-13 09:21:21 +01:00
Jakub Vrana
f457053d85 Use the fact that we handle oninput in whisper() 2018-01-13 09:07:35 +01:00
Jakub Vrana
e255ba9aa4 Move inline event handlers to <script> 2018-01-13 08:58:01 +01:00
Jakub Vrana
3fe0d88f98 Editor: Fix Search data in tables 2018-01-12 23:59:04 +01:00
Jakub Vrana
68c6b1c942 Move inline event handlers to <script> 2018-01-12 23:42:20 +01:00
Jakub Vrana
001c37e240 Use <script> instead of inline event handler for skipping original 2018-01-12 23:27:14 +01:00
Jakub Vrana
b6cc584f48 Move inline event handlers to <script> 2018-01-12 22:46:16 +01:00
Jakub Vrana
af1ad47a64 Return false from editingMoveRow() 2018-01-12 22:35:05 +01:00
Jakub Vrana
2eaac2e94e Move inline event handlers to <script> 2018-01-12 22:25:38 +01:00
Jakub Vrana
40abffe8de Use oninput instead of onchange 2018-01-12 22:18:54 +01:00
Jakub Vrana
259a465125 Move inline event handlers to <script> 2018-01-12 21:57:54 +01:00
Jakub Vrana
6c1fbf13c6 Fix fieldChange() after 6353a898 2018-01-12 21:49:45 +01:00
Jakub Vrana
6353a89816 Use oninput instead of onkeyup 2018-01-12 18:46:44 +01:00
Jakub Vrana
38aac7ada2 Move inline event handlers to <script> 2018-01-12 18:34:19 +01:00
Jakub Vrana
24245867d7 Use <script> instead of inline event handler in on_help() 2018-01-12 18:11:00 +01:00
Jakub Vrana
1459df56bc Move inline event handlers to <script> 2018-01-12 17:59:46 +01:00
Jakub Vrana
dc3a0e1a32 Clone onchange in cloneNode() 2018-01-12 17:33:23 +01:00
Jakub Vrana
0411495d20 Move inline event handlers to <script> 2018-01-12 17:19:47 +01:00
Jakub Vrana
3d69fbf5f7 Allow searching data in tables by Ctrl+Enter 2018-01-12 17:11:29 +01:00
Jakub Vrana
5e9df49fd1 Move inline event handlers to <script> 2018-01-12 17:11:29 +01:00
Jakub Vrana
565a5ca0eb Fix selectors in schema after 58b2904d 2018-01-12 17:11:29 +01:00
Jakub Vrana
9061583538 Rely on event always passed to handlers 2018-01-12 17:11:29 +01:00
Jakub Vrana
35b1db6974 Move inline event handlers to <script> 2018-01-12 17:11:29 +01:00
Jakub Vrana
068ee71bf7 Return false from editingRemoveRow 2018-01-12 17:11:29 +01:00
Jakub Vrana
efcf37d162 Move inline event handlers to <script> 2018-01-12 17:11:29 +01:00
Jakub Vrana
e645693147 Use script() for <script> 2018-01-12 17:10:33 +01:00
Jakub Vrana
12fbfc9847 Move inline event handlers to <script> 2018-01-12 17:09:41 +01:00
Jakub Vrana
6b2ba65084 Use <script> instead of inline event handler in print_fieldset() 2018-01-12 17:09:41 +01:00
Jakub Vrana
a5ee3451ac Use <script> instead of inline event handler in confirm() 2018-01-12 17:09:41 +01:00
Jakub Vrana
da671df728 Move inline event handlers to <script> 2018-01-12 17:09:41 +01:00
Jakub Vrana
650221357d Return false from ajaxSetHtml() 2018-01-12 17:09:41 +01:00
Jakub Vrana
d996b48cfa Move inline event handlers to <script> 2018-01-12 17:09:41 +01:00
Jakub Vrana
22b4322710 Revert using @this in formChecked 2018-01-12 17:09:41 +01:00
Jakub Vrana
36edd445a6 Move inline event handlers to <script> 2018-01-12 17:09:41 +01:00
Jakub Vrana
7305783c21 Return false from toggle() 2018-01-12 17:09:41 +01:00
Jakub Vrana
ee3a88d574 onchange='selectFieldChange 2018-01-12 17:09:41 +01:00
Jakub Vrana
e5c52589ec Use @this in selectFieldChange 2018-01-12 17:09:41 +01:00
Jakub Vrana
3b0e1cf289 Move inline event handlers to <script> 2018-01-12 17:09:41 +01:00
Jakub Vrana
767fc0e47e Fix indexesAddColumn after 14778165 2018-01-12 17:09:41 +01:00
Jakub Vrana
63581af0f6 Move inline event handlers to <script> 2018-01-12 17:09:35 +01:00
Jakub Vrana
813ada6661 Revert using @this in formChecked 2018-01-11 18:58:00 +01:00
Jakub Vrana
4be72a2a0d Allow customizing CSP 2018-01-11 18:39:49 +01:00
Jakub Vrana
541c3c1fed Allow img-src data: common in skins 2018-01-11 18:39:49 +01:00
Jakub Vrana
3408d4ad78 Use JSON.parse if available 2018-01-11 18:39:49 +01:00
Jakub Vrana
e614ae08c4 Add Content Security Policy 2018-01-11 18:39:49 +01:00
Jakub Vrana
552d2a6be4 Always send security headers in customization 2018-01-11 18:39:49 +01:00
Jakub Vrana
415253b1b1 Add nosniff header 2018-01-11 18:39:22 +01:00
Jakub Vrana
d07b7e3773 Use Referrer-Policy instead of <meta name="referrer">
To make securityheaders.io happy.

Also fix a typo in the value (https://lists.w3.org/Archives/Public/public-webappsec/2015May/0059.html).
2018-01-11 18:38:15 +01:00
Jakub Vrana
3de101dff4 Editor: Fix doubleclick on database page 2018-01-11 17:24:57 +01:00
Jakub Vrana
48dacd1e97 Fix a typo from 9cb28186 2018-01-11 17:05:37 +01:00
Jakub Vrana
14778165a8 Use @this in JavaScript (prepares for removing inline event handlers) 2018-01-11 17:01:29 +01:00
Jakub Vrana
72b199378a Prevent PHP 7.1 warning about non-numeric values 2018-01-11 16:22:29 +01:00
Jakub Vrana
329fa55af5 Unindent doc-comments 2018-01-11 15:14:05 +01:00
Jakub Vrana
ecf34769ad Delete type="text/css" from <style> as it is the default in HTML5 2018-01-11 14:14:15 +01:00
Jakub Vrana
dc85ba2d86 Delete type="text/javascript" from <script> as it is the default in HTML5 2018-01-11 14:13:43 +01:00
Jakub Vrana
741b76fbd4 Replace getElementsByTagName by shortcut for querySelectorAll 2018-01-11 14:00:04 +01:00
Jakub Vrana
58b2904d62 Use querySelector 2018-01-11 13:55:48 +01:00
Jakub Vrana
9cb281868f Replace getElementById by shortcut for querySelector (requires IE8) 2018-01-11 13:51:32 +01:00
Jakub Vrana
67f6aea77f Fix skin for Chrome 61 (thanks to Dominik Ulrich) 2017-10-28 15:05:07 +02:00
Jakub Vrana
7bcba262df Editor: Display field comment's text inside [] only in edit form 2017-10-01 08:45:17 -07:00
Itamar Schen
75c0786d2e Fix hebrew typos (#228) 2017-09-29 09:25:32 +02:00
Jakub Vrana
c4f6cbb32e Add new Hebrew translations 2017-09-11 13:25:49 +02:00
Jakub Vrana
b10e9e127e Add Hebrew translation 2017-09-09 12:06:14 +02:00
Lukas Tribus
32f1e856ad Editor: Don't set time zone from PHP
Current implementation checks the delta between the local time and
UTC, and applies the delta as time zone for MySQL.

This assumption is wrong if the current time is DST enabled, but the
time that is converted isn't - and vice versa.

For example, Europe/Prague is "CET-1CEST,M3.5.0,M10.5.0/3", when
the MySQL connections is setup now (September, DST enabled) and
we are reading a TIMESTAMP from November, then MySQL applies +0200
instead of +0100 to that timestamp even though November is supposed
to be DST disabled.

There is no reliable and portable way in PHP to understand the
time zone, especially since PHP >= 5.4.0 ignores environment
variable and OS settings [1].

MySQL needs to be properly setup (TZ data loaded [2] and default
TZ set [3]), then everything will work just fine.

The current implementation however causes wrong data 50% of the
time, even when OS/MySQL/PHP is properly setup. As a MySQL
connection will converte timestamps from both DST enabled and
DST disabled dates, a static UTC offset must never be set at
connection level (set time_zone = ...).

This change removes the current implementation, therefor maintaining
OS/MySQL defaults, fixing the DST issue in properly configured
environments.

[1] http://php.net/manual/en/function.date-default-timezone-get.php
[2] https://dev.mysql.com/doc/refman/5.5/en/mysql-tzinfo-to-sql.html
[3] https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html
2017-09-09 11:44:42 +02:00
Jonathan Vollebregt
17e45e9a9c Make sure all sidebar elements are pushed down, not just the form.
This was breaking the #logins block at the log in screen.
2017-09-09 11:39:47 +02:00
Jonathan Vollebregt
e1f43da8df Update AdminerTablesFilter to produce li as per c9801e2e24 2017-05-19 11:23:35 +02:00
Jakub Vrana
70aef8a55a MySQL: Remove dedicated view for replication status 2017-05-19 11:11:44 +02:00
Jakub Vrana
0b824dad29 Sort table names (bug #552) 2017-05-19 10:57:20 +02:00
Alfonso Montero
65fa4b4e31 Update es.inc.php 2017-04-22 10:07:55 +02:00
Jakub Vrana
c0a3f30060 Add a donate link 2017-04-16 10:42:27 +02:00
Jakub Vrana
7af1ee3702 Release 4.3.1 2017-04-14 09:48:11 +02:00
Jakub Vrana
3cbece1ec0 Fix SQL command autofocus 2017-04-09 12:30:34 +02:00
Jakub Vrana
0d73372c50 Add a todo 2017-04-09 12:13:18 +02:00
Jakub Vrana
fb7bd02713 Don't overwrite previous cookies (bug #539) 2017-04-09 11:04:57 +02:00
Jakub Vrana
fb71941daa PostgreSQL: Fix JSONB version support 2017-04-08 20:17:08 +02:00
Jakub Vrana
504c56216c PostgreSQL: Support JSON and JSONB data types (bug #542) 2017-04-08 19:59:13 +02:00
Jakub Vrana
88803c6d0e Update haeckel design (thanks to Klemens Haeckel) 2017-04-08 19:51:13 +02:00
Andre Polykanine A.K.A. Menelion Elensúlë
b585ee8261 Updating Russian translation 2017-04-08 19:41:36 +02:00
Deni
f4817e8568 Fix table dependency on export 2017-04-08 19:38:03 +02:00
Deni
105aca9b04 Fix PostgreSQL nullable fields in export 2017-04-08 19:37:56 +02:00
Jakub Vrana
f556f6acb1 PostgreSQL: Fix index size computation in PostgreSQL < 9.0 (reverts 4c78976c) 2017-04-08 19:33:46 +02:00
Jakub Vrana
22d0cf4171 Release 4.3.0 2017-03-15 18:24:12 +01:00
Jakub Vrana
fa0963f370 Reorder changelog 2017-03-15 16:57:58 +01:00
Jakub Vrana
ba28845651 Update JUSH 2017-03-15 12:53:26 +01:00
Jakub Vrana
8fd7ff0187 Highlight JSON 2017-03-10 08:56:58 +01:00
Jakub Vrana
e040b296c5 Print number of bytes in blob in italics 2017-03-10 08:19:58 +01:00
Jakub Vrana
b616c57352 MySQL: Support JSON data type 2017-03-10 08:15:52 +01:00
Jakub Vrana
50390ea38c Support MySQL 8 2017-03-09 18:52:00 +01:00
Jakub Vrana
9d7d30891e Use SameSite cookies (except session cookie) 2017-03-07 18:12:23 +01:00
Jakub Vrana
4cf73abccd Rely on noreferrer in Firefox too 2017-03-01 11:35:01 +01:00
Jakub Vrana
2d6451b99a Improve SQLite login error message 2017-03-01 11:23:20 +01:00
Jakub Vrana
40d1feec9f Update URL 2017-02-27 13:44:22 +01:00
Jakub Vrana
e40d9692c7 Save bytes 2017-02-22 11:49:25 +01:00
Jakub Vrana
770fc9673c Lint PHP files 2017-02-21 13:47:19 +01:00
Jakub Vrana
56b6590a4f Simplify SQLite development 2017-02-21 13:13:39 +01:00
Jakub Vrana
f8fd4dd6e3 Document new engines 2017-02-21 13:05:43 +01:00
Jakub Vrana
d8c28d1c91 Avoid referencing global variable (doesn't work in PHP 7.1 if Adminer is included inside a function) 2017-02-21 12:07:13 +01:00
Jakub Vrana
46f39f3cdb Bump version 2017-02-21 12:07:13 +01:00
Jakub Vrana
8a9df8ede1 Elasticsearch: allow empty server name 2017-02-21 12:07:13 +01:00
Jakub Vrana
e4d35f9591 Hide materialized views in MySQL 2017-02-20 19:28:16 +01:00
Jakub Vrana
346353153d Unindent 2017-02-20 19:28:16 +01:00
Jakub Vrana
9df33e82e6 Elasticsearch: Support HTTPS by inputting https://server (bug #446) 2017-02-20 18:06:14 +01:00
Jakub Vrana
fa09eba15e Save bytes 2017-02-20 17:25:59 +01:00
Jakub Vrana
d5b329a1a4 MySQL: Support spatial indexes (bug #455) 2017-02-20 17:25:34 +01:00
Jakub Vrana
0cd02bb98a Fix dropping foreign keys linking to other database 2017-02-20 16:59:13 +01:00
Jakub Vrana
a7cbf66347 Move 'Create user' above the list of users 2017-02-20 16:52:10 +01:00
Jakub Vrana
fa6865da6a Use 'Create database' instead of 'Create new database' 2017-02-20 16:47:03 +01:00
Jakub Vrana
63b6b99365 Support high Unicode characters in shorten_utf8 (bug #481) 2017-02-20 16:22:30 +01:00
Jakub Vrana
a0a1476e5b Fix where() escaping in MS SQL (bug #496) 2017-02-20 15:23:22 +01:00
Jakub Vrana
8a9d803137 Add jsonly class to JS checkboxes 2017-02-20 15:11:47 +01:00
Jakub Vrana
4588af77ac Display message about missing master status 2017-02-20 14:06:19 +01:00
Jakub Vrana
91bd2e84f5 Add Czech translation 2017-02-20 12:55:57 +01:00
Matthew Gamble
2a534798fa Add basic support for MySQL replication 2017-02-20 12:54:40 +01:00
Adam Kuśmierz
a062e9cc58 Checkbox for bool in psql 2017-02-20 12:31:36 +01:00
Peter Knut
6c84764334 Fixed all alternative designs after changes in a list of tables made here: https://github.com/vrana/adminer/pull/116 2017-02-20 12:21:50 +01:00
Jakub Vrana
a01ca3ade4 PostgreSQL: Allow changing materialized views 2017-02-20 12:13:09 +01:00
Jakub Vrana
6ee4692afd PostgreSQL: Fix index size computation 2017-02-20 12:06:41 +01:00
Jakub Vrana
b8cd3b317d Verify commit success after import.
Fixes https://sourceforge.net/p/adminer/bugs-and-features/521/.
2017-02-19 14:22:41 +01:00
Jonathan Vollebregt
64a49e95e8 Add javascript move for editing 2017-02-19 13:55:50 +01:00
Jan Kalina
8dd971ca5e foreign key link fix - added missing ns 2017-02-19 13:02:55 +01:00
Peter Knut
c9801e2e24 Tables list implemented as <ul>
Encapsulation of list items is necessery for advanced CSS themes.
2017-02-19 11:39:04 +01:00
newsiram
4578d47409 Changed NULL format
+ <i> was not italics
+ reduce font & showed border
2017-02-19 11:36:20 +01:00
Loren Klingman
12aaf506b8 Fix MS SQL Driver to not show warnings for version fetching on connection and to retrieve the next set of results properly 2017-02-19 11:35:24 +01:00
Mathieu Rochette
4cfe6263d9 fix logger for SQL commands 2017-02-19 11:00:07 +01:00
Felix Geyer
b8bea7fc56 Hide databases the user can't connect to
pg_database lists all databases including the ones the user can't connect to.
There is little point in showing them when we know connecting will fail.
2017-02-19 10:33:22 +01:00
0xACE
cd8ff96a09 Breadcumb no longer blocks the logout button.
Not sure why the top bar is blocking the logout button. This patch allows the user  to see and click the logout button.
2017-02-19 10:15:05 +01:00
Kakysha
4a69059e1b Edit json and jsonb types in textarea 2017-02-19 10:02:51 +01:00
Gargaj
842ea0bd46 Add namespace to routine call
MSSQL is picky about this, shouldn't affect the drivers that don't use namespaces.
2017-02-19 09:53:51 +01:00
K0n24d
1d0607177d Do not set input type as numeric if field is an array 2017-02-19 09:45:05 +01:00
isra00
9e4d9fda65 New skin 'flat' 2017-02-19 09:31:19 +01:00
nafex
47c582acb3 make bytea fields shortable 2017-02-19 09:30:39 +01:00
Lubor Bilek
32334f1106 PostgreSQL export: table structure, columns, sequences, indexes, foreign keys, comments, trigger definition 2017-02-19 09:26:47 +01:00
Matthew Gamble
a10238516c Add plugin for printing table indexes structure in expanded format 2017-02-18 19:22:47 +01:00
Matthew Gamble
4801da091b Add plugin for printing table structure in expanded format
Instead of trying to squeeze everything into three columns, this plugin
uses multiple columns for each part of a column's structure.
2017-02-18 19:21:16 +01:00
Matthew Gamble
76612b1e8a Move rendering of table structure and indexes list into plugin system
This allows the creation of a plugin to extend the display of either or
both of these things.
2017-02-18 19:15:23 +01:00
Matthew Gamble
eb8c9929d3 Handle checkboxes properly in selectAddRow() 2017-02-18 18:59:06 +01:00
Ion Bazan
cf10398104 fixed Elastic table_status() 2017-02-18 18:45:23 +01:00
Jiří Barouš
d00927ce66 Improve limit check in edit-foreign plugin
The limit is enforced in the query to prevent out-of-memory errors for big target tables.
2017-02-18 18:32:32 +01:00
Jonathan Vollebregt
28a84fec18 AdminerTablesFilter: Persist filter value in a tab 2017-02-18 18:13:05 +01:00
Jonathan Vollebregt
2c8eff9b53 Update AdminerTablesFilter
* Removes children request (Should work on IE6, 7, 8 now)
* Uses <strong> instead of <b>
* Doesn't leave said <strong> tags behind after updating the list
* Highlights multiple matches in a single table name
* Works case insensitively
* Improves performance with setTimeout
    With 400 tables, the old implementation locks up the tab (or
    browser if using something without multiprocess) for about
    half a second per keyup. Yes, this includes modifiers that
    don't actually change the filter. The new version handles
    the same event in 0.09 milliseconds.

    That's with all the above improvements.
    Tested in firefox 45.1.1 performance monitor.
2017-02-18 18:12:58 +01:00
Alessandro Frangioni
5f26d3a1b8 Added support for binary foreign keys selection on edit 2017-02-18 18:06:14 +01:00
Adam Kuśmierz
3344fae96e Plugin: Use <select> on custom user types in psql 2017-02-18 18:01:17 +01:00
Janne Cederberg
dedbd01f64 Tabs must also be escaped in JSON strings
If database table data contains tab characters (0x09) then those
must also be escaped along with newlines and carriage returns for
the resulting JSON file to be valid.
2017-02-18 17:51:55 +01:00
PiR-B-
4c78976cba Fix index length with Postgresql 2017-02-18 17:42:34 +01:00
soleuu
1a6186648c postgresql error with index on hidden columns (ctid) 2017-02-18 17:41:45 +01:00
Daniel Berthereau
36f42d0fda Fixed background of the list of the tables. 2017-02-18 17:40:00 +01:00
Jakub Vrana
45712a5d4c Document changes 2017-02-18 17:37:12 +01:00
Charles Wu
73690164b7 Added pdo_dblib as a driver for MSSQL (as native MSSQL driver does not exist for PHP7) 2017-02-18 17:35:36 +01:00
Jakub Vrana
3fa1eadf2c Use null instead of undefined on after parsing JSON 2017-02-18 17:32:40 +01:00
shaununderwood
3a1c251065 Changed 'undefined' to 'null'
'undefined' is not a valid JSON attribute value and should been 'null'
2017-02-18 17:32:40 +01:00
Massimiliano Torromeo
d0268c69da Fixed mssql driver for usage with microsoft's php7 sqlsrv extension 2017-02-18 17:32:40 +01:00
Adam Kusmierz
fd3d1c7e2e Plugin which shows sql structure comments in field names title 2017-02-18 17:32:40 +01:00
Adam Kusmierz
cbd3adc564 PHP Warning hidden and better parsing times (at least for postgresql) 2017-02-18 17:32:40 +01:00
soleuu
86e26846a8 postgresql : ERROR: function connection_id() does not exist 2017-02-18 17:32:40 +01:00
soleuu
6860478950 postgresql : unique partial index musn't be considered as unique. can cause problems on row edition 2017-02-18 17:32:40 +01:00
Jakub Vrana
dc9ae77e2f Fix error found by PHPStan 2017-02-16 19:05:45 +01:00
jose
8f60870d9a mistype correction 2017-02-13 17:17:36 +01:00
Jakub Vrana
d6c3430607 Add accessibility labels to Foreign keys 2017-01-23 15:12:42 -08:00
Jakub Vrana
2cee788ad3 Add accessibility labels to Indexes 2017-01-23 14:29:00 -08:00
Jakub Vrana
647cab7c69 Use class instead inline style 2017-01-23 14:10:50 -08:00
Jakub Vrana
9bb75e1230 Add accessibility labels to databases and tables checkboxes 2017-01-23 14:05:47 -08:00
Jakub Vrana
7099560add Escape quote in field name to make it work in Chrome (thanks to zcepenela pani) 2017-01-23 13:30:05 -08:00
Lucas Sandery
14cb9ca1ef Additional theme with responsive and RTL support
Signed-off-by: Lucas Sandery <lucas-sandery@users.noreply.github.com>
2017-01-23 12:53:27 -08:00
Lucas Sandery
31057f0ef2 RTL layout fixes
Signed-off-by: Lucas Sandery <lucas-sandery@users.noreply.github.com>
2017-01-23 12:50:23 -08:00
Jakub Vrana
fa09962ab1 Add SQLite auto-login plugin 2016-11-28 10:09:51 -08:00
Jakub Vrana
bad3c6b086 Disallow selecting driver if there's only one 2016-11-28 10:07:03 -08:00
MegaXLR
0922b312d3 Changed 'geraakt' to 'beinvloed' in Dutch translation 2016-10-02 11:27:23 +02:00
Jakub Vrana
949b913d4f Change comment not supported by compile.php 2016-09-27 22:04:44 -07:00
Jakub Vrana
af25827ff4 Add Cache-Control: immutable to static files 2016-09-27 21:53:11 -07:00
Jakub Vrana
9872229e11 Make maxlength in edit fields a soft limit 2016-09-19 10:12:33 -07:00
Jakub Vrana
682e86d236 Add accessibility labels to Create Table fields 2016-09-19 15:33:12 +02:00
Jakub Vrana
f0a5fb56a5 Update Indonesian translation (thanks to Benny) 2016-07-22 17:30:38 +02:00
157 changed files with 4970 additions and 1213 deletions

5
.travis.yml Normal file
View File

@@ -0,0 +1,5 @@
language: php
php:
- '5.6'
- '7.1'
script: git diff --name-only $TRAVIS_COMMIT_RANGE | grep '\.php$' | xargs -n1 -P8 php -l | grep -v 'No syntax errors'; test $? -eq 1

View File

@@ -29,7 +29,7 @@ if (!$error && $_POST) {
$call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val); $call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val);
} }
$query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($PROCEDURE) . "(" . implode(", ", $call) . ")"; $query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")";
echo "<p><code class='jush-$jush'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n"; echo "<p><code class='jush-$jush'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
if (!$connection->multi_query($query)) { if (!$connection->multi_query($query)) {

View File

@@ -35,7 +35,6 @@ if ($_POST && !process_fields($row["fields"]) && !$error) {
$all_fields = array(); $all_fields = array();
$use_all_fields = false; $use_all_fields = false;
$foreign = array(); $foreign = array();
ksort($row["fields"]);
$orig_field = reset($orig_fields); $orig_field = reset($orig_fields);
$after = " FIRST"; $after = " FIRST";
@@ -164,8 +163,8 @@ foreach ($engines as $engine) {
<p> <p>
<?php if (support("columns") || $TABLE == "") { ?> <?php if (support("columns") || $TABLE == "") { ?>
<?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo h($row["name"]); ?>" autocapitalize="off"> <?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
<?php if ($TABLE == "" && !$_POST) { ?><script type='text/javascript'>focus(document.getElementById('form')['name']);</script><?php } ?> <?php if ($TABLE == "" && !$_POST) { echo script("focus(qs('#form')['name']);"); } ?>
<?php echo ($engines ? "<select name='Engine' onchange='helpClose();'" . on_help("getTarget(event).value", 1) . ">" . optionlist(array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . "</select>" : ""); ?> <?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 echo ($collations && !preg_match("~sqlite|mssql~", $jush) ? html_select("Collation", array("" => "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?> <?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'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php } ?> <?php } ?>
@@ -188,9 +187,10 @@ edit_fields($row["fields"], $collations, "TABLE", $foreign_keys, $comments);
<p> <p>
<?php echo lang('Auto Increment'); ?>: <input type="number" name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>"> <?php echo lang('Auto Increment'); ?>: <input type="number" name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
<?php echo checkbox("defaults", 1, true, lang('Default values'), "columnShow(this.checked, 5)", "jsonly"); ?> <?php echo checkbox("defaults", 1, true, lang('Default values'), "columnShow(this.checked, 5)", "jsonly"); ?>
<?php if (!$_POST["defaults"]) { ?><script type="text/javascript">editingHideDefaults()</script><?php } ?> <?php if (!$_POST["defaults"]) { echo script("editingHideDefaults();"); } ?>
<?php echo (support("comment") <?php echo (support("comment")
? "<label><input type='checkbox' name='comments' value='1' class='jsonly' onclick=\"columnShow(this.checked, 6); toggle('Comment'); if (this.checked) this.form['Comment'].focus();\"" . ($comments ? " checked" : "") . ">" . lang('Comment') . "</label>" ? "<label><input type='checkbox' name='comments' value='1' class='jsonly'" . ($comments ? " checked" : "") . ">" . lang('Comment') . "</label>"
. script("qsl('input').onclick = function () { columnShow(this.checked, 6); toggle('Comment'); if (this.checked) this.form['Comment'].focus(); };")
. ' <input name="Comment" id="Comment" value="' . h($row["Comment"]) . '" maxlength="' . ($connection->server_info >= 5.5 ? 2048 : 60) . '"' . ($comments ? '' : ' class="hidden"') . '>' . ' <input name="Comment" id="Comment" value="' . h($row["Comment"]) . '" maxlength="' . ($connection->server_info >= 5.5 ? 2048 : 60) . '"' . ($comments ? '' : ' class="hidden"') . '>'
: '') : '')
; ?> ; ?>
@@ -198,14 +198,14 @@ edit_fields($row["fields"], $collations, "TABLE", $foreign_keys, $comments);
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php } ?> <?php } ?>
<?php if ($TABLE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?> <?php if ($TABLE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $TABLE)); ?><?php } ?>
<?php <?php
if (support("partitioning")) { if (support("partitioning")) {
$partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]); $partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]);
print_fieldset("partition", lang('Partition by'), $row["partition_by"]); print_fieldset("partition", lang('Partition by'), $row["partition_by"]);
?> ?>
<p> <p>
<?php echo "<select name='partition_by' onchange='partitionByChange(this);'" . on_help("getTarget(event).value.replace(/./, 'PARTITION BY \$&')", 1) . ">" . optionlist(array("" => "") + $partition_by, $row["partition_by"]) . "</select>"; ?> <?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;"); ?>
(<input name="partition" value="<?php echo h($row["partition"]); ?>">) (<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"]); ?>"> <?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'"); ?>> <table cellspacing="0" id="partition-table"<?php echo ($partition_table ? "" : " class='hidden'"); ?>>
@@ -213,7 +213,8 @@ if (support("partitioning")) {
<?php <?php
foreach ($row["partition_names"] as $key => $val) { foreach ($row["partition_names"] as $key => $val) {
echo '<tr>'; echo '<tr>';
echo '<td><input name="partition_names[]" value="' . h($val) . '"' . ($key == count($row["partition_names"]) - 1 ? ' onchange="partitionNameChange(this);"' : '') . ' autocapitalize="off">'; echo '<td><input name="partition_names[]" value="' . h($val) . '" autocapitalize="off">';
echo ($key == count($row["partition_names"]) - 1 ? script("qsl('input').oninput = partitionNameChange;") : '');
echo '<td><input name="partition_values[]" value="' . h($row["partition_values"][$key]) . '">'; echo '<td><input name="partition_values[]" value="' . h($row["partition_values"][$key]) . '">';
} }
?> ?>

View File

@@ -65,12 +65,12 @@ echo ($_POST["add_x"] || strpos($name, "\n")
'sql' => "charset-charsets.html", 'sql' => "charset-charsets.html",
'mssql' => "ms187963.aspx", 'mssql' => "ms187963.aspx",
)) : ""); )) : "");
echo script("focus(qs('#name'));");
?> ?>
<script type='text/javascript'>focus(document.getElementById('name'));</script>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php <?php
if (DB != "") { if (DB != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n"; echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop %s?', DB)) . "\n";
} elseif (!$_POST["add_x"] && $_GET["db"] == "") { } elseif (!$_POST["add_x"] && $_GET["db"] == "") {
echo "<input type='image' class='icon' name='add' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>\n"; echo "<input type='image' class='icon' name='add' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>\n";
} }

View File

@@ -4,7 +4,7 @@ $tables_views = array_merge((array) $_POST["tables"], (array) $_POST["views"]);
if ($tables_views && !$error && !$_POST["search"]) { if ($tables_views && !$error && !$_POST["search"]) {
$result = true; $result = true;
$message = ""; $message = "";
if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) { if ($jush == "sql" && $_POST["tables"] && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) {
queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once
} }
@@ -56,16 +56,19 @@ if ($adminer->homepage()) {
echo "<form action='' method='post'>\n"; echo "<form action='' method='post'>\n";
if (support("table")) { if (support("table")) {
echo "<fieldset><legend>" . lang('Search data in tables') . " <span id='selected2'></span></legend><div>"; echo "<fieldset><legend>" . lang('Search data in tables') . " <span id='selected2'></span></legend><div>";
echo "<input type='search' name='query' value='" . h($_POST["query"]) . "'> <input type='submit' name='search' value='" . lang('Search') . "'>\n"; 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";
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
if ($_POST["search"] && $_POST["query"] != "") { if ($_POST["search"] && $_POST["query"] != "") {
search_tables(); search_tables();
} }
} }
echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);">';
$doc_link = doc_link(array('sql' => 'show-table-status.html')); $doc_link = doc_link(array('sql' => 'show-table-status.html'));
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 '<th>' . lang('Table'); echo '<th>' . lang('Table');
echo '<td>' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html')); echo '<td>' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html'));
echo '<td>' . lang('Collation') . doc_link(array('sql' => 'charset-mysql.html')); echo '<td>' . lang('Collation') . doc_link(array('sql' => 'charset-mysql.html'));
@@ -80,10 +83,11 @@ if ($adminer->homepage()) {
$tables = 0; $tables = 0;
foreach ($tables_list as $name => $type) { foreach ($tables_list as $name => $type) {
$view = ($type !== null && !preg_match('~table~i', $type)); $view = ($type !== null && !preg_match('~table~i', $type));
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');"); $id = h("Table-" . $name);
echo '<th>' . (support("table") || support("indexes") ? '<a href="' . h(ME) . 'table=' . urlencode($name) . '" title="' . lang('Show structure') . '">' . h($name) . '</a>' : h($name)); echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');", "", $id);
echo '<th>' . (support("table") || support("indexes") ? "<a href='" . h(ME) . "table=" . urlencode($name) . "' title='" . lang('Show structure') . "' id='$id'>" . h($name) . '</a>' : h($name));
if ($view) { if ($view) {
echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '" title="' . lang('Alter view') . '">' . (preg_match('~materialized~i', $type) ? lang('Materialized View') : lang('View')) . '</a>'; echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '" title="' . lang('Alter view') . '">' . (preg_match('~materialized~i', $type) ? lang('Materialized view') : lang('View')) . '</a>';
echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '" title="' . lang('Select data') . '">?</a>'; echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '" title="' . lang('Select data') . '">?</a>';
} else { } else {
foreach (array( foreach (array(
@@ -115,17 +119,17 @@ if ($adminer->homepage()) {
echo "</table>\n"; echo "</table>\n";
if (!information_schema(DB)) { if (!information_schema(DB)) {
$vacuum = "<input type='submit' value='" . lang('Vacuum') . "'" . on_help("'VACUUM'") . "> "; $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'") . "> "; $optimize = "<input type='submit' name='optimize' value='" . lang('Optimize') . "'> " . on_help($jush == "sql" ? "'OPTIMIZE TABLE'" : "'VACUUM OPTIMIZE'");
echo "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>" echo "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>"
. ($jush == "sqlite" ? $vacuum . ($jush == "sqlite" ? $vacuum
: ($jush == "pgsql" ? $vacuum . $optimize : ($jush == "pgsql" ? $vacuum . $optimize
: ($jush == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'" . on_help("'ANALYZE TABLE'") . "> " . $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='check' value='" . lang('Check') . "'> " . on_help("'CHECK TABLE'")
. "<input type='submit' name='repair' value='" . lang('Repair') . "'" . on_help("'REPAIR TABLE'") . "> " . "<input type='submit' name='repair' value='" . lang('Repair') . "'> " . on_help("'REPAIR TABLE'")
: ""))) : "")))
. "<input type='submit' name='truncate' value='" . lang('Truncate') . "'" . confirm() . on_help($jush == "sqlite" ? "'DELETE'" : "'TRUNCATE" . ($jush == "pgsql" ? "'" : " 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') . "'" . confirm() . on_help("'DROP TABLE'") . ">\n"; . "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . on_help("'DROP TABLE'") . confirm() . "\n";
$databases = (support("scheme") ? $adminer->schemas() : $adminer->databases()); $databases = (support("scheme") ? $adminer->schemas() : $adminer->databases());
if (count($databases) != 1 && $jush != "sqlite") { if (count($databases) != 1 && $jush != "sqlite") {
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB)); $db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
@@ -135,17 +139,17 @@ if ($adminer->homepage()) {
echo (support("copy") ? " <input type='submit' name='copy' value='" . lang('Copy') . "'>" : ""); echo (support("copy") ? " <input type='submit' name='copy' value='" . lang('Copy') . "'>" : "");
echo "\n"; echo "\n";
} }
echo "<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^(tables|views)\[/));" . (support("table") ? " selectCount('selected2', formChecked(this, /^tables\[/) || $tables);" : "") . "\">\n"; // used by trCheck() echo "<input type='hidden' name='all' value=''>"; // used by trCheck()
echo script("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^(tables|views)\[/));" . (support("table") ? " selectCount('selected2', formChecked(this, /^tables\[/) || $tables);" : "") . " }");
echo "<input type='hidden' name='token' value='$token'>\n"; echo "<input type='hidden' name='token' value='$token'>\n";
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
echo "</form>\n"; echo "</form>\n";
echo "<script type='text/javascript'>tableCheck();</script>\n"; echo script("tableCheck();");
} }
echo '<p class="links"><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n"; echo '<p class="links"><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
echo (support("view") ? '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n" : ""); echo (support("view") ? '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n" : "");
echo (support("materializedview") ? '<a href="' . h(ME) . 'view=&amp;materialized=1">' . lang('Create materialized view') . "</a>\n" : "");
if (support("routine")) { if (support("routine")) {
echo "<h3 id='routines'>" . lang('Routines') . "</h3>\n"; echo "<h3 id='routines'>" . lang('Routines') . "</h3>\n";
@@ -222,7 +226,7 @@ if ($adminer->homepage()) {
} }
if ($tables_list) { if ($tables_list) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=db');</script>\n"; echo script("ajaxSetHtml('" . js_escape(ME) . "script=db');");
} }
} }
} }

14
adminer/designs.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
function adminer_object() {
include_once "../plugins/plugin.php";
include_once "../plugins/designs.php";
$designs = array();
foreach (glob("../designs/*", GLOB_ONLYDIR) as $filename) {
$designs["$filename/adminer.css"] = basename($filename);
}
return new AdminerPlugin(array(
new AdminerDesigns($designs),
));
}
include "./index.php";

View File

@@ -17,9 +17,10 @@ if (isset($_GET["elastic"])) {
*/ */
function rootQuery($path, $content = array(), $method = 'GET') { function rootQuery($path, $content = array(), $method = 'GET') {
@ini_set('track_errors', 1); // @ - may be disabled @ini_set('track_errors', 1); // @ - may be disabled
$file = @file_get_contents($this->_url . '/' . ltrim($path, '/'), false, stream_context_create(array('http' => array( $file = @file_get_contents("$this->_url/" . ltrim($path, '/'), false, stream_context_create(array('http' => array(
'method' => $method, 'method' => $method,
'content' => json_encode($content), 'content' => $content === null ? $content : json_encode($content),
'header' => 'Content-Type: application/json',
'ignore_errors' => 1, // available since PHP 5.2.10 'ignore_errors' => 1, // available since PHP 5.2.10
)))); ))));
if (!$file) { if (!$file) {
@@ -59,7 +60,8 @@ if (isset($_GET["elastic"])) {
} }
function connect($server, $username, $password) { function connect($server, $username, $password) {
$this->_url = "http://$username:$password@$server/"; preg_match('~^(https?://)?(.*)~', $server, $match);
$this->_url = ($match[1] ? $match[1] : "http://") . "$username:$password@$match[2]";
$return = $this->query(''); $return = $this->query('');
if ($return) { if ($return) {
$this->server_info = $return['version']['number']; $this->server_info = $return['version']['number'];
@@ -175,6 +177,47 @@ if (isset($_GET["elastic"])) {
return new Min_Result($return); return new Min_Result($return);
} }
function update($type, $record, $queryWhere) {
$parts = preg_split('~ *= *~', $queryWhere);
if (count($parts) == 2) {
$id = trim($parts[1]);
$query = "$type/$id";
return $this->_conn->query($query, $record, 'POST');
}
return false;
}
function insert($type, $record) {
$id = ""; //! user should be able to inform _id
$query = "$type/$id";
$response = $this->_conn->query($query, $record, 'POST');
$this->_conn->last_id = $response['_id'];
return $response['created'];
}
function delete($type, $queryWhere) {
$ids = array();
if (is_array($_GET["where"]) && $_GET["where"]["_id"]) {
$ids[] = $_GET["where"]["_id"];
}
if (is_array($_POST['check'])) {
foreach ($_POST['check'] as $check) {
$parts = preg_split('~ *= *~', $check);
if (count($parts) == 2) {
$ids[] = trim($parts[1]);
}
}
}
$this->_conn->affected_rows = 0;
foreach ($ids as $id) {
$query = "{$type}/{$id}";
$response = $this->_conn->query($query, '{}', 'DELETE');
if (is_array($response) && $response['found'] == true) {
$this->_conn->affected_rows++;
}
}
return $this->_conn->affected_rows;
}
} }
@@ -222,9 +265,14 @@ if (isset($_GET["elastic"])) {
function count_tables($databases) { function count_tables($databases) {
global $connection; global $connection;
$return = $connection->query('_mapping'); $return = array();
if ($return) { $result = $connection->query('_stats');
$return = array_map('count', $return); if ($result && $result['indices']) {
$indices = $result['indices'];
foreach($indices as $indice => $stats) {
$indexing = $stats['total']['indexing'];
$return[$indice] = $indexing['index_total'];
}
} }
return $return; return $return;
} }
@@ -240,28 +288,30 @@ if (isset($_GET["elastic"])) {
function table_status($name = "", $fast = false) { function table_status($name = "", $fast = false) {
global $connection; global $connection;
$search = $connection->query("_search?search_type=count", array( $search = $connection->query("_search", array(
"facets" => array( "size" => 0,
"aggregations" => array(
"count_by_type" => array( "count_by_type" => array(
"terms" => array( "terms" => array(
"field" => "_type", "field" => "_type"
) )
) )
) )
), "POST"); ), "POST");
$return = array(); $return = array();
if ($search) { if ($search) {
foreach ($search["facets"]["count_by_type"]["terms"] as $table) { $tables = $search["aggregations"]["count_by_type"]["buckets"];
$return[$table["term"]] = array( foreach ($tables as $table) {
"Name" => $table["term"], $return[$table["key"]] = array(
"Name" => $table["key"],
"Engine" => "table", "Engine" => "table",
"Rows" => $table["count"], "Rows" => $table["doc_count"],
); );
} if ($name != "" && $name == $table["key"]) {
if ($name != "" && $name == $table["term"]) {
return $return[$name]; return $return[$name];
} }
} }
}
return $return; return $return;
} }
@@ -335,16 +385,16 @@ if (isset($_GET["elastic"])) {
return null; return null;
} }
/** Create database /** Create index
* @param string * @param string
* @return mixed * @return mixed
*/ */
function create_database($db) { function create_database($db) {
global $connection; global $connection;
return $connection->rootQuery(urlencode($db), array(), 'PUT'); return $connection->rootQuery(urlencode($db), null, 'PUT');
} }
/** Drop databases /** Remove index
* @param array * @param array
* @return mixed * @return mixed
*/ */
@@ -353,7 +403,27 @@ if (isset($_GET["elastic"])) {
return $connection->rootQuery(urlencode(implode(',', $databases)), array(), 'DELETE'); return $connection->rootQuery(urlencode(implode(',', $databases)), array(), 'DELETE');
} }
/** Drop tables /** Alter type
* @param array
* @return mixed
*/
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
global $connection;
$properties = array();
foreach($fields as $f) {
$field_name = trim($f[1][0]);
$field_type = trim($f[1][1] ?: "text");
$properties[$field_name] = array(
'type' => $field_type
);
}
if (!empty($properties)) {
$properties = array('properties' => $properties);
}
return $connection->query("_mapping/{$name}", $properties, 'PUT');
}
/** Drop types
* @param array * @param array
* @return bool * @return bool
*/ */
@@ -366,9 +436,25 @@ if (isset($_GET["elastic"])) {
return $return; return $return;
} }
function last_id() {
global $connection;
return $connection->last_id;
}
$jush = "elastic"; $jush = "elastic";
$operators = array("=", "query"); $operators = array("=", "query");
$functions = array(); $functions = array();
$grouping = array(); $grouping = array();
$edit_functions = array(array("json")); $edit_functions = array(array("json"));
$types = array(); ///< @var array ($type => $maximum_unsigned_length, ...)
$structured_types = array(); ///< @var array ($description => array($type, ...), ...)
foreach (array(
lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
lang('Date and time') => array("date" => 10),
lang('Strings') => array("string" => 65535, "text" => 65535),
lang('Binary') => array("binary" => 255),
) as $key => $val) {
$types += $val;
$structured_types[$key] = array_keys($val);
}
} }

View File

@@ -2,7 +2,7 @@
$drivers["mongo"] = "MongoDB (beta)"; $drivers["mongo"] = "MongoDB (beta)";
if (isset($_GET["mongo"])) { if (isset($_GET["mongo"])) {
$possible_drivers = array("mongo"); $possible_drivers = array("mongo", "mongodb");
define("DRIVER", "mongo"); define("DRIVER", "mongo");
if (class_exists('MongoDB')) { if (class_exists('MongoDB')) {
@@ -109,7 +109,6 @@ if (isset($_GET["mongo"])) {
} }
} }
}
@@ -129,7 +128,7 @@ if (isset($_GET["mongo"])) {
return new Min_Result($this->_conn->_db->selectCollection($table) return new Min_Result($this->_conn->_db->selectCollection($table)
->find(array(), $select) ->find(array(), $select)
->sort($sort) ->sort($sort)
->limit(+$limit) ->limit($limit != "" ? +$limit : 0)
->skip($page * $limit) ->skip($page * $limit)
); );
} }
@@ -148,29 +147,6 @@ if (isset($_GET["mongo"])) {
} }
} }
function connect() {
global $adminer;
$connection = new Min_DB;
$credentials = $adminer->credentials();
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
return $connection;
}
return $connection->error;
}
function error() {
global $connection;
return h($connection->error);
}
function logged_user() {
global $adminer;
$credentials = $adminer->credentials();
return $credentials[1];
}
function get_databases($flush) { function get_databases($flush) {
global $connection; global $connection;
$return = array(); $return = array();
@@ -181,13 +157,6 @@ if (isset($_GET["mongo"])) {
return $return; return $return;
} }
function collations() {
return array();
}
function db_collation($db, $collations) {
}
function count_tables($databases) { function count_tables($databases) {
global $connection; global $connection;
$return = array(); $return = array();
@@ -202,23 +171,6 @@ if (isset($_GET["mongo"])) {
return array_fill_keys($connection->_db->getCollectionNames(true), 'table'); return array_fill_keys($connection->_db->getCollectionNames(true), 'table');
} }
function table_status($name = "", $fast = false) {
$return = array();
foreach (tables_list() as $table => $type) {
$return[$table] = array("Name" => $table);
if ($name == $table) {
return $return[$table];
}
}
return $return;
}
function information_schema() {
}
function is_view($table_status) {
}
function drop_databases($databases) { function drop_databases($databases) {
global $connection; global $connection;
foreach ($databases as $db) { foreach ($databases as $db) {
@@ -252,6 +204,489 @@ if (isset($_GET["mongo"])) {
return fields_from_edit(); return fields_from_edit();
} }
function found_rows($table_status, $where) {
global $connection;
//! don't call count_rows()
return $connection->_db->selectCollection($_GET["select"])->count($where);
}
$operators = array("=");
} elseif (class_exists('MongoDB\Driver\Manager')) {
class Min_DB {
var $extension = "MongoDB", $error, $last_id;
/** @var MongoDB\Driver\Manager */
var $_link;
var $_db, $_db_name;
function connect($server, $username, $password) {
global $adminer;
$db = $adminer->database();
$options = array();
if ($username != "") {
$options["username"] = $username;
$options["password"] = $password;
}
if ($db != "") {
$options["db"] = $db;
}
try {
$class = 'MongoDB\Driver\Manager';
$this->_link = new $class("mongodb://$server", $options);
return true;
} catch (Exception $ex) {
$this->error = $ex->getMessage();
return false;
}
}
function query($query) {
return false;
}
function select_db($database) {
try {
$this->_db_name = $database;
return true;
} catch (Exception $ex) {
$this->error = $ex->getMessage();
return false;
}
}
function quote($string) {
return $string;
}
}
class Min_Result {
var $num_rows, $_rows = array(), $_offset = 0, $_charset = array();
function __construct($result) {
foreach ($result as $item) {
$row = array();
foreach ($item as $key => $val) {
if (is_a($val, 'MongoDB\BSON\Binary')) {
$this->_charset[$key] = 63;
}
$row[$key] =
(is_a($val, 'MongoDB\BSON\ObjectID') ? 'MongoDB\BSON\ObjectID("' . strval($val) . '")' :
(is_a($val, 'MongoDB\BSON\UTCDatetime') ? $val->toDateTime()->format('Y-m-d H:i:s') :
(is_a($val, 'MongoDB\BSON\Binary') ? $val->bin : //! allow downloading
(is_a($val, 'MongoDB\BSON\Regex') ? strval($val) :
(is_object($val) ? json_encode($val, 256) : // 256 = JSON_UNESCAPED_UNICODE
$val // MongoMinKey, MongoMaxKey
)))));
}
$this->_rows[] = $row;
foreach ($row as $key => $val) {
if (!isset($this->_rows[0][$key])) {
$this->_rows[0][$key] = null;
}
}
}
$this->num_rows = $result->count;
}
function fetch_assoc() {
$row = current($this->_rows);
if (!$row) {
return $row;
}
$return = array();
foreach ($this->_rows[0] as $key => $val) {
$return[$key] = $row[$key];
}
next($this->_rows);
return $return;
}
function fetch_row() {
$return = $this->fetch_assoc();
if (!$return) {
return $return;
}
return array_values($return);
}
function fetch_field() {
$keys = array_keys($this->_rows[0]);
$name = $keys[$this->_offset++];
return (object) array(
'name' => $name,
'charsetnr' => $this->_charset[$name],
);
}
}
class Min_Driver extends Min_SQL {
public $primary = "_id";
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
global $connection;
$select = ($select == array("*")
? array()
: array_fill_keys($select, 1)
);
if (count($select) && !isset($select['_id'])) {
$select['_id'] = 0;
}
$where = where_to_query($where);
$sort = array();
foreach ($order as $val) {
$val = preg_replace('~ DESC$~', '', $val, 1, $count);
$sort[$val] = ($count ? -1 : 1);
}
if (isset($_GET['limit']) && is_numeric($_GET['limit']) && $_GET['limit'] > 0) {
$limit = $_GET['limit'];
}
$limit = min(200, max(1, (int) $limit));
$skip = $page * $limit;
$class = 'MongoDB\Driver\Query';
$query = new $class($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort));
$results = $connection->_link->executeQuery("$connection->_db_name.$table", $query);
return new Min_Result($results);
}
function update($table, $set, $queryWhere, $limit = 0, $separator = "\n") {
global $connection;
$db = $connection->_db_name;
$where = sql_query_where_parser($queryWhere);
$class = 'MongoDB\Driver\BulkWrite';
$bulk = new $class(array());
if (isset($set['_id'])) {
unset($set['_id']);
}
$removeFields = array();
foreach ($set as $key => $value) {
if ($value == 'NULL') {
$removeFields[$key] = 1;
unset($set[$key]);
}
}
$update = array('$set' => $set);
if (count($removeFields)) {
$update['$unset'] = $removeFields;
}
$bulk->update($where, $update, array('upsert' => false));
$results = $connection->_link->executeBulkWrite("$db.$table", $bulk);
$connection->affected_rows = $results->getModifiedCount();
return true;
}
function delete($table, $queryWhere, $limit = 0) {
global $connection;
$db = $connection->_db_name;
$where = sql_query_where_parser($queryWhere);
$class = 'MongoDB\Driver\BulkWrite';
$bulk = new $class(array());
$bulk->delete($where, array('limit' => $limit));
$results = $connection->_link->executeBulkWrite("$db.$table", $bulk);
$connection->affected_rows = $results->getDeletedCount();
return true;
}
function insert($table, $set) {
global $connection;
$db = $connection->_db_name;
$class = 'MongoDB\Driver\BulkWrite';
$bulk = new $class(array());
if (isset($set['_id']) && empty($set['_id'])) {
unset($set['_id']);
}
$bulk->insert($set);
$results = $connection->_link->executeBulkWrite("$db.$table", $bulk);
$connection->affected_rows = $results->getInsertedCount();
return true;
}
}
function get_databases($flush) {
/** @var $connection Min_DB */
global $connection;
$return = array();
$class = 'MongoDB\Driver\Command';
$command = new $class(array('listDatabases' => 1));
$results = $connection->_link->executeCommand('admin', $command);
foreach ($results as $dbs) {
foreach ($dbs->databases as $db) {
$return[] = $db->name;
}
}
return $return;
}
function count_tables($databases) {
$return = array();
return $return;
}
function tables_list() {
global $connection;
$class = 'MongoDB\Driver\Command';
$command = new $class(array('listCollections' => 1));
$results = $connection->_link->executeCommand($connection->_db_name, $command);
$collections = array();
foreach ($results as $result) {
$collections[$result->name] = 'table';
}
return $collections;
}
function drop_databases($databases) {
return false;
}
function indexes($table, $connection2 = null) {
global $connection;
$return = array();
$class = 'MongoDB\Driver\Command';
$command = new $class(array('listIndexes' => $table));
$results = $connection->_link->executeCommand($connection->_db_name, $command);
foreach ($results as $index) {
$descs = array();
$columns = array();
foreach (get_object_vars($index->key) as $column => $type) {
$descs[] = ($type == -1 ? '1' : null);
$columns[] = $column;
}
$return[$index->name] = array(
"type" => ($index->name == "_id_" ? "PRIMARY" : (isset($index->unique) ? "UNIQUE" : "INDEX")),
"columns" => $columns,
"lengths" => array(),
"descs" => $descs,
);
}
return $return;
}
function fields($table) {
$fields = fields_from_edit();
if (!count($fields)) {
global $driver;
$result = $driver->select($table, array("*"), null, null, array(), 10);
while ($row = $result->fetch_assoc()) {
foreach ($row as $key => $val) {
$row[$key] = null;
$fields[$key] = array(
"field" => $key,
"type" => "string",
"null" => ($key != $driver->primary),
"auto_increment" => ($key == $driver->primary),
"privileges" => array(
"insert" => 1,
"select" => 1,
"update" => 1,
),
);
}
}
}
return $fields;
}
function found_rows($table_status, $where) {
global $connection;
$where = where_to_query($where);
$class = 'MongoDB\Driver\Command';
$command = new $class(array('count' => $table_status['Name'], 'query' => $where));
$results = $connection->_link->executeCommand($connection->_db_name, $command);
$toArray = $results->toArray();
return $toArray[0]->n;
}
function sql_query_where_parser($queryWhere) {
$queryWhere = trim(preg_replace('/WHERE[\s]?[(]?\(?/', '', $queryWhere));
$queryWhere = preg_replace('/\)\)\)$/', ')', $queryWhere);
$wheres = explode(' AND ', $queryWhere);
$wheresOr = explode(') OR (', $queryWhere);
$where = array();
foreach ($wheres as $whereStr) {
$where[] = trim($whereStr);
}
if (count($wheresOr) == 1) {
$wheresOr = array();
} elseif (count($wheresOr) > 1) {
$where = array();
}
return where_to_query($where, $wheresOr);
}
function where_to_query($whereAnd = array(), $whereOr = array()) {
global $operators;
$data = array();
foreach (array('and' => $whereAnd, 'or' => $whereOr) as $type => $where) {
if (is_array($where)) {
foreach ($where as $expression) {
list($col, $op, $val) = explode(" ", $expression, 3);
if ($col == "_id") {
$val = str_replace('MongoDB\BSON\ObjectID("', "", $val);
$val = str_replace('")', "", $val);
$class = 'MongoDB\BSON\ObjectID';
$val = new $class($val);
}
if (!in_array($op, $operators)) {
continue;
}
if (preg_match('~^\(f\)(.+)~', $op, $match)) {
$val = (float) $val;
$op = $match[1];
} elseif (preg_match('~^\(date\)(.+)~', $op, $match)) {
$dateTime = new DateTime($val);
$class = 'MongoDB\BSON\UTCDatetime';
$val = new $class($dateTime->getTimestamp() * 1000);
$op = $match[1];
}
switch ($op) {
case '=':
$op = '$eq';
break;
case '!=':
$op = '$ne';
break;
case '>':
$op = '$gt';
break;
case '<':
$op = '$lt';
break;
case '>=':
$op = '$gte';
break;
case '<=':
$op = '$lte';
break;
case 'regex':
$op = '$regex';
break;
default:
continue;
}
if ($type == 'and') {
$data['$and'][] = array($col => array($op => $val));
} elseif ($type == 'or') {
$data['$or'][] = array($col => array($op => $val));
}
}
}
}
return $data;
}
$operators = array(
"=",
"!=",
">",
"<",
">=",
"<=",
"regex",
"(f)=",
"(f)!=",
"(f)>",
"(f)<",
"(f)>=",
"(f)<=",
"(date)=",
"(date)!=",
"(date)>",
"(date)<",
"(date)>=",
"(date)<=",
);
}
function table($idf) {
return $idf;
}
function idf_escape($idf) {
return $idf;
}
function table_status($name = "", $fast = false) {
$return = array();
foreach (tables_list() as $table => $type) {
$return[$table] = array("Name" => $table);
if ($name == $table) {
return $return[$table];
}
}
return $return;
}
function last_id() {
global $connection;
return $connection->last_id;
}
function error() {
global $connection;
return h($connection->error);
}
function collations() {
return array();
}
function logged_user() {
global $adminer;
$credentials = $adminer->credentials();
return $credentials[1];
}
function connect() {
global $adminer;
$connection = new Min_DB;
$credentials = $adminer->credentials();
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
return $connection;
}
return $connection->error;
}
function alter_indexes($table, $alter) {
global $connection;
foreach ($alter as $val) {
list($type, $name, $set) = $val;
if ($set == "DROP") {
$return = $connection->_db->command(array("deleteIndexes" => $table, "index" => $name));
} else {
$columns = array();
foreach ($set as $column) {
$column = preg_replace('~ DESC$~', '', $column, 1, $count);
$columns[$column] = ($count ? -1 : 1);
}
$return = $connection->_db->selectCollection($table)->ensureIndex($columns, array(
"unique" => ($type == "UNIQUE"),
"name" => $name,
//! "sparse"
));
}
if ($return['errmsg']) {
$connection->error = $return['errmsg'];
return false;
}
}
return true;
}
function support($feature) {
return preg_match("~database|indexes~", $feature);
}
function db_collation($db, $collations) {
}
function information_schema() {
}
function is_view($table_status) {
}
function convert_field($field) { function convert_field($field) {
} }
@@ -270,12 +705,6 @@ if (isset($_GET["mongo"])) {
return array(); return array();
} }
function found_rows($table_status, $where) {
global $connection;
//! don't call count_rows()
return $connection->_db->selectCollection($_GET["select"])->count($where);
}
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) { function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
global $connection; global $connection;
if ($table == "") { if ($table == "") {
@@ -306,51 +735,7 @@ if (isset($_GET["mongo"])) {
return true; return true;
} }
function alter_indexes($table, $alter) {
global $connection;
foreach ($alter as $val) {
list($type, $name, $set) = $val;
if ($set == "DROP") {
$return = $connection->_db->command(array("deleteIndexes" => $table, "index" => $name));
} else {
$columns = array();
foreach ($set as $column) {
$column = preg_replace('~ DESC$~', '', $column, 1, $count);
$columns[$column] = ($count ? -1 : 1);
}
$return = $connection->_db->selectCollection($table)->ensureIndex($columns, array(
"unique" => ($type == "UNIQUE"),
"name" => $name,
//! "sparse"
));
}
if ($return['errmsg']) {
$connection->error = $return['errmsg'];
return false;
}
}
return true;
}
function last_id() {
global $connection;
return $connection->last_id;
}
function table($idf) {
return $idf;
}
function idf_escape($idf) {
return $idf;
}
function support($feature) {
return preg_match("~database|indexes~", $feature);
}
$jush = "mongo"; $jush = "mongo";
$operators = array("=");
$functions = array(); $functions = array();
$grouping = array(); $grouping = array();
$edit_functions = array(array("json")); $edit_functions = array(array("json"));

View File

@@ -8,7 +8,7 @@
$drivers["mssql"] = "MS SQL"; $drivers["mssql"] = "MS SQL";
if (isset($_GET["mssql"])) { if (isset($_GET["mssql"])) {
$possible_drivers = array("SQLSRV", "MSSQL"); $possible_drivers = array("SQLSRV", "MSSQL", "PDO_DBLIB");
define("DRIVER", "mssql"); define("DRIVER", "mssql");
if (extension_loaded("sqlsrv")) { if (extension_loaded("sqlsrv")) {
class Min_DB { class Min_DB {
@@ -109,11 +109,11 @@ if (isset($_GET["mssql"])) {
} }
function fetch_assoc() { function fetch_assoc() {
return $this->_convert(sqlsrv_fetch_array($this->_result, SQLSRV_FETCH_ASSOC, SQLSRV_SCROLL_NEXT)); return $this->_convert(sqlsrv_fetch_array($this->_result, SQLSRV_FETCH_ASSOC));
} }
function fetch_row() { function fetch_row() {
return $this->_convert(sqlsrv_fetch_array($this->_result, SQLSRV_FETCH_NUMERIC, SQLSRV_SCROLL_NEXT)); return $this->_convert(sqlsrv_fetch_array($this->_result, SQLSRV_FETCH_NUMERIC));
} }
function fetch_field() { function fetch_field() {
@@ -164,7 +164,7 @@ if (isset($_GET["mssql"])) {
} }
function query($query, $unbuffered = false) { function query($query, $unbuffered = false) {
$result = mssql_query($query, $this->_link); //! $unbuffered $result = @mssql_query($query, $this->_link); //! $unbuffered
$this->error = ""; $this->error = "";
if (!$result) { if (!$result) {
$this->error = mssql_get_last_message(); $this->error = mssql_get_last_message();
@@ -186,7 +186,7 @@ if (isset($_GET["mssql"])) {
} }
function next_result() { function next_result() {
return mssql_next_result($this->_result); return mssql_next_result($this->_result->_result);
} }
function result($query, $field = 0) { function result($query, $field = 0) {
@@ -234,8 +234,21 @@ if (isset($_GET["mssql"])) {
} }
} }
} elseif (extension_loaded("pdo_dblib")) {
class Min_DB extends Min_PDO {
var $extension = "PDO_DBLIB";
function connect($server, $username, $password) {
$this->dsn("dblib:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
return true;
} }
function select_db($database) {
// database selection is separated from the connection so dbname in DSN can't be used
return $this->query("USE " . idf_escape($database));
}
}
}
class Min_Driver extends Min_SQL { class Min_Driver extends Min_SQL {
@@ -288,7 +301,7 @@ if (isset($_GET["mssql"])) {
} }
function get_databases() { function get_databases() {
return get_vals("EXEC sp_databases"); return get_vals("SELECT name FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')");
} }
function limit($query, $where, $limit, $offset = 0, $separator = " ") { function limit($query, $where, $limit, $offset = 0, $separator = " ") {
@@ -348,7 +361,7 @@ if (isset($_GET["mssql"])) {
function fields($table) { function fields($table) {
$return = array(); $return = array();
foreach (get_rows("SELECT c.*, t.name type, d.definition [default] foreach (get_rows("SELECT c.max_length, c.precision, c.scale, c.name, c.is_nullable, c.is_identity, c.collation_name, t.name type, CAST(d.definition as text) [default]
FROM sys.all_columns c FROM sys.all_columns c
JOIN sys.all_objects o ON c.object_id = o.object_id JOIN sys.all_objects o ON c.object_id = o.object_id
JOIN sys.types t ON c.user_type_id = t.user_type_id JOIN sys.types t ON c.user_type_id = t.user_type_id

View File

@@ -301,12 +301,16 @@ if (!defined("DRIVER")) {
* @return mixed Min_DB or string for error * @return mixed Min_DB or string for error
*/ */
function connect() { function connect() {
global $adminer; global $adminer, $types, $structured_types;
$connection = new Min_DB; $connection = new Min_DB;
$credentials = $adminer->credentials(); $credentials = $adminer->credentials();
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) { 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)); // available in MySQLi since PHP 5.0.5
$connection->query("SET sql_quote_show_create = 1, autocommit = 1"); $connection->query("SET sql_quote_show_create = 1, autocommit = 1");
if (version_compare($connection->server_info, '5.7.8') >= 0) {
$structured_types[lang('Strings')][] = "json";
$types["json"] = 4294967295;
}
return $connection; return $connection;
} }
$return = $connection->error; $return = $connection->error;
@@ -429,7 +433,7 @@ if (!defined("DRIVER")) {
global $connection; global $connection;
$return = array(); $return = array();
foreach (get_rows($fast && $connection->server_info >= 5 foreach (get_rows($fast && $connection->server_info >= 5
? "SELECT TABLE_NAME AS Name, Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() " . ($name != "" ? "AND TABLE_NAME = " . q($name) : "ORDER BY Name") ? "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, "%_\\")) : "") : "SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_\\")) : "")
) as $row) { ) as $row) {
if ($row["Engine"] == "InnoDB") { if ($row["Engine"] == "InnoDB") {
@@ -500,10 +504,11 @@ if (!defined("DRIVER")) {
function indexes($table, $connection2 = null) { function indexes($table, $connection2 = null) {
$return = array(); $return = array();
foreach (get_rows("SHOW INDEX FROM " . table($table), $connection2) as $row) { foreach (get_rows("SHOW INDEX FROM " . table($table), $connection2) as $row) {
$return[$row["Key_name"]]["type"] = ($row["Key_name"] == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? "INDEX" : "UNIQUE"))); $name = $row["Key_name"];
$return[$row["Key_name"]]["columns"][] = $row["Column_name"]; $return[$name]["type"] = ($name == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? ($row["Index_type"] == "SPATIAL" ? "SPATIAL" : "INDEX") : "UNIQUE")));
$return[$row["Key_name"]]["lengths"][] = $row["Sub_part"]; $return[$name]["columns"][] = $row["Column_name"];
$return[$row["Key_name"]]["descs"][] = null; $return[$name]["lengths"][] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]);
$return[$name]["descs"][] = null;
} }
return $return; return $return;
} }
@@ -808,8 +813,9 @@ if (!defined("DRIVER")) {
function routine($name, $type) { function routine($name, $type) {
global $connection, $enum_length, $inout, $types; global $connection, $enum_length, $inout, $types;
$aliases = array("bool", "boolean", "integer", "double precision", "real", "dec", "numeric", "fixed", "national char", "national varchar"); $aliases = array("bool", "boolean", "integer", "double precision", "real", "dec", "numeric", "fixed", "national char", "national varchar");
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";
$type_pattern = "((" . implode("|", array_merge(array_keys($types), $aliases)) . ")\\b(?:\\s*\\(((?:[^'\")]|$enum_length)++)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?"; $type_pattern = "((" . implode("|", array_merge(array_keys($types), $aliases)) . ")\\b(?:\\s*\\(((?:[^'\")]|$enum_length)++)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?";
$pattern = "\\s*(" . ($type == "FUNCTION" ? "" : $inout) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern"; $pattern = "$space*(" . ($type == "FUNCTION" ? "" : $inout) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
$create = $connection->result("SHOW CREATE $type " . idf_escape($name), 2); $create = $connection->result("SHOW CREATE $type " . idf_escape($name), 2);
preg_match("~\\(((?:$pattern\\s*,?)*)\\)\\s*" . ($type == "FUNCTION" ? "RETURNS\\s+$type_pattern\\s+" : "") . "(.*)~is", $create, $match); preg_match("~\\(((?:$pattern\\s*,?)*)\\)\\s*" . ($type == "FUNCTION" ? "RETURNS\\s+$type_pattern\\s+" : "") . "(.*)~is", $create, $match);
$fields = array(); $fields = array();
@@ -910,9 +916,10 @@ if (!defined("DRIVER")) {
/** Get SQL command to create table /** Get SQL command to create table
* @param string * @param string
* @param bool * @param bool
* @param string
* @return string * @return string
*/ */
function create_sql($table, $auto_increment) { function create_sql($table, $auto_increment, $style) {
global $connection; global $connection;
$return = $connection->result("SHOW CREATE TABLE " . table($table), 1); $return = $connection->result("SHOW CREATE TABLE " . table($table), 1);
if (!$auto_increment) { if (!$auto_increment) {
@@ -939,14 +946,12 @@ if (!defined("DRIVER")) {
/** Get SQL commands to create triggers /** Get SQL commands to create triggers
* @param string * @param string
* @param string
* @return string * @return string
*/ */
function trigger_sql($table, $style) { function trigger_sql($table) {
$return = ""; $return = "";
foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_\\")), null, "-- ") as $row) { foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_\\")), null, "-- ") as $row) {
$return .= "\n" . ($style == 'CREATE+ALTER' ? "DROP TRIGGER IF EXISTS " . idf_escape($row["Trigger"]) . ";;\n" : "") $return .= "\nCREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . table($row["Table"]) . " FOR EACH ROW\n$row[Statement];;\n";
. "CREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . table($row["Table"]) . " FOR EACH ROW\n$row[Statement];;\n";
} }
return $return; return $return;
} }
@@ -977,6 +982,7 @@ if (!defined("DRIVER")) {
* @return string * @return string
*/ */
function convert_field($field) { function convert_field($field) {
global $connection;
if (preg_match("~binary~", $field["type"])) { if (preg_match("~binary~", $field["type"])) {
return "HEX(" . idf_escape($field["field"]) . ")"; return "HEX(" . idf_escape($field["field"]) . ")";
} }
@@ -984,7 +990,7 @@ if (!defined("DRIVER")) {
return "BIN(" . idf_escape($field["field"]) . " + 0)"; // + 0 is required outside MySQLnd return "BIN(" . idf_escape($field["field"]) . " + 0)"; // + 0 is required outside MySQLnd
} }
if (preg_match("~geometry|point|linestring|polygon~", $field["type"])) { if (preg_match("~geometry|point|linestring|polygon~", $field["type"])) {
return "AsWKT(" . idf_escape($field["field"]) . ")"; return ($connection->server_info >= 8 ? "ST_" : "") . "AsWKT(" . idf_escape($field["field"]) . ")";
} }
} }
@@ -1012,13 +1018,17 @@ if (!defined("DRIVER")) {
*/ */
function support($feature) { function support($feature) {
global $connection; global $connection;
return !preg_match("~scheme|sequence|type|view_trigger" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|routine|trigger|view" : "") : "") . "~", $feature); return !preg_match("~scheme|sequence|type|view_trigger|materializedview" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|routine|trigger|view" : "") : "") . "~", $feature);
} }
function kill_process($val) { function kill_process($val) {
return queries("KILL " . number($val)); return queries("KILL " . number($val));
} }
function connection_id(){
return "SELECT CONNECTION_ID()";
}
function max_connections() { function max_connections() {
global $connection; global $connection;
return $connection->result("SELECT @@max_connections"); return $connection->result("SELECT @@max_connections");

View File

@@ -186,12 +186,20 @@ if (isset($_GET["pgsql"])) {
} }
function connect() { function connect() {
global $adminer; global $adminer, $types, $structured_types;
$connection = new Min_DB; $connection = new Min_DB;
$credentials = $adminer->credentials(); $credentials = $adminer->credentials();
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) { if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
if ($connection->server_info >= 9) { if ($connection->server_info >= 9) {
$connection->query("SET application_name = 'Adminer'"); $connection->query("SET application_name = 'Adminer'");
if ($connection->server_info >= 9.2) {
$structured_types[lang('Strings')][] = "json";
$types["json"] = 4294967295;
if ($connection->server_info >= 9.4) {
$structured_types[lang('Strings')][] = "jsonb";
$types["jsonb"] = 4294967295;
}
}
} }
return $connection; return $connection;
} }
@@ -199,7 +207,7 @@ if (isset($_GET["pgsql"])) {
} }
function get_databases() { function get_databases() {
return get_vals("SELECT datname FROM pg_database ORDER BY datname"); return get_vals("SELECT datname FROM pg_database WHERE has_database_privilege(datname, 'CONNECT') ORDER BY datname");
} }
function limit($query, $where, $limit, $offset = 0, $separator = " ") { function limit($query, $where, $limit, $offset = 0, $separator = " ") {
@@ -244,10 +252,10 @@ ORDER BY 1";
function table_status($name = "") { function table_status($name = "") {
$return = array(); $return = array();
foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN 'table' WHEN 'mv' THEN 'materialized view' WHEN 'f' THEN 'foreign table' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids::int AS \"Oid\", reltuples as \"Rows\" foreach (get_rows("SELECT c.relname AS \"Name\", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \"Engine\", pg_relation_size(c.oid) AS \"Data_length\", pg_total_relation_size(c.oid) - pg_relation_size(c.oid) AS \"Index_length\", obj_description(c.oid, 'pg_class') AS \"Comment\", c.relhasoids::int AS \"Oid\", c.reltuples as \"Rows\", n.nspname
FROM pg_class FROM pg_class c
WHERE relkind IN ('r','v','mv','f') JOIN pg_namespace n ON(n.nspname = current_schema() AND n.oid = c.relnamespace)
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) WHERE relkind IN ('r', 'm', 'v', 'f')
" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname") " . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")
) as $row) { //! Index_length, Auto_increment ) as $row) { //! Index_length, Auto_increment
$return[$row["Name"]] = $row; $return[$row["Name"]] = $row;
@@ -296,7 +304,7 @@ ORDER BY a.attnum"
$row["auto_increment"] = preg_match('~^nextval\\(~i', $row["default"]); $row["auto_increment"] = preg_match('~^nextval\\(~i', $row["default"]);
$row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1); $row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1);
if (preg_match('~(.+)::[^)]+(.*)~', $row["default"], $match)) { if (preg_match('~(.+)::[^)]+(.*)~', $row["default"], $match)) {
$row["default"] = ($match[1][0] == "'" ? idf_unescape($match[1]) : $match[1]) . $match[2]; $row["default"] = ($match[1] == "NULL" ? null : (($match[1][0] == "'" ? idf_unescape($match[1]) : $match[1]) . $match[2]));
} }
$return[$row["field"]] = $row; $return[$row["field"]] = $row;
} }
@@ -311,9 +319,9 @@ ORDER BY a.attnum"
$return = array(); $return = array();
$table_oid = $connection2->result("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q($table)); $table_oid = $connection2->result("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q($table));
$columns = get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $table_oid AND attnum > 0", $connection2); $columns = get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $table_oid AND attnum > 0", $connection2);
foreach (get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption FROM pg_index i, pg_class ci WHERE i.indrelid = $table_oid AND ci.oid = i.indexrelid", $connection2) as $row) { foreach (get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption , (indpred IS NOT NULL)::int as indispartial FROM pg_index i, pg_class ci WHERE i.indrelid = $table_oid AND ci.oid = i.indexrelid", $connection2) as $row) {
$relname = $row["relname"]; $relname = $row["relname"];
$return[$relname]["type"] = ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX")); $return[$relname]["type"] = ($row["indispartial"] ? "INDEX" : ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX")));
$return[$relname]["columns"] = array(); $return[$relname]["columns"] = array();
foreach (explode(" ", $row["indkey"]) as $indkey) { foreach (explode(" ", $row["indkey"]) as $indkey) {
$return[$relname]["columns"][] = $columns[$indkey]; $return[$relname]["columns"][] = $columns[$indkey];
@@ -330,7 +338,7 @@ ORDER BY a.attnum"
function foreign_keys($table) { function foreign_keys($table) {
global $on_actions; global $on_actions;
$return = array(); $return = array();
foreach (get_rows("SELECT conname, pg_get_constraintdef(oid) AS definition foreach (get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
FROM pg_constraint FROM pg_constraint
WHERE conrelid = (SELECT pc.oid FROM pg_class AS pc INNER JOIN pg_namespace AS pn ON (pn.oid = pc.relnamespace) WHERE pc.relname = " . q($table) . " AND pn.nspname = current_schema()) WHERE conrelid = (SELECT pc.oid FROM pg_class AS pc INNER JOIN pg_namespace AS pn ON (pn.oid = pc.relnamespace) WHERE pc.relname = " . q($table) . " AND pn.nspname = current_schema())
AND contype = 'f'::char AND contype = 'f'::char
@@ -352,7 +360,7 @@ ORDER BY conkey, conname") as $row) {
function view($name) { function view($name) {
global $connection; global $connection;
return array("select" => $connection->result("SELECT pg_get_viewdef(" . q($name) . ")")); return array("select" => trim($connection->result("SELECT pg_get_viewdef(" . q($name) . ")")));
} }
function collations() { function collations() {
@@ -506,18 +514,21 @@ ORDER BY conkey, conname") as $row) {
return true; return true;
} }
function trigger($name) { function trigger($name, $table = null) {
if ($name == "") { if ($name == "") {
return array("Statement" => "EXECUTE PROCEDURE ()"); return array("Statement" => "EXECUTE PROCEDURE ()");
} }
$rows = get_rows('SELECT trigger_name AS "Trigger", condition_timing AS "Timing", event_manipulation AS "Event", \'FOR EACH \' || action_orientation AS "Type", action_statement AS "Statement" FROM information_schema.triggers WHERE event_object_table = ' . q($_GET["trigger"]) . ' AND trigger_name = ' . q($name)); if ($table === null) {
$table = $_GET['trigger'];
}
$rows = get_rows('SELECT t.trigger_name AS "Trigger", t.action_timing AS "Timing", (SELECT STRING_AGG(event_manipulation, \' OR \') FROM information_schema.triggers WHERE event_object_table = t.event_object_table AND trigger_name = t.trigger_name ) AS "Events", t.event_manipulation AS "Event", \'FOR EACH \' || t.action_orientation AS "Type", t.action_statement AS "Statement" FROM information_schema.triggers t WHERE t.event_object_table = ' . q($table) . ' AND t.trigger_name = ' . q($name));
return reset($rows); return reset($rows);
} }
function triggers($table) { function triggers($table) {
$return = array(); $return = array();
foreach (get_rows("SELECT * FROM information_schema.triggers WHERE event_object_table = " . q($table)) as $row) { foreach (get_rows("SELECT * FROM information_schema.triggers WHERE event_object_table = " . q($table)) as $row) {
$return[$row["trigger_name"]] = array($row["condition_timing"], $row["event_manipulation"]); $return[$row["trigger_name"]] = array($row["action_timing"], $row["event_manipulation"]);
} }
return $return; return $return;
} }
@@ -606,6 +617,93 @@ AND typelem = 0"
return $return; return $return;
} }
function create_sql($table, $auto_increment, $style) {
global $connection;
$return = '';
$return_parts = array();
$sequences = array();
$status = table_status($table);
$fields = fields($table);
$indexes = indexes($table);
ksort($indexes);
$fkeys = foreign_keys($table);
ksort($fkeys);
if (!$status || empty($fields)) {
return false;
}
$return = "CREATE TABLE " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " (\n ";
// fields' definitions
foreach ($fields as $field_name => $field) {
$part = idf_escape($field['field']) . ' ' . $field['full_type']
. (is_null($field['default']) ? "" : " DEFAULT $field[default]")
. ($field['attnotnull'] ? " NOT NULL" : "");
$return_parts[] = $part;
// sequences for fields
if (preg_match('~nextval\(\'([^\']+)\'\)~', $field['default'], $matches)) {
$sequence_name = $matches[1];
$sq = reset(get_rows("SELECT * FROM $sequence_name"));
$sequences[] = ($style == "DROP+CREATE" ? "DROP SEQUENCE $sequence_name;\n" : "")
. "CREATE SEQUENCE $sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value] START " . ($auto_increment ? $sq['last_value'] : 1) . " CACHE $sq[cache_value];";
}
}
// adding sequences before table definition
if (!empty($sequences)) {
$return = implode("\n\n", $sequences) . "\n\n$return";
}
// primary + unique keys
foreach ($indexes as $index_name => $index) {
switch($index['type']) {
case 'UNIQUE': $return_parts[] = "CONSTRAINT " . idf_escape($index_name) . " UNIQUE (" . implode(', ', array_map('idf_escape', $index['columns'])) . ")"; break;
case 'PRIMARY': $return_parts[] = "CONSTRAINT " . idf_escape($index_name) . " PRIMARY KEY (" . implode(', ', array_map('idf_escape', $index['columns'])) . ")"; break;
}
}
// foreign keys
foreach ($fkeys as $fkey_name => $fkey) {
$return_parts[] = "CONSTRAINT " . idf_escape($fkey_name) . " $fkey[definition] " . ($fkey['deferrable'] ? 'DEFERRABLE' : 'NOT DEFERRABLE');
}
$return .= implode(",\n ", $return_parts) . "\n) WITH (oids = " . ($status['Oid'] ? 'true' : 'false') . ");";
// "basic" indexes after table definition
foreach ($indexes as $index_name => $index) {
if ($index['type'] == 'INDEX') {
$return .= "\n\nCREATE INDEX " . idf_escape($index_name) . " ON " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " USING btree (" . implode(', ', array_map('idf_escape', $index['columns'])) . ");";
}
}
// coments for table & fields
if ($status['Comment']) {
$return .= "\n\nCOMMENT ON TABLE " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " IS " . q($status['Comment']) . ";";
}
foreach ($fields as $field_name => $field) {
if ($field['comment']) {
$return .= "\n\nCOMMENT ON COLUMN " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . "." . idf_escape($field_name) . " IS " . q($field['comment']) . ";";
}
}
return rtrim($return, ';');
}
function trigger_sql($table) {
$status = table_status($table);
$return = "";
foreach (triggers($table) as $trg_id => $trg) {
$trigger = trigger($trg_id, $status['Name']);
$return .= "\nCREATE TRIGGER " . idf_escape($trigger['Trigger']) . " $trigger[Timing] $trigger[Events] ON " . idf_escape($status["nspname"]) . "." . idf_escape($status['Name']) . " $trigger[Type] $trigger[Statement];;\n";
}
return $return;
}
function use_sql($database) { function use_sql($database) {
return "\connect " . idf_escape($database); return "\connect " . idf_escape($database);
} }
@@ -631,13 +729,17 @@ AND typelem = 0"
function support($feature) { function support($feature) {
global $connection; global $connection;
return preg_match('~^(database|table|columns|sql|indexes|comment|view|' . ($connection->server_info >= 9.3 ? 'materializedview|' : '') . 'scheme|processlist|sequence|trigger|type|variables|drop_col|kill)$~', $feature); //! routine| return preg_match('~^(database|table|columns|sql|indexes|comment|view|' . ($connection->server_info >= 9.3 ? 'materializedview|' : '') . 'scheme|processlist|sequence|trigger|type|variables|drop_col|kill|dump)$~', $feature); //! routine|
} }
function kill_process($val) { function kill_process($val) {
return queries("SELECT pg_terminate_backend(" . number($val) . ")"); return queries("SELECT pg_terminate_backend(" . number($val) . ")");
} }
function connection_id(){
return "SELECT pg_backend_pid()";
}
function max_connections() { function max_connections() {
global $connection; global $connection;
return $connection->result("SHOW max_connections"); return $connection->result("SHOW max_connections");

View File

@@ -184,11 +184,13 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function __construct() { function __construct() {
parent::__construct(":memory:"); parent::__construct(":memory:");
$this->query("PRAGMA foreign_keys = 1");
} }
function select_db($filename) { function select_db($filename) {
if (is_readable($filename) && $this->query("ATTACH " . $this->quote(preg_match("~(^[/\\\\]|:)~", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3 if (is_readable($filename) && $this->query("ATTACH " . $this->quote(preg_match("~(^[/\\\\]|:)~", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
parent::__construct($filename); parent::__construct($filename);
$this->query("PRAGMA foreign_keys = 1");
return true; return true;
} }
return false; return false;
@@ -713,7 +715,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return true; return true;
} }
function create_sql($table, $auto_increment) { function create_sql($table, $auto_increment, $style) {
global $connection; global $connection;
$return = $connection->result("SELECT sql FROM sqlite_master WHERE type IN ('table', 'view') AND name = " . q($table)); $return = $connection->result("SELECT sql FROM sqlite_master WHERE type IN ('table', 'view') AND name = " . q($table));
foreach (indexes($table) as $name => $index) { foreach (indexes($table) as $name => $index) {
@@ -732,7 +734,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function use_sql($database) { function use_sql($database) {
} }
function trigger_sql($table, $style) { function trigger_sql($table) {
return implode(get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND tbl_name = " . q($table))); return implode(get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND tbl_name = " . q($table)));
} }

View File

@@ -92,7 +92,7 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
$fields = fields($name); $fields = fields($name);
$adminer->dumpData($name, $_POST["data_style"], "SELECT *" . convert_fields($fields, $fields) . " FROM " . table($name)); $adminer->dumpData($name, $_POST["data_style"], "SELECT *" . convert_fields($fields, $fields) . " FROM " . table($name));
} }
if ($is_sql && $_POST["triggers"] && $table && ($triggers = trigger_sql($name, $_POST["table_style"]))) { if ($is_sql && $_POST["triggers"] && $table && ($triggers = trigger_sql($name))) {
echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n"; echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n";
} }
@@ -169,8 +169,8 @@ $prefixes = array();
if (DB != "") { if (DB != "") {
$checked = ($TABLE != "" ? "" : " checked"); $checked = ($TABLE != "" ? "" : " checked");
echo "<thead><tr>"; echo "<thead><tr>";
echo "<th style='text-align: left;'><label class='block'><input type='checkbox' id='check-tables'$checked onclick='formCheck(this, /^tables\\[/);'>" . lang('Tables') . "</label>"; 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 onclick='formCheck(this, /^data\\[/);'></label>"; 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 "</thead>\n"; echo "</thead>\n";
$views = ""; $views = "";
@@ -178,22 +178,25 @@ if (DB != "") {
foreach ($tables_list as $name => $type) { foreach ($tables_list as $name => $type) {
$prefix = preg_replace('~_.*~', '', $name); $prefix = preg_replace('~_.*~', '', $name);
$checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name $checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name
$print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "checkboxClick(event, this); formUncheck('check-tables');", "block"); $print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "checkboxClick.call(this, event); formUncheck('check-tables');", "block");
if ($type !== null && !preg_match('~table~i', $type)) { if ($type !== null && !preg_match('~table~i', $type)) {
$views .= "$print\n"; $views .= "$print\n";
} else { } else {
echo "$print<td align='right'><label class='block'><span id='Rows-" . h($name) . "'></span>" . checkbox("data[]", $name, $checked, "", "checkboxClick(event, this); formUncheck('check-data');") . "</label>\n"; echo "$print<td align='right'><label class='block'><span id='Rows-" . h($name) . "'></span>" . checkbox("data[]", $name, $checked, "", "checkboxClick.call(this, event); formUncheck('check-data');") . "</label>\n";
} }
$prefixes[$prefix]++; $prefixes[$prefix]++;
} }
echo $views; echo $views;
if ($tables_list) { if ($tables_list) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=db');</script>\n"; echo script("ajaxSetHtml('" . js_escape(ME) . "script=db');");
} }
} else { } else {
echo "<thead><tr><th style='text-align: left;'><label class='block'><input type='checkbox' id='check-databases'" . ($TABLE == "" ? " checked" : "") . " onclick='formCheck(this, /^databases\\[/);'>" . lang('Database') . "</label></thead>\n"; 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 "</thead>\n";
$databases = $adminer->databases(); $databases = $adminer->databases();
if ($databases) { if ($databases) {
foreach ($databases as $db) { foreach ($databases as $db) {

View File

@@ -1,7 +1,7 @@
<?php <?php
$TABLE = $_GET["edit"]; $TABLE = $_GET["edit"];
$fields = fields($TABLE); $fields = fields($TABLE);
$where = (isset($_GET["select"]) ? (count($_POST["check"]) == 1 ? where_check($_POST["check"][0], $fields) : "") : where($_GET, $fields)); $where = (isset($_GET["select"]) ? ($_POST["check"] && count($_POST["check"]) == 1 ? where_check($_POST["check"][0], $fields) : "") : where($_GET, $fields));
$update = (isset($_GET["select"]) ? $_POST["edit"] : $where); $update = (isset($_GET["select"]) ? $_POST["edit"] : $where);
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
if (!isset($field["privileges"][$update ? "update" : "insert"]) || $adminer->fieldName($field) == "") { if (!isset($field["privileges"][$update ? "update" : "insert"]) || $adminer->fieldName($field) == "") {
@@ -82,10 +82,14 @@ if ($_POST["save"]) {
} }
if ($select) { if ($select) {
$result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1)); $result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1));
if (!$result) {
$error = error();
} else {
$row = $result->fetch_assoc(); $row = $result->fetch_assoc();
if (!$row) { // MySQLi returns null if (!$row) { // MySQLi returns null
$row = false; $row = false;
} }
}
if (isset($_GET["select"]) && (!$row || $result->fetch_assoc())) { // $result->num_rows != 1 isn't available in all drivers if (isset($_GET["select"]) && (!$row || $result->fetch_assoc())) { // $result->num_rows != 1 isn't available in all drivers
$row = null; $row = null;
} }

View File

@@ -47,6 +47,6 @@ if (!$row && $EVENT != "") {
<p><?php textarea("EVENT_DEFINITION", $row["EVENT_DEFINITION"]); ?> <p><?php textarea("EVENT_DEFINITION", $row["EVENT_DEFINITION"]); ?>
<p> <p>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($EVENT != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?> <?php if ($EVENT != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $EVENT)); ?><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -6,6 +6,7 @@ if ($_SERVER["HTTP_IF_MODIFIED_SINCE"]) {
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT"); header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: immutable");
if ($_GET["file"] == "favicon.ico") { if ($_GET["file"] == "favicon.ico") {
header("Content-Type: image/x-icon"); header("Content-Type: image/x-icon");
@@ -18,7 +19,7 @@ if ($_GET["file"] == "favicon.ico") {
echo lzw_decompress(compile_file('../adminer/static/functions.js;static/editing.js', 'minify_js')); echo lzw_decompress(compile_file('../adminer/static/functions.js;static/editing.js', 'minify_js'));
} elseif ($_GET["file"] == "jush.js") { } elseif ($_GET["file"] == "jush.js") {
header("Content-Type: text/javascript; charset=utf-8"); header("Content-Type: text/javascript; charset=utf-8");
echo lzw_decompress(compile_file('../externals/jush/modules/jush.js;../externals/jush/modules/jush-textarea.js;../externals/jush/modules/jush-txt.js;../externals/jush/modules/jush-sql.js;../externals/jush/modules/jush-pgsql.js;../externals/jush/modules/jush-sqlite.js;../externals/jush/modules/jush-mssql.js;../externals/jush/modules/jush-oracle.js;../externals/jush/modules/jush-simpledb.js', 'minify_js')); echo lzw_decompress(compile_file('../externals/jush/modules/jush.js;../externals/jush/modules/jush-textarea.js;../externals/jush/modules/jush-txt.js;../externals/jush/modules/jush-js.js;../externals/jush/modules/jush-sql.js;../externals/jush/modules/jush-pgsql.js;../externals/jush/modules/jush-sqlite.js;../externals/jush/modules/jush-mssql.js;../externals/jush/modules/jush-oracle.js;../externals/jush/modules/jush-simpledb.js', 'minify_js'));
} else { } else {
header("Content-Type: image/gif"); header("Content-Type: image/gif");
switch ($_GET["file"]) { switch ($_GET["file"]) {

View File

@@ -7,6 +7,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-
$message = ($_POST["drop"] ? lang('Foreign key has been dropped.') : ($name != "" ? lang('Foreign key has been altered.') : lang('Foreign key has been created.'))); $message = ($_POST["drop"] ? lang('Foreign key has been dropped.') : ($name != "" ? lang('Foreign key has been altered.') : lang('Foreign key has been created.')));
$location = ME . "table=" . urlencode($TABLE); $location = ME . "table=" . urlencode($TABLE);
if (!$_POST["drop"]) {
$row["source"] = array_filter($row["source"], 'strlen'); $row["source"] = array_filter($row["source"], 'strlen');
ksort($row["source"]); // enforce input order ksort($row["source"]); // enforce input order
$target = array(); $target = array();
@@ -14,6 +15,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-
$target[$key] = $row["target"][$key]; $target[$key] = $row["target"][$key];
} }
$row["target"] = $target; $row["target"] = $target;
}
if ($jush == "sqlite") { if ($jush == "sqlite") {
queries_redirect($location, $message, recreate_table($TABLE, $TABLE, array(), array(), array(" $name" => ($_POST["drop"] ? "" : " " . format_foreign_key($row))))); queries_redirect($location, $message, recreate_table($TABLE, $TABLE, array(), array(), array(" $name" => ($_POST["drop"] ? "" : " " . format_foreign_key($row)))));
@@ -60,13 +62,13 @@ $referencable = array_keys(array_filter(table_status('', true), 'fk_support'));
<input type="hidden" name="change-js" value=""> <input type="hidden" name="change-js" value="">
<noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>"></noscript> <noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>"></noscript>
<table cellspacing="0"> <table cellspacing="0">
<thead><tr><th><?php echo lang('Source'); ?><th><?php echo lang('Target'); ?></thead> <thead><tr><th id="label-source"><?php echo lang('Source'); ?><th id="label-target"><?php echo lang('Target'); ?></thead>
<?php <?php
$j = 0; $j = 0;
foreach ($row["source"] as $key => $val) { foreach ($row["source"] as $key => $val) {
echo "<tr>"; echo "<tr>";
echo "<td>" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1)); echo "<td>" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow.call(this);" : 1), "label-source");
echo "<td>" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key]); echo "<td>" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key], 1, "label-target");
$j++; $j++;
} }
?> ?>
@@ -84,6 +86,6 @@ foreach ($row["source"] as $key => $val) {
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<noscript><p><input type="submit" name="add" value="<?php echo lang('Add column'); ?>"></noscript> <noscript><p><input type="submit" name="add" value="<?php echo lang('Add column'); ?>"></noscript>
<?php } ?> <?php } ?>
<?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?> <?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $name)); ?><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -9,7 +9,7 @@ class Adminer {
* @return string HTML code * @return string HTML code
*/ */
function name() { function name() {
return "<a href='https://www.adminer.org/' target='_blank' id='h1'>Adminer</a>"; return "<a href='https://www.adminer.org/'" . target_blank() . " id='h1'>Adminer</a>";
} }
/** Connection parameters /** Connection parameters
@@ -65,14 +65,20 @@ class Adminer {
} }
/** Headers to send before HTML output /** Headers to send before HTML output
* @return bool true to send security headers * @return null
*/ */
function headers() { function headers() {
return true; }
/** Get Content Security Policy headers
* @return array of arrays with directive name in key, allowed sources in value
*/
function csp() {
return csp();
} }
/** Print HTML code inside <head> /** Print HTML code inside <head>
* @return bool true to link adminer.css if exists * @return bool true to link favicon.ico and adminer.css if exists
*/ */
function head() { function head() {
?> ?>
@@ -81,6 +87,18 @@ class Adminer {
return true; return true;
} }
/** Get URLs of the CSS files
* @return array of strings
*/
function css() {
$return = array();
$filename = "adminer.css";
if (file_exists($filename)) {
$return[] = $filename;
}
return $return;
}
/** Print login form /** Print login form
* @return null * @return null
*/ */
@@ -88,16 +106,14 @@ class Adminer {
global $drivers; global $drivers;
?> ?>
<table cellspacing="0"> <table cellspacing="0">
<tr><th><?php echo lang('System'); ?><td><?php echo html_select("auth[driver]", $drivers, DRIVER); ?> <tr><th><?php echo lang('System'); ?><td><?php echo html_select("auth[driver]", $drivers, DRIVER) . "\n"; ?>
<tr><th><?php echo lang('Server'); ?><td><input name="auth[server]" value="<?php echo h(SERVER); ?>" title="hostname[:port]" placeholder="localhost" autocapitalize="off"> <tr><th><?php echo lang('Server'); ?><td><input name="auth[server]" value="<?php echo h(SERVER); ?>" title="hostname[:port]" placeholder="localhost" autocapitalize="off">
<tr><th><?php echo lang('Username'); ?><td><input name="auth[username]" id="username" value="<?php echo h($_GET["username"]); ?>" autocapitalize="off"> <tr><th><?php echo lang('Username'); ?><td><input name="auth[username]" id="username" value="<?php echo h($_GET["username"]); ?>" autocapitalize="off">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="auth[password]"> <tr><th><?php echo lang('Password'); ?><td><input type="password" name="auth[password]">
<tr><th><?php echo lang('Database'); ?><td><input name="auth[db]" value="<?php echo h($_GET["db"]); ?>" autocapitalize="off"> <tr><th><?php echo lang('Database'); ?><td><input name="auth[db]" value="<?php echo h($_GET["db"]); ?>" autocapitalize="off">
</table> </table>
<script type="text/javascript">
focus(document.getElementById('username'));
</script>
<?php <?php
echo script("focus(qs('#username'));");
echo "<p><input type='submit' value='" . lang('Login') . "'>\n"; echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n"; echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
} }
@@ -110,7 +126,7 @@ focus(document.getElementById('username'));
function login($login, $password) { function login($login, $password) {
global $jush; global $jush;
if ($jush == "sqlite") { if ($jush == "sqlite") {
return lang('Implement %s method to use SQLite.', 'login()'); return lang('<a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to use SQLite.', target_blank(), '<code>login()</code>');
} }
return true; return true;
} }
@@ -197,6 +213,15 @@ focus(document.getElementById('username'));
; ;
} }
/** Query printed in SQL command before execution
* @param string query to be executed
* @return string escaped query to be printed
*/
function sqlCommandQuery($query)
{
return shorten_utf8(trim($query), 1000);
}
/** Description of a row in a table /** Description of a row in a table
* @param string * @param string
* @return string SQL expression, empty string for no description * @return string SQL expression, empty string for no description
@@ -230,9 +255,12 @@ focus(document.getElementById('username'));
* @return string * @return string
*/ */
function selectVal($val, $link, $field, $original) { function selectVal($val, $link, $field, $original) {
$return = ($val === null ? "<i>NULL</i>" : (preg_match("~char|binary~", $field["type"]) && !preg_match("~var~", $field["type"]) ? "<code>$val</code>" : $val)); $return = ($val === null ? "<i>NULL</i>" : (preg_match("~char|binary|boolean~", $field["type"]) && !preg_match("~var~", $field["type"]) ? "<code>$val</code>" : $val));
if (preg_match('~blob|bytea|raw|file~', $field["type"]) && !is_utf8($val)) { if (preg_match('~blob|bytea|raw|file~', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($original)); $return = "<i>" . lang('%d byte(s)', strlen($original)) . "</i>";
}
if (preg_match('~json~', $field["type"])) {
$return = "<code class='jush-js'>$return</code>";
} }
return ($link ? "<a href='" . h($link) . "'" . (is_url($link) ? " rel='noreferrer'" : "") . ">$return</a>" : $return); return ($link ? "<a href='" . h($link) . "'" . (is_url($link) ? " rel='noreferrer'" : "") . ">$return</a>" : $return);
} }
@@ -246,6 +274,45 @@ focus(document.getElementById('username'));
return $val; return $val;
} }
/** Print table structure in tabular format
* @param array data about individual fields
* @return null
*/
function tableStructurePrint($fields) {
echo "<table cellspacing='0' class='nowrap'>\n";
echo "<thead><tr><th>" . lang('Column') . "<td>" . lang('Type') . (support("comment") ? "<td>" . lang('Comment') : "") . "</thead>\n";
foreach ($fields as $field) {
echo "<tr" . odd() . "><th>" . h($field["field"]);
echo "<td><span title='" . h($field["collation"]) . "'>" . h($field["full_type"]) . "</span>";
echo ($field["null"] ? " <i>NULL</i>" : "");
echo ($field["auto_increment"] ? " <i>" . lang('Auto Increment') . "</i>" : "");
echo (isset($field["default"]) ? " <span title='" . lang('Default value') . "'>[<b>" . h($field["default"]) . "</b>]</span>" : "");
echo (support("comment") ? "<td>" . nbsp($field["comment"]) : "");
echo "\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";
foreach ($indexes as $name => $index) {
ksort($index["columns"]); // enforce correct columns order
$print = array();
foreach ($index["columns"] as $key => $val) {
$print[] = "<i>" . h($val) . "</i>"
. ($index["lengths"][$key] ? "(" . $index["lengths"][$key] . ")" : "")
. ($index["descs"][$key] ? " DESC" : "")
;
}
echo "<tr title='" . h($name) . "'><th>$index[type]<td>" . implode(", ", $print) . "\n";
}
echo "</table>\n";
}
/** Print columns box in select /** Print columns box in select
* @param array result of selectColumnsProcess()[0] * @param array result of selectColumnsProcess()[0]
* @param array selectable columns * @param array selectable columns
@@ -258,9 +325,16 @@ focus(document.getElementById('username'));
$select[""] = array(); $select[""] = array();
foreach ($select as $key => $val) { foreach ($select as $key => $val) {
$val = $_GET["columns"][$key]; $val = $_GET["columns"][$key];
$column = select_input(" name='columns[$i][col]' onchange='" . ($key !== "" ? "selectFieldChange(this.form)" : "selectAddRow(this)") . ";'", $columns, $val["col"]); $column = select_input(
echo "<div>" . ($functions || $grouping ? "<select name='columns[$i][fun]' onchange='helpClose();" . ($key !== "" ? "" : " this.nextSibling.nextSibling.onchange();") . "'" " name='columns[$i][col]'",
. on_help("getTarget(event).value && getTarget(event).value.replace(/ |\$/, '(') + ')'", 1) . ">" . optionlist(array(-1 => "") + array_filter(array(lang('Functions') => $functions, lang('Aggregation') => $grouping)), $val["fun"]) . "</select>" $columns,
$val["col"],
($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"; . "($column)" : $column) . "</div>\n";
$i++; $i++;
} }
@@ -277,21 +351,30 @@ focus(document.getElementById('username'));
print_fieldset("search", lang('Search'), $where); print_fieldset("search", lang('Search'), $where);
foreach ($indexes as $i => $index) { foreach ($indexes as $i => $index) {
if ($index["type"] == "FULLTEXT") { if ($index["type"] == "FULLTEXT") {
echo "(<i>" . implode("</i>, <i>", array_map('h', $index["columns"])) . "</i>) AGAINST"; 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]) . "' onchange='selectFieldChange(this.form);'>"; 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 checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL");
echo "<br>\n"; echo "</div>\n";
} }
} }
$_GET["where"] = (array) $_GET["where"]; $_GET["where"] = (array) $_GET["where"];
reset($_GET["where"]); reset($_GET["where"]);
$change_next = "this.nextSibling.onchange();"; $change_next = "this.parentNode.firstChild.onchange();";
for ($i = 0; $i <= count($_GET["where"]); $i++) { for ($i = 0; $i <= count($_GET["where"]); $i++) {
list(, $val) = each($_GET["where"]); list(, $val) = each($_GET["where"]);
if (!$val || ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators))) { if (!$val || ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators))) {
echo "<div>" . select_input(" name='where[$i][col]' onchange='$change_next'", $columns, $val["col"], "(" . lang('anywhere') . ")"); 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 html_select("where[$i][op]", $this->operators, $val["op"], $change_next);
echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "' onchange='" . ($val ? "selectFieldChange(this.form)" : "selectAddRow(this)") . ";' onkeydown='selectSearchKeydown(this, event);' onsearch='selectSearchSearch(this);'></div>\n"; 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></fieldset>\n"; echo "</div></fieldset>\n";
@@ -308,12 +391,12 @@ focus(document.getElementById('username'));
$i = 0; $i = 0;
foreach ((array) $_GET["order"] as $key => $val) { foreach ((array) $_GET["order"] as $key => $val) {
if ($val != "") { if ($val != "") {
echo "<div>" . select_input(" name='order[$i]' onchange='selectFieldChange(this.form);'", $columns, $val); echo "<div>" . select_input(" name='order[$i]'", $columns, $val, "selectFieldChange");
echo checkbox("desc[$i]", 1, isset($_GET["desc"][$key]), lang('descending')) . "</div>\n"; echo checkbox("desc[$i]", 1, isset($_GET["desc"][$key]), lang('descending')) . "</div>\n";
$i++; $i++;
} }
} }
echo "<div>" . select_input(" name='order[$i]' onchange='selectAddRow(this);'", $columns); echo "<div>" . select_input(" name='order[$i]'", $columns, "", "selectAddRow");
echo checkbox("desc[$i]", 1, false, lang('descending')) . "</div>\n"; echo checkbox("desc[$i]", 1, false, lang('descending')) . "</div>\n";
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
@@ -324,7 +407,8 @@ focus(document.getElementById('username'));
*/ */
function selectLimitPrint($limit) { function selectLimitPrint($limit) {
echo "<fieldset><legend>" . lang('Limit') . "</legend><div>"; // <div> for easy styling echo "<fieldset><legend>" . lang('Limit') . "</legend><div>"; // <div> for easy styling
echo "<input type='number' name='limit' class='size' value='" . h($limit) . "' onchange='selectFieldChange(this.form);'>"; echo "<input type='number' name='limit' class='size' value='" . h($limit) . "'>";
echo script("qsl('input').oninput = selectFieldChange;", "");
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
@@ -348,12 +432,13 @@ focus(document.getElementById('username'));
echo "<fieldset><legend>" . lang('Action') . "</legend><div>"; echo "<fieldset><legend>" . lang('Action') . "</legend><div>";
echo "<input type='submit' value='" . lang('Select') . "'>"; echo "<input type='submit' value='" . lang('Select') . "'>";
echo " <span id='noindex' title='" . lang('Full table scan') . "'></span>"; echo " <span id='noindex' title='" . lang('Full table scan') . "'></span>";
echo "<script type='text/javascript'>\n"; echo "<script" . nonce() . ">\n";
echo "var indexColumns = "; echo "var indexColumns = ";
$columns = array(); $columns = array();
foreach ($indexes as $index) { foreach ($indexes as $index) {
if ($index["type"] != "FULLTEXT") { $current_key = reset($index["columns"]);
$columns[reset($index["columns"])] = 1; if ($index["type"] != "FULLTEXT" && $current_key) {
$columns[$current_key] = 1;
} }
} }
$columns[""] = 1; $columns[""] = 1;
@@ -361,7 +446,7 @@ focus(document.getElementById('username'));
json_row($key); json_row($key);
} }
echo ";\n"; echo ";\n";
echo "selectFieldChange(document.getElementById('form'));\n"; echo "selectFieldChange.call(qs('#form')['select']);\n";
echo "</script>\n"; echo "</script>\n";
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
@@ -422,6 +507,9 @@ focus(document.getElementById('username'));
} }
} }
foreach ((array) $_GET["where"] as $val) { foreach ((array) $_GET["where"] as $val) {
if ($val["op"] == "") {
$val["op"] = "LIKE %%";
}
if ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators)) { if ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators)) {
$cond = " $val[op]"; $cond = " $val[op]";
if (preg_match('~IN$~', $val["op"])) { if (preg_match('~IN$~', $val["op"])) {
@@ -447,7 +535,7 @@ focus(document.getElementById('username'));
&& (!preg_match("~[\x80-\xFF]~", $val["val"]) || $is_text) && (!preg_match("~[\x80-\xFF]~", $val["val"]) || $is_text)
) { ) {
$name = idf_escape($name); $name = idf_escape($name);
$cols[] = ($jush == "sql" && $is_text && !preg_match("~^utf8_~", $field["collation"]) ? "CONVERT($name USING " . charset($connection) . ")" : $name); $cols[] = ($jush == "sql" && $is_text && !preg_match("~^utf8~", $field["collation"]) ? "CONVERT($name USING " . charset($connection) . ")" : $name);
} }
} }
$return[] = ($cols ? "(" . implode("$cond OR ", $cols) . "$cond)" : "0"); $return[] = ($cols ? "(" . implode("$cond OR ", $cols) . "$cond)" : "0");
@@ -519,12 +607,16 @@ focus(document.getElementById('username'));
global $jush; global $jush;
restart_session(); restart_session();
$history = &get_session("queries"); $history = &get_session("queries");
if (!$history[$_GET["db"]]) {
$history[$_GET["db"]] = array();
}
$id = "sql-" . count($history[$_GET["db"]]); $id = "sql-" . count($history[$_GET["db"]]);
if (strlen($query) > 1e6) { if (strlen($query) > 1e6) {
$query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment $query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
} }
$history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"] $history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
return " <span class='time'>" . @date("H:i:s") . "</span> <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a>" // @ - time zone may be not set return " <span class='time'>" . @date("H:i:s") . "</span>" // @ - time zone may be not set
. " <a href='#$id' class='toggle'>" . lang('SQL command') . "</a>"
. "<div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre>' . "<div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre>'
. ($time ? " <span class='time'>($time)</span>" : '') . ($time ? " <span class='time'>($time)</span>" : '')
. (support("sql") ? '<p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a>' : '') . (support("sql") ? '<p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a>' : '')
@@ -574,6 +666,16 @@ focus(document.getElementById('username'));
return ""; return "";
} }
/** Get hint for edit field
* @param string table name
* @param array single field from fields()
* @param string
* @return string
*/
function editHint($table, $field, $value) {
return "";
}
/** Process sent input /** Process sent input
* @param array single field from fields() * @param array single field from fields()
* @param string * @param string
@@ -593,7 +695,7 @@ focus(document.getElementById('username'));
} elseif (preg_match('~^([+-]|\\|\\|)$~', $function)) { } elseif (preg_match('~^([+-]|\\|\\|)$~', $function)) {
$return = idf_escape($name) . " $function $return"; $return = idf_escape($name) . " $function $return";
} elseif (preg_match('~^[+-] interval$~', $function)) { } elseif (preg_match('~^[+-] interval$~', $function)) {
$return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : $return); $return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+\$~i", $value) ? $value : $return);
} elseif (preg_match('~^(addtime|subtime|concat)$~', $function)) { } elseif (preg_match('~^(addtime|subtime|concat)$~', $function)) {
$return = "$function(" . idf_escape($name) . ", $return)"; $return = "$function(" . idf_escape($name) . ", $return)";
} elseif (preg_match('~^(md5|sha1|password|encrypt)$~', $function)) { } elseif (preg_match('~^(md5|sha1|password|encrypt)$~', $function)) {
@@ -647,7 +749,7 @@ focus(document.getElementById('username'));
} }
$create = "CREATE TABLE " . table($table) . " (" . implode(", ", $fields) . ")"; $create = "CREATE TABLE " . table($table) . " (" . implode(", ", $fields) . ")";
} else { } else {
$create = create_sql($table, $_POST["auto_increment"]); $create = create_sql($table, $_POST["auto_increment"], $style);
} }
set_utf8mb4($create); set_utf8mb4($create);
if ($style && $create) { if ($style && $create) {
@@ -760,6 +862,13 @@ focus(document.getElementById('username'));
return $ext; return $ext;
} }
/** Set the path of the file for webserver load
* @return string path of the sql dump file
*/
function importServerPath() {
return "adminer.sql";
}
/** Print homepage /** Print homepage
* @return bool whether to print default homepage * @return bool whether to print default homepage
*/ */
@@ -780,7 +889,7 @@ focus(document.getElementById('username'));
?> ?>
<h1> <h1>
<?php echo $this->name(); ?> <span class="version"><?php echo $VERSION; ?></span> <?php echo $this->name(); ?> <span class="version"><?php echo $VERSION; ?></span>
<a href="https://www.adminer.org/#download" target="_blank" id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a> <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>
</h1> </h1>
<?php <?php
if ($missing == "auth") { if ($missing == "auth") {
@@ -790,7 +899,7 @@ focus(document.getElementById('username'));
foreach ($usernames as $username => $password) { foreach ($usernames as $username => $password) {
if ($password !== null) { if ($password !== null) {
if ($first) { if ($first) {
echo "<p id='logins' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n"; echo "<p id='logins'>" . script("mixin(qs('#logins'), {onmouseover: menuOver, onmouseout: menuOut});");
$first = false; $first = false;
} }
$dbs = $_SESSION["db"][$vendor][$server][$username]; $dbs = $_SESSION["db"][$vendor][$server][$username];
@@ -806,13 +915,14 @@ focus(document.getElementById('username'));
$connection->select_db(DB); $connection->select_db(DB);
$tables = table_status('', true); $tables = table_status('', true);
} }
echo script_src("../externals/jush/modules/jush.js");
echo script_src("../externals/jush/modules/jush-textarea.js");
echo script_src("../externals/jush/modules/jush-txt.js");
echo script_src("../externals/jush/modules/jush-js.js");
if (support("sql")) { if (support("sql")) {
echo script_src("../externals/jush/modules/jush-$jush.js");
?> ?>
<script type="text/javascript" src="../externals/jush/modules/jush.js"></script> <script<?php echo nonce(); ?>>
<script type="text/javascript" src="../externals/jush/modules/jush-textarea.js"></script>
<script type="text/javascript" src="../externals/jush/modules/jush-txt.js"></script>
<script type="text/javascript" src="../externals/jush/modules/jush-<?php echo $jush; ?>.js"></script>
<script type="text/javascript">
<?php <?php
if ($tables) { if ($tables) {
$links = array(); $links = array();
@@ -859,15 +969,15 @@ bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info,
<p id="dbs"> <p id="dbs">
<?php <?php
hidden_fields_get(); hidden_fields_get();
$db_events = " onmousedown='dbMouseDown(event, this);' onchange='dbChange(this);'"; $db_events = script("mixin(qsl('select'), {onmousedown: dbMouseDown, onchange: dbChange});", "");
echo "<span title='" . lang('database') . "'>DB</span>: " . ($databases echo "<span title='" . lang('database') . "'>DB</span>: " . ($databases
? "<select name='db'$db_events>" . optionlist(array("" => "") + $databases, DB) . "</select>" ? "<select name='db'>" . optionlist(array("" => "") + $databases, DB) . "</select>$db_events"
: '<input name="db" value="' . h(DB) . '" autocapitalize="off">' : '<input name="db" value="' . h(DB) . '" autocapitalize="off">'
); );
echo "<input type='submit' value='" . lang('Use') . "'" . ($databases ? " class='hidden'" : "") . ">\n"; echo "<input type='submit' value='" . lang('Use') . "'" . ($databases ? " class='hidden'" : "") . ">\n";
if ($missing != "db" && DB != "" && $connection->select_db(DB)) { if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
if (support("scheme")) { if (support("scheme")) {
echo "<br>" . lang('Schema') . ": <select name='ns'$db_events>" . optionlist(array("" => "") + $adminer->schemas(), $_GET["ns"]) . "</select>"; echo "<br>" . lang('Schema') . ": <select name='ns'>" . optionlist(array("" => "") + $adminer->schemas(), $_GET["ns"]) . "</select>$db_events";
if ($_GET["ns"] != "") { if ($_GET["ns"] != "") {
set_schema($_GET["ns"]); set_schema($_GET["ns"]);
} }
@@ -886,17 +996,18 @@ bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info,
* @return null * @return null
*/ */
function tablesPrint($tables) { function tablesPrint($tables) {
echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n"; echo "<ul id='tables'>" . script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");
foreach ($tables as $table => $status) { foreach ($tables as $table => $status) {
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> "; echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
$name = $this->tableName($status); $name = $this->tableName($status);
echo (support("table") || support("indexes") echo (support("table") || support("indexes")
? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' ? '<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") . 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>" . " title='" . lang('Show structure') . "'>$name</a>"
: "<span>$name</span>" : "<span>$name</span>"
) . "<br>\n"; ) . "\n";
} }
echo "</ul>\n";
} }
} }

View File

@@ -17,15 +17,10 @@ if ($_COOKIE["adminer_permanent"]) {
function add_invalid_login() { function add_invalid_login() {
global $adminer; global $adminer;
$filename = get_temp_dir() . "/adminer.invalid"; $fp = file_open_lock(get_temp_dir() . "/adminer.invalid");
$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) { if (!$fp) {
return; return;
} }
}
flock($fp, LOCK_EX);
$invalids = unserialize(stream_get_contents($fp)); $invalids = unserialize(stream_get_contents($fp));
$time = time(); $time = time();
if ($invalids) { if ($invalids) {
@@ -40,22 +35,21 @@ function add_invalid_login() {
$invalid = array($time + 30*60, 0); // active for 30 minutes $invalid = array($time + 30*60, 0); // active for 30 minutes
} }
$invalid[1]++; $invalid[1]++;
$serialized = serialize($invalids); file_write_unlock($fp, serialize($invalids));
rewind($fp); }
fwrite($fp, $serialized);
ftruncate($fp, strlen($serialized)); function check_invalid_login() {
flock($fp, LOCK_UN); global $adminer;
fclose($fp); $invalids = unserialize(@file_get_contents(get_temp_dir() . "/adminer.invalid")); // @ - may not exist
$invalid = $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)));
}
} }
$auth = $_POST["auth"]; $auth = $_POST["auth"];
if ($auth) { if ($auth) {
$invalids = unserialize(@file_get_contents(get_temp_dir() . "/adminer.invalid")); // @ - may not exist
$invalid = $invalids[$adminer->bruteForceKey()];
$next_attempt = ($invalid[1] > 30 ? $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)));
}
session_regenerate_id(); // defense against session fixation session_regenerate_id(); // defense against session fixation
$vendor = $auth["driver"]; $vendor = $auth["driver"];
$server = $auth["server"]; $server = $auth["server"];
@@ -89,7 +83,7 @@ if ($auth) {
set_session($key, null); set_session($key, null);
} }
unset_permanent(); unset_permanent();
redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.')); redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.') . ' ' . lang('Thanks for using Adminer, consider <a href="%s">donating</a>.', 'https://sourceforge.net/donate/index.php?group_id=264133'));
} }
} elseif ($permanent && !$_SESSION["pwds"]) { } elseif ($permanent && !$_SESSION["pwds"]) {
@@ -120,7 +114,6 @@ function unset_permanent() {
*/ */
function auth_error($error) { function auth_error($error) {
global $adminer, $has_token; global $adminer, $has_token;
$error = h($error);
$session_name = session_name(); $session_name = session_name();
if (isset($_GET["username"])) { if (isset($_GET["username"])) {
header("HTTP/1.1 403 Forbidden"); // 401 requires sending WWW-Authenticate header header("HTTP/1.1 403 Forbidden"); // 401 requires sending WWW-Authenticate header
@@ -131,7 +124,7 @@ function auth_error($error) {
$password = get_password(); $password = get_password();
if ($password !== null) { if ($password !== null) {
if ($password === false) { if ($password === false) {
$error .= '<br>' . lang('Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.', '<code>permanentLogin()</code>'); $error .= '<br>' . lang('Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.', target_blank(), '<code>permanentLogin()</code>');
} }
set_password(DRIVER, SERVER, $_GET["username"], null); set_password(DRIVER, SERVER, $_GET["username"], null);
} }
@@ -162,13 +155,17 @@ if (isset($_GET["username"])) {
page_footer("auth"); page_footer("auth");
exit; exit;
} }
list($host, $port) = explode(":", SERVER, 2);
if (is_numeric($port) && $port < 1024) {
auth_error(lang('Connecting to privileged ports is not allowed.'));
}
check_invalid_login();
$connection = connect(); $connection = connect();
$driver = new Min_Driver($connection);
} }
$driver = new Min_Driver($connection);
if (!is_object($connection) || ($login = $adminer->login($_GET["username"], get_password())) !== true) { if (!is_object($connection) || ($login = $adminer->login($_GET["username"], get_password())) !== true) {
auth_error((is_string($connection) ? $connection : (is_string($login) ? $login : lang('Invalid credentials.')))); auth_error((is_string($connection) ? h($connection) : (is_string($login) ? $login : lang('Invalid credentials.'))));
} }
if ($auth && $_POST["token"]) { if ($auth && $_POST["token"]) {

View File

@@ -36,8 +36,8 @@ if (!strpos($_SERVER["REQUEST_URI"], '?') && $_SERVER["QUERY_STRING"] != "") { /
$HTTPS = $_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off"); $HTTPS = $_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off");
@ini_set("session.use_trans_sid", false); // protect links in export, @ - may be disabled @ini_set("session.use_trans_sid", false); // protect links in export, @ - may be disabled
session_cache_limiter(""); // to allow restarting session and to not send Cache-Control: no-store
if (!defined("SID")) { if (!defined("SID")) {
session_cache_limiter(""); // to allow restarting session
session_name("adminer_sid"); // use specific session name to get own namespace session_name("adminer_sid"); // use specific session name to get own namespace
$params = array(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), "", $HTTPS); $params = array(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), "", $HTTPS);
if (version_compare(PHP_VERSION, '5.2.0') >= 0) { if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
@@ -54,7 +54,7 @@ if (get_magic_quotes_runtime()) {
} }
@set_time_limit(0); // @ - can be disabled @set_time_limit(0); // @ - can be disabled
@ini_set("zend.ze1_compatibility_mode", false); // @ - deprecated @ini_set("zend.ze1_compatibility_mode", false); // @ - deprecated
@ini_set("precision", 20); // @ - can be disabled @ini_set("precision", 17); // @ - can be disabled, 17 - internal PHP precision
include "../adminer/include/lang.inc.php"; include "../adminer/include/lang.inc.php";
include "../adminer/lang/$LANG.inc.php"; include "../adminer/lang/$LANG.inc.php";

View File

@@ -12,7 +12,7 @@ function connect_error() {
page_header(lang('Select database'), $error, false); page_header(lang('Select database'), $error, false);
echo "<p class='links'>\n"; echo "<p class='links'>\n";
foreach (array( foreach (array(
'database' => lang('Create new database'), 'database' => lang('Create database'),
'privileges' => lang('Privileges'), 'privileges' => lang('Privileges'),
'processlist' => lang('Process list'), 'processlist' => lang('Process list'),
'variables' => lang('Variables'), 'variables' => lang('Variables'),
@@ -29,13 +29,14 @@ function connect_error() {
$scheme = support("scheme"); $scheme = support("scheme");
$collations = collations(); $collations = collations();
echo "<form action='' method='post'>\n"; echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' class='checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n"; echo "<table cellspacing='0' class='checkable'>\n";
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
echo "<thead><tr>" echo "<thead><tr>"
. (support("database") ? "<td>&nbsp;" : "") . (support("database") ? "<td>&nbsp;" : "")
. "<th>" . lang('Database') . " - <a href='" . h(ME) . "refresh=1'>" . lang('Refresh') . "</a>" . "<th>" . lang('Database') . " - <a href='" . h(ME) . "refresh=1'>" . lang('Refresh') . "</a>"
. "<td>" . lang('Collation') . "<td>" . lang('Collation')
. "<td>" . lang('Tables') . "<td>" . lang('Tables')
. "<td>" . lang('Size') . " - <a href='" . h(ME) . "dbsize=1' onclick=\"return !ajaxSetHtml('" . h(js_escape(ME)) . "script=connect');\">" . lang('Compute') . "</a>" . "<td>" . lang('Size') . " - <a href='" . h(ME) . "dbsize=1'>" . lang('Compute') . "</a>" . script("qsl('a').onclick = partial(ajaxSetHtml, '" . js_escape(ME) . "script=connect');", "")
. "</thead>\n" . "</thead>\n"
; ;
@@ -43,8 +44,9 @@ function connect_error() {
foreach ($databases as $db => $tables) { foreach ($databases as $db => $tables) {
$root = h(ME) . "db=" . urlencode($db); $root = h(ME) . "db=" . urlencode($db);
echo "<tr" . odd() . ">" . (support("database") ? "<td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"])) : ""); $id = h("Db-" . $db);
echo "<th><a href='$root'>" . h($db) . "</a>"; echo "<tr" . odd() . ">" . (support("database") ? "<td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]), "", "", "", $id) : "");
echo "<th><a href='$root' id='$db'>" . h($db) . "</a>";
$collation = nbsp(db_collation($db, $collations)); $collation = nbsp(db_collation($db, $collations));
echo "<td>" . (support("database") ? "<a href='$root" . ($scheme ? "&amp;ns=" : "") . "&amp;database=' title='" . lang('Alter database') . "'>$collation</a>" : $collation); echo "<td>" . (support("database") ? "<a href='$root" . ($scheme ? "&amp;ns=" : "") . "&amp;database=' title='" . lang('Alter database') . "'>$collation</a>" : $collation);
echo "<td align='right'><a href='$root&amp;schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>" . ($_GET["dbsize"] ? $tables : "?") . "</a>"; echo "<td align='right'><a href='$root&amp;schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>" . ($_GET["dbsize"] ? $tables : "?") . "</a>";
@@ -55,12 +57,12 @@ function connect_error() {
echo "</table>\n"; echo "</table>\n";
echo (support("database") echo (support("database")
? "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>\n" ? "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>\n"
. "<input type='hidden' name='all' value='' onclick=\"selectCount('selected', formChecked(this, /^db/));\">\n" // used by trCheck() . "<input type='hidden' name='all' value=''>" . script("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^db/)); };") // used by trCheck()
. "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n" . "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm() . "\n"
. "</div></fieldset>\n" . "</div></fieldset>\n"
: "" : ""
); );
echo "<script type='text/javascript'>tableCheck();</script>\n"; echo script("tableCheck();");
echo "<input type='hidden' name='token' value='$token'>\n"; echo "<input type='hidden' name='token' value='$token'>\n";
echo "</form>\n"; echo "</form>\n";
} }

View File

@@ -19,28 +19,49 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>"> <html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
<meta name="referrer" content="origin-when-crossorigin">
<title><?php echo $title_page; ?></title> <title><?php echo $title_page; ?></title>
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css"> <link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
<script type="text/javascript" src="../adminer/static/functions.js"></script> <?php echo script_src("../adminer/static/functions.js"); ?>
<script type="text/javascript" src="static/editing.js"></script> <?php echo script_src("static/editing.js"); ?>
<?php if ($adminer->head()) { ?> <?php if ($adminer->head()) { ?>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
<link rel="apple-touch-icon" href="../adminer/static/favicon.ico"> <link rel="apple-touch-icon" href="../adminer/static/favicon.ico">
<?php if (file_exists("adminer.css")) { ?> <?php foreach ($adminer->css() as $css) { ?>
<link rel="stylesheet" type="text/css" href="adminer.css"> <link rel="stylesheet" type="text/css" href="<?php echo h($css); ?>">
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
<body class="<?php echo lang('ltr'); ?> nojs" onkeydown="bodyKeydown(event);" onclick="bodyClick(event);"<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " onload=\"verifyVersion('$VERSION');\""); ?>> <body class="<?php echo lang('ltr'); ?> nojs">
<script type="text/javascript"> <?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'); document.body.className = document.body.className.replace(/ nojs/, ' js');
var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>'; var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>';
</script> </script>
<div id="help" class="jush-<?php echo $jush; ?> jsonly hidden" onmouseover="helpOpen = 1;" onmouseout="helpMouseout(this, event);"></div> <div id="help" class="jush-<?php echo $jush; ?> jsonly hidden"></div>
<?php echo script("mixin(qs('#help'), {onmouseover: function () { helpOpen = 1; }, onmouseout: helpMouseout});"); ?>
<div id="content"> <div id="content">
<?php <?php
@@ -89,10 +110,45 @@ function page_headers() {
global $adminer; global $adminer;
header("Content-Type: text/html; charset=utf-8"); header("Content-Type: text/html; charset=utf-8");
header("Cache-Control: no-cache"); header("Cache-Control: no-cache");
if ($adminer->headers()) {
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox 3.6.9 header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox 3.6.9
header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page
header("X-Content-Type-Options: nosniff");
header("Referrer-Policy: origin-when-cross-origin");
foreach ($adminer->csp() as $csp) {
$header = array();
foreach ($csp as $key => $val) {
$header[] = "$key $val";
} }
header("Content-Security-Policy: " . implode("; ", $header));
}
$adminer->headers();
}
/** Get Content Security Policy headers
* @return array of arrays with directive name in key, allowed sources in value
*/
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",
"object-src" => "'none'",
"base-uri" => "'none'",
"form-action" => "'self'",
),
);
}
/** Get a CSP nonce
* @return string Base64 value
*/
function get_nonce() {
static $nonce;
if (!$nonce) {
$nonce = base64_encode(rand_string());
}
return $nonce;
} }
/** Print flash and error messages /** Print flash and error messages
@@ -103,7 +159,7 @@ function page_messages($error) {
$uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]); $uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
$messages = $_SESSION["messages"][$uri]; $messages = $_SESSION["messages"][$uri];
if ($messages) { if ($messages) {
echo "<div class='message'>" . implode("</div>\n<div class='message'>", $messages) . "</div>\n"; echo "<div class='message'>" . implode("</div>\n<div class='message'>", $messages) . "</div>" . script("messagesPrint();");
unset($_SESSION["messages"][$uri]); unset($_SESSION["messages"][$uri]);
} }
if ($error) { if ($error) {
@@ -132,6 +188,6 @@ function page_footer($missing = "") {
<div id="menu"> <div id="menu">
<?php $adminer->navigation($missing); ?> <?php $adminer->navigation($missing); ?>
</div> </div>
<script type="text/javascript">setupSubmitHighlight(document);</script>
<?php <?php
echo script("setupSubmitHighlight(document);");
} }

View File

@@ -27,7 +27,7 @@
$query = $adminer->selectQueryBuild($select, $where, $group, $order, $limit, $page); $query = $adminer->selectQueryBuild($select, $where, $group, $order, $limit, $page);
if (!$query) { if (!$query) {
$query = "SELECT" . limit( $query = "SELECT" . limit(
($_GET["page"] != "last" && +$limit && $group && $is_group && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) . "\nFROM " . table($table), ($_GET["page"] != "last" && $limit != "" && $group && $is_group && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) . "\nFROM " . table($table),
($where ? "\nWHERE " . implode(" AND ", $where) : "") . ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : ""), ($where ? "\nWHERE " . implode(" AND ", $where) : "") . ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : ""),
($limit != "" ? +$limit : null), ($limit != "" ? +$limit : null),
($page ? $limit * $page : 0), ($page ? $limit * $page : 0),

View File

@@ -141,7 +141,7 @@ function edit_type($key, $field, $collations, $foreign_keys = array()) {
global $structured_types, $types, $unsigned, $on_actions; global $structured_types, $types, $unsigned, $on_actions;
$type = $field["type"]; $type = $field["type"];
?> ?>
<td><select name="<?php echo h($key); ?>[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"<?php echo on_help("getTarget(event).value", 1); ?>><?php <td><select name="<?php echo h($key); ?>[type]" class="type" aria-labelledby="label-type"><?php
if ($type && !isset($types[$type]) && !isset($foreign_keys[$type])) { if ($type && !isset($types[$type]) && !isset($foreign_keys[$type])) {
array_unshift($structured_types, $type); array_unshift($structured_types, $type);
} }
@@ -150,7 +150,9 @@ if ($foreign_keys) {
} }
echo optionlist($structured_types, $type); echo optionlist($structured_types, $type);
?></select> ?></select>
<td><input name="<?php echo h($key); ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editingLengthFocus(this);"<?php echo (!$field["length"] && preg_match('~var(char|binary)$~', $type) ? " class='required'" : ""); ?> onchange="editingLengthChange(this);" onkeyup="this.onchange();"><td class="options"><?php //! type="number" with enabled JavaScript <?php echo on_help("getTarget(event).value", 1); ?>
<?php echo script("mixin(qsl('select'), {onfocus: function () { lastType = selectValue(this); }, onchange: editingTypeChange});", ""); ?>
<td><input name="<?php echo h($key); ?>[length]" value="<?php echo h($field["length"]); ?>" size="3"<?php echo (!$field["length"] && preg_match('~var(char|binary)$~', $type) ? " class='required'" : ""); ?> aria-labelledby="label-length"><?php echo script("mixin(qsl('input'), {onfocus: editingLengthFocus, oninput: editingLengthChange});", ""); ?><td class="options"><?php //! type="number" with enabled JavaScript
echo "<select name='" . h($key) . "[collation]'" . (preg_match('~(char|text|enum|set)$~', $type) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>'; echo "<select name='" . h($key) . "[collation]'" . (preg_match('~(char|text|enum|set)$~', $type) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
echo ($unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match('~((^|[^o])int|float|double|decimal)$~', $type) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : ''); echo ($unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match('~((^|[^o])int|float|double|decimal)$~', $type) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
echo (isset($field['on_update']) ? "<select name='" . h($key) . "[on_update]'" . (preg_match('~timestamp|datetime~', $type) ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), $field["on_update"]) . '</select>' : ''); echo (isset($field['on_update']) ? "<select name='" . h($key) . "[on_update]'" . (preg_match('~timestamp|datetime~', $type) ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), $field["on_update"]) . '</select>' : '');
@@ -196,7 +198,7 @@ function process_field($field, $type_field) {
process_type($type_field), process_type($type_field),
($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp ($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp
(isset($default) ? " DEFAULT " . ( (isset($default) ? " DEFAULT " . (
(preg_match('~time~', $field["type"]) && preg_match('~^CURRENT_TIMESTAMP$~i', $default)) (preg_match('~time~', $field["type"]) && preg_match('~^CURRENT_TIMESTAMP(\(\))?$~i', $default))
|| ($jush == "sqlite" && preg_match('~^CURRENT_(TIME|TIMESTAMP|DATE)$~i', $default)) || ($jush == "sqlite" && preg_match('~^CURRENT_(TIME|TIMESTAMP|DATE)$~i', $default))
|| ($field["type"] == "bit" && preg_match("~^([0-9]+|b'[0-1]+')\$~", $default)) || ($field["type"] == "bit" && preg_match("~^([0-9]+|b'[0-1]+')\$~", $default))
|| ($jush == "pgsql" && preg_match("~^[a-z]+\\(('[^']*')+\\)\$~", $default)) || ($jush == "pgsql" && preg_match("~^[a-z]+\\(('[^']*')+\\)\$~", $default))
@@ -238,25 +240,26 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
?> ?>
<thead><tr class="wrap"> <thead><tr class="wrap">
<?php if ($type == "PROCEDURE") { ?><td>&nbsp;<?php } ?> <?php if ($type == "PROCEDURE") { ?><td>&nbsp;<?php } ?>
<th><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?> <th id="label-name"><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?>
<td><?php echo lang('Type'); ?><textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;" onblur="editingLengthBlur(this);"></textarea> <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><?php echo lang('Length'); ?> <td id="label-length"><?php echo lang('Length'); ?>
<td><?php echo lang('Options'); ?> <td><?php echo lang('Options'); /* no label required, options have their own label */ ?>
<?php if ($type == "TABLE") { ?> <?php if ($type == "TABLE") { ?>
<td>NULL <td id="label-null">NULL
<td><input type="radio" name="auto_increment_col" value=""><acronym title="<?php echo lang('Auto Increment'); ?>">AI</acronym><?php echo doc_link(array( <td><input type="radio" name="auto_increment_col" value=""><acronym id="label-ai" title="<?php echo lang('Auto Increment'); ?>">AI</acronym><?php echo doc_link(array(
'sql' => "example-auto-increment.html", 'sql' => "example-auto-increment.html",
'sqlite' => "autoinc.html", 'sqlite' => "autoinc.html",
'pgsql' => "datatype.html#DATATYPE-SERIAL", 'pgsql' => "datatype.html#DATATYPE-SERIAL",
'mssql' => "ms186775.aspx", 'mssql' => "ms186775.aspx",
)); ?> )); ?>
<td><?php echo lang('Default value'); ?> <td id="label-default"><?php echo lang('Default value'); ?>
<?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . ">" . lang('Comment') : ""); ?> <?php echo (support("comment") ? "<td id='label-comment'" . ($comments ? "" : " class='hidden'") . ">" . lang('Comment') : ""); ?>
<?php } ?> <?php } ?>
<td><?php echo "<input type='image' class='icon' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script> <td><?php echo "<input type='image' class='icon' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>" . script("row_count = " . count($fields) . ";"); ?>
</thead> </thead>
<tbody onkeydown="return editingKeydown(event);"> <tbody>
<?php <?php
echo script("qsl('tbody').onkeydown = editingKeydown;");
foreach ($fields as $i => $field) { foreach ($fields as $i => $field) {
$i++; $i++;
$orig = $field[($_POST ? "orig" : "field")]; $orig = $field[($_POST ? "orig" : "field")];
@@ -264,24 +267,23 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
?> ?>
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>> <tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
<?php echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", explode("|", $inout), $field["inout"]) : ""); ?> <?php echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", explode("|", $inout), $field["inout"]) : ""); ?>
<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" onchange="editingNameChange(this);<?php echo ($field["field"] != "" || count($fields) > 1 ? '' : ' editingAddRow(this);" onkeyup="if (this.value) editingAddRow(this);'); ?>" maxlength="64" autocapitalize="off"><?php } ?> <th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" maxlength="64" autocapitalize="off" aria-labelledby="label-name"><?php echo script("qsl('input').oninput = function () { editingNameChange.call(this);" . ($field["field"] != "" || count($fields) > 1 ? "" : " editingAddRow.call(this);") . " };", ""); ?><?php } ?>
<input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>"> <input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>">
<?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?> <?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
<?php if ($type == "TABLE") { ?> <?php if ($type == "TABLE") { ?>
<td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block"); ?> <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 } ?> onclick="var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); }"></label><td><?php <td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> aria-labelledby="label-ai"><?php echo script("qsl('input').onclick = function () { var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.oninput(); } }"); ?></label><td><?php
echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onkeyup="keyupChange.call(this);" onchange="this.previousSibling.checked = true;"> 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 script("qsl('input').oninput = function () { this.previousSibling.checked = true; }", ""); ?>
<?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' maxlength='" . ($connection->server_info >= 5.5 ? 1024 : 255) . "'>" : ""); ?> <?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' maxlength='" . ($connection->server_info >= 5.5 ? 1024 : 255) . "' aria-labelledby='label-comment'>" : ""); ?>
<?php } ?> <?php } ?>
<?php <?php
echo "<td>"; echo "<td>";
echo (support("move_col") ? echo (support("move_col") ?
"<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return !editingAddRow(this, 1);'>&nbsp;" "<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>&nbsp;" . script("qsl('input').onclick = partial(editingAddRow, 1);", "")
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'>&nbsp;" . "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'>&nbsp;" . script("qsl('input').onclick = partial(editingMoveRow, 1);", "")
. "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'>&nbsp;" . "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'>&nbsp;" . script("qsl('input').onclick = partial(editingMoveRow, 0);", "")
: ""); : "");
echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow(this, 'fields\$1[field]');\">" : ""); echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "'>" . script("qsl('input').onclick = partial(editingRemoveRow, 'fields\$1[field]');") : "");
echo "\n";
} }
} }
@@ -290,7 +292,6 @@ echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?><input nam
* @return bool * @return bool
*/ */
function process_fields(&$fields) { function process_fields(&$fields) {
ksort($fields);
$offset = 0; $offset = 0;
if ($_POST["up"]) { if ($_POST["up"]) {
$last = 0; $last = 0;
@@ -491,13 +492,13 @@ function ini_bytes($ini) {
function doc_link($paths) { function doc_link($paths) {
global $jush, $connection; global $jush, $connection;
$urls = array( $urls = array(
'sql' => "http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/", 'sql' => "https://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/",
'sqlite' => "http://www.sqlite.org/", 'sqlite' => "https://www.sqlite.org/",
'pgsql' => "http://www.postgresql.org/docs/" . substr($connection->server_info, 0, 3) . "/static/", 'pgsql' => "https://www.postgresql.org/docs/" . substr($connection->server_info, 0, 3) . "/static/",
'mssql' => "http://msdn.microsoft.com/library/", 'mssql' => "https://msdn.microsoft.com/library/",
'oracle' => "http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/", 'oracle' => "https://download.oracle.com/docs/cd/B19306_01/server.102/b14200/",
); );
return ($paths[$jush] ? "<a href='$urls[$jush]$paths[$jush]' target='_blank' rel='noreferrer'><sup>?</sup></a>" : ""); return ($paths[$jush] ? "<a href='$urls[$jush]$paths[$jush]'" . target_blank() . "><sup>?</sup></a>" : "");
} }
/** Wrap gzencode() for usage in ob_start() /** Wrap gzencode() for usage in ob_start()

View File

@@ -69,7 +69,7 @@ function remove_slashes($process, $filter = false) {
*/ */
function bracket_escape($idf, $back = false) { function bracket_escape($idf, $back = false) {
// escape brackets inside name="x[]" // escape brackets inside name="x[]"
static $trans = array(':' => ':1', ']' => ':2', '[' => ':3'); static $trans = array(':' => ':1', ']' => ':2', '[' => ':3', '"' => ':4');
return strtr($idf, ($back ? array_flip($trans) : $trans)); return strtr($idf, ($back ? array_flip($trans) : $trans));
} }
@@ -81,6 +81,37 @@ function charset($connection) {
return (version_compare($connection->server_info, "5.5.3") >= 0 ? "utf8mb4" : "utf8"); // SHOW CHARSET would require an extra query return (version_compare($connection->server_info, "5.5.3") >= 0 ? "utf8mb4" : "utf8"); // SHOW CHARSET would require an extra query
} }
/** Return <script> element
* @param string
* @param string
* @return string
*/
function script($source, $trailing = "\n") {
return "<script" . nonce() . ">$source</script>$trailing";
}
/** Return <script src> element
* @param string
* @return string
*/
function script_src($url) {
return "<script src='" . h($url) . "'" . nonce() . "></script>\n";
}
/** Get a nonce="" attribute with CSP nonce
* @return string
*/
function nonce() {
return ' nonce="' . get_nonce() . '"';
}
/** Get a target="_blank" attribute
* @return string
*/
function target_blank() {
return ' target="_blank" rel="noopener"';
}
/** Escape for HTML /** Escape for HTML
* @param string * @param string
* @return string * @return string
@@ -112,13 +143,15 @@ function nl_br($string) {
* @param string * @param string
* @param string * @param string
* @param string * @param string
* @param string
* @return string * @return string
*/ */
function checkbox($name, $value, $checked, $label = "", $onclick = "", $class = "") { function checkbox($name, $value, $checked, $label = "", $onclick = "", $class = "", $labelled_by = "") {
$return = "<input type='checkbox' name='$name' value='" . h($value) . "'" $return = "<input type='checkbox' name='$name' value='" . h($value) . "'"
. ($checked ? " checked" : "") . ($checked ? " checked" : "")
. ($onclick ? ' onclick="' . h($onclick) . '"' : '') . ($labelled_by ? " aria-labelledby='$labelled_by'" : "")
. ">" . ">"
. ($onclick ? script("qsl('input').onclick = function () { $onclick };", "") : "")
; ;
return ($label != "" || $class ? "<label" . ($class ? " class='$class'" : "") . ">$return" . h($label) . "</label>" : $return); return ($label != "" || $class ? "<label" . ($class ? " class='$class'" : "") . ">$return" . h($label) . "</label>" : $return);
} }
@@ -152,11 +185,16 @@ function optionlist($options, $selected = null, $use_keys = false) {
* @param array * @param array
* @param string * @param string
* @param string true for no onchange, false for radio * @param string true for no onchange, false for radio
* @param string
* @return string * @return string
*/ */
function html_select($name, $options, $value = "", $onchange = true) { function html_select($name, $options, $value = "", $onchange = true, $labelled_by = "") {
if ($onchange) { if ($onchange) {
return "<select name='" . h($name) . "'" . (is_string($onchange) ? ' onchange="' . h($onchange) . '"' : "") . ">" . optionlist($options, $value) . "</select>"; return "<select name='" . h($name) . "'"
. ($labelled_by ? " aria-labelledby='$labelled_by'" : "")
. ">" . optionlist($options, $value) . "</select>"
. (is_string($onchange) ? script("qsl('select').onchange = function () { $onchange };", "") : "")
;
} }
$return = ""; $return = "";
foreach ($options as $key => $val) { foreach ($options as $key => $val) {
@@ -170,31 +208,38 @@ function html_select($name, $options, $value = "", $onchange = true) {
* @param array * @param array
* @param string * @param string
* @param string * @param string
* @param string
* @return string * @return string
*/ */
function select_input($attrs, $options, $value = "", $placeholder = "") { function select_input($attrs, $options, $value = "", $onchange = "", $placeholder = "") {
return ($options $tag = ($options ? "select" : "input");
? "<select$attrs><option value=''>$placeholder" . optionlist($options, $value, true) . "</select>" return "<$tag$attrs" . ($options
: "<input$attrs size='10' value='" . h($value) . "' placeholder='$placeholder'>" ? "><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
} }
/** Get onclick confirmation /** Get onclick confirmation
* @param string
* @param string
* @return string * @return string
*/ */
function confirm() { function confirm($message = "", $selector = "qsl('input')") {
return " onclick=\"return confirm('" . lang('Are you sure?') . "');\""; return script("$selector.onclick = function () { return confirm('" . ($message ? js_escape($message) : lang('Are you sure?')) . "'); };", "");
} }
/** Print header for hidden fieldset (close by </div></fieldset>) /** Print header for hidden fieldset (close by </div></fieldset>)
* @param string * @param string
* @param string * @param string
* @param bool * @param bool
* @param string
* @return null * @return null
*/ */
function print_fieldset($id, $legend, $visible = false, $onclick = "") { function print_fieldset($id, $legend, $visible = false) {
echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"" . h($onclick) . "return !toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n"; 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";
} }
/** Return class='active' if $bold is true /** Return class='active' if $bold is true
@@ -237,7 +282,7 @@ function json_row($key, $val = null) {
echo "{"; echo "{";
} }
if ($key != "") { if ($key != "") {
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\"\\/") . '": ' . ($val !== null ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : 'undefined'); echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\t\"\\/") . '": ' . ($val !== null ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : 'null');
$first = false; $first = false;
} else { } else {
echo "\n}\n"; echo "\n}\n";
@@ -323,9 +368,10 @@ function get_vals($query, $column = 0) {
* @param string * @param string
* @param Min_DB * @param Min_DB
* @param float * @param float
* @param bool
* @return array * @return array
*/ */
function get_key_vals($query, $connection2 = null, $timeout = 0) { function get_key_vals($query, $connection2 = null, $timeout = 0, $set_keys = true) {
global $connection; global $connection;
if (!is_object($connection2)) { if (!is_object($connection2)) {
$connection2 = $connection; $connection2 = $connection;
@@ -336,7 +382,11 @@ function get_key_vals($query, $connection2 = null, $timeout = 0) {
$connection2->timeout = 0; $connection2->timeout = 0;
if (is_object($result)) { if (is_object($result)) {
while ($row = $result->fetch_row()) { while ($row = $result->fetch_row()) {
if ($set_keys) {
$return[$row[0]] = $row[1]; $return[$row[0]] = $row[1];
} else {
$return[] = $row[0];
}
} }
} }
return $return; return $return;
@@ -406,10 +456,10 @@ function where($where, $fields = array()) {
$key = bracket_escape($key, 1); // 1 - back $key = bracket_escape($key, 1); // 1 - back
$column = escape_key($key); $column = escape_key($key);
$return[] = $column $return[] = $column
. (($jush == "sql" && preg_match('~^[0-9]*\\.[0-9]*$~', $val)) || $jush == "mssql" . ($jush == "sql" && preg_match('~^[0-9]*\\.[0-9]*$~', $val) ? " LIKE " . q(addcslashes($val, "%_\\"))
? " LIKE " . q(addcslashes($val, "%_\\")) : ($jush == "mssql" ? " LIKE " . q(preg_replace('~[_%[]~', '[\0]', $val))
: " = " . unconvert_field($fields[$key], q($val)) : " = " . unconvert_field($fields[$key], q($val))
) // LIKE because of floats but slow with ints, in MS SQL because of text )) // LIKE because of floats but slow with ints, in MS SQL because of text
; //! enum and set ; //! enum and set
if ($jush == "sql" && preg_match('~char|text~', $fields[$key]["type"]) && preg_match("~[^ -@]~", $val)) { // not just [a-z] to catch non-ASCII characters if ($jush == "sql" && preg_match('~char|text~', $fields[$key]["type"]) && preg_match("~[^ -@]~", $val)) { // not just [a-z] to catch non-ASCII characters
$return[] = "$column = " . q($val) . " COLLATE " . charset($connection) . "_bin"; $return[] = "$column = " . q($val) . " COLLATE " . charset($connection) . "_bin";
@@ -471,18 +521,12 @@ function convert_fields($columns, $fields, $select = array()) {
*/ */
function cookie($name, $value, $lifetime = 2592000) { // 2592000 - 30 days function cookie($name, $value, $lifetime = 2592000) { // 2592000 - 30 days
global $HTTPS; global $HTTPS;
$params = array( return header("Set-Cookie: $name=" . urlencode($value)
$name, . ($lifetime ? "; expires=" . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT" : "")
(preg_match("~\n~", $value) ? "" : $value), // HTTP Response Splitting protection in PHP < 5.1.2 . "; path=" . preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"])
($lifetime ? time() + $lifetime : 0), . ($HTTPS ? "; secure" : "")
preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), . "; HttpOnly; SameSite=lax",
"", false);
$HTTPS
);
if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
$params[] = true; // HttpOnly
}
return call_user_func_array('setcookie', $params);
} }
/** Restart stopped session /** Restart stopped session
@@ -587,7 +631,7 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
$sql = $adminer->messageQuery($query, $time); $sql = $adminer->messageQuery($query, $time);
} }
if ($failed) { if ($failed) {
$error = error() . $sql; $error = error() . $sql . script("messagesPrint();");
return false; return false;
} }
if ($redirect) { if ($redirect) {
@@ -744,7 +788,7 @@ function is_utf8($val) {
* @return string escaped string with appended ... * @return string escaped string with appended ...
*/ */
function shorten_utf8($string, $length = 80, $suffix = "") { function shorten_utf8($string, $length = 80, $suffix = "") {
if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{10FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow
preg_match("(^(" . repeat_pattern("[\t\r\n -~]", $length) . ")($)?)", $string, $match); preg_match("(^(" . repeat_pattern("[\t\r\n -~]", $length) . ")($)?)", $string, $match);
} }
return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<i>...</i>"); return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<i>...</i>");
@@ -867,32 +911,28 @@ function input($field, $value, $function) {
if ($field["type"] == "enum") { if ($field["type"] == "enum") {
echo nbsp($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value); echo nbsp($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
} else { } else {
$first = 0;
foreach ($functions as $key => $val) {
if ($key === "" || !$val) {
break;
}
$first++;
}
$onchange = ($first ? " onchange=\"var f = this.form['function[" . h(js_escape(bracket_escape($field["field"]))) . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\" onkeyup='keyupChange.call(this);'" : "");
$attrs .= $onchange;
$has_function = (in_array($function, $functions) || isset($functions[$function])); $has_function = (in_array($function, $functions) || isset($functions[$function]));
echo (count($functions) > 1 echo (count($functions) > 1
? "<select name='function[$name]' onchange='functionChange(this);'" . on_help("getTarget(event).value.replace(/^SQL\$/, '')", 1) . ">" . optionlist($functions, $function === null || $has_function ? $function : "") . "</select>" ? "<select name='function[$name]'>" . optionlist($functions, $function === null || $has_function ? $function : "") . "</select>"
. on_help("getTarget(event).value.replace(/^SQL\$/, '')", 1)
. script("qsl('select').onchange = functionChange;", "")
: nbsp(reset($functions)) : nbsp(reset($functions))
) . '<td>'; ) . '<td>';
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table $input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
if ($input != "") { if ($input != "") {
echo $input; echo $input;
} elseif (preg_match('~bool~', $field["type"])) {
echo "<input type='hidden'$attrs value='0'>" .
"<input type='checkbox'" . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? " checked='checked'" : "") . "$attrs value='1'>";
} elseif ($field["type"] == "set") { //! 64 bits } elseif ($field["type"] == "set") { //! 64 bits
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches); preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) { foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val)); $val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true)); $checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true));
echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($adminer->editVal($val, $field)) . '</label>'; echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . ">" . h($adminer->editVal($val, $field)) . '</label>';
} }
} elseif (preg_match('~blob|bytea|raw|file~', $field["type"]) && ini_bool("file_uploads")) { } elseif (preg_match('~blob|bytea|raw|file~', $field["type"]) && ini_bool("file_uploads")) {
echo "<input type='file' name='fields-$name'$onchange>"; echo "<input type='file' name='fields-$name'>";
} elseif (($text = preg_match('~text|lob~', $field["type"])) || preg_match("~\n~", $value)) { } elseif (($text = preg_match('~text|lob~', $field["type"])) || preg_match("~\n~", $value)) {
if ($text && $jush != "sqlite") { if ($text && $jush != "sqlite") {
$attrs .= " cols='50' rows='12'"; $attrs .= " cols='50' rows='12'";
@@ -901,7 +941,7 @@ function input($field, $value, $function) {
$attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height $attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height
} }
echo "<textarea$attrs>" . h($value) . '</textarea>'; echo "<textarea$attrs>" . h($value) . '</textarea>';
} elseif ($function == "json") { } elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) {
echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>'; echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>';
} else { } else {
// int(3) is only a display hint // int(3) is only a display hint
@@ -911,12 +951,24 @@ 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 // type='date' and type='time' display localized value which may be confusing, type='datetime' uses 'T' as date and time separator
echo "<input" echo "<input"
. ((!$has_function || $function === "") && preg_match('~(?<!o)int~', $field["type"]) ? " type='number'" : "") . ((!$has_function || $function === "") && preg_match('~(?<!o)int~', $field["type"]) && !preg_match('~\[\]~', $field["full_type"]) ? " type='number'" : "")
. " value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . " value='" . h($value) . "'" . ($maxlength ? " data-maxlength='$maxlength'" : "")
. (preg_match('~char|binary~', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . (preg_match('~char|binary~', $field["type"]) && $maxlength > 20 ? " size='40'" : "")
. "$attrs>" . "$attrs>"
; ;
} }
echo $adminer->editHint($_GET["edit"], $field, $value);
// skip 'original'
$first = 0;
foreach ($functions as $key => $val) {
if ($key === "" || !$val) {
break;
}
$first++;
}
if ($first) {
echo script("mixin(qsl('td'), {onchange: partial(skipOriginal, $first), oninput: function () { this.onchange(); }});");
}
} }
} }
@@ -1000,7 +1052,6 @@ function fields_from_edit() {
*/ */
function search_tables() { function search_tables() {
global $adminer, $connection; global $adminer, $connection;
$_GET["where"][0]["op"] = "LIKE %%";
$_GET["where"][0]["val"] = $_POST["query"]; $_GET["where"][0]["val"] = $_POST["query"];
$found = false; $found = false;
foreach (table_status('', true) as $table => $table_status) { foreach (table_status('', true) as $table => $table_status) {
@@ -1081,6 +1132,35 @@ function get_temp_dir() {
return $return; 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);
}
flock($fp, LOCK_EX);
return $fp;
}
/** 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);
}
/** Read password from file adminer.key in temporary directory or create one /** Read password from file adminer.key in temporary directory or create one
* @param bool * @param bool
* @return string or false if the file can not be created * @return string or false if the file can not be created
@@ -1135,7 +1215,7 @@ function select_value($val, $link, $field, $text_length) {
$link = "mailto:$val"; $link = "mailto:$val";
} }
if ($protocol = is_url($val)) { if ($protocol = is_url($val)) {
$link = (($protocol == "http" && $HTTPS) || preg_match('~WebKit~i', $_SERVER["HTTP_USER_AGENT"]) // WebKit supports noreferrer since 2009 $link = (($protocol == "http" && $HTTPS) || preg_match('~WebKit|Firefox~i', $_SERVER["HTTP_USER_AGENT"]) // WebKit supports noreferrer since 2009, Firefox since version 38
? $val // HTTP links from HTTPS pages don't receive Referer automatically ? $val // HTTP links from HTTPS pages don't receive Referer automatically
: "https://www.adminer.org/redirect/?url=" . urlencode($val) // intermediate page to hide Referer : "https://www.adminer.org/redirect/?url=" . urlencode($val) // intermediate page to hide Referer
); );
@@ -1181,7 +1261,7 @@ function is_url($string) {
* @return bool * @return bool
*/ */
function is_shortable($field) { function is_shortable($field) {
return preg_match('~char|text|lob|geometry|point|linestring|polygon|string~', $field["type"]); return preg_match('~char|text|lob|geometry|point|linestring|polygon|string|bytea~', $field["type"]);
} }
/** Get query to compute number of found rows /** Get query to compute number of found rows
@@ -1209,12 +1289,12 @@ function slow_query($query) {
$db = $adminer->database(); $db = $adminer->database();
$timeout = $adminer->queryTimeout(); $timeout = $adminer->queryTimeout();
if (support("kill") && is_object($connection2 = connect()) && ($db == "" || $connection2->select_db($db))) { if (support("kill") && is_object($connection2 = connect()) && ($db == "" || $connection2->select_db($db))) {
$kill = $connection2->result("SELECT CONNECTION_ID()"); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL $kill = $connection2->result(connection_id()); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
?> ?>
<script type="text/javascript"> <script<?php echo nonce(); ?>>
var timeout = setTimeout(function () { var timeout = setTimeout(function () {
ajax('<?php echo js_escape(ME); ?>script=kill', function () { ajax('<?php echo js_escape(ME); ?>script=kill', function () {
}, 'token=<?php echo $token; ?>&kill=<?php echo $kill; ?>'); }, 'kill=<?php echo $kill; ?>&token=<?php echo $token; ?>');
}, <?php echo 1000 * $timeout; ?>); }, <?php echo 1000 * $timeout; ?>);
</script> </script>
<?php <?php
@@ -1223,13 +1303,13 @@ var timeout = setTimeout(function () {
} }
ob_flush(); ob_flush();
flush(); flush();
$return = @get_key_vals($query, $connection2, $timeout); // @ - may be killed $return = @get_key_vals($query, $connection2, $timeout, false); // @ - may be killed
if ($connection2) { if ($connection2) {
echo "<script type='text/javascript'>clearTimeout(timeout);</script>\n"; echo script("clearTimeout(timeout);");
ob_flush(); ob_flush();
flush(); flush();
} }
return array_keys($return); return $return;
} }
/** Generate BREACH resistant CSRF token /** Generate BREACH resistant CSRF token
@@ -1292,7 +1372,7 @@ function lzw_decompress($binary) {
* @return string * @return string
*/ */
function on_help($command, $side = 0) { function on_help($command, $side = 0) {
return " onmouseover='helpMouseover(this, event, " . h($command) . ", $side);' onmouseout='helpMouseout(this, event);'"; return script("mixin(qsl('select, input'), {onmouseover: function (event) { helpMouseover.call(this, event, $command, $side) }, onmouseout: helpMouseout});", "");
} }
/** Print edit data form /** Print edit data form
@@ -1320,7 +1400,7 @@ function edit_form($TABLE, $fields, $row, $update) {
if (!$fields) { if (!$fields) {
echo "<p class='error'>" . lang('You have no privileges to update this table.') . "\n"; echo "<p class='error'>" . lang('You have no privileges to update this table.') . "\n";
} else { } else {
echo "<table cellspacing='0' onkeydown='return editingKeydown(event);'>\n"; echo "<table cellspacing='0'>" . script("qsl('table').onkeydown = editingKeydown;");
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
echo "<tr><th>" . $adminer->fieldName($field); echo "<tr><th>" . $adminer->fieldName($field);
@@ -1360,7 +1440,8 @@ function edit_form($TABLE, $fields, $row, $update) {
} }
if (!support("table")) { if (!support("table")) {
echo "<tr>" echo "<tr>"
. "<th><input name='field_keys[]' onkeyup='keyupChange.call(this);' onchange='fieldChange(this);' value=''>" // needs empty value for keyupChange() . "<th><input name='field_keys[]'>"
. script("qsl('input').oninput = fieldChange;")
. "<td class='function'>" . html_select("field_funs[]", $adminer->editFunctions(array("null" => isset($_GET["select"])))) . "<td class='function'>" . html_select("field_funs[]", $adminer->editFunctions(array("null" => isset($_GET["select"]))))
. "<td><input name='field_vals[]'>" . "<td><input name='field_vals[]'>"
. "\n" . "\n"
@@ -1373,13 +1454,14 @@ function edit_form($TABLE, $fields, $row, $update) {
echo "<input type='submit' value='" . lang('Save') . "'>\n"; echo "<input type='submit' value='" . lang('Save') . "'>\n";
if (!isset($_GET["select"])) { if (!isset($_GET["select"])) {
echo "<input type='submit' name='insert' value='" . ($update echo "<input type='submit' name='insert' value='" . ($update
? lang('Save and continue edit') . "' onclick='return !ajaxForm(this.form, \"" . lang('Saving') . '...", this)' ? lang('Save and continue edit')
: lang('Save and insert next') : lang('Save and insert next')
) . "' title='Ctrl+Shift+Enter'>\n"; ) . "' title='Ctrl+Shift+Enter'>\n";
echo ($update ? script("qsl('input').onclick = function () { return !ajaxForm(this.form, '" . lang('Saving') . "...', this); };") : "");
} }
} }
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'" . confirm() . ">\n" echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'>" . confirm() . "\n"
: ($_POST || !$fields ? "" : "<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n") : ($_POST || !$fields ? "" : script("focus(qsa('td', qs('#form'))[1].firstChild);"))
); );
if (isset($_GET["select"])) { if (isset($_GET["select"])) {
hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"])); hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));

View File

@@ -2,13 +2,13 @@
// not used in a single language version // not used in a single language version
$langs = array( $langs = array(
'en' => 'English', // Jakub Vrána - http://www.vrana.cz 'en' => 'English', // Jakub Vrána - https://www.vrana.cz
'ar' => 'العربية', // Y.M Amine - Algeria - nbr7@live.fr 'ar' => 'العربية', // Y.M Amine - Algeria - nbr7@live.fr
'bg' => 'Български', // Deyan Delchev 'bg' => 'Български', // Deyan Delchev
'bn' => 'বাংলা', // Dipak Kumar - dipak.ndc@gmail.com 'bn' => 'বাংলা', // Dipak Kumar - dipak.ndc@gmail.com
'bs' => 'Bosanski', // Emir Kurtovic 'bs' => 'Bosanski', // Emir Kurtovic
'ca' => 'Català', // Joan Llosas 'ca' => 'Català', // Joan Llosas
'cs' => 'Čeština', // Jakub Vrána - http://www.vrana.cz 'cs' => 'Čeština', // Jakub Vrána - https://www.vrana.cz
'da' => 'Dansk', // Jarne W. Beutnagel - jarne@beutnagel.dk 'da' => 'Dansk', // Jarne W. Beutnagel - jarne@beutnagel.dk
'de' => 'Deutsch', // Klemens Häckel - http://clickdimension.wordpress.com 'de' => 'Deutsch', // Klemens Häckel - http://clickdimension.wordpress.com
'el' => 'Ελληνικά', // Dimitrios T. Tanis - jtanis@tanisfood.gr 'el' => 'Ελληνικά', // Dimitrios T. Tanis - jtanis@tanisfood.gr
@@ -18,6 +18,7 @@ $langs = array(
'fi' => 'Suomi', // Finnish - Kari Eveli - http://www.lexitec.fi/ 'fi' => 'Suomi', // Finnish - Kari Eveli - http://www.lexitec.fi/
'fr' => 'Français', // Francis Gagné, Aurélien Royer 'fr' => 'Français', // Francis Gagné, Aurélien Royer
'gl' => 'Galego', // Eduardo Penabad Ramos 'gl' => 'Galego', // Eduardo Penabad Ramos
'he' => 'עברית', // Binyamin Yawitz - https://stuff-group.com/
'hu' => 'Magyar', // Borsos Szilárd (Borsosfi) - http://www.borsosfi.hu, info@borsosfi.hu 'hu' => 'Magyar', // Borsos Szilárd (Borsosfi) - http://www.borsosfi.hu, info@borsosfi.hu
'id' => 'Bahasa Indonesia', // Ivan Lanin - http://ivan.lanin.org 'id' => 'Bahasa Indonesia', // Ivan Lanin - http://ivan.lanin.org
'it' => 'Italiano', // Alessandro Fiorotto, Paolo Asperti 'it' => 'Italiano', // Alessandro Fiorotto, Paolo Asperti
@@ -30,7 +31,7 @@ $langs = array(
'pt' => 'Português', // André Dias 'pt' => 'Português', // André Dias
'pt-br' => 'Português (Brazil)', // Gian Live - gian@live.com, Davi Alexandre davi@davialexandre.com.br, RobertoPC - http://www.robertopc.com.br 'pt-br' => 'Português (Brazil)', // Gian Live - gian@live.com, Davi Alexandre davi@davialexandre.com.br, RobertoPC - http://www.robertopc.com.br
'ro' => 'Limba Română', // .nick .messing - dot.nick.dot.messing@gmail.com 'ro' => 'Limba Română', // .nick .messing - dot.nick.dot.messing@gmail.com
'ru' => 'Русский язык', // Maksim Izmaylov 'ru' => 'Русский', // Maksim Izmaylov; Andre Polykanine - https://github.com/Oire/
'sk' => 'Slovenčina', // Ivan Suchy - http://www.ivansuchy.com, Juraj Krivda - http://www.jstudio.cz 'sk' => 'Slovenčina', // Ivan Suchy - http://www.ivansuchy.com, Juraj Krivda - http://www.jstudio.cz
'sl' => 'Slovenski', // Matej Ferlan - www.itdinamik.com, matej.ferlan@itdinamik.com 'sl' => 'Slovenski', // Matej Ferlan - www.itdinamik.com, matej.ferlan@itdinamik.com
'sr' => 'Српски', // Nikola Radovanović - cobisimo@gmail.com 'sr' => 'Српски', // Nikola Radovanović - cobisimo@gmail.com

View File

@@ -16,10 +16,10 @@ if (extension_loaded('pdo')) {
try { try {
parent::__construct($dsn, $username, $password); parent::__construct($dsn, $username, $password);
} catch (Exception $ex) { } catch (Exception $ex) {
auth_error($ex->getMessage()); auth_error(h($ex->getMessage()));
} }
$this->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS $this->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS
$this->server_info = $this->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION $this->server_info = @$this->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
} }
/*abstract function select_db($database);*/ /*abstract function select_db($database);*/

View File

@@ -1,2 +1,2 @@
<?php <?php
$VERSION = "4.2.5"; $VERSION = "4.5.0";

View File

@@ -1,10 +1,10 @@
<?php <?php
/** Adminer - Compact database management /** Adminer - Compact database management
* @link https://www.adminer.org/ * @link https://www.adminer.org/
* @author Jakub Vrana, http://www.vrana.cz/ * @author Jakub Vrana, https://www.vrana.cz/
* @copyright 2007 Jakub Vrana * @copyright 2007 Jakub Vrana
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other) * @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/ */
include "./include/bootstrap.inc.php"; include "./include/bootstrap.inc.php";

View File

@@ -2,9 +2,20 @@
$TABLE = $_GET["indexes"]; $TABLE = $_GET["indexes"];
$index_types = array("PRIMARY", "UNIQUE", "INDEX"); $index_types = array("PRIMARY", "UNIQUE", "INDEX");
$table_status = table_status($TABLE, true); $table_status = table_status($TABLE, true);
if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.6 ? '|InnoDB' : '') . '~i', $table_status["Engine"])) { $server_info = $connection->server_info;
$fulltext = ($server_info >= 5.6);
$spatial = ($server_info >= 5.7);
if (preg_match('~([\d.]+)-MariaDB~', $server_info, $match)) {
$server_info = $match[1];
$fulltext = (version_compare($server_info, '10.0.5') >= 0);
$spatial = (version_compare($server_info, '10.2.2') >= 0);
}
if (preg_match('~MyISAM|M?aria' . ($fulltext ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
$index_types[] = "FULLTEXT"; $index_types[] = "FULLTEXT";
} }
if (preg_match('~MyISAM|M?aria' . ($spatial ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
$index_types[] = "SPATIAL";
}
$indexes = indexes($TABLE); $indexes = indexes($TABLE);
$primary = array(); $primary = array();
if ($jush == "mongo") { // doesn't support primary key if ($jush == "mongo") { // doesn't support primary key
@@ -93,9 +104,9 @@ if (!$row) {
<form action="" method="post"> <form action="" method="post">
<table cellspacing="0" class="nowrap"> <table cellspacing="0" class="nowrap">
<thead><tr> <thead><tr>
<th><?php echo lang('Index Type'); ?> <th id="label-type"><?php echo lang('Index Type'); ?>
<th><input type="submit" style="left: -1000px; position: absolute;"><?php echo lang('Column (length)'); ?> <th><input type="submit" class="wayoff"><?php echo lang('Column (length)'); ?>
<th><?php echo lang('Name'); ?> <th id="label-name"><?php echo lang('Name'); ?>
<th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>&nbsp; <th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>&nbsp;
</thead> </thead>
<?php <?php
@@ -110,25 +121,26 @@ if ($primary) {
$j = 1; $j = 1;
foreach ($row["indexes"] as $index) { foreach ($row["indexes"] as $index) {
if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) { if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) {
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow(this);" : 1)); echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow.call(this);" : 1), "label-type");
echo "<td>"; echo "<td>";
ksort($index["columns"]); ksort($index["columns"]);
$i = 1; $i = 1;
foreach ($index["columns"] as $key => $column) { foreach ($index["columns"] as $key => $column) {
echo "<span>" . select_input( echo "<span>" . select_input(
" name='indexes[$j][columns][$i]' onchange=\"" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . "(this, '" . h(js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_")) . "');\"", " name='indexes[$j][columns][$i]' title='" . lang('Column') . "'",
($fields ? array_combine($fields, $fields) : $fields), ($fields ? array_combine($fields, $fields) : $fields),
$column $column,
"partial(" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . ", '" . js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_") . "')"
); );
echo ($jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "'>" : ""); echo ($jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "' title='" . lang('Length') . "'>" : "");
echo ($jush != "sql" ? checkbox("indexes[$j][descs][$i]", 1, $index["descs"][$key], lang('descending')) : ""); echo ($jush != "sql" ? checkbox("indexes[$j][descs][$i]", 1, $index["descs"][$key], lang('descending')) : "");
echo " </span>"; echo " </span>";
$i++; $i++;
} }
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off'>\n"; echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off' aria-labelledby='label-name'>\n";
echo "<td><input type='image' class='icon' name='drop_col[$j]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick=\"return !editingRemoveRow(this, 'indexes\$1[type]');\">\n"; echo "<td><input type='image' class='icon' name='drop_col[$j]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "'>" . script("qsl('input').onclick = partial(editingRemoveRow, 'indexes\$1[type]');");
} }
$j++; $j++;
} }

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'كلمة المرور', 'Password' => 'كلمة المرور',
'Select database' => 'اختر قاعدة البيانات', 'Select database' => 'اختر قاعدة البيانات',
'Invalid database.' => 'قاعدة البيانات غير صالحة.', 'Invalid database.' => 'قاعدة البيانات غير صالحة.',
'Create new database' => 'أنشئ فاعدة بيانات جديدة',
'Table has been dropped.' => 'تم حذف الجدول.', 'Table has been dropped.' => 'تم حذف الجدول.',
'Table has been altered.' => 'تم تعديل الجدول.', 'Table has been altered.' => 'تم تعديل الجدول.',
'Table has been created.' => 'تم إنشاء الجدول.', 'Table has been created.' => 'تم إنشاء الجدول.',

View File

@@ -12,7 +12,7 @@ $translations = array(
'Logout successful.' => 'Излизането е успешно.', 'Logout successful.' => 'Излизането е успешно.',
'Invalid credentials.' => 'Невалидни потребителски данни.', 'Invalid credentials.' => 'Невалидни потребителски данни.',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Прекалено много неуспешни опити за вход, опитайте пак след %d минута.', 'Прекалено много неуспешни опити за вход, опитайте пак след %d минути.'), 'Too many unsuccessful logins, try again in %d minute(s).' => array('Прекалено много неуспешни опити за вход, опитайте пак след %d минута.', 'Прекалено много неуспешни опити за вход, опитайте пак след %d минути.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Главната парола вече е невалидна. <a href="https://www.adminer.org/en/extension/" target="_blank">Изберете</a> %s метод, за да я направите постоянна.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Главната парола вече е невалидна. <a href="https://www.adminer.org/en/extension/"%s>Изберете</a> %s метод, за да я направите постоянна.',
'Language' => 'Език', 'Language' => 'Език',
'Invalid CSRF token. Send the form again.' => 'Невалиден шифроващ ключ. Попълнете и изпратете формуляра отново.', 'Invalid CSRF token. Send the form again.' => 'Невалиден шифроващ ключ. Попълнете и изпратете формуляра отново.',
'If you did not send this request from Adminer then close this page.' => 'Ако не сте изпратили тази заявка през Adminer, затворете тази страница.', 'If you did not send this request from Adminer then close this page.' => 'Ако не сте изпратили тази заявка през Adminer, затворете тази страница.',
@@ -82,7 +82,6 @@ $translations = array(
'Use' => 'Избор', 'Use' => 'Избор',
'Select database' => 'Избор на база данни', 'Select database' => 'Избор на база данни',
'Invalid database.' => 'Невалидна база данни.', 'Invalid database.' => 'Невалидна база данни.',
'Create new database' => 'Нова база данни',
'Database has been dropped.' => 'Базата данни беше премахната.', 'Database has been dropped.' => 'Базата данни беше премахната.',
'Databases have been dropped.' => 'Базите данни бяха премехнати.', 'Databases have been dropped.' => 'Базите данни бяха премехнати.',
'Database has been created.' => 'Базата данни беше създадена.', 'Database has been created.' => 'Базата данни беше създадена.',
@@ -182,13 +181,12 @@ $translations = array(
'Values' => 'Стойности', 'Values' => 'Стойности',
'View' => 'Изглед', 'View' => 'Изглед',
'Materialized View' => 'Запаметен изглед', 'Materialized view' => 'Запаметен изглед',
'View has been dropped.' => 'Изгледа беше премахнат.', 'View has been dropped.' => 'Изгледа беше премахнат.',
'View has been altered.' => 'Изгледа беше променен.', 'View has been altered.' => 'Изгледа беше променен.',
'View has been created.' => 'Изгледа беше създаден.', 'View has been created.' => 'Изгледа беше създаден.',
'Alter view' => 'Промяна на изглед', 'Alter view' => 'Промяна на изглед',
'Create view' => 'Създаване на изглед', 'Create view' => 'Създаване на изглед',
'Create materialized view' => 'Създаване на запаметен изглед',
'Indexes' => 'Индекси', 'Indexes' => 'Индекси',
'Indexes have been altered.' => 'Индексите бяха променени.', 'Indexes have been altered.' => 'Индексите бяха променени.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'পাসওয়ার্ড', 'Password' => 'পাসওয়ার্ড',
'Select database' => 'ডাটাবেজ নির্বাচন করো', 'Select database' => 'ডাটাবেজ নির্বাচন করো',
'Invalid database.' => 'ভুল ডাটাবেজ।', 'Invalid database.' => 'ভুল ডাটাবেজ।',
'Create new database' => 'নতুন ডাটাবেজ তৈরী করো',
'Table has been dropped.' => 'টেবিল মুছে ফেলা হয়েছে।', 'Table has been dropped.' => 'টেবিল মুছে ফেলা হয়েছে।',
'Table has been altered.' => 'টেবিল সম্পাদনা করা হয়েছে।', 'Table has been altered.' => 'টেবিল সম্পাদনা করা হয়েছে।',
'Table has been created.' => 'টেবিল তৈরী করা হয়েছে।', 'Table has been created.' => 'টেবিল তৈরী করা হয়েছে।',

View File

@@ -77,7 +77,6 @@ $translations = array(
'Use' => 'Koristi', 'Use' => 'Koristi',
'Select database' => 'Izaberite bazu', 'Select database' => 'Izaberite bazu',
'Invalid database.' => 'Neispravna baza podataka.', 'Invalid database.' => 'Neispravna baza podataka.',
'Create new database' => 'Napravi novu bazu podataka',
'Database has been dropped.' => 'Baza podataka je izbrisana.', 'Database has been dropped.' => 'Baza podataka je izbrisana.',
'Databases have been dropped.' => 'Baze podataka su izbrisane.', 'Databases have been dropped.' => 'Baze podataka su izbrisane.',
'Database has been created.' => 'Baza podataka je spašena.', 'Database has been created.' => 'Baza podataka je spašena.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Contrasenya', 'Password' => 'Contrasenya',
'Select database' => 'Selecciona base de dades', 'Select database' => 'Selecciona base de dades',
'Invalid database.' => 'Base de dades invàlida.', 'Invalid database.' => 'Base de dades invàlida.',
'Create new database' => 'Crea una nova base de dades',
'Table has been dropped.' => 'S\'ha suprimit la taula.', 'Table has been dropped.' => 'S\'ha suprimit la taula.',
'Table has been altered.' => 'S\'ha modificat la taula.', 'Table has been altered.' => 'S\'ha modificat la taula.',
'Table has been created.' => 'S\'ha creat la taula.', 'Table has been created.' => 'S\'ha creat la taula.',

View File

@@ -10,15 +10,17 @@ $translations = array(
'Logout' => 'Odhlásit', 'Logout' => 'Odhlásit',
'Logged as: %s' => 'Přihlášen jako: %s', 'Logged as: %s' => 'Přihlášen jako: %s',
'Logout successful.' => 'Odhlášení proběhlo v pořádku.', 'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
'Thanks for using Adminer, consider <a href="%s">donating</a>.' => 'Díky za použití Admineru, zvažte <a href="%s">příspěvek</a>.',
'Invalid credentials.' => 'Neplatné přihlašovací údaje.', 'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
'Implement %s method to use SQLite.' => 'Pro přihlášení k SQLite implementujte metodu %s.', '<a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to use SQLite.' => 'Pro přihlášení k SQLite <a href="https://www.adminer.org/cs/extension/"%s>implementujte</a> metodu %s.',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minutu.', 'Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minuty.', 'Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minut.'), 'Too many unsuccessful logins, try again in %d minute(s).' => array('Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minutu.', 'Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minuty.', 'Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minut.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Platnost hlavního hesla vypršela. <a href="https://www.adminer.org/cs/extension/" target="_blank">Implementujte</a> metodu %s, aby platilo stále.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Platnost hlavního hesla vypršela. <a href="https://www.adminer.org/cs/extension/"%s>Implementujte</a> metodu %s, aby platilo stále.',
'Language' => 'Jazyk', 'Language' => 'Jazyk',
'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odešlete formulář znovu.', 'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odešlete formulář znovu.',
'If you did not send this request from Adminer then close this page.' => 'Pokud jste tento požadavek neposlali z Adminera, tak tuto stránku zavřete.', 'If you did not send this request from Adminer then close this page.' => 'Pokud jste tento požadavek neposlali z Adminera, tak tuto stránku zavřete.',
'No extension' => 'Žádné rozšíření', 'No extension' => 'Žádné rozšíření',
'None of the supported PHP extensions (%s) are available.' => 'Není dostupné žádné z podporovaných PHP rozšíření (%s).', 'None of the supported PHP extensions (%s) are available.' => 'Není dostupné žádné z podporovaných PHP rozšíření (%s).',
'Connecting to privileged ports is not allowed.' => 'Připojování k privilegovaným portům není povoleno.',
'Session support must be enabled.' => 'Session proměnné musí být povolené.', 'Session support must be enabled.' => 'Session proměnné musí být povolené.',
'Session expired, please login again.' => 'Session vypršela, přihlašte se prosím znovu.', 'Session expired, please login again.' => 'Session vypršela, přihlašte se prosím znovu.',
'%s version: %s through PHP extension %s' => 'Verze %s: %s přes PHP rozšíření %s', '%s version: %s through PHP extension %s' => 'Verze %s: %s přes PHP rozšíření %s',
@@ -84,7 +86,6 @@ $translations = array(
'Use' => 'Vybrat', 'Use' => 'Vybrat',
'Select database' => 'Vybrat databázi', 'Select database' => 'Vybrat databázi',
'Invalid database.' => 'Nesprávná databáze.', 'Invalid database.' => 'Nesprávná databáze.',
'Create new database' => 'Vytvořit novou databázi',
'Database has been dropped.' => 'Databáze byla odstraněna.', 'Database has been dropped.' => 'Databáze byla odstraněna.',
'Databases have been dropped.' => 'Databáze byly odstraněny.', 'Databases have been dropped.' => 'Databáze byly odstraněny.',
'Database has been created.' => 'Databáze byla vytvořena.', 'Database has been created.' => 'Databáze byla vytvořena.',
@@ -170,6 +171,7 @@ $translations = array(
'Default value' => 'Výchozí hodnota', 'Default value' => 'Výchozí hodnota',
'Default values' => 'Výchozí hodnoty', 'Default values' => 'Výchozí hodnoty',
'Drop' => 'Odstranit', 'Drop' => 'Odstranit',
'Drop %s?' => 'Odstranit %s?',
'Are you sure?' => 'Opravdu?', 'Are you sure?' => 'Opravdu?',
'Size' => 'Velikost', 'Size' => 'Velikost',
'Compute' => 'Spočítat', 'Compute' => 'Spočítat',
@@ -184,13 +186,12 @@ $translations = array(
'Values' => 'Hodnoty', 'Values' => 'Hodnoty',
'View' => 'Pohled', 'View' => 'Pohled',
'Materialized View' => 'Materializovaný pohled', 'Materialized view' => 'Materializovaný pohled',
'View has been dropped.' => 'Pohled byl odstraněn.', 'View has been dropped.' => 'Pohled byl odstraněn.',
'View has been altered.' => 'Pohled byl změněn.', 'View has been altered.' => 'Pohled byl změněn.',
'View has been created.' => 'Pohled byl vytvořen.', 'View has been created.' => 'Pohled byl vytvořen.',
'Alter view' => 'Pozměnit pohled', 'Alter view' => 'Pozměnit pohled',
'Create view' => 'Vytvořit pohled', 'Create view' => 'Vytvořit pohled',
'Create materialized view' => 'Vytvořit materializovaný pohled',
'Indexes' => 'Indexy', 'Indexes' => 'Indexy',
'Indexes have been altered.' => 'Indexy byly změněny.', 'Indexes have been altered.' => 'Indexy byly změněny.',

View File

@@ -10,7 +10,7 @@ $translations = array(
'Logged as: %s' => 'Logget ind som: %s', 'Logged as: %s' => 'Logget ind som: %s',
'Logout successful.' => 'Log af vellykket.', 'Logout successful.' => 'Log af vellykket.',
'Invalid credentials.' => 'Ugyldige log ind oplysninger.', 'Invalid credentials.' => 'Ugyldige log ind oplysninger.',
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Master-kodeordet er udløbet. <a href="https://www.adminer.org/en/extension/" target="_blank">Implementer</a> en metode for %s for at gøre det permanent.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Master-kodeordet er udløbet. <a href="https://www.adminer.org/en/extension/"%s>Implementer</a> en metode for %s for at gøre det permanent.',
'Language' => 'Sprog', 'Language' => 'Sprog',
'Invalid CSRF token. Send the form again.' => 'Ugyldigt CSRF-token - Genindsend formen.', 'Invalid CSRF token. Send the form again.' => 'Ugyldigt CSRF-token - Genindsend formen.',
'No extension' => 'Ingen udvidelse', 'No extension' => 'Ingen udvidelse',
@@ -68,7 +68,6 @@ $translations = array(
'Use' => 'Brug', 'Use' => 'Brug',
'Select database' => 'Vælg database', 'Select database' => 'Vælg database',
'Invalid database.' => 'Ugyldig database.', 'Invalid database.' => 'Ugyldig database.',
'Create new database' => 'Opret ny database',
'Database has been dropped.' => 'Databasen er blevet slettet.', 'Database has been dropped.' => 'Databasen er blevet slettet.',
'Databases have been dropped.' => 'Databasene er blevet slettet.', 'Databases have been dropped.' => 'Databasene er blevet slettet.',
'Database has been created.' => 'Databasen er oprettet.', 'Database has been created.' => 'Databasen er oprettet.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Passwort', 'Password' => 'Passwort',
'Select database' => 'Datenbank auswählen', 'Select database' => 'Datenbank auswählen',
'Invalid database.' => 'Datenbank ungültig.', 'Invalid database.' => 'Datenbank ungültig.',
'Create new database' => 'Datenbank erstellen',
'Table has been dropped.' => 'Tabelle wurde entfernt.', 'Table has been dropped.' => 'Tabelle wurde entfernt.',
'Table has been altered.' => 'Tabelle wurde geändert.', 'Table has been altered.' => 'Tabelle wurde geändert.',
'Table has been created.' => 'Tabelle wurde erstellt.', 'Table has been created.' => 'Tabelle wurde erstellt.',
@@ -284,6 +283,6 @@ $translations = array(
'Saving' => 'Speichere', 'Saving' => 'Speichere',
'yes' => 'ja', 'yes' => 'ja',
'no' => 'nein', 'no' => 'nein',
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Das Master-Passwort ist abgelaufen. <a href="https://www.adminer.org/de/extension/" target="_blank">Implementieren</a> Sie die %s Methode, um es permanent zu machen.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Das Master-Passwort ist abgelaufen. <a href="https://www.adminer.org/de/extension/"%s>Implementieren</a> Sie die %s Methode, um es permanent zu machen.',
'%d / ' => '%d / ', '%d / ' => '%d / ',
); );

View File

@@ -12,7 +12,7 @@ $translations = array(
'Logout successful.' => 'Αποσυνδεθήκατε με επιτυχία.', 'Logout successful.' => 'Αποσυνδεθήκατε με επιτυχία.',
'Invalid credentials.' => 'Εσφαλμένα Διαπιστευτήρια.', 'Invalid credentials.' => 'Εσφαλμένα Διαπιστευτήρια.',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Επανηλημμένες ανεπιτυχείς προσπάθειες σύνδεσης, δοκιμάστε ξανά σε %s λεπτό.', 'Επανηλημμένες ανεπιτυχείς προσπάθειες σύνδεσης, δοκιμάστε ξανά σε %s λεπτά.'), 'Too many unsuccessful logins, try again in %d minute(s).' => array('Επανηλημμένες ανεπιτυχείς προσπάθειες σύνδεσης, δοκιμάστε ξανά σε %s λεπτό.', 'Επανηλημμένες ανεπιτυχείς προσπάθειες σύνδεσης, δοκιμάστε ξανά σε %s λεπτά.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Έλειξε ο Κύριος Κωδικός. <a href="https://www.adminer.org/en/extension/" target="_blank">Ενεργοποιήστε</a> τη μέθοδο %s για να τον κάνετε μόνιμο.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Έλειξε ο Κύριος Κωδικός. <a href="https://www.adminer.org/en/extension/"%s>Ενεργοποιήστε</a> τη μέθοδο %s για να τον κάνετε μόνιμο.',
'Language' => 'Γλώσσα', 'Language' => 'Γλώσσα',
'Invalid CSRF token. Send the form again.' => 'Άκυρο κουπόνι CSRF. Στείλτε τη φόρμα ξανά.', 'Invalid CSRF token. Send the form again.' => 'Άκυρο κουπόνι CSRF. Στείλτε τη φόρμα ξανά.',
'If you did not send this request from Adminer then close this page.' => 'Αν δε στείλατε αυτό το αίτημα από το Adminer, τότε κλείστε αυτή τη σελίδα.', 'If you did not send this request from Adminer then close this page.' => 'Αν δε στείλατε αυτό το αίτημα από το Adminer, τότε κλείστε αυτή τη σελίδα.',
@@ -83,7 +83,6 @@ $translations = array(
'Use' => 'χρήση', 'Use' => 'χρήση',
'Select database' => 'Επιλέξτε Β.Δ.', 'Select database' => 'Επιλέξτε Β.Δ.',
'Invalid database.' => 'Άκυρη Β.Δ.', 'Invalid database.' => 'Άκυρη Β.Δ.',
'Create new database' => 'Δημιουργία νέας Β.Δ.',
'Database has been dropped.' => 'Η Β.Δ. διαγράφηκε.', 'Database has been dropped.' => 'Η Β.Δ. διαγράφηκε.',
'Databases have been dropped.' => 'Οι Β.Δ. διαγράφηκαν.', 'Databases have been dropped.' => 'Οι Β.Δ. διαγράφηκαν.',
'Database has been created.' => 'Η Β.Δ. δημιουργήθηκε.', 'Database has been created.' => 'Η Β.Δ. δημιουργήθηκε.',
@@ -183,13 +182,12 @@ $translations = array(
'Values' => 'Τιμές', 'Values' => 'Τιμές',
'View' => 'Προβολή', 'View' => 'Προβολή',
'Materialized View' => 'Υλοποιημένη Προβολή', 'Materialized view' => 'Υλοποιημένη προβολή',
'View has been dropped.' => 'Η προβολή διαγράφηκε.', 'View has been dropped.' => 'Η προβολή διαγράφηκε.',
'View has been altered.' => 'Η προβολή τροποποιήθηκε.', 'View has been altered.' => 'Η προβολή τροποποιήθηκε.',
'View has been created.' => 'Η προβολή δημιουργήθηκε.', 'View has been created.' => 'Η προβολή δημιουργήθηκε.',
'Alter view' => 'Τροποποίηση προβολής', 'Alter view' => 'Τροποποίηση προβολής',
'Create view' => 'Δημιουργία προβολής', 'Create view' => 'Δημιουργία προβολής',
'Create materialized view' => 'Δημιουργία Υλοποιημένης προβολής',
'Indexes' => 'Δείκτες', 'Indexes' => 'Δείκτες',
'Indexes have been altered.' => 'Οι δείκτες τροποποιήθηκαν.', 'Indexes have been altered.' => 'Οι δείκτες τροποποιήθηκαν.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Contraseña', 'Password' => 'Contraseña',
'Select database' => 'Seleccionar Base de datos', 'Select database' => 'Seleccionar Base de datos',
'Invalid database.' => 'Base de datos incorrecta.', 'Invalid database.' => 'Base de datos incorrecta.',
'Create new database' => 'Crear nueva base de datos',
'Table has been dropped.' => 'Tabla eliminada.', 'Table has been dropped.' => 'Tabla eliminada.',
'Table has been altered.' => 'Tabla modificada.', 'Table has been altered.' => 'Tabla modificada.',
'Table has been created.' => 'Tabla creada.', 'Table has been created.' => 'Tabla creada.',
@@ -45,9 +44,9 @@ $translations = array(
'Delete' => 'Eliminar', 'Delete' => 'Eliminar',
'Database' => 'Base de datos', 'Database' => 'Base de datos',
'Routines' => 'Procedimientos', 'Routines' => 'Procedimientos',
'Indexes have been altered.' => 'Indices actualizados.', 'Indexes have been altered.' => 'Índices actualizados.',
'Indexes' => 'Indices', 'Indexes' => 'Índices',
'Alter indexes' => 'Modificar indices', 'Alter indexes' => 'Modificar índices',
'Add next' => 'Agregar', 'Add next' => 'Agregar',
'Language' => 'Idioma', 'Language' => 'Idioma',
'Select' => 'Mostrar', 'Select' => 'Mostrar',
@@ -78,7 +77,7 @@ $translations = array(
'File uploads are disabled.' => 'Importación de archivos deshablilitada.', 'File uploads are disabled.' => 'Importación de archivos deshablilitada.',
'Routine has been called, %d row(s) affected.' => array('Consulta ejecutada, %d registro afectado.', 'Consulta ejecutada, %d registros afectados.'), 'Routine has been called, %d row(s) affected.' => array('Consulta ejecutada, %d registro afectado.', 'Consulta ejecutada, %d registros afectados.'),
'Call' => 'Llamar', 'Call' => 'Llamar',
'No extension' => 'No hay extension', 'No extension' => 'No hay extensión',
'None of the supported PHP extensions (%s) are available.' => 'Ninguna de las extensiones PHP soportadas (%s) está disponible.', 'None of the supported PHP extensions (%s) are available.' => 'Ninguna de las extensiones PHP soportadas (%s) está disponible.',
'Session support must be enabled.' => 'Deben estar habilitadas las sesiones.', 'Session support must be enabled.' => 'Deben estar habilitadas las sesiones.',
'Session expired, please login again.' => 'Sesión caducada, por favor escriba su clave de nuevo.', 'Session expired, please login again.' => 'Sesión caducada, por favor escriba su clave de nuevo.',
@@ -114,7 +113,7 @@ $translations = array(
'Routine has been dropped.' => 'Procedimiento eliminado.', 'Routine has been dropped.' => 'Procedimiento eliminado.',
'Routine has been altered.' => 'Procedimiento modificado.', 'Routine has been altered.' => 'Procedimiento modificado.',
'Routine has been created.' => 'Procedimiento creado.', 'Routine has been created.' => 'Procedimiento creado.',
'Alter function' => 'Modificar Función', 'Alter function' => 'Modificar función',
'Alter procedure' => 'Modificar procedimiento', 'Alter procedure' => 'Modificar procedimiento',
'Return type' => 'Tipo de valor de vuelta', 'Return type' => 'Tipo de valor de vuelta',
'Add trigger' => 'Agregar disparador', 'Add trigger' => 'Agregar disparador',
@@ -128,7 +127,7 @@ $translations = array(
'%s version: %s through PHP extension %s' => 'Versión %s: %s a través de la extensión de PHP %s', '%s version: %s through PHP extension %s' => 'Versión %s: %s a través de la extensión de PHP %s',
'%d row(s)' => array('%d registro', '%d registros'), '%d row(s)' => array('%d registro', '%d registros'),
'Remove' => 'Eliminar', 'Remove' => 'Eliminar',
'Are you sure?' => 'Está seguro?', 'Are you sure?' => '¿Está seguro?',
'Privileges' => 'Privilegios', 'Privileges' => 'Privilegios',
'Create user' => 'Crear Usuario', 'Create user' => 'Crear Usuario',
'User has been dropped.' => 'Usuario eliminado.', 'User has been dropped.' => 'Usuario eliminado.',
@@ -140,7 +139,7 @@ $translations = array(
'Grant' => 'Conceder', 'Grant' => 'Conceder',
'Revoke' => 'Impedir', 'Revoke' => 'Impedir',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'POST data demasiado grande. Reduzca el tamaño o aumente la directiva de configuración %s.', 'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'POST data demasiado grande. Reduzca el tamaño o aumente la directiva de configuración %s.',
'Logged as: %s' => 'Logeado como: %s', 'Logged as: %s' => 'Logueado como: %s',
'Move up' => 'Mover arriba', 'Move up' => 'Mover arriba',
'Move down' => 'Mover abajo', 'Move down' => 'Mover abajo',
'Functions' => 'Funciones', 'Functions' => 'Funciones',
@@ -192,7 +191,7 @@ $translations = array(
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Excedida la cantidad máxima de campos permitidos. Por favor aumente %s.', '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 by' => 'Particionar por',
'Partitions' => 'Particiones', 'Partitions' => 'Particiones',
'Partition name' => 'Nombre de Partición', 'Partition name' => 'Nombre de partición',
'Values' => 'Valores', 'Values' => 'Valores',
'%d row(s) have been imported.' => array('%d registro importado.', '%d registros importados.'), '%d row(s) have been imported.' => array('%d registro importado.', '%d registros importados.'),
'anywhere' => 'donde sea', 'anywhere' => 'donde sea',
@@ -249,16 +248,16 @@ $translations = array(
'System' => 'Motor de base de datos', 'System' => 'Motor de base de datos',
'Select data' => 'Visualizar contenido', 'Select data' => 'Visualizar contenido',
'Show structure' => 'Mostrar estructura', 'Show structure' => 'Mostrar estructura',
'empty' => 'ningúno', 'empty' => 'ninguno',
'Network' => 'Red', 'Network' => 'Red',
'Geometry' => 'Geometría', 'Geometry' => 'Geometría',
'File exists.' => 'Ese archivo ya existe.', 'File exists.' => 'Ese archivo ya existe.',
'Attachments' => 'Adjuntos', 'Attachments' => 'Adjuntos',
'%d query(s) executed OK.' => array('%d sentencia sql ejecutada correctamente.', '%d sentencias sql ejecutadas correctamente.'), '%d query(s) executed OK.' => array('%d sentencia SQL ejecutada correctamente.', '%d sentencias SQL ejecutadas correctamente.'),
'Show only errors' => 'Mostrar solamente errores', 'Show only errors' => 'Mostrar solamente errores',
'Refresh' => 'Refrescar', 'Refresh' => 'Refrescar',
'Invalid schema.' => 'Esquema inválido.', 'Invalid schema.' => 'Esquema inválido.',
'Please use one of the extensions %s.' => 'Por favor use una de las extensiones %s.', 'Please use one of the extensions %s.' => 'Por favor, use una de las extensiones %s.',
'now' => 'ahora', 'now' => 'ahora',
'ltr' => 'ltr', 'ltr' => 'ltr',
'Tables have been copied.' => 'Tablas copiadas.', 'Tables have been copied.' => 'Tablas copiadas.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Parool', 'Password' => 'Parool',
'Select database' => 'Vali andmebaas', 'Select database' => 'Vali andmebaas',
'Invalid database.' => 'Tundmatu andmebaas.', 'Invalid database.' => 'Tundmatu andmebaas.',
'Create new database' => 'Loo uus andmebaas',
'Table has been dropped.' => 'Tabel on edukalt kustutatud.', 'Table has been dropped.' => 'Tabel on edukalt kustutatud.',
'Table has been altered.' => 'Tabeli andmed on edukalt muudetud.', 'Table has been altered.' => 'Tabeli andmed on edukalt muudetud.',
'Table has been created.' => 'Tabel on edukalt loodud.', 'Table has been created.' => 'Tabel on edukalt loodud.',

View File

@@ -12,7 +12,7 @@ $translations = array(
'Logout successful.' => 'با موفقیت خارج شدید.', 'Logout successful.' => 'با موفقیت خارج شدید.',
'Invalid credentials.' => 'اعتبار سنجی نامعتبر.', 'Invalid credentials.' => 'اعتبار سنجی نامعتبر.',
'Too many unsuccessful logins, try again in %d minute(s).' => array('ورودهای ناموفق بیش از حد، %d دقیقه دیگر تلاش نمایید.', 'ورودهای ناموفق بیش از حد، %d دقیقه دیگر تلاش نمایید.'), 'Too many unsuccessful logins, try again in %d minute(s).' => array('ورودهای ناموفق بیش از حد، %d دقیقه دیگر تلاش نمایید.', 'ورودهای ناموفق بیش از حد، %d دقیقه دیگر تلاش نمایید.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'رمز اصلی باطل شده است. روش %s را <a href="https://www.adminer.org/en/extension/" target="_blank">پیاده سازی</a> کرده تا آن را دائمی سازید.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'رمز اصلی باطل شده است. روش %s را <a href="https://www.adminer.org/en/extension/"%s>پیاده سازی</a> کرده تا آن را دائمی سازید.',
'Language' => 'زبان', 'Language' => 'زبان',
'Invalid CSRF token. Send the form again.' => 'CSRF token نامعتبر است. دوباره سعی کنید.', 'Invalid CSRF token. Send the form again.' => 'CSRF token نامعتبر است. دوباره سعی کنید.',
'No extension' => 'پسوند نامعتبر', 'No extension' => 'پسوند نامعتبر',
@@ -81,7 +81,6 @@ $translations = array(
'Use' => 'استفاده', 'Use' => 'استفاده',
'Select database' => 'انتخاب پایگاه داده', 'Select database' => 'انتخاب پایگاه داده',
'Invalid database.' => 'پایگاه داده نامعتبر.', 'Invalid database.' => 'پایگاه داده نامعتبر.',
'Create new database' => 'ایجاد پایگاه داده جدید',
'Database has been dropped.' => 'پایگاه داده حذف شد.', 'Database has been dropped.' => 'پایگاه داده حذف شد.',
'Databases have been dropped.' => 'پایگاه های داده حذف شدند.', 'Databases have been dropped.' => 'پایگاه های داده حذف شدند.',
'Database has been created.' => 'پایگاه داده ایجاد شد.', 'Database has been created.' => 'پایگاه داده ایجاد شد.',
@@ -181,13 +180,12 @@ $translations = array(
'Values' => 'مقادیر', 'Values' => 'مقادیر',
'View' => 'نمایش', 'View' => 'نمایش',
'Materialized View' => 'نمایه مادی', 'Materialized view' => 'نمایه مادی',
'View has been dropped.' => 'نمایش حذف شد.', 'View has been dropped.' => 'نمایش حذف شد.',
'View has been altered.' => 'نمایش ویرایش شد.', 'View has been altered.' => 'نمایش ویرایش شد.',
'View has been created.' => 'نمایش ایجاد شد.', 'View has been created.' => 'نمایش ایجاد شد.',
'Alter view' => 'حذف نمایش', 'Alter view' => 'حذف نمایش',
'Create view' => 'ایجاد نمایش', 'Create view' => 'ایجاد نمایش',
'Create materialized view' => 'ایجاد نمایه مادی',
'Indexes' => 'ایندکسها', 'Indexes' => 'ایندکسها',
'Indexes have been altered.' => 'ایندکسها ویرایش شدند.', 'Indexes have been altered.' => 'ایندکسها ویرایش شدند.',

View File

@@ -12,7 +12,7 @@ $translations = array(
'Logout successful.' => 'Uloskirjautuminen onnistui.', 'Logout successful.' => 'Uloskirjautuminen onnistui.',
'Invalid credentials.' => 'Virheelliset kirjautumistiedot.', 'Invalid credentials.' => 'Virheelliset kirjautumistiedot.',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Liian monta epäonnistunutta sisäänkirjautumisyritystä, kokeile uudestaan %d minuutin kuluttua.', 'Liian monta epäonnistunutta sisäänkirjautumisyritystä, kokeile uudestaan %d minuutin kuluttua.'), 'Too many unsuccessful logins, try again in %d minute(s).' => array('Liian monta epäonnistunutta sisäänkirjautumisyritystä, kokeile uudestaan %d minuutin kuluttua.', 'Liian monta epäonnistunutta sisäänkirjautumisyritystä, kokeile uudestaan %d minuutin kuluttua.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Master-salasana ei ole enää voimassa. <a href="https://www.adminer.org/en/extension/" target="_blank">Toteuta</a> %s-metodi sen tekemiseksi pysyväksi.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Master-salasana ei ole enää voimassa. <a href="https://www.adminer.org/en/extension/"%s>Toteuta</a> %s-metodi sen tekemiseksi pysyväksi.',
'Language' => 'Kieli', 'Language' => 'Kieli',
'Invalid CSRF token. Send the form again.' => 'Virheellinen CSRF-vastamerkki. Lähetä lomake uudelleen.', 'Invalid CSRF token. Send the form again.' => 'Virheellinen CSRF-vastamerkki. Lähetä lomake uudelleen.',
'If you did not send this request from Adminer then close this page.' => 'Jollet lähettänyt tämä pyyntö Adminerista, sulje tämä sivu.', 'If you did not send this request from Adminer then close this page.' => 'Jollet lähettänyt tämä pyyntö Adminerista, sulje tämä sivu.',
@@ -83,7 +83,6 @@ $translations = array(
'Use' => 'Käytä', 'Use' => 'Käytä',
'Select database' => 'Valitse tietokanta', 'Select database' => 'Valitse tietokanta',
'Invalid database.' => 'Tietokanta ei kelpaa.', 'Invalid database.' => 'Tietokanta ei kelpaa.',
'Create new database' => 'Luo uusi tietokanta',
'Database has been dropped.' => 'Tietokanta on poistettu.', 'Database has been dropped.' => 'Tietokanta on poistettu.',
'Databases have been dropped.' => 'Tietokannat on poistettu.', 'Databases have been dropped.' => 'Tietokannat on poistettu.',
'Database has been created.' => 'Tietokanta on luotu.', 'Database has been created.' => 'Tietokanta on luotu.',
@@ -183,13 +182,12 @@ $translations = array(
'Values' => 'Arvot', 'Values' => 'Arvot',
'View' => 'Näkymä', 'View' => 'Näkymä',
'Materialized View' => 'Materialisoitunut näkymä', 'Materialized view' => 'Materialisoitunut näkymä',
'View has been dropped.' => 'Näkymä on poistettu.', 'View has been dropped.' => 'Näkymä on poistettu.',
'View has been altered.' => 'Näkymää on muutettu.', 'View has been altered.' => 'Näkymää on muutettu.',
'View has been created.' => 'Näkymä on luotu.', 'View has been created.' => 'Näkymä on luotu.',
'Alter view' => 'Muuta näkymää', 'Alter view' => 'Muuta näkymää',
'Create view' => 'Luo näkymä', 'Create view' => 'Luo näkymä',
'Create materialized view' => 'Luo materialisoitunut näkymä',
'Indexes' => 'Indeksit', 'Indexes' => 'Indeksit',
'Indexes have been altered.' => 'Indeksejä on muutettu.', 'Indexes have been altered.' => 'Indeksejä on muutettu.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Mot de passe', 'Password' => 'Mot de passe',
'Select database' => 'Sélectionner la base de données', 'Select database' => 'Sélectionner la base de données',
'Invalid database.' => 'Base de données invalide.', 'Invalid database.' => 'Base de données invalide.',
'Create new database' => 'Créer une base de données',
'Table has been dropped.' => 'La table a été effacée.', 'Table has been dropped.' => 'La table a été effacée.',
'Table has been altered.' => 'La table a été modifiée.', 'Table has been altered.' => 'La table a été modifiée.',
'Table has been created.' => 'La table a été créée.', 'Table has been created.' => 'La table a été créée.',
@@ -275,7 +274,7 @@ $translations = array(
'File must be in UTF-8 encoding.' => 'Les fichiers doivent être encodés en UTF-8.', 'File must be in UTF-8 encoding.' => 'Les fichiers doivent être encodés en UTF-8.',
'Full table scan' => 'Scan de toute la table', 'Full table scan' => 'Scan de toute la table',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Trop de connexions échouées, essayez à nouveau dans %d minute.', 'Trop de connexions échouées, essayez à nouveau dans %d minutes.'), 'Too many unsuccessful logins, try again in %d minute(s).' => array('Trop de connexions échouées, essayez à nouveau dans %d minute.', 'Trop de connexions échouées, essayez à nouveau dans %d minutes.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Le mot de passe a expiré. <a href="https://www.adminer.org/en/extension/" target="_blank">Implémentez</a> la méthode %s afin de le rendre permanent.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Le mot de passe a expiré. <a href="https://www.adminer.org/en/extension/"%s>Implémentez</a> la méthode %s afin de le rendre permanent.',
'You can upload a big SQL file via FTP and import it from server.' => 'Vous pouvez uploader un gros fichier SQL par FTP et ensuite l\'importer depuis le serveur.', 'You can upload a big SQL file via FTP and import it from server.' => 'Vous pouvez uploader un gros fichier SQL par FTP et ensuite l\'importer depuis le serveur.',
'Size' => 'Taille', 'Size' => 'Taille',
'Compute' => 'Calcul', 'Compute' => 'Calcul',
@@ -283,8 +282,7 @@ $translations = array(
'Saving' => 'Enregistrement', 'Saving' => 'Enregistrement',
'yes' => 'oui', 'yes' => 'oui',
'no' => 'non', 'no' => 'non',
'Materialized View' => 'Vue matérialisée', 'Materialized view' => 'Vue matérialisée',
'Create materialized view' => 'Créer une vue matérialisée',
'%d / ' => '%d / ', '%d / ' => '%d / ',
'Limit rows' => 'Limiter les lignes', 'Limit rows' => 'Limiter les lignes',
'Default value' => 'Valeur par défaut', 'Default value' => 'Valeur par défaut',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Contrasinal', 'Password' => 'Contrasinal',
'Select database' => 'Seleccionar Base de datos', 'Select database' => 'Seleccionar Base de datos',
'Invalid database.' => 'Base de datos incorrecta.', 'Invalid database.' => 'Base de datos incorrecta.',
'Create new database' => 'Crear nova base de datos',
'Table has been dropped.' => 'Eliminouse a táboa.', 'Table has been dropped.' => 'Eliminouse a táboa.',
'Table has been altered.' => 'Modificouse a táboa.', 'Table has been altered.' => 'Modificouse a táboa.',
'Table has been created.' => 'Creouse a táboa.', 'Table has been created.' => 'Creouse a táboa.',
@@ -267,10 +266,9 @@ $translations = array(
'Edit all' => 'Editar todo', 'Edit all' => 'Editar todo',
'HH:MM:SS' => 'HH:MM:SS', 'HH:MM:SS' => 'HH:MM:SS',
'Tables have been optimized.' => 'Optimizáronse as táboas', 'Tables have been optimized.' => 'Optimizáronse as táboas',
'Materialized View' => 'Vista materializada', 'Materialized view' => 'Vista materializada',
'Vacuum' => 'Baleirar', 'Vacuum' => 'Baleirar',
'Selected' => 'Selección', 'Selected' => 'Selección',
'Create materialized view' => 'Crear vista materializada',
'File must be in UTF-8 encoding.' => 'O ficheiro ten que estar codificado con UTF-8', 'File must be in UTF-8 encoding.' => 'O ficheiro ten que estar codificado con UTF-8',
'Modify' => 'Modificar', 'Modify' => 'Modificar',
'Loading' => 'Cargando', 'Loading' => 'Cargando',
@@ -280,7 +278,7 @@ $translations = array(
'Default value' => 'Valor por defecto', 'Default value' => 'Valor por defecto',
'Full table scan' => 'Escaneo completo da táboa', 'Full table scan' => 'Escaneo completo da táboa',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Demasiados intentos de conexión, intentao de novo en %d minuto', 'Demasiados intentos de conexión, intentao de novo en %d minutos'), 'Too many unsuccessful logins, try again in %d minute(s).' => array('Demasiados intentos de conexión, intentao de novo en %d minuto', 'Demasiados intentos de conexión, intentao de novo en %d minutos'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'O contrasinal principal caducou. <a href="https://www.adminer.org/en/extension/" target="_blank">Implementa</a> o método %s para facelo permanente.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'O contrasinal principal caducou. <a href="https://www.adminer.org/en/extension/"%s>Implementa</a> o método %s para facelo permanente.',
'If you did not send this request from Adminer then close this page.' => 'Se non enviaches esta petición dende o Adminer entón pecha esta páxina', 'If you did not send this request from Adminer then close this page.' => 'Se non enviaches esta petición dende o Adminer entón pecha esta páxina',
'You can upload a big SQL file via FTP and import it from server.' => 'Podes subir un ficheiro SQL de gran tamaño vía FTP e importalo dende o servidor', 'You can upload a big SQL file via FTP and import it from server.' => 'Podes subir un ficheiro SQL de gran tamaño vía FTP e importalo dende o servidor',
'Size' => 'Tamaño', 'Size' => 'Tamaño',

294
adminer/lang/he.inc.php Normal file
View File

@@ -0,0 +1,294 @@
<?php
$translations = array(
'Login' => 'התחברות',
'Logout successful.' => 'ההתחברות הצליחה',
'Invalid credentials.' => 'פרטי התחברות שגויים',
'Server' => 'שרת',
'Username' => 'שם משתמש',
'Password' => 'סיסמה',
'Select database' => 'בחר מסד נתונים',
'Invalid database.' => 'מסד נתונים שגוי',
'Table has been dropped.' => 'הטבלה הושלכה',
'Table has been altered.' => 'הטבלה שונתה',
'Table has been created.' => 'הטבלה נוצרה',
'Alter table' => 'שנה טבלה',
'Create table' => 'צור טבלה',
'Table name' => 'שם הטבלה',
'engine' => 'מנוע',
'collation' => 'קולקציה',
'Column name' => 'שם עמודה',
'Type' => 'סוג',
'Length' => 'אורך',
'Auto Increment' => 'הגדלה אוטומטית',
'Options' => 'אפשרויות',
'Save' => 'שמור',
'Drop' => 'השלך',
'Database has been created.' => 'מסד הנתונים נוצר',
'Database has been renamed.' => 'שם מסד הנתונים שונה',
'Database has been altered.' => 'מסד הנתונים שונה',
'Alter database' => 'שנה מסד נתונים',
'Create database' => 'צור מסד נתונים',
'SQL command' => 'שאילתת SQL',
'Logout' => 'התנתק',
'database' => 'מסד נתונים',
'Use' => 'השתמש',
'No tables.' => 'אין טבלאות',
'select' => 'בחר',
'Item has been deleted.' => 'הפריט נמחק',
'Item has been updated.' => 'הפריט עודכן',
'Edit' => 'ערוך',
'Insert' => 'הכנס',
'Save and insert next' => 'שמור והמשך להכניס',
'Delete' => 'מחק',
'Database' => 'מסד נתונים',
'Routines' => 'רוטינות',
'Indexes have been altered.' => 'האינדקסים שונו',
'Indexes' => 'אינדקסים',
'Alter indexes' => 'שנה אינדקסים',
'Add next' => 'הוסף הבא',
'Language' => 'שפה',
'Select' => 'בחר',
'New item' => 'פריט חדש',
'Search' => 'חפש',
'Sort' => 'מיין',
'descending' => 'סדר הפוך',
'Limit' => 'הגבל',
'No rows.' => 'אין שורות',
'Action' => 'פעולות',
'edit' => 'ערוך',
'Page' => 'עמוד',
'Query executed OK, %d row(s) affected.' => 'השאילתה בוצעה כהלכה, %d שורות הושפעו',
'Error in query' => 'שגיאה בשאילתה',
'Execute' => 'הרץ',
'Table' => 'טבלה',
'Foreign keys' => 'מפתחות זרים',
'Triggers' => 'מפעילים',
'View' => 'הצג',
'Unable to select the table' => 'בחירת הטבלה נכשלה',
'Invalid CSRF token. Send the form again.' => 'כשל באבטחת נתונים, שלח טופס שוב',
'Comment' => 'הערה',
'Default values' => 'ערכי ברירת מחדל',
'%d byte(s)' => '%d בתים',
'No commands to execute.' => 'לא נמצאו פקודות להרצה',
'Unable to upload a file.' => 'העלאת הקובץ נכשלה',
'File upload' => 'העלה קובץ',
'File uploads are disabled.' => 'העלאת קבצים מבוטלת',
'Routine has been called, %d row(s) affected.' => 'הרוטינה נקראה, %d שורות הושפעו',
'Call' => 'קרא',
'No extension' => 'אין תוסף',
'None of the supported PHP extensions (%s) are available.' => 'שום תוסף PHP (%s) זמין',
'Session support must be enabled.' => 'חובה להפעיל תמיכה בסשן',
'Session expired, please login again.' => 'תם זמן ההפעלה, אנא התחבר שוב',
'Text length' => 'אורך הטקסט',
'Foreign key has been dropped.' => 'המפתח הזר הושלך',
'Foreign key has been altered.' => 'המפתח הזר שונה',
'Foreign key has been created.' => 'המפתח הזר נוצר',
'Foreign key' => 'מפתח זר',
'Target table' => 'טבלת יעד',
'Change' => 'שנה',
'Source' => 'מקור',
'Target' => 'יעד',
'Add column' => 'הוסף עמודה',
'Alter' => 'שנה',
'Add foreign key' => 'הוסף מפתח זר',
'ON DELETE' => 'בעת מחיקה',
'ON UPDATE' => 'בעת עידכון',
'Index Type' => 'סוג אינדקס',
'Column (length)' => 'עמודה (אורך)',
'View has been dropped.' => 'התצוגה הושלכה',
'View has been altered.' => 'התצוגה שונתה',
'View has been created.' => 'התצוגה נוצרה',
'Alter view' => 'שנה תצוגה',
'Create view' => 'צור תצוגה',
'Name' => 'שם',
'Process list' => 'רשימת תהליכים',
'%d process(es) have been killed.' => '%d תהליכים חוסלו',
'Kill' => 'חסל',
'Parameter name' => 'שם הפרמטר',
'Database schema' => 'סכמת מסד נתונים',
'Create procedure' => 'צור פרוצדורה',
'Create function' => 'צור פונקציה',
'Routine has been dropped.' => 'הרוטינה הושלכה',
'Routine has been altered.' => 'הרוטינה שונתה',
'Routine has been created.' => 'הרוטינה נוצרה',
'Alter function' => 'שנה פונקציה',
'Alter procedure' => 'שנה פרוצדורה',
'Return type' => 'סוג ערך מוחזר',
'Add trigger' => 'הוסף טריגר',
'Trigger has been dropped.' => 'הטריגר הושלך',
'Trigger has been altered.' => 'הטריגר שונה',
'Trigger has been created.' => 'הטריגר נוצר',
'Alter trigger' => 'שנה טריגר',
'Create trigger' => 'צור טריגר',
'Time' => 'זמן',
'Event' => 'אירוע',
'%d row(s)' => '%d שורות',
'Remove' => 'הסר',
'Are you sure?' => 'האם אתה בטוח?',
'Privileges' => 'פריווילגיות',
'Create user' => 'צור משתמש',
'User has been dropped.' => 'המשתמש הושלך',
'User has been altered.' => 'המשתמש שונה',
'User has been created.' => 'המשתמש נוצר',
'Hashed' => 'הצפנה',
'Column' => 'עמודה',
'Routine' => 'רוטינה',
'Grant' => 'הענק',
'Revoke' => 'שלול',
'%s version: %s through PHP extension %s' => '%s גרסה: %s דרך תוסף PHP %s',
'Logged as: %s' => 'מחובר כ: %s',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'מידע גדול מידי נשלח ב-POST. הקטן את את המידע הוא הגדלת את הגדרות ה-%s',
'Move up' => 'הזז למעלה',
'Move down' => 'הזז למטה',
'Export' => 'יצא',
'Tables' => 'טבלאות',
'Data' => 'נתונים',
'Output' => 'פלט',
'open' => 'פתח',
'save' => 'שמור',
'Format' => 'פורמט',
'Functions' => 'פונקציות',
'Aggregation' => 'צבירה',
'Event has been dropped.' => 'האירוע הושלך',
'Event has been altered.' => 'האירוע שונה',
'Event has been created.' => 'האירוע נוצר',
'Alter event' => 'שנה אירוע',
'Create event' => 'צור אירוע',
'Start' => 'התחלה',
'End' => 'סיום',
'Every' => 'כל',
'Status' => 'סטטוס',
'On completion preserve' => 'בעת סיום שמור',
'Events' => 'אירועים',
'Schedule' => 'תזמן',
'At given time' => 'לפי זמן נתון',
'Save and continue edit' => 'שמור והמשך לערוך',
'original' => 'מקורי',
'Tables have been truncated.' => 'הטבלה קוצרה',
'Tables have been moved.' => 'הטבלה הועברה',
'Tables have been dropped.' => 'הטבלה הושלכה',
'Tables and views' => 'טבלאות ותצוגות',
'Engine' => 'מנוע',
'Collation' => 'קולקציה',
'Data Length' => 'אורך נתונים',
'Index Length' => 'אורך אינדקס',
'Data Free' => 'נתונים משוחררים',
'Rows' => 'שורות',
',' => ',',
'0123456789' => '0123456789',
'Analyze' => 'נתח',
'Optimize' => 'יעל',
'Check' => 'בדוק',
'Repair' => 'תקן',
'Truncate' => 'קצר',
'Move to other database' => 'העבר למסד נתונים אחר',
'Move' => 'העבר',
'%d item(s) have been affected.' => '%d פריטים הושפעו',
'whole result' => 'כל התוצאות',
'Clone' => 'שכפל',
'Maximum number of allowed fields exceeded. Please increase %s.' => 'הגעת למספר השדות המרבי. בבקשה הגדל את %s',
'Partition by' => 'מחיצות ע"י',
'Partitions' => 'מחיצות',
'Partition name' => 'שם מחיצה',
'Values' => 'ערכים',
'%d row(s) have been imported.' => '%d שורות יובאו',
'anywhere' => 'בכל מקום',
'Import' => 'יבא',
'Stop on error' => 'עצור בעת שגיאה',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$1-$3-$5',
'[yyyy]-mm-dd' => '[yyyy]-mm-dd',
'History' => 'היסטוריה',
'Variables' => 'משתנים',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'על עמודות המקור והיעד להיות מאותו טיפוס נתונים, חובה שיהיה אינדקס בעמודת היעד ושהמידע המתאים יהיה קיים',
'Relations' => 'הקשרים',
'Run file' => 'הרץ קובץ',
'Clear' => 'נקה',
'Maximum allowed file size is %sB.' => 'גודל מקסימלאי להעלאה: %sB',
'Numbers' => 'מספרים',
'Date and time' => 'תאריך ושעה',
'Strings' => 'מחרוזות',
'Binary' => 'בינארי',
'Lists' => 'רשימות',
'Editor' => 'עורך',
'E-mail' => 'דוא"ל',
'From' => 'מ:',
'Subject' => 'נושא',
'Send' => 'שלח',
'%d e-mail(s) have been sent.' => '%d הודעות דוא"ל נשלחו',
'Webserver file %s' => 'קובץ השרת %s',
'File does not exist.' => 'הקובץ אינו קיים',
'%d in total' => '%d בסך הכל',
'Permanent login' => 'התחבר לצמיתות',
'Databases have been dropped.' => 'מסד הנתונים הושלך',
'Database has been dropped.' => 'מסד הנתונים הושלך',
'Search data in tables' => 'חפש מידע בטבלאות',
'Schema' => 'סכמה',
'Alter schema' => 'שנה סכמה',
'Create schema' => 'צור סכמה',
'Schema has been dropped.' => 'הסכמה הושלכה',
'Schema has been created.' => 'הסכמה נוצרה',
'Schema has been altered.' => 'הסכמה שונתה',
'Sequences' => 'סדרות',
'Create sequence' => 'צור סדרה',
'Alter sequence' => 'שנה סדרה',
'Sequence has been dropped.' => 'הסדרה הושלכה',
'Sequence has been created.' => 'הסדרה נוצרה',
'Sequence has been altered.' => 'הסדרה שונתה',
'User types' => 'סוגי משתמשים',
'Create type' => 'צור סוג',
'Alter type' => 'שנה סוג',
'Type has been dropped.' => 'הסוג הושלך',
'Type has been created.' => 'הסוג נוצר',
'Use edit link to modify this value.' => 'השתמש בקישור העריכה בשביל לשנות את הערך',
'last' => 'אחרון',
'From server' => 'משרת',
'System' => 'מערכת',
'Select data' => 'בחר נתונים',
'Show structure' => 'הראה מבנה',
'empty' => 'ריק',
'Network' => 'רשת',
'Geometry' => 'גיאומטריה',
'File exists.' => 'קובץ קיים',
'Attachments' => 'קבצים מצורפים',
'Item%s has been inserted.' => 'הפריט %s הוזן בהצלחה',
'now' => 'כעת',
'%d query(s) executed OK.' => '%d שאילתות בוצעו בהצלחה',
'Show only errors' => 'הראה שגיאות בלבד',
'Refresh' => 'רענן',
'Invalid schema.' => 'סכמה שגויה',
'Please use one of the extensions %s.' => 'בבקשה השתמש באחד מהתוספים %s',
'ltr' => 'rtl',
'Tables have been copied.' => 'הטבלה הועתקה',
'Copy' => 'העתק',
'Permanent link' => 'קישור סופי',
'Edit all' => 'ערוך הכל',
'HH:MM:SS' => 'HH:MM:SS',
'Tables have been optimized.' => 'הטבלאות עברו אופטימיזציה',
'Materialized view' => 'תצוגת מימוש ',
'Vacuum' => 'וואקום',
'Selected' => 'נבחרים',
'Ctrl+click on a value to modify it.' => 'לחץ ctrl + לחיצת עכבר לערוך ערך זה',
'File must be in UTF-8 encoding.' => 'על הקובץ להיות בקידוד utf-8',
'Modify' => 'ערוך',
'Loading' => 'טוען',
'Load more data' => 'טען נתונים נוספים',
'ATTACH queries are not supported.' => 'שאילתת ATTACH אינה נתמכת',
'%d / ' => '%d / ',
'Limit rows' => 'הגבל שורות',
'<a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to use SQLite.' => '<a href="https://www.adminer.org/en/extension/"%s>התקן</a> את תוסף SQLite בשביל להתחבר',
'Default value' => 'ערך ברירת מחדל',
'Full table scan' => 'סריקה טבלה מלאה',
'Too many unsuccessful logins, try again in %d minute(s).' => 'יותר מידי נסיונות כניסה נכשלו, אנא נסה עוד %d דקות',
'Thanks for using Adminer, consider <a href="%s">donating</a>.' => 'תודה שהשתמש ב-adminer אנא שקול <a href="%s">לתרום</a>.',
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'סיסמת המאסטר פגה <a href="https://www.adminer.org/en/extension/"%s>התקן תוסף</a> על מנת להפוך את זה לתמידי',
'If you did not send this request from Adminer then close this page.' => 'אם לא אתה שלחת בקשה ל-Adminer הינך יכול לסגור חלון זה',
'You can upload a big SQL file via FTP and import it from server.' => 'ניתן לעלות קבצים ב-FTP ואז למשוך אותם מהשרת',
'Size' => 'גודל',
'Compute' => 'חישוב',
'You are offline.' => 'הינך לא מקוון',
'You have no privileges to update this table.' => 'אין לך ההרשאות המתאימות לעדכן טבלה זו',
'Saving' => 'שומר',
'yes' => 'כן',
'no' => 'לא',
);

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Jelszó', 'Password' => 'Jelszó',
'Select database' => 'Adatbázis kiválasztása', 'Select database' => 'Adatbázis kiválasztása',
'Invalid database.' => 'Érvénytelen adatbázis.', 'Invalid database.' => 'Érvénytelen adatbázis.',
'Create new database' => 'Új adatbázis',
'Table has been dropped.' => 'A tábla eldobva.', 'Table has been dropped.' => 'A tábla eldobva.',
'Table has been altered.' => 'A tábla módosult.', 'Table has been altered.' => 'A tábla módosult.',
'Table has been created.' => 'A tábla létrejött.', 'Table has been created.' => 'A tábla létrejött.',

View File

@@ -10,11 +10,11 @@ $translations = array(
'Logout' => 'Keluar', 'Logout' => 'Keluar',
'Logged as: %s' => 'Masuk sebagai: %s', 'Logged as: %s' => 'Masuk sebagai: %s',
'Logout successful.' => 'Berhasil keluar.', 'Logout successful.' => 'Berhasil keluar.',
'Invalid credentials.' => 'Akses invalid.', 'Invalid credentials.' => 'Akses tidak sah.',
'Language' => 'Bahasa', 'Language' => 'Bahasa',
'Invalid CSRF token. Send the form again.' => 'Token CSRF invalid. Kirim ulang formulir.', 'Invalid CSRF token. Send the form again.' => 'Token CSRF tidak sah. Kirim ulang formulir.',
'No extension' => 'Ekstensi tidak tersedia', 'No extension' => 'Ekstensi tidak ada',
'None of the supported PHP extensions (%s) are available.' => 'Ekstensi PHP yang didukung (%s) tidak tersedia.', 'None of the supported PHP extensions (%s) are available.' => 'Ekstensi PHP yang didukung (%s) tidak ada.',
'Session support must be enabled.' => 'Dukungan sesi harus aktif.', 'Session support must be enabled.' => 'Dukungan sesi harus aktif.',
'Session expired, please login again.' => 'Sesi habis, silakan masuk lagi.', 'Session expired, please login again.' => 'Sesi habis, silakan masuk lagi.',
'%s version: %s through PHP extension %s' => 'Versi %s: %s dengan ekstensi PHP %s', '%s version: %s through PHP extension %s' => 'Versi %s: %s dengan ekstensi PHP %s',
@@ -44,26 +44,26 @@ $translations = array(
'SQL command' => 'Perintah SQL', 'SQL command' => 'Perintah SQL',
'%d query(s) executed OK.' => '%d kueri berhasil dijalankan.', '%d query(s) executed OK.' => '%d kueri berhasil dijalankan.',
'Query executed OK, %d row(s) affected.' => 'Kueri berhasil, %d baris terpengaruh.', 'Query executed OK, %d row(s) affected.' => 'Kueri berhasil, %d baris terpengaruh.',
'No commands to execute.' => 'Tiada perintah untuk dijalankan.', 'No commands to execute.' => 'Tidak ada perintah untuk dijalankan.',
'Error in query' => 'Kesalahan dalam kueri', 'Error in query' => 'Galat dalam kueri',
'Execute' => 'Jalankan', 'Execute' => 'Jalankan',
'Stop on error' => 'Hentikan pada kesalahan', 'Stop on error' => 'Hentikan jika galat',
'Show only errors' => 'Hanya tampilkan kesalahan', 'Show only errors' => 'Hanya tampilkan galat',
// sprintf() format for time of the command // sprintf() format for time of the command
'%.3f s' => '%.3f s', '%.3f s' => '%.3f s',
'History' => 'Riwayat', 'History' => 'Riwayat',
'Clear' => 'Bersihkan', 'Clear' => 'Bersihkan',
'Edit all' => 'Edit semua',
'Edit all' => 'Sunting semua',
'File upload' => 'Unggah berkas', 'File upload' => 'Unggah berkas',
'From server' => 'Dari server', 'From server' => 'Dari server',
'Webserver file %s' => 'Berkas server web %s', 'Webserver file %s' => 'Berkas server web %s',
'Run file' => 'Jalankan berkas', 'Run file' => 'Jalankan berkas',
'File does not exist.' => 'Berkas tidak ditemukan.', 'File does not exist.' => 'Berkas tidak ada.',
'File uploads are disabled.' => 'Pengunggahan berkas dimatikan.', 'File uploads are disabled.' => 'Pengunggahan berkas dimatikan.',
'Unable to upload a file.' => 'Tidak dapat mengunggah berkas.', 'Unable to upload a file.' => 'Tidak dapat mengunggah berkas.',
'Maximum allowed file size is %sB.' => 'Besar berkas yang diizinkan adalah %s bita.', 'Maximum allowed file size is %sB.' => 'Besar berkas yang diizinkan adalah %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Data POST terlalu besar. Kurangi data atau perbesar pengarah konfigurasi %s.', 'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Data POST terlalu besar. Kurangi data atau perbesar direktif konfigurasi %s.',
'Export' => 'Ekspor', 'Export' => 'Ekspor',
'Output' => 'Hasil', 'Output' => 'Hasil',
@@ -76,19 +76,18 @@ $translations = array(
'database' => 'basis data', 'database' => 'basis data',
'Use' => 'Gunakan', 'Use' => 'Gunakan',
'Select database' => 'Pilih basis data', 'Select database' => 'Pilih basis data',
'Invalid database.' => 'Basis data invalid.', 'Invalid database.' => 'Basis data tidak sah.',
'Create new database' => 'Buat basis data baru',
'Database has been dropped.' => 'Basis data berhasil dihapus.', 'Database has been dropped.' => 'Basis data berhasil dihapus.',
'Databases have been dropped.' => 'Basis data berhasil dihapus.', 'Databases have been dropped.' => 'Basis data berhasil dihapus.',
'Database has been created.' => 'Basis data berhasil dibuat.', 'Database has been created.' => 'Basis data berhasil dibuat.',
'Database has been renamed.' => 'Basis data berhasil diganti nama.', 'Database has been renamed.' => 'Basis data berhasil diganti namanya.',
'Database has been altered.' => 'Basis data berhasil diubah.', 'Database has been altered.' => 'Basis data berhasil diubah.',
'Alter database' => 'Ubah basis data', 'Alter database' => 'Ubah basis data',
'Create database' => 'Buat basis data', 'Create database' => 'Buat basis data',
'Database schema' => 'Skema basis data', 'Database schema' => 'Skema basis data',
// link to current database schema layout // link to current database schema layout
'Permanent link' => 'Tautan permanen', 'Permanent link' => 'Pranala permanen',
// thousands separator - must contain single byte // thousands separator - must contain single byte
',' => '.', ',' => '.',
@@ -113,9 +112,9 @@ $translations = array(
'Tables have been copied.' => 'Tabel berhasil disalin.', 'Tables have been copied.' => 'Tabel berhasil disalin.',
'Routines' => 'Rutin', 'Routines' => 'Rutin',
'Routine has been called, %d row(s) affected.' => array('Rutin telah dipanggil, %d baris terpengaruh.', 'Rutin telah dipanggil, %d baris terpengaruh'), 'Routine has been called, %d row(s) affected.' => 'Rutin telah dipanggil, %d baris terpengaruh.',
'Call' => 'Panggilan', 'Call' => 'Panggilan',
'Parameter name' => 'Nama paramater', 'Parameter name' => 'Nama parameter',
'Create procedure' => 'Buat prosedur', 'Create procedure' => 'Buat prosedur',
'Create function' => 'Buat fungsi', 'Create function' => 'Buat fungsi',
'Routine has been dropped.' => 'Rutin berhasil dihapus.', 'Routine has been dropped.' => 'Rutin berhasil dihapus.',
@@ -123,14 +122,14 @@ $translations = array(
'Routine has been created.' => 'Rutin berhasil dibuat.', 'Routine has been created.' => 'Rutin berhasil dibuat.',
'Alter function' => 'Ubah fungsi', 'Alter function' => 'Ubah fungsi',
'Alter procedure' => 'Ubah prosedur', 'Alter procedure' => 'Ubah prosedur',
'Return type' => 'Jenis balikan', 'Return type' => 'Jenis pengembalian',
'Events' => 'Peristiwa', 'Events' => 'Even',
'Event has been dropped.' => 'Peristiwa berhasil dihapus.', 'Event has been dropped.' => 'Even berhasil dihapus.',
'Event has been altered.' => 'Peristiwa berhasil diubah.', 'Event has been altered.' => 'Even berhasil diubah.',
'Event has been created.' => 'Peristiwa berhasil dibuat.', 'Event has been created.' => 'Even berhasil dibuat.',
'Alter event' => 'Ubah peristiwa', 'Alter event' => 'Ubah even',
'Create event' => 'Buat peristiwa', 'Create event' => 'Buat even',
'At given time' => 'Pada waktu tertentu', 'At given time' => 'Pada waktu tertentu',
'Every' => 'Setiap', 'Every' => 'Setiap',
'Schedule' => 'Jadwal', 'Schedule' => 'Jadwal',
@@ -141,7 +140,7 @@ $translations = array(
'Tables' => 'Tabel', 'Tables' => 'Tabel',
'Tables and views' => 'Tabel dan tampilan', 'Tables and views' => 'Tabel dan tampilan',
'Table' => 'Tabel', 'Table' => 'Tabel',
'No tables.' => 'Tiada tabel.', 'No tables.' => 'Tidak ada tabel.',
'Alter table' => 'Ubah tabel', 'Alter table' => 'Ubah tabel',
'Create table' => 'Buat tabel', 'Create table' => 'Buat tabel',
'Table has been dropped.' => 'Tabel berhasil dihapus.', 'Table has been dropped.' => 'Tabel berhasil dihapus.',
@@ -156,16 +155,16 @@ $translations = array(
'Column name' => 'Nama kolom', 'Column name' => 'Nama kolom',
'Type' => 'Jenis', 'Type' => 'Jenis',
'Length' => 'Panjang', 'Length' => 'Panjang',
'Auto Increment' => 'Kenaikan Otomatis', 'Auto Increment' => 'Inkrementasi Otomatis',
'Options' => 'Opsi', 'Options' => 'Opsi',
'Comment' => 'Komentar', 'Comment' => 'Komentar',
'Default values' => 'Nilai bawaan', 'Default values' => 'Nilai bawaan',
'Drop' => 'Hapus', 'Drop' => 'Hapus',
'Are you sure?' => 'Anda yakin', 'Are you sure?' => 'Anda yakin?',
'Move up' => 'Naik', 'Move up' => 'Naik',
'Move down' => 'Turun', 'Move down' => 'Turun',
'Remove' => 'Hapus', 'Remove' => 'Hapus',
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Jumlah ruas maksimum yang diizinkan dilewati. Harap naikkan %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Sudah lebih dumlah ruas maksimum yang diizinkan. Harap naikkan %s.',
'Partition by' => 'Partisi menurut', 'Partition by' => 'Partisi menurut',
'Partitions' => 'Partisi', 'Partitions' => 'Partisi',
@@ -202,15 +201,15 @@ $translations = array(
'ON UPDATE' => 'ON UPDATE', 'ON UPDATE' => 'ON UPDATE',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Kolom sumber dan sasaran harus memiliki jenis data yang sama. Kolom sasaran harus memiliki indeks dan data rujukan harus ada.', 'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Kolom sumber dan sasaran harus memiliki jenis data yang sama. Kolom sasaran harus memiliki indeks dan data rujukan harus ada.',
'Triggers' => 'Picu', 'Triggers' => 'Pemicu',
'Add trigger' => 'Tambah picu', 'Add trigger' => 'Tambah pemicu',
'Trigger has been dropped.' => 'Picu berhasil dihapus.', 'Trigger has been dropped.' => 'Pemicu berhasil dihapus.',
'Trigger has been altered.' => 'Picu berhasil diubah.', 'Trigger has been altered.' => 'Pemicu berhasil diubah.',
'Trigger has been created.' => 'Picu berhasil dibuat.', 'Trigger has been created.' => 'Pemicu berhasil dibuat.',
'Alter trigger' => 'Ubah picu', 'Alter trigger' => 'Ubah pemicu',
'Create trigger' => 'Buat picu', 'Create trigger' => 'Buat pemicu',
'Time' => 'Waktu', 'Time' => 'Waktu',
'Event' => 'Peristiwa', 'Event' => 'Even',
'Name' => 'Nama', 'Name' => 'Nama',
'select' => 'pilih', 'select' => 'pilih',
@@ -221,14 +220,14 @@ $translations = array(
'Search' => 'Cari', 'Search' => 'Cari',
'anywhere' => 'di mana pun', 'anywhere' => 'di mana pun',
'Search data in tables' => 'Cari data dalam tabel', 'Search data in tables' => 'Cari data dalam tabel',
'Sort' => 'Urutan', 'Sort' => 'Urutkan',
'descending' => 'menurun', 'descending' => 'menurun',
'Limit' => 'Limit', 'Limit' => 'Batas',
'Text length' => 'Panjang teks', 'Text length' => 'Panjang teks',
'Action' => 'Tindakan', 'Action' => 'Tindakan',
'Full table scan' => 'Pindai tabel lengkap', 'Full table scan' => 'Pindai tabel lengkap',
'Unable to select the table' => 'Gagal memilih tabel', 'Unable to select the table' => 'Gagal memilih tabel',
'No rows.' => 'Tiada baris.', 'No rows.' => 'Tidak ada baris.',
'%d row(s)' => '%d baris', '%d row(s)' => '%d baris',
'Page' => 'Halaman', 'Page' => 'Halaman',
'last' => 'terakhir', 'last' => 'terakhir',
@@ -239,7 +238,7 @@ $translations = array(
'%d row(s) have been imported.' => '%d baris berhasil diimpor.', '%d row(s) have been imported.' => '%d baris berhasil diimpor.',
// in-place editing in select // in-place editing in select
'Use edit link to modify this value.' => 'Gunakan tautan edit untuk mengubah nilai ini.', 'Use edit link to modify this value.' => 'Gunakan pranala suntingan untuk mengubah nilai ini.',
// %s can contain auto-increment value // %s can contain auto-increment value
'Item%s has been inserted.' => 'Entri%s berhasil disisipkan.', 'Item%s has been inserted.' => 'Entri%s berhasil disisipkan.',
@@ -247,30 +246,30 @@ $translations = array(
'Item has been updated.' => 'Entri berhasil diperbarui.', 'Item has been updated.' => 'Entri berhasil diperbarui.',
'%d item(s) have been affected.' => '%d entri terpengaruh.', '%d item(s) have been affected.' => '%d entri terpengaruh.',
'New item' => 'Entri baru', 'New item' => 'Entri baru',
'original' => 'orisinal', 'original' => 'asli',
// label for value '' in enum data type // label for value '' in enum data type
'empty' => 'kosong', 'empty' => 'kosong',
'edit' => 'edit', 'edit' => 'sunting',
'Edit' => 'Edit', 'Edit' => 'Sunting',
'Insert' => 'Sisipkan', 'Insert' => 'Sisipkan',
'Save' => 'Simpan', 'Save' => 'Simpan',
'Save and continue edit' => 'Simpan dan terus mengedit', 'Save and continue edit' => 'Simpan dan lanjut menyunting',
'Save and insert next' => 'Simpan dan sisipkan yang lain', 'Save and insert next' => 'Simpan dan sisipkan berikutnya',
'Clone' => 'Gandakan', 'Clone' => 'Gandakan',
'Delete' => 'Hapus', 'Delete' => 'Hapus',
'E-mail' => 'Surel', 'E-mail' => 'Surel',
'From' => 'Dari', 'From' => 'Dari',
'Subject' => 'Subjek', 'Subject' => 'Judul',
'Attachments' => 'Lampiran', 'Attachments' => 'Lampiran',
'Send' => 'Kirim', 'Send' => 'Kirim',
'%d e-mail(s) have been sent.' => array('%d surel berhasil dikirim.', '%d surel berhasil dikirim'), '%d e-mail(s) have been sent.' => '%d surel berhasil dikirim.',
// data type descriptions // data type descriptions
'Numbers' => 'Angka', 'Numbers' => 'Angka',
'Date and time' => 'Tanggal dan waktu', 'Date and time' => 'Tanggal dan waktu',
'Strings' => 'String', 'Strings' => 'String',
'Binary' => 'Biner', 'Binary' => 'Binari',
'Lists' => 'Daftar', 'Lists' => 'Daftar',
'Network' => 'Jaringan', 'Network' => 'Jaringan',
'Geometry' => 'Geometri', 'Geometry' => 'Geometri',
@@ -298,7 +297,7 @@ $translations = array(
'Schema has been created.' => 'Skema berhasil dibuat.', 'Schema has been created.' => 'Skema berhasil dibuat.',
'Schema has been altered.' => 'Skema berhasil diubah.', 'Schema has been altered.' => 'Skema berhasil diubah.',
'Schema' => 'Skema', 'Schema' => 'Skema',
'Invalid schema.' => 'Skema invalid.', 'Invalid schema.' => 'Skema tidak sah.',
// PostgreSQL sequences support // PostgreSQL sequences support
'Sequences' => 'Deret', 'Sequences' => 'Deret',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Password', 'Password' => 'Password',
'Select database' => 'Seleziona database', 'Select database' => 'Seleziona database',
'Invalid database.' => 'Database non valido.', 'Invalid database.' => 'Database non valido.',
'Create new database' => 'Crea nuovo database',
'Table has been dropped.' => 'Tabella eliminata.', 'Table has been dropped.' => 'Tabella eliminata.',
'Table has been altered.' => 'Tabella modificata.', 'Table has been altered.' => 'Tabella modificata.',
'Table has been created.' => 'Tabella creata.', 'Table has been created.' => 'Tabella creata.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'パスワード', 'Password' => 'パスワード',
'Select database' => 'データベースを選択してください', 'Select database' => 'データベースを選択してください',
'Invalid database.' => '不正なデータベース', 'Invalid database.' => '不正なデータベース',
'Create new database' => '新規にデータベースを作成',
'Table has been dropped.' => 'テーブルを削除しました', 'Table has been dropped.' => 'テーブルを削除しました',
'Table has been altered.' => 'テーブルを変更しました', 'Table has been altered.' => 'テーブルを変更しました',
'Table has been created.' => 'テーブルを作成しました', 'Table has been created.' => 'テーブルを作成しました',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => '비밀번호', 'Password' => '비밀번호',
'Select database' => '데이터베이스를 선택하십시오.', 'Select database' => '데이터베이스를 선택하십시오.',
'Invalid database.' => '잘못된 데이터베이스입니다.', 'Invalid database.' => '잘못된 데이터베이스입니다.',
'Create new database' => '새 데이터베이스 만들기',
'Table has been dropped.' => '테이블을 삭제했습니다.', 'Table has been dropped.' => '테이블을 삭제했습니다.',
'Table has been altered.' => '테이블을 변경했습니다.', 'Table has been altered.' => '테이블을 변경했습니다.',
'Table has been created.' => '테이블을 만들었습니다.', 'Table has been created.' => '테이블을 만들었습니다.',

View File

@@ -77,7 +77,6 @@ $translations = array(
'Use' => 'Naudoti', 'Use' => 'Naudoti',
'Select database' => 'Pasirinkti duomenų bazę', 'Select database' => 'Pasirinkti duomenų bazę',
'Invalid database.' => 'Neteisinga duomenų bazė.', 'Invalid database.' => 'Neteisinga duomenų bazė.',
'Create new database' => 'Sukurti naują duomenų bazę',
'Database has been dropped.' => 'Duomenų bazė panaikinta.', 'Database has been dropped.' => 'Duomenų bazė panaikinta.',
'Databases have been dropped.' => 'Duomenų bazės panaikintos.', 'Databases have been dropped.' => 'Duomenų bazės panaikintos.',
'Database has been created.' => 'Duomenų bazė sukurta.', 'Database has been created.' => 'Duomenų bazė sukurta.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Wachtwoord', 'Password' => 'Wachtwoord',
'Select database' => 'Database selecteren', 'Select database' => 'Database selecteren',
'Invalid database.' => 'Ongeldige database.', 'Invalid database.' => 'Ongeldige database.',
'Create new database' => 'Nieuwe database',
'Table has been dropped.' => 'Tabel verwijderd.', 'Table has been dropped.' => 'Tabel verwijderd.',
'Table has been altered.' => 'Tabel aangepast.', 'Table has been altered.' => 'Tabel aangepast.',
'Table has been created.' => 'Tabel aangemaakt.', 'Table has been created.' => 'Tabel aangemaakt.',
@@ -61,7 +60,7 @@ $translations = array(
'Action' => 'Acties', 'Action' => 'Acties',
'edit' => 'bewerk', 'edit' => 'bewerk',
'Page' => 'Pagina', 'Page' => 'Pagina',
'Query executed OK, %d row(s) affected.' => array('Query uitgevoerd, %d rij geraakt.', 'Query uitgevoerd, %d rijen geraakt.'), 'Query executed OK, %d row(s) affected.' => array('Query uitgevoerd, %d rij geraakt.', 'Query uitgevoerd, %d rijen beïnvloed.'),
'Error in query' => 'Fout in query', 'Error in query' => 'Fout in query',
'Execute' => 'Uitvoeren', 'Execute' => 'Uitvoeren',
'Table' => 'Tabel', 'Table' => 'Tabel',

View File

@@ -10,7 +10,7 @@ $translations = array(
'Logged as: %s' => 'Logget inn som: %s', 'Logged as: %s' => 'Logget inn som: %s',
'Logout successful.' => 'Utlogging vellykket.', 'Logout successful.' => 'Utlogging vellykket.',
'Invalid credentials.' => 'Ugylding innloggingsinformasjon.', 'Invalid credentials.' => 'Ugylding innloggingsinformasjon.',
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Master-passord er utløpt. <a href="https://www.adminer.org/en/extension/" target="_blank">Implementer</a> en metode for %s for å gjøre det permanent.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Master-passord er utløpt. <a href="https://www.adminer.org/en/extension/"%s>Implementer</a> en metode for %s for å gjøre det permanent.',
'Language' => 'Språk', 'Language' => 'Språk',
'Invalid CSRF token. Send the form again.' => 'Ugylding CSRF-token - Send inn skjemaet igjen.', 'Invalid CSRF token. Send the form again.' => 'Ugylding CSRF-token - Send inn skjemaet igjen.',
'No extension' => 'Ingen utvidelse', 'No extension' => 'Ingen utvidelse',
@@ -68,7 +68,6 @@ $translations = array(
'Use' => 'Bruk', 'Use' => 'Bruk',
'Select database' => 'Velg database', 'Select database' => 'Velg database',
'Invalid database.' => 'Ugyldig database.', 'Invalid database.' => 'Ugyldig database.',
'Create new database' => 'Lag ny database',
'Database has been dropped.' => 'Databasen har blitt slettet.', 'Database has been dropped.' => 'Databasen har blitt slettet.',
'Databases have been dropped.' => 'Databasene har blitt slettet.', 'Databases have been dropped.' => 'Databasene har blitt slettet.',
'Database has been created.' => 'Databasen er opprettet.', 'Database has been created.' => 'Databasen er opprettet.',

View File

@@ -12,7 +12,7 @@ $translations = array(
'Logout successful.' => 'Wylogowano pomyślnie.', 'Logout successful.' => 'Wylogowano pomyślnie.',
'Invalid credentials.' => 'Nieprawidłowe dane logowania.', 'Invalid credentials.' => 'Nieprawidłowe dane logowania.',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Za dużo nieudanych prób logowania, spróbuj ponownie za %d minutę.', 'Za dużo nieudanych prób logowania, spróbuj ponownie za %d minuty.', 'Za dużo nieudanych prób logowania, spróbuj ponownie za %d minut.'), 'Too many unsuccessful logins, try again in %d minute(s).' => array('Za dużo nieudanych prób logowania, spróbuj ponownie za %d minutę.', 'Za dużo nieudanych prób logowania, spróbuj ponownie za %d minuty.', 'Za dużo nieudanych prób logowania, spróbuj ponownie za %d minut.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Ważność hasła głównego wygasła. <a href="https://www.adminer.org/pl/extension/" target="_blank">Zaimplementuj</a> własną metodę %s, aby ustawić je na stałe.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Ważność hasła głównego wygasła. <a href="https://www.adminer.org/pl/extension/"%s>Zaimplementuj</a> własną metodę %s, aby ustawić je na stałe.',
'Language' => 'Język', 'Language' => 'Język',
'Invalid CSRF token. Send the form again.' => 'Nieprawidłowy token CSRF. Spróbuj wysłać formularz ponownie.', 'Invalid CSRF token. Send the form again.' => 'Nieprawidłowy token CSRF. Spróbuj wysłać formularz ponownie.',
'If you did not send this request from Adminer then close this page.' => 'Jeżeli nie wywołałeś tej strony z Adminera, zamknij to okno.', 'If you did not send this request from Adminer then close this page.' => 'Jeżeli nie wywołałeś tej strony z Adminera, zamknij to okno.',
@@ -82,7 +82,6 @@ $translations = array(
'Use' => 'Wybierz', 'Use' => 'Wybierz',
'Select database' => 'Wybierz bazę danych', 'Select database' => 'Wybierz bazę danych',
'Invalid database.' => 'Nie znaleziono bazy danych.', 'Invalid database.' => 'Nie znaleziono bazy danych.',
'Create new database' => 'Utwórz nową bazę danych',
'Database has been dropped.' => 'Baza danych została usunięta.', 'Database has been dropped.' => 'Baza danych została usunięta.',
'Databases have been dropped.' => 'Bazy danych zostały usunięte.', 'Databases have been dropped.' => 'Bazy danych zostały usunięte.',
'Database has been created.' => 'Baza danych została utworzona.', 'Database has been created.' => 'Baza danych została utworzona.',
@@ -182,13 +181,12 @@ $translations = array(
'Values' => 'Wartości', 'Values' => 'Wartości',
'View' => 'Perspektywa', 'View' => 'Perspektywa',
'Materialized View' => 'Zmaterializowana perspektywa', 'Materialized view' => 'Zmaterializowana perspektywa',
'View has been dropped.' => 'Perspektywa została usunięta.', 'View has been dropped.' => 'Perspektywa została usunięta.',
'View has been altered.' => 'Perspektywa została zmieniona.', 'View has been altered.' => 'Perspektywa została zmieniona.',
'View has been created.' => 'Perspektywa została utworzona.', 'View has been created.' => 'Perspektywa została utworzona.',
'Alter view' => 'Zmień perspektywę', 'Alter view' => 'Zmień perspektywę',
'Create view' => 'Utwórz perspektywę', 'Create view' => 'Utwórz perspektywę',
'Create materialized view' => 'Utwórz zmaterializowaną perspektywę',
'Indexes' => 'Indeksy', 'Indexes' => 'Indeksy',
'Indexes have been altered.' => 'Indeksy zostały zmienione.', 'Indexes have been altered.' => 'Indeksy zostały zmienione.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Senha', 'Password' => 'Senha',
'Select database' => 'Selecionar Base de dados', 'Select database' => 'Selecionar Base de dados',
'Invalid database.' => 'Base de dados inválida.', 'Invalid database.' => 'Base de dados inválida.',
'Create new database' => 'Criar nova base de dados',
'Table has been dropped.' => 'A Tabela foi eliminada.', 'Table has been dropped.' => 'A Tabela foi eliminada.',
'Table has been altered.' => 'A Tabela foi alterada.', 'Table has been altered.' => 'A Tabela foi alterada.',
'Table has been created.' => 'A Tabela foi criada.', 'Table has been created.' => 'A Tabela foi criada.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Senha', 'Password' => 'Senha',
'Select database' => 'Selecionar Base de dados', 'Select database' => 'Selecionar Base de dados',
'Invalid database.' => 'Base de dados inválida.', 'Invalid database.' => 'Base de dados inválida.',
'Create new database' => 'Criar nova base de dados',
'Table has been dropped.' => 'Tabela eliminada.', 'Table has been dropped.' => 'Tabela eliminada.',
'Table has been altered.' => 'Tabela modificada.', 'Table has been altered.' => 'Tabela modificada.',
'Table has been created.' => 'Tabela criada.', 'Table has been created.' => 'Tabela criada.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Parola', 'Password' => 'Parola',
'Select database' => 'Alege baza de date', 'Select database' => 'Alege baza de date',
'Invalid database.' => 'Bază de deate invalidă.', 'Invalid database.' => 'Bază de deate invalidă.',
'Create new database' => 'Crează o bază de date nouă',
'Table has been dropped.' => 'Tabelul a fost șters.', 'Table has been dropped.' => 'Tabelul a fost șters.',
'Table has been altered.' => 'Tabelul a fost modificat.', 'Table has been altered.' => 'Tabelul a fost modificat.',
'Table has been created.' => 'Tabelul a fost creat.', 'Table has been created.' => 'Tabelul a fost creat.',

View File

@@ -7,15 +7,14 @@ $translations = array(
'Username' => 'Имя пользователя', 'Username' => 'Имя пользователя',
'Password' => 'Пароль', 'Password' => 'Пароль',
'Select database' => 'Выбрать базу данных', 'Select database' => 'Выбрать базу данных',
'Invalid database.' => 'Плохая база данных.', 'Invalid database.' => 'Неверная база данных.',
'Create new database' => 'Создать новую базу данных',
'Table has been dropped.' => 'Таблица была удалена.', 'Table has been dropped.' => 'Таблица была удалена.',
'Table has been altered.' => 'Таблица была изменена.', 'Table has been altered.' => 'Таблица была изменена.',
'Table has been created.' => 'Таблица была создана.', 'Table has been created.' => 'Таблица была создана.',
'Alter table' => 'Изменить таблицу', 'Alter table' => 'Изменить таблицу',
'Create table' => 'Создать таблицу', 'Create table' => 'Создать таблицу',
'Table name' => 'Название таблицы', 'Table name' => 'Название таблицы',
'engine' => 'тип', 'engine' => 'Тип таблицы',
'collation' => 'режим сопоставления', 'collation' => 'режим сопоставления',
'Column name' => 'Название поля', 'Column name' => 'Название поля',
'Type' => 'Тип', 'Type' => 'Тип',
@@ -30,7 +29,7 @@ $translations = array(
'Database has been altered.' => 'База данных была изменена.', 'Database has been altered.' => 'База данных была изменена.',
'Alter database' => 'Изменить базу данных', 'Alter database' => 'Изменить базу данных',
'Create database' => 'Создать базу данных', 'Create database' => 'Создать базу данных',
'SQL command' => 'SQL запрос', 'SQL command' => 'SQL-запрос',
'Logout' => 'Выйти', 'Logout' => 'Выйти',
'database' => 'база данных', 'database' => 'база данных',
'Use' => 'Выбрать', 'Use' => 'Выбрать',
@@ -68,7 +67,7 @@ $translations = array(
'Triggers' => 'Триггеры', 'Triggers' => 'Триггеры',
'View' => 'Представление', 'View' => 'Представление',
'Unable to select the table' => 'Не удалось получить данные из таблицы', 'Unable to select the table' => 'Не удалось получить данные из таблицы',
'Invalid CSRF token. Send the form again.' => 'Недействительный CSRF токен. Отправите форму ещё раз.', 'Invalid CSRF token. Send the form again.' => 'Недействительный CSRF-токен. Отправите форму ещё раз.',
'Comment' => 'Комментарий', 'Comment' => 'Комментарий',
'Default values' => 'Значения по умолчанию', 'Default values' => 'Значения по умолчанию',
'%d byte(s)' => array('%d байт', '%d байта', '%d байтов'), '%d byte(s)' => array('%d байт', '%d байта', '%d байтов'),
@@ -91,13 +90,13 @@ $translations = array(
'Change' => 'Изменить', 'Change' => 'Изменить',
'Source' => 'Источник', 'Source' => 'Источник',
'Target' => 'Цель', 'Target' => 'Цель',
'Add column' => 'Добавить колонку', 'Add column' => 'Добавить поле',
'Alter' => 'Изменить', 'Alter' => 'Изменить',
'Add foreign key' => 'Добавить внешний ключ', 'Add foreign key' => 'Добавить внешний ключ',
'ON DELETE' => 'При стирании', 'ON DELETE' => 'При стирании',
'ON UPDATE' => 'При обновлении', 'ON UPDATE' => 'При обновлении',
'Index Type' => 'Тип индекса', 'Index Type' => 'Тип индекса',
'Column (length)' => 'Колонка (длина)', 'Column (length)' => 'Поле (длина)',
'View has been dropped.' => 'Представление было удалено.', 'View has been dropped.' => 'Представление было удалено.',
'View has been altered.' => 'Представление было изменено.', 'View has been altered.' => 'Представление было изменено.',
'View has been created.' => 'Представление было создано.', 'View has been created.' => 'Представление было создано.',
@@ -135,11 +134,11 @@ $translations = array(
'User has been altered.' => 'Пользователь был изменён.', 'User has been altered.' => 'Пользователь был изменён.',
'User has been created.' => 'Пользователь был создан.', 'User has been created.' => 'Пользователь был создан.',
'Hashed' => 'Хешировано', 'Hashed' => 'Хешировано',
'Column' => 'Колонка', 'Column' => 'поле',
'Routine' => 'Процедура', 'Routine' => 'Процедура',
'Grant' => 'Позволить', 'Grant' => 'Позволить',
'Revoke' => 'Запретить', 'Revoke' => 'Запретить',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Слишком большой объем POST-данных. Пошлите меньший объем данных или увеличьте параметр конфигурационной директивы %s.', 'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Слишком большой объем POST-данных. Пошлите меньший объём данных или увеличьте параметр конфигурационной директивы %s.',
'Logged as: %s' => 'Вы вошли как: %s', 'Logged as: %s' => 'Вы вошли как: %s',
'Move up' => 'Переместить вверх', 'Move up' => 'Переместить вверх',
'Move down' => 'Переместить вниз', 'Move down' => 'Переместить вниз',
@@ -182,7 +181,7 @@ $translations = array(
'Tables have been moved.' => 'Таблицы были перемещены.', 'Tables have been moved.' => 'Таблицы были перемещены.',
'Move to other database' => 'Переместить в другую базу данных', 'Move to other database' => 'Переместить в другую базу данных',
'Move' => 'Переместить', 'Move' => 'Переместить',
'Engine' => 'Тип', 'Engine' => 'Тип таблиц',
'Save and continue edit' => 'Сохранить и продолжить редактирование', 'Save and continue edit' => 'Сохранить и продолжить редактирование',
'original' => 'исходный', 'original' => 'исходный',
'%d item(s) have been affected.' => array('Была изменена %d запись.', 'Были изменены %d записи.', 'Было изменено %d записей.'), '%d item(s) have been affected.' => array('Была изменена %d запись.', 'Были изменены %d записи.', 'Было изменено %d записей.'),
@@ -203,20 +202,20 @@ $translations = array(
'[yyyy]-mm-dd' => 'дд.мм.[гггг]', '[yyyy]-mm-dd' => 'дд.мм.[гггг]',
'History' => 'История', 'History' => 'История',
'Variables' => 'Переменные', 'Variables' => 'Переменные',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Колонки должны иметь одинаковые типы данных, в результирующей колонке должен быть индекс, данные для импорта должны существовать.', 'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Поля должны иметь одинаковые типы данных, в результирующем поле должен быть индекс, данные для импорта должны существовать.',
'Relations' => 'Реляции', 'Relations' => 'Отношения',
'Run file' => 'Запустить файл', 'Run file' => 'Запустить файл',
'Clear' => 'Очистить', 'Clear' => 'Очистить',
'Maximum allowed file size is %sB.' => 'Максимальный разрешённый размер файла - %sB.', 'Maximum allowed file size is %sB.' => 'Максимальный разрешённый размер файла %sB.',
'Numbers' => 'Число', 'Numbers' => 'Числа',
'Date and time' => 'Дата и время', 'Date and time' => 'Дата и время',
'Strings' => 'Строки', 'Strings' => 'Строки',
'Binary' => 'Двоичный тип', 'Binary' => 'Двоичный тип',
'Lists' => 'Списки', 'Lists' => 'Списки',
'Editor' => 'Редактор', 'Editor' => 'Редактор',
'E-mail' => 'Электропочта', 'E-mail' => 'Эл. почта',
'From' => 'От', 'From' => 'От',
'Subject' => 'Кому', 'Subject' => 'Тема',
'Send' => 'Послать', 'Send' => 'Послать',
'%d e-mail(s) have been sent.' => array('Было отправлено %d письмо.', 'Было отправлено %d письма.', 'Было отправлено %d писем.'), '%d e-mail(s) have been sent.' => array('Было отправлено %d письмо.', 'Было отправлено %d письма.', 'Было отправлено %d писем.'),
'Webserver file %s' => 'Файл %s на вебсервере', 'Webserver file %s' => 'Файл %s на вебсервере',
@@ -242,7 +241,7 @@ $translations = array(
'Alter type' => 'Изменить тип', 'Alter type' => 'Изменить тип',
'Type has been dropped.' => 'Тип удален.', 'Type has been dropped.' => 'Тип удален.',
'Type has been created.' => 'Создан новый тип.', 'Type has been created.' => 'Создан новый тип.',
'Ctrl+click on a value to modify it.' => 'Ctrl+кликни по значению, чтобы его изменить.', 'Ctrl+click on a value to modify it.' => 'Выполните Ctrl+Щелчок мышью по значению, чтобы его изменить.',
'Use edit link to modify this value.' => 'Изменить это значение можно с помощью ссылки «изменить».', 'Use edit link to modify this value.' => 'Изменить это значение можно с помощью ссылки «изменить».',
'last' => 'последняя', 'last' => 'последняя',
'From server' => 'С сервера', 'From server' => 'С сервера',
@@ -266,4 +265,29 @@ $translations = array(
'Permanent link' => 'Постоянная ссылка', 'Permanent link' => 'Постоянная ссылка',
'Edit all' => 'Редактировать всё', 'Edit all' => 'Редактировать всё',
'HH:MM:SS' => 'ЧЧ:ММ:СС', 'HH:MM:SS' => 'ЧЧ:ММ:СС',
'Tables have been optimized.' => 'Таблицы оптимизированы.',
'Materialized view' => 'Материализованное представление',
'Vacuum' => 'Вакуум',
'Selected' => 'Выбранные',
'File must be in UTF-8 encoding.' => 'Файл должен быть в кодировке UTF-8.',
'Modify' => 'Изменить',
'Loading' => 'Загрузка',
'Load more data' => 'Загрузить ещё данные',
'ATTACH queries are not supported.' => 'ATTACH-запросы не поддерживаются.',
'%d / ' => '%d / ',
'Limit rows' => 'Лимит строк',
'<a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to use SQLite.' => '<a href="https://www.adminer.org/en/extension/"%s>Реализуйте</a> метод %s, чтобы использовать SQLite.',
'Default value' => 'Значение по умолчанию',
'Full table scan' => 'Анализ полной таблицы',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Слишком много неудачных попыток входа. Попробуйте снова через %d минуту.', 'Слишком много неудачных попыток входа. Попробуйте снова через %d минуты.', 'Слишком много неудачных попыток входа. Попробуйте снова через %d минут.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Мастер-пароль истёк. <a href="https://www.adminer.org/en/extension/"%s>Реализуйте</a> метод %s, чтобы сделать его постоянным.',
'If you did not send this request from Adminer then close this page.' => 'Если вы не посылали этот запрос из Adminer, закройте эту страницу.',
'You can upload a big SQL file via FTP and import it from server.' => 'Вы можете закачать большой SQL-файл по FTP и затем импортировать его с сервера.',
'Size' => 'Размер',
'Compute' => 'Вычислить',
'You are offline.' => 'Вы не выполнили вход.',
'You have no privileges to update this table.' => 'У вас нет прав на обновление этой таблицы.',
'Saving' => 'Сохранение',
'yes' => 'Да',
'no' => 'Нет',
); );

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'Heslo', 'Password' => 'Heslo',
'Select database' => 'Vybrať databázu', 'Select database' => 'Vybrať databázu',
'Invalid database.' => 'Nesprávna databáza.', 'Invalid database.' => 'Nesprávna databáza.',
'Create new database' => 'Vytvoriť novú databázu',
'Table has been dropped.' => 'Tabuľka bola odstránená.', 'Table has been dropped.' => 'Tabuľka bola odstránená.',
'Table has been altered.' => 'Tabuľka bola zmenená.', 'Table has been altered.' => 'Tabuľka bola zmenená.',
'Table has been created.' => 'Tabuľka bola vytvorená.', 'Table has been created.' => 'Tabuľka bola vytvorená.',

View File

@@ -76,7 +76,6 @@ $translations = array(
'Use' => 'Uporabi', 'Use' => 'Uporabi',
'Select database' => 'Izberi bazo', 'Select database' => 'Izberi bazo',
'Invalid database.' => 'Neveljavna baza.', 'Invalid database.' => 'Neveljavna baza.',
'Create new database' => 'Ustvari novo bazo',
'Database has been dropped.' => 'Baza je zavržena.', 'Database has been dropped.' => 'Baza je zavržena.',
'Databases have been dropped.' => 'Baze so zavržene.', 'Databases have been dropped.' => 'Baze so zavržene.',
'Database has been created.' => 'Baza je ustvarjena.', 'Database has been created.' => 'Baza je ustvarjena.',

View File

@@ -77,7 +77,6 @@ $translations = array(
'Use' => 'Користи', 'Use' => 'Користи',
'Select database' => 'Изаберите базу', 'Select database' => 'Изаберите базу',
'Invalid database.' => 'Неисправна база података.', 'Invalid database.' => 'Неисправна база података.',
'Create new database' => 'Направи нову базу података',
'Database has been dropped.' => 'База података је избрисана.', 'Database has been dropped.' => 'База података је избрисана.',
'Databases have been dropped.' => 'Базњ података су избрисане.', 'Databases have been dropped.' => 'Базњ података су избрисане.',
'Database has been created.' => 'База података је креирана.', 'Database has been created.' => 'База података је креирана.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'க‌ட‌வுச்சொல்', 'Password' => 'க‌ட‌வுச்சொல்',
'Select database' => 'த‌க‌வ‌ல்த‌ள‌த்தை தேர்வு செய்', 'Select database' => 'த‌க‌வ‌ல்த‌ள‌த்தை தேர்வு செய்',
'Invalid database.' => 'த‌க‌வ‌ல்த‌ள‌ம் ச‌ரியானதல்ல‌.', 'Invalid database.' => 'த‌க‌வ‌ல்த‌ள‌ம் ச‌ரியானதல்ல‌.',
'Create new database' => 'புதிய‌ த‌க‌வ‌ல்த‌ள‌த்தை உருவாக்கு',
'Table has been dropped.' => 'அட்ட‌வ‌ணை நீக்க‌ப்ப‌ட்ட‌து.', 'Table has been dropped.' => 'அட்ட‌வ‌ணை நீக்க‌ப்ப‌ட்ட‌து.',
'Table has been altered.' => 'அட்ட‌வணை மாற்ற‌ப்ப‌ட்ட‌து.', 'Table has been altered.' => 'அட்ட‌வணை மாற்ற‌ப்ப‌ட்ட‌து.',
'Table has been created.' => 'அட்ட‌வ‌ணை உருவாக்க‌ப்ப‌ட்ட‌து.', 'Table has been created.' => 'அட்ட‌வ‌ணை உருவாக்க‌ப்ப‌ட்ட‌து.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => 'รหัสผ่าน', 'Password' => 'รหัสผ่าน',
'Select database' => 'เลือกฐานข้อมูล', 'Select database' => 'เลือกฐานข้อมูล',
'Invalid database.' => 'ฐานข้อมูลไม่ถูกต้อง.', 'Invalid database.' => 'ฐานข้อมูลไม่ถูกต้อง.',
'Create new database' => 'สร้างฐานข้อมูลใหม่',
'Table has been dropped.' => 'ลบตารางแล้ว.', 'Table has been dropped.' => 'ลบตารางแล้ว.',
'Table has been altered.' => 'แก้ไขตารางแล้ว.', 'Table has been altered.' => 'แก้ไขตารางแล้ว.',
'Table has been created.' => 'สร้างตารางใหม่แล้ว.', 'Table has been created.' => 'สร้างตารางใหม่แล้ว.',

View File

@@ -77,7 +77,6 @@ $translations = array(
'Use' => 'Kullan', 'Use' => 'Kullan',
'Select database' => 'Veri tabanı seç', 'Select database' => 'Veri tabanı seç',
'Invalid database.' => 'Geçersiz veri tabanı.', 'Invalid database.' => 'Geçersiz veri tabanı.',
'Create new database' => 'Yeni veri tabanı oluştur',
'Database has been dropped.' => 'Veri tabanı silindi.', 'Database has been dropped.' => 'Veri tabanı silindi.',
'Databases have been dropped.' => 'Veritabanları silindi.', 'Databases have been dropped.' => 'Veritabanları silindi.',
'Database has been created.' => 'Veri tabanı oluşturuldu.', 'Database has been created.' => 'Veri tabanı oluşturuldu.',

View File

@@ -77,7 +77,6 @@ $translations = array(
'Use' => 'Обрати', 'Use' => 'Обрати',
'Select database' => 'Обрати базу даних', 'Select database' => 'Обрати базу даних',
'Invalid database.' => 'Погана база даних.', 'Invalid database.' => 'Погана база даних.',
'Create new database' => 'Створити нову базу даних',
'Database has been dropped.' => 'Базу даних було видалено.', 'Database has been dropped.' => 'Базу даних було видалено.',
'Databases have been dropped.' => 'Бази даних були видалені.', 'Databases have been dropped.' => 'Бази даних були видалені.',
'Database has been created.' => 'Базу даних було створено.', 'Database has been created.' => 'Базу даних було створено.',

View File

@@ -12,7 +12,7 @@ $translations = array(
'Logout successful.' => 'Đã thoát xong.', 'Logout successful.' => 'Đã thoát xong.',
'Invalid credentials.' => 'Tài khoản sai.', 'Invalid credentials.' => 'Tài khoản sai.',
'Too many unsuccessful logins, try again in %d minute(s).' => 'Bạn gõ sai tài khoản quá nhiều lần, hãy thử lại sau %d phút nữa.', 'Too many unsuccessful logins, try again in %d minute(s).' => 'Bạn gõ sai tài khoản quá nhiều lần, hãy thử lại sau %d phút nữa.',
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Mật khẩu đã hết hạn. <a href="https://www.adminer.org/en/extension/" target="_blank">Thử cách làm</a> để giữ cố định.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Mật khẩu đã hết hạn. <a href="https://www.adminer.org/en/extension/"%s>Thử cách làm</a> để giữ cố định.',
'Language' => 'Ngôn ngữ', 'Language' => 'Ngôn ngữ',
'Invalid CSRF token. Send the form again.' => 'Mã kiểm tra CSRF sai, hãy nhập lại biểu mẫu.', 'Invalid CSRF token. Send the form again.' => 'Mã kiểm tra CSRF sai, hãy nhập lại biểu mẫu.',
'No extension' => 'Không có phần mở rộng', 'No extension' => 'Không có phần mở rộng',
@@ -80,7 +80,6 @@ $translations = array(
'Use' => 'Sử dụng', 'Use' => 'Sử dụng',
'Select database' => 'Chọn CSDL', 'Select database' => 'Chọn CSDL',
'Invalid database.' => 'CSDL sai.', 'Invalid database.' => 'CSDL sai.',
'Create new database' => 'Tạo CSDL',
'Database has been dropped.' => 'CSDL đã bị xoá.', 'Database has been dropped.' => 'CSDL đã bị xoá.',
'Databases have been dropped.' => 'Các CSDL đã bị xoá.', 'Databases have been dropped.' => 'Các CSDL đã bị xoá.',
'Database has been created.' => 'Đã tạo CSDL.', 'Database has been created.' => 'Đã tạo CSDL.',

View File

@@ -10,15 +10,17 @@ $translations = array(
'Logout' => 'Xx', 'Logout' => 'Xx',
'Logged as: %s' => 'Xx', 'Logged as: %s' => 'Xx',
'Logout successful.' => 'Xx.', 'Logout successful.' => 'Xx.',
'Thanks for using Adminer, consider <a href="%s">donating</a>.' => 'Xx.',
'Invalid credentials.' => 'Xx.', 'Invalid credentials.' => 'Xx.',
'Implement %s method to use SQLite.' => 'Xx.', '<a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to use SQLite.' => 'Xx.',
'Too many unsuccessful logins, try again in %d minute(s).' => array('Xx.', 'Xx.'), 'Too many unsuccessful logins, try again in %d minute(s).' => array('Xx.', 'Xx.'),
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Xx.', 'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Xx.',
'Language' => 'Xx', 'Language' => 'Xx',
'Invalid CSRF token. Send the form again.' => 'Xx.', 'Invalid CSRF token. Send the form again.' => 'Xx.',
'If you did not send this request from Adminer then close this page.' => 'Xx.', 'If you did not send this request from Adminer then close this page.' => 'Xx.',
'No extension' => 'Xx', 'No extension' => 'Xx',
'None of the supported PHP extensions (%s) are available.' => 'Xx.', 'None of the supported PHP extensions (%s) are available.' => 'Xx.',
'Connecting to privileged ports is not allowed.' => 'Xx.',
'Session support must be enabled.' => 'Xx.', 'Session support must be enabled.' => 'Xx.',
'Session expired, please login again.' => 'Xx.', 'Session expired, please login again.' => 'Xx.',
'%s version: %s through PHP extension %s' => 'Xx', '%s version: %s through PHP extension %s' => 'Xx',
@@ -85,7 +87,6 @@ $translations = array(
'Use' => 'Xx', 'Use' => 'Xx',
'Select database' => 'Xx', 'Select database' => 'Xx',
'Invalid database.' => 'Xx.', 'Invalid database.' => 'Xx.',
'Create new database' => 'Xx',
'Database has been dropped.' => 'Xx.', 'Database has been dropped.' => 'Xx.',
'Databases have been dropped.' => 'Xx.', 'Databases have been dropped.' => 'Xx.',
'Database has been created.' => 'Xx.', 'Database has been created.' => 'Xx.',
@@ -171,7 +172,8 @@ $translations = array(
'Default value' => 'Xx', 'Default value' => 'Xx',
'Default values' => 'Xx', 'Default values' => 'Xx',
'Drop' => 'Xx', 'Drop' => 'Xx',
'Are you sure?' => 'Xx', 'Drop %s?' => 'Xx?',
'Are you sure?' => 'Xx?',
'Size' => 'Xx', 'Size' => 'Xx',
'Compute' => 'Xx', 'Compute' => 'Xx',
'Move up' => 'Xx', 'Move up' => 'Xx',
@@ -185,13 +187,12 @@ $translations = array(
'Values' => 'Xx', 'Values' => 'Xx',
'View' => 'Xx', 'View' => 'Xx',
'Materialized View' => 'Xx', 'Materialized view' => 'Xx',
'View has been dropped.' => 'Xx.', 'View has been dropped.' => 'Xx.',
'View has been altered.' => 'Xx.', 'View has been altered.' => 'Xx.',
'View has been created.' => 'Xx.', 'View has been created.' => 'Xx.',
'Alter view' => 'Xx', 'Alter view' => 'Xx',
'Create view' => 'Xx', 'Create view' => 'Xx',
'Create materialized view' => 'Xx',
'Indexes' => 'Xx', 'Indexes' => 'Xx',
'Indexes have been altered.' => 'Xx.', 'Indexes have been altered.' => 'Xx.',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => '密碼', 'Password' => '密碼',
'Select database' => '選擇資料庫', 'Select database' => '選擇資料庫',
'Invalid database.' => '無效的資料庫。', 'Invalid database.' => '無效的資料庫。',
'Create new database' => '建立新資料庫',
'Table has been altered.' => '資料表已修改。', 'Table has been altered.' => '資料表已修改。',
'Table has been created.' => '資料表已修改。', 'Table has been created.' => '資料表已修改。',
'Alter table' => '修改資料表', 'Alter table' => '修改資料表',

View File

@@ -8,7 +8,6 @@ $translations = array(
'Password' => '密码', 'Password' => '密码',
'Select database' => '选择数据库', 'Select database' => '选择数据库',
'Invalid database.' => '无效数据库。', 'Invalid database.' => '无效数据库。',
'Create new database' => '创建新数据库',
'Table has been dropped.' => '已删除表。', 'Table has been dropped.' => '已删除表。',
'Table has been altered.' => '已修改表。', 'Table has been altered.' => '已修改表。',
'Table has been created.' => '已创建表。', 'Table has been created.' => '已创建表。',

View File

@@ -17,7 +17,7 @@ function adminer_object() {
new AdminerDumpXml, new AdminerDumpXml,
new AdminerDumpAlter, new AdminerDumpAlter,
//~ new AdminerSqlLog("past-" . rtrim(`git describe --tags --abbrev=0`) . ".sql"), //~ new AdminerSqlLog("past-" . rtrim(`git describe --tags --abbrev=0`) . ".sql"),
//~ new AdminerEditCalendar("<script type='text/javascript' src='../externals/jquery-ui/jquery-1.4.4.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.core.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.widget.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.datepicker.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.mouse.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.slider.js'></script>\n<script type='text/javascript' src='../externals/jquery-timepicker/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' href='../externals/jquery-ui/themes/base/jquery.ui.all.css'>\n<style type='text/css'>\n.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }\n.ui-timepicker-div dl { text-align: left; }\n.ui-timepicker-div dl dt { height: 25px; }\n.ui-timepicker-div dl dd { margin: -25px 0 10px 65px; }\n.ui-timepicker-div td { font-size: 90%; }\n</style>\n", "../externals/jquery-ui/ui/i18n/jquery.ui.datepicker-%s.js"), //~ new AdminerEditCalendar(script_src("../externals/jquery-ui/jquery-1.4.4.js") . script_src("../externals/jquery-ui/ui/jquery.ui.core.js") . script_src("../externals/jquery-ui/ui/jquery.ui.widget.js") . script_src("../externals/jquery-ui/ui/jquery.ui.datepicker.js") . script_src("../externals/jquery-ui/ui/jquery.ui.mouse.js") . script_src("../externals/jquery-ui/ui/jquery.ui.slider.js") . script_src("../externals/jquery-timepicker/jquery-ui-timepicker-addon.js") . "<link rel='stylesheet' href='../externals/jquery-ui/themes/base/jquery.ui.all.css'>\n<style>\n.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }\n.ui-timepicker-div dl { text-align: left; }\n.ui-timepicker-div dl dt { height: 25px; }\n.ui-timepicker-div dl dd { margin: -25px 0 10px 65px; }\n.ui-timepicker-div td { font-size: 90%; }\n</style>\n", "../externals/jquery-ui/ui/i18n/jquery.ui.datepicker-%s.js"),
//~ new AdminerTinymce("../externals/tinymce/jscripts/tiny_mce/tiny_mce_dev.js"), //~ new AdminerTinymce("../externals/tinymce/jscripts/tiny_mce/tiny_mce_dev.js"),
//~ new AdminerWymeditor(array("../externals/wymeditor/src/jquery/jquery.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.explorer.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.mozilla.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.opera.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.safari.js")), //~ new AdminerWymeditor(array("../externals/wymeditor/src/jquery/jquery.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.explorer.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.mozilla.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.opera.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.safari.js")),
new AdminerFileUpload(""), new AdminerFileUpload(""),

View File

@@ -1,6 +1,8 @@
<?php <?php
page_header(lang('Privileges')); page_header(lang('Privileges'));
echo '<p class="links"><a href="' . h(ME) . 'user=">' . lang('Create user') . "</a>";
$result = $connection->query("SELECT User, Host FROM mysql." . (DB == "" ? "user" : "db WHERE " . q(DB) . " LIKE Db") . " ORDER BY Host, User"); $result = $connection->query("SELECT User, Host FROM mysql." . (DB == "" ? "user" : "db WHERE " . q(DB) . " LIKE Db") . " ORDER BY Host, User");
$grant = $result; $grant = $result;
if (!$result) { if (!$result) {
@@ -25,5 +27,3 @@ if (!$grant || DB != "") {
echo "</table>\n"; echo "</table>\n";
echo "</form>\n"; echo "</form>\n";
echo '<p class="links"><a href="' . h(ME) . 'user=">' . lang('Create user') . "</a>";

View File

@@ -49,6 +49,6 @@ if (isset($_GET["function"])) {
<p><?php textarea("definition", $row["definition"]); ?> <p><?php textarea("definition", $row["definition"]); ?>
<p> <p>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($PROCEDURE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?> <?php if ($PROCEDURE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $PROCEDURE)); ?><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -13,8 +13,9 @@ page_header(lang('Process list'), $error);
?> ?>
<form action="" method="post"> <form action="" method="post">
<table cellspacing="0" onclick="tableClick(event);" ondblclick="tableClick(event, true);" class="nowrap checkable"> <table cellspacing="0" class="nowrap checkable">
<?php <?php
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
// HTML valid because there is always at least one process // HTML valid because there is always at least one process
$i = -1; $i = -1;
foreach (process_list() as $i => $row) { foreach (process_list() as $i => $row) {
@@ -44,7 +45,7 @@ foreach (process_list() as $i => $row) {
} }
?> ?>
</table> </table>
<script type='text/javascript'>tableCheck();</script> <?php echo script("tableCheck();"); ?>
<p> <p>
<?php <?php
if (support("kill")) { if (support("kill")) {

View File

@@ -48,19 +48,19 @@ foreach (table_status('', true) as $table => $table_status) {
} }
?> ?>
<div id="schema" style="height: <?php echo $top; ?>em;" onselectstart="return false;"> <div id="schema" style="height: <?php echo $top; ?>em;">
<script type="text/javascript"> <script<?php echo nonce(); ?>>
qs('#schema').onselectstart = function () { return false; };
var tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>}; var tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
var em = document.getElementById('schema').offsetHeight / <?php echo $top; ?>; var em = qs('#schema').offsetHeight / <?php echo $top; ?>;
document.onmousemove = schemaMousemove; document.onmousemove = schemaMousemove;
document.onmouseup = function (ev) { document.onmouseup = partialArg(schemaMouseup, '<?php echo js_escape(DB); ?>');
schemaMouseup(ev, '<?php echo js_escape(DB); ?>');
};
</script> </script>
<?php <?php
foreach ($schema as $name => $table) { foreach ($schema as $name => $table) {
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schemaMousedown(this, event);'>"; 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 '<a href="' . h(ME) . 'table=' . urlencode($name) . '"><b>' . h($name) . "</b></a>";
echo script("qsl('div').onmousedown = schemaMousedown;");
foreach ($table["fields"] as $field) { foreach ($table["fields"] as $field) {
$val = '<span' . type_class($field["type"]) . ' title="' . h($field["full_type"] . ($field["null"] ? " NULL" : '')) . '">' . h($field["field"]) . '</span>'; $val = '<span' . type_class($field["type"]) . ' title="' . h($field["full_type"] . ($field["null"] ? " NULL" : '')) . '">' . h($field["field"]) . '</span>';

View File

@@ -27,11 +27,11 @@ if (!$row) {
<form action="" method="post"> <form action="" method="post">
<p><input name="name" id="name" value="<?php echo h($row["name"]); ?>" autocapitalize="off"> <p><input name="name" id="name" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
<script type='text/javascript'>focus(document.getElementById('name'));</script> <?php echo script("focus(qs('#name'));"); ?>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php <?php
if ($_GET["ns"] != "") { if ($_GET["ns"] != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n"; echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop %s?', $_GET["ns"])) . "\n";
} }
?> ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">

View File

@@ -34,6 +34,12 @@ if ($_GET["script"] == "db") {
} elseif ($_GET["script"] == "kill") { } elseif ($_GET["script"] == "kill") {
$connection->query("KILL " . number($_POST["kill"])); $connection->query("KILL " . number($_POST["kill"]));
} elseif ($_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"])));
}
} else { // connect } else { // connect
foreach (count_tables($adminer->databases()) as $db => $val) { foreach (count_tables($adminer->databases()) as $db => $val) {
json_row("tables-$db", $val); json_row("tables-$db", $val);

View File

@@ -205,7 +205,7 @@ if ($_POST && !$error) {
} }
$result = (!$rows || $driver->insertUpdate($TABLE, $rows, $primary)); $result = (!$rows || $driver->insertUpdate($TABLE, $rows, $primary));
if ($result) { if ($result) {
$driver->commit(); $result = $driver->commit();
} }
queries_redirect(remove_from_uri("page"), lang('%d row(s) have been imported.', $affected), $result); queries_redirect(remove_from_uri("page"), lang('%d row(s) have been imported.', $affected), $result);
$driver->rollback(); // after queries_redirect() to not overwrite error $driver->rollback(); // after queries_redirect() to not overwrite error
@@ -226,7 +226,7 @@ $set = null;
if (isset($rights["insert"]) || !support("table")) { if (isset($rights["insert"]) || !support("table")) {
$set = ""; $set = "";
foreach ((array) $_GET["where"] as $val) { foreach ((array) $_GET["where"] as $val) {
if (count($foreign_keys[$val["col"]]) == 1 && ($val["op"] == "=" if ($foreign_keys[$val["col"]] && count($foreign_keys[$val["col"]]) == 1 && ($val["op"] == "="
|| (!$val["op"] && !preg_match('~[_%]~', $val["val"])) // LIKE in Editor || (!$val["op"] && !preg_match('~[_%]~', $val["val"])) // LIKE in Editor
)) { )) {
$set .= "&set" . urlencode("[" . bracket_escape($val["col"]) . "]") . "=" . urlencode($val["val"]); $set .= "&set" . urlencode("[" . bracket_escape($val["col"]) . "]") . "=" . urlencode($val["val"]);
@@ -288,7 +288,7 @@ if (!$columns && support("table")) {
} }
// use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest) // use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest)
if ($_GET["page"] != "last" && +$limit && $group && $is_group && $jush == "sql") { if ($_GET["page"] != "last" && $limit != "" && $group && $is_group && $jush == "sql") {
$found_rows = $connection->result(" SELECT FOUND_ROWS()"); // space to allow mysql.trace_mode $found_rows = $connection->result(" SELECT FOUND_ROWS()"); // space to allow mysql.trace_mode
} }
@@ -297,8 +297,12 @@ if (!$columns && support("table")) {
} else { } else {
$backward_keys = $adminer->backwardKeys($TABLE, $table_name); $backward_keys = $adminer->backwardKeys($TABLE, $table_name);
echo "<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);' onkeydown='return editingKeydown(event);'>\n"; echo "<table id='table' cellspacing='0' class='nowrap checkable'>";
echo "<thead><tr>" . (!$group && $select ? "" : "<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='" . h($_GET["modify"] ? remove_from_uri("modify") : $_SERVER["REQUEST_URI"] . "&modify=1") . "'>" . lang('Modify') . "</a>"); echo script("mixin(qs('#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/);", "")
. " <a href='" . h($_GET["modify"] ? remove_from_uri("modify") : $_SERVER["REQUEST_URI"] . "&modify=1") . "'>" . lang('Modify') . "</a>");
$names = array(); $names = array();
$functions = array(); $functions = array();
reset($select); reset($select);
@@ -314,13 +318,14 @@ if (!$columns && support("table")) {
$column = idf_escape($key); $column = idf_escape($key);
$href = remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key); $href = remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key);
$desc = "&desc%5B0%5D=1"; $desc = "&desc%5B0%5D=1";
echo '<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">'; echo "<th>" . script("mixin(qsl('th'), {onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')});", "");
echo '<a href="' . h($href . ($order[0] == $column || $order[0] == $key || (!$order && $is_group && $group[0] == $column) ? $desc : '')) . '">'; // $order[0] == $key - COUNT(*) echo '<a href="' . h($href . ($order[0] == $column || $order[0] == $key || (!$order && $is_group && $group[0] == $column) ? $desc : '')) . '">'; // $order[0] == $key - COUNT(*)
echo apply_sql_function($val["fun"], $name) . "</a>"; //! columns looking like functions echo apply_sql_function($val["fun"], $name) . "</a>"; //! columns looking like functions
echo "<span class='column hidden'>"; echo "<span class='column hidden'>";
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"]) { if (!$val["fun"]) {
echo '<a href="#fieldset-search" onclick="selectSearch(\'' . h(js_escape($key)) . '\'); return false;" 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>"; echo "</span>";
} }
@@ -359,9 +364,9 @@ if (!$columns && support("table")) {
} }
$unique_idf = ""; $unique_idf = "";
foreach ($unique_array as $key => $val) { foreach ($unique_array as $key => $val) {
if (($jush == "sql" || $jush == "pgsql") && strlen($val) > 64) { if (($jush == "sql" || $jush == "pgsql") && preg_match('~char|text|enum|set~', $fields[$key]["type"]) && strlen($val) > 64) {
$key = (strpos($key, '(') ? $key : idf_escape($key)); //! columns looking like functions $key = (strpos($key, '(') ? $key : idf_escape($key)); //! columns looking like functions
$key = "MD5(" . ($jush == 'sql' && preg_match("~^utf8_~", $fields[$key]["collation"]) ? $key : "CONVERT($key USING " . charset($connection) . ")") . ")"; $key = "MD5(" . ($jush != 'sql' || preg_match("~^utf8~", $fields[$key]["collation"]) ? $key : "CONVERT($key USING " . charset($connection) . ")") . ")";
$val = md5($val); $val = md5($val);
} }
$unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key)); $unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
@@ -387,6 +392,9 @@ if (!$columns && support("table")) {
$link .= where_link($i, $foreign_key["target"][$i], $rows[$n][$source]); $link .= where_link($i, $foreign_key["target"][$i], $rows[$n][$source]);
} }
$link = ($foreign_key["db"] != "" ? preg_replace('~([?&]db=)[^&]+~', '\\1' . urlencode($foreign_key["db"]), ME) : ME) . 'select=' . urlencode($foreign_key["table"]) . $link; // InnoDB supports non-UNIQUE keys $link = ($foreign_key["db"] != "" ? preg_replace('~([?&]db=)[^&]+~', '\\1' . urlencode($foreign_key["db"]), ME) : ME) . 'select=' . urlencode($foreign_key["table"]) . $link; // InnoDB supports non-UNIQUE keys
if ($foreign_key["ns"]) {
$link = preg_replace('~([?&]ns=)[^&]+~', '\\1' . urlencode($foreign_key["ns"]), $link);
}
if (count($foreign_key["source"]) == 1) { if (count($foreign_key["source"]) == 1) {
break; break;
} }
@@ -416,7 +424,8 @@ if (!$columns && support("table")) {
echo "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>"); echo "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>");
} else { } else {
$long = strpos($val, "<i>...</i>"); $long = strpos($val, "<i>...</i>");
echo "<td id='$id' onclick=\"selectClick(this, event, " . ($long ? 2 : ($text ? 1 : 0)) . ($editable ? "" : ", '" . h(lang('Use edit link to modify this value.')) . "'") . ");\">$val"; echo "<td id='$id'>$val</td>";
echo script("qsl('td').onclick = partialArg(selectClick, " . ($long ? 2 : ($text ? 1 : 0)) . ($editable ? "" : ", '" . h(lang('Use edit link to modify this value.')) . "'") . ");", "");
} }
} }
} }
@@ -437,7 +446,7 @@ if (!$columns && support("table")) {
if (($rows || $page) && !is_ajax()) { if (($rows || $page) && !is_ajax()) {
$exact_count = true; $exact_count = true;
if ($_GET["page"] != "last") { if ($_GET["page"] != "last") {
if (!+$limit) { if ($limit == "") {
$found_rows = count($rows); $found_rows = count($rows);
} elseif ($jush != "sql" || !$is_group) { } elseif ($jush != "sql" || !$is_group) {
$found_rows = ($is_group ? false : found_rows($table_status, $where)); $found_rows = ($is_group ? false : found_rows($table_status, $where));
@@ -450,7 +459,7 @@ if (!$columns && support("table")) {
} }
} }
if (+$limit && ($found_rows === false || $found_rows > $limit || $page)) { if ($limit != "" && ($found_rows === false || $found_rows > $limit || $page)) {
echo "<p class='pages'>"; echo "<p class='pages'>";
// display first, previous 4, next 4 and last page // display first, previous 4, next 4 and last page
$max_page = ($found_rows === false $max_page = ($found_rows === false
@@ -458,7 +467,8 @@ if (!$columns && support("table")) {
: floor(($found_rows - 1) / $limit) : floor(($found_rows - 1) / $limit)
); );
if ($jush != "simpledb") { if ($jush != "simpledb") {
echo '<a href="' . h(remove_from_uri("page")) . "\" onclick=\"pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "'), event); return false;\">" . lang('Page') . "</a>:"; echo '<a href="' . h(remove_from_uri("page")) . '">' . lang('Page') . "</a>:";
echo script("qsl('a').onclick = function () { pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "')); return false; };");
echo pagination(0, $page) . ($page > 5 ? " ..." : ""); echo pagination(0, $page) . ($page > 5 ? " ..." : "");
for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) { for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) {
echo pagination($i, $page); echo pagination($i, $page);
@@ -471,7 +481,8 @@ if (!$columns && support("table")) {
); );
} }
echo (($found_rows === false ? count($rows) + 1 : $found_rows - $page * $limit) > $limit echo (($found_rows === false ? count($rows) + 1 : $found_rows - $page * $limit) > $limit
? ' <a href="' . h(remove_from_uri("page") . "&page=" . ($page + 1)) . '" onclick="return !selectLoadMore(this, ' . (+$limit) . ', \'' . lang('Loading') . '...\');" class="loadmore">' . lang('Load more data') . '</a>' ? ' <a href="' . h(remove_from_uri("page") . "&page=" . ($page + 1)) . '" class="loadmore">' . lang('Load more data') . '</a>'
. script("qsl('a').onclick = partial(selectLoadMore, " . (+$limit) . ", '" . lang('Loading') . "...');", "")
: '' : ''
); );
} else { } else {
@@ -495,7 +506,7 @@ if (!$columns && support("table")) {
<fieldset><legend><?php echo lang('Selected'); ?> <span id="selected"></span></legend><div> <fieldset><legend><?php echo lang('Selected'); ?> <span id="selected"></span></legend><div>
<input type="submit" name="edit" value="<?php echo lang('Edit'); ?>"> <input type="submit" name="edit" value="<?php echo lang('Edit'); ?>">
<input type="submit" name="clone" value="<?php echo lang('Clone'); ?>"> <input type="submit" name="clone" value="<?php echo lang('Clone'); ?>">
<input type="submit" name="delete" value="<?php echo lang('Delete'); ?>"<?php echo confirm(); ?>> <input type="submit" name="delete" value="<?php echo lang('Delete'); ?>"><?php echo confirm(); ?>
</div></fieldset> </div></fieldset>
<?php <?php
} }
@@ -516,7 +527,7 @@ if (!$columns && support("table")) {
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
echo (!$group && $select ? "" : "<script type='text/javascript'>tableCheck();</script>\n"); echo (!$group && $select ? "" : script("tableCheck();"));
} }
if ($adminer->selectImportPrint()) { if ($adminer->selectImportPrint()) {

View File

@@ -28,7 +28,7 @@ if (!$row) {
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php <?php
if ($SEQUENCE != "") { if ($SEQUENCE != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n"; echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop %s?', $SEQUENCE)) . "\n";
} }
?> ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">

View File

@@ -21,9 +21,10 @@ if (!$error && $_POST) {
if (!isset($_GET["import"])) { if (!isset($_GET["import"])) {
$query = $_POST["query"]; $query = $_POST["query"];
} elseif ($_POST["webfile"]) { } elseif ($_POST["webfile"]) {
$fp = @fopen((file_exists("adminer.sql") $sql_file_path = $adminer->importServerPath();
? "adminer.sql" $fp = @fopen((file_exists($sql_file_path)
: "compress.zlib://adminer.sql.gz" ? $sql_file_path
: "compress.zlib://$sql_file_path.gz"
), "rb"); ), "rb");
$query = ($fp ? fread($fp, 1e6) : false); $query = ($fp ? fread($fp, 1e6) : false);
} else { } else {
@@ -93,7 +94,7 @@ if (!$error && $_POST) {
$empty = false; $empty = false;
$q = substr($query, 0, $pos); $q = substr($query, 0, $pos);
$commands++; $commands++;
$print = "<pre id='sql-$commands'><code class='jush-$jush'>" . shorten_utf8(trim($q), 1000) . "</code></pre>\n"; $print = "<pre id='sql-$commands'><code class='jush-$jush'>" . $adminer->sqlCommandQuery($q) . "</code></pre>\n";
if ($jush == "sqlite" && preg_match("~^$space*+ATTACH\\b~i", $q, $match)) { if ($jush == "sqlite" && preg_match("~^$space*+ATTACH\\b~i", $q, $match)) {
// PHP doesn't support setting SQLITE_LIMIT_ATTACHED // PHP doesn't support setting SQLITE_LIMIT_ATTACHED
echo $print; echo $print;
@@ -137,7 +138,7 @@ if (!$error && $_POST) {
echo "<p>" . ($num_rows ? ($limit && $num_rows > $limit ? lang('%d / ', $limit) : "") . lang('%d row(s)', $num_rows) : ""); echo "<p>" . ($num_rows ? ($limit && $num_rows > $limit ? lang('%d / ', $limit) : "") . lang('%d row(s)', $num_rows) : "");
echo $time; echo $time;
$id = "export-$commands"; $id = "export-$commands";
$export = ", <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('Export') . "</a><span id='$id' class='hidden'>: " $export = ", <a href='#$id'>" . lang('Export') . "</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "") . "<span id='$id' class='hidden'>: "
. html_select("output", $adminer->dumpOutput(), $adminer_export["output"]) . " " . html_select("output", $adminer->dumpOutput(), $adminer_export["output"]) . " "
. html_select("format", $dump_format, $adminer_export["format"]) . html_select("format", $dump_format, $adminer_export["format"])
. "<input type='hidden' name='query' value='" . h($q) . "'>" . "<input type='hidden' name='query' value='" . h($q) . "'>"
@@ -145,7 +146,7 @@ if (!$error && $_POST) {
; ;
if ($connection2 && preg_match("~^($space|\\()*+SELECT\\b~i", $q) && ($explain = explain($connection2, $q))) { if ($connection2 && preg_match("~^($space|\\()*+SELECT\\b~i", $q) && ($explain = explain($connection2, $q))) {
$id = "explain-$commands"; $id = "explain-$commands";
echo ", <a href='#$id' onclick=\"return !toggle('$id');\">EXPLAIN</a>$export"; echo ", <a href='#$id'>EXPLAIN</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "") . $export;
echo "<div id='$id' class='hidden'>\n"; echo "<div id='$id' class='hidden'>\n";
select($explain, $connection2, $orgtables); select($explain, $connection2, $orgtables);
echo "</div>\n"; echo "</div>\n";
@@ -208,7 +209,7 @@ if (!isset($_GET["import"])) {
} }
echo "<p>"; echo "<p>";
textarea("query", $q, 20); textarea("query", $q, 20);
echo ($_POST ? "" : "<script type='text/javascript'>focus(document.getElementsByTagName('textarea')[0]);</script>\n"); echo ($_POST ? "" : script("qs('textarea').focus();"));
echo "<p>$execute\n"; echo "<p>$execute\n";
echo lang('Limit rows') . ": <input type='number' name='limit' class='size' value='" . h($_POST ? $_POST["limit"] : $_GET["limit"]) . "'>\n"; echo lang('Limit rows') . ": <input type='number' name='limit' class='size' value='" . h($_POST ? $_POST["limit"] : $_GET["limit"]) . "'>\n";
@@ -220,7 +221,7 @@ if (!isset($_GET["import"])) {
); );
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
echo "<fieldset><legend>" . lang('From server') . "</legend><div>"; echo "<fieldset><legend>" . lang('From server') . "</legend><div>";
echo lang('Webserver file %s', "<code>adminer.sql" . (extension_loaded("zlib") ? "[.gz]" : "") . "</code>"); echo lang('Webserver file %s', "<code>" . h($adminer->importServerPath()) . (extension_loaded("zlib") ? "[.gz]" : "") . "</code>");
echo ' <input type="submit" name="webfile" value="' . lang('Run file') . '">'; echo ' <input type="submit" name="webfile" value="' . lang('Run file') . '">';
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
echo "<p>"; echo "<p>";

8
adminer/sqlite.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
function adminer_object() {
include_once "../plugins/plugin.php";
include_once "../plugins/login-sqlite.php";
return new AdminerPlugin(array(new AdminerLoginSqlite("admin", password_hash("", PASSWORD_DEFAULT))));
}
include "./index.php";

View File

@@ -10,8 +10,8 @@ h2 { font-size: 150%; margin: 0 0 20px -18px; padding: .8em 1em; border-bottom:
h3 { font-weight: normal; font-size: 130%; margin: 1em 0 0; } h3 { font-weight: normal; font-size: 130%; margin: 1em 0 0; }
form { margin: 0; } form { margin: 0; }
td table { width: 100%; margin: 0; } td table { width: 100%; margin: 0; }
table { margin: 1em 20px 0 0; border: 0; border-top: 1px solid #999; border-left: 1px solid #999; font-size: 90%; } table { margin: 1em 20px 0 0; border-collapse: collapse; font-size: 90%; }
td, th { border: 0; border-right: 1px solid #999; border-bottom: 1px solid #999; padding: .2em .3em; } td, th { border: 1px solid #999; padding: .2em .3em; }
th { background: #eee; text-align: left; } th { background: #eee; text-align: left; }
thead th { text-align: center; padding: .2em .5em; } thead th { text-align: center; padding: .2em .5em; }
thead td, thead th { background: #ddf; } thead td, thead th { background: #ddf; }
@@ -26,11 +26,13 @@ pre, textarea { font: 100%/1.25 monospace; }
input[type=image] { vertical-align: middle; } input[type=image] { vertical-align: middle; }
input.default { box-shadow: 1px 1px 1px #777; } input.default { box-shadow: 1px 1px 1px #777; }
input.required { box-shadow: 1px 1px 1px red; } input.required { box-shadow: 1px 1px 1px red; }
input.maxlength { box-shadow: 1px 1px 1px red; }
input.wayoff { left: -1000px; position: absolute; }
.block { display: block; } .block { display: block; }
.version { color: #777; font-size: 67%; } .version { color: #777; font-size: 67%; }
.js .hidden, .nojs .jsonly { display: none; } .js .hidden, .nojs .jsonly { display: none; }
.js .column { position: absolute; background: #ddf; padding: .27em 1ex .3em 0; margin-top: -.27em; } .js .column { position: absolute; background: #ddf; padding: .27em 1ex .3em 0; margin-top: -.27em; }
.nowrap td, .nowrap th, td.nowrap { white-space: pre; } .nowrap td, .nowrap th, td.nowrap, p.nowrap { white-space: pre; }
.wrap td { white-space: normal; } .wrap td { white-space: normal; }
.error { color: red; background: #fee; } .error { color: red; background: #fee; }
.error b { background: #fff; font-weight: normal; } .error b { background: #fff; font-weight: normal; }
@@ -60,7 +62,8 @@ input.required { box-shadow: 1px 1px 1px red; }
.logout { margin-top: .5em; position: absolute; top: 0; right: 0; } .logout { margin-top: .5em; position: absolute; top: 0; right: 0; }
.loadmore { margin-left: 1ex; } .loadmore { margin-left: 1ex; }
#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; } #menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; }
#menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; } #menu p, #tables { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
#tables li{ list-style: none; }
#dbs { overflow: hidden; } #dbs { overflow: hidden; }
#logins, #tables { white-space: nowrap; overflow: auto; } #logins, #tables { white-space: nowrap; overflow: auto; }
#logins a, #tables a, #tables span { background: #fff; } #logins a, #tables a, #tables span { background: #fff; }
@@ -79,6 +82,8 @@ input.required { box-shadow: 1px 1px 1px red; }
.rtl .logout { left: 0; right: auto; } .rtl .logout { left: 0; right: auto; }
.rtl #content { margin: 2em 21em 0 0; padding: 10px 0 20px 20px; } .rtl #content { margin: 2em 21em 0 0; padding: 10px 0 20px 20px; }
.rtl #breadcrumb { left: auto; right: 21em; margin: 0 -18px 0 0; } .rtl #breadcrumb { left: auto; right: 21em; margin: 0 -18px 0 0; }
.rtl .pages { left: auto; right: 21em; }
.rtl input.wayoff { left: auto; right: -1000px; }
.rtl #lang, .rtl #menu { left: auto; right: 0; } .rtl #lang, .rtl #menu { left: auto; right: 0; }
@media all and (max-device-width: 880px) { @media all and (max-device-width: 880px) {
@@ -87,6 +92,7 @@ input.required { box-shadow: 1px 1px 1px red; }
#content { margin-left: 10px; } #content { margin-left: 10px; }
#lang { position: static; border-top: 1px solid #999; } #lang { position: static; border-top: 1px solid #999; }
#breadcrumb { left: auto; } #breadcrumb { left: auto; }
.rtl .pages { right: auto; }
.rtl #content { margin-right: 10px; } .rtl #content { margin-right: 10px; }
.rtl #breadcrumb { right: auto; } .rtl #breadcrumb { right: auto; }
} }

View File

@@ -5,7 +5,7 @@
*/ */
function bodyLoad(version) { function bodyLoad(version) {
if (window.jush) { if (window.jush) {
jush.create_links = ' target="_blank" rel="noreferrer"'; jush.create_links = ' target="_blank" rel="noopener"';
if (version) { if (version) {
for (var key in jush.urls) { for (var key in jush.urls) {
var obj = jush.urls; var obj = jush.urls;
@@ -23,7 +23,7 @@ function bodyLoad(version) {
jush.custom_links = jushLinks; jush.custom_links = jushLinks;
} }
jush.highlight_tag('code', 0); jush.highlight_tag('code', 0);
var tags = document.getElementsByTagName('textarea'); var tags = qsa('textarea', document);
for (var i = 0; i < tags.length; i++) { for (var i = 0; i < tags.length; i++) {
if (/(^|\s)jush-/.test(tags[i].className)) { if (/(^|\s)jush-/.test(tags[i].className)) {
var pre = jush.textarea(tags[i]); var pre = jush.textarea(tags[i]);
@@ -60,6 +60,15 @@ function typePassword(el, disable) {
} }
} }
/** Install toggle handler
*/
function messagesPrint() {
var els = qsa('.toggle', document);
for (var i = 0; i < els.length; i++) {
els[i].onclick = partial(toggle, els[i].getAttribute('href').substr(1));
}
}
var dbCtrl; var dbCtrl;
@@ -67,45 +76,46 @@ var dbPrevious = {};
/** Check if database should be opened to a new window /** Check if database should be opened to a new window
* @param MouseEvent * @param MouseEvent
* @param HTMLSelectElement * @this HTMLSelectElement
*/ */
function dbMouseDown(event, el) { function dbMouseDown(event) {
dbCtrl = isCtrl(event); dbCtrl = isCtrl(event);
if (dbPrevious[el.name] == undefined) { if (dbPrevious[this.name] == undefined) {
dbPrevious[el.name] = el.value; dbPrevious[this.name] = this.value;
} }
} }
/** Load database after selecting it /** Load database after selecting it
* @param HTMLSelectElement * @this HTMLSelectElement
*/ */
function dbChange(el) { function dbChange() {
if (dbCtrl) { if (dbCtrl) {
el.form.target = '_blank'; this.form.target = '_blank';
} }
el.form.submit(); this.form.submit();
el.form.target = ''; this.form.target = '';
if (dbCtrl && dbPrevious[el.name] != undefined) { if (dbCtrl && dbPrevious[this.name] != undefined) {
el.value = dbPrevious[el.name]; this.value = dbPrevious[this.name];
dbPrevious[el.name] = undefined; dbPrevious[this.name] = undefined;
} }
} }
/** Check whether the query will be executed with index /** Check whether the query will be executed with index
* @param HTMLFormElement * @this HTMLElement
*/ */
function selectFieldChange(form) { function selectFieldChange() {
var form = this.form;
var ok = (function () { var ok = (function () {
var inputs = form.getElementsByTagName('input'); var inputs = qsa('input', form);
for (var i=0; i < inputs.length; i++) { for (var i=0; i < inputs.length; i++) {
if (inputs[i].value && /^fulltext/.test(inputs[i].name)) { if (inputs[i].value && /^fulltext/.test(inputs[i].name)) {
return true; return true;
} }
} }
var ok = form.limit.value; var ok = form.limit.value;
var selects = form.getElementsByTagName('select'); var selects = qsa('select', form);
var group = false; var group = false;
var columns = {}; var columns = {};
for (var i=0; i < selects.length; i++) { for (var i=0; i < selects.length; i++) {
@@ -172,14 +182,14 @@ function idfEscape(s) {
} }
/** Detect foreign key /** Detect foreign key
* @param HTMLInputElement * @this HTMLInputElement
*/ */
function editingNameChange(field) { function editingNameChange() {
var name = field.name.substr(0, field.name.length - 7); var name = this.name.substr(0, this.name.length - 7);
var type = formField(field.form, name + '[type]'); var type = formField(this.form, name + '[type]');
var opts = type.options; var opts = type.options;
var candidate; // don't select anything with ambiguous match (like column `id`) var candidate; // don't select anything with ambiguous match (like column `id`)
var val = field.value; var val = this.value;
for (var i = opts.length; i--; ) { for (var i = opts.length; i--; ) {
var match = /(.+)`(.+)/.exec(opts[i].value); var match = /(.+)`(.+)/.exec(opts[i].value);
if (!match) { // common type if (!match) { // common type
@@ -209,23 +219,23 @@ function editingNameChange(field) {
} }
/** Add table row for next field /** Add table row for next field
* @param HTMLInputElement
* @param boolean * @param boolean
* @return boolean * @return boolean false
* @this HTMLInputElement
*/ */
function editingAddRow(button, focus) { function editingAddRow(focus) {
var match = /(\d+)(\.\d+)?/.exec(button.name); var match = /(\d+)(\.\d+)?/.exec(this.name);
var x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1'; var x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1';
var row = parentTag(button, 'tr'); var row = parentTag(this, 'tr');
var row2 = cloneNode(row); var row2 = cloneNode(row);
var tags = row.getElementsByTagName('select'); var tags = qsa('select', row);
var tags2 = row2.getElementsByTagName('select'); var tags2 = qsa('select', row2);
for (var i=0; i < tags.length; i++) { for (var i=0; i < tags.length; i++) {
tags2[i].name = tags[i].name.replace(/[0-9.]+/, x); tags2[i].name = tags[i].name.replace(/[0-9.]+/, x);
tags2[i].selectedIndex = tags[i].selectedIndex; tags2[i].selectedIndex = tags[i].selectedIndex;
} }
tags = row.getElementsByTagName('input'); tags = qsa('input', row);
tags2 = row2.getElementsByTagName('input'); tags2 = qsa('input', row2);
var input = tags2[0]; // IE loose tags2 after insertBefore() var input = tags2[0]; // IE loose tags2 after insertBefore()
for (var i=0; i < tags.length; i++) { for (var i=0; i < tags.length; i++) {
if (tags[i].name == 'auto_increment_col') { if (tags[i].name == 'auto_increment_col') {
@@ -240,43 +250,52 @@ function editingAddRow(button, focus) {
tags2[i].checked = false; tags2[i].checked = false;
} }
} }
tags[0].onchange = function () { tags[0].oninput = editingNameChange;
editingNameChange(tags[0]);
};
tags[0].onkeyup = function () {
};
row.parentNode.insertBefore(row2, row.nextSibling); row.parentNode.insertBefore(row2, row.nextSibling);
if (focus) { if (focus) {
input.onchange = function () { input.oninput = editingNameChange;
editingNameChange(input);
};
input.onkeyup = function () {
};
input.focus(); input.focus();
} }
added += '0'; added += '0';
rowCount++; rowCount++;
return true; return false;
} }
/** Remove table row for field /** Remove table row for field
* @param HTMLInputElement
* @param string * @param string
* @return boolean * @return boolean false
* @this HTMLInputElement
*/ */
function editingRemoveRow(button, name) { function editingRemoveRow(name) {
var field = formField(button.form, button.name.replace(/[^\[]+(.+)/, name)); var field = formField(this.form, this.name.replace(/[^\[]+(.+)/, name));
field.parentNode.removeChild(field); field.parentNode.removeChild(field);
parentTag(button, 'tr').style.display = 'none'; parentTag(this, 'tr').style.display = 'none';
return false;
}
/** Move table row for field
* @param boolean direction to move row, true for up or false for down
* @return boolean false for success
* @this HTMLInputElement
*/
function editingMoveRow(dir){
var row = parentTag(this, 'tr');
if (!('nextElementSibling' in row)) {
return true; return true;
} }
row.parentNode.insertBefore(row, dir
? row.previousElementSibling
: row.nextElementSibling ? row.nextElementSibling.nextElementSibling : row.parentNode.firstChild);
return false;
}
var lastType = ''; var lastType = '';
/** Clear length and hide collation or unsigned /** Clear length and hide collation or unsigned
* @param HTMLSelectElement * @this HTMLSelectElement
*/ */
function editingTypeChange(type) { function editingTypeChange() {
var type = this;
var name = type.name.substr(0, type.name.length - 6); var name = type.name.substr(0, type.name.length - 6);
var text = selectValue(type); var text = selectValue(type);
for (var i=0; i < type.form.elements.length; i++) { for (var i=0; i < type.form.elements.length; i++) {
@@ -288,7 +307,7 @@ function editingTypeChange(type) {
)) { )) {
el.value = ''; el.value = '';
} }
el.onchange.apply(el); el.oninput.apply(el);
} }
if (lastType == 'timestamp' && el.name == name + '[has_default]' && /timestamp/i.test(formField(type.form, name + '[default]').value)) { if (lastType == 'timestamp' && el.name == name + '[has_default]' && /timestamp/i.test(formField(type.form, name + '[default]').value)) {
el.checked = false; el.checked = false;
@@ -310,37 +329,37 @@ function editingTypeChange(type) {
} }
/** Mark length as required /** Mark length as required
* @param HTMLInputElement * @this HTMLInputElement
*/ */
function editingLengthChange(el) { function editingLengthChange() {
alterClass(el, 'required', !el.value.length && /var(char|binary)$/.test(selectValue(el.parentNode.previousSibling.firstChild))); alterClass(this, 'required', !this.value.length && /var(char|binary)$/.test(selectValue(this.parentNode.previousSibling.firstChild)));
} }
/** Edit enum or set /** Edit enum or set
* @param HTMLInputElement * @this HTMLInputElement
*/ */
function editingLengthFocus(field) { function editingLengthFocus() {
var td = field.parentNode; var td = this.parentNode;
if (/(enum|set)$/.test(selectValue(td.previousSibling.firstChild))) { if (/(enum|set)$/.test(selectValue(td.previousSibling.firstChild))) {
var edit = document.getElementById('enum-edit'); var edit = qs('#enum-edit');
var val = field.value; var val = this.value;
edit.value = (/^'.+'$/.test(val) ? val.substr(1, val.length - 2).replace(/','/g, "\n").replace(/''/g, "'") : val); //! doesn't handle 'a'',''b' correctly edit.value = (/^'.+'$/.test(val) ? val.substr(1, val.length - 2).replace(/','/g, "\n").replace(/''/g, "'") : val); //! doesn't handle 'a'',''b' correctly
td.appendChild(edit); td.appendChild(edit);
field.style.display = 'none'; this.style.display = 'none';
edit.style.display = 'inline'; edit.style.display = 'inline';
edit.focus(); edit.focus();
} }
} }
/** Finish editing of enum or set /** Finish editing of enum or set
* @param HTMLTextAreaElement * @this HTMLTextAreaElement
*/ */
function editingLengthBlur(edit) { function editingLengthBlur() {
var field = edit.parentNode.firstChild; var field = this.parentNode.firstChild;
var val = edit.value; var val = this.value;
field.value = (/^'[^\n]+'$/.test(val) ? val : "'" + val.replace(/\n+$/, '').replace(/'/g, "''").replace(/\n/g, "','") + "'"); field.value = (/^'[^\n]+'$/.test(val) ? val : val && "'" + val.replace(/\n+$/, '').replace(/'/g, "''").replace(/\n/g, "','") + "'");
field.style.display = 'inline'; field.style.display = 'inline';
edit.style.display = 'none'; this.style.display = 'none';
} }
/** Show or hide selected table column /** Show or hide selected table column
@@ -348,9 +367,9 @@ function editingLengthBlur(edit) {
* @param number * @param number
*/ */
function columnShow(checked, column) { function columnShow(checked, column) {
var trs = document.getElementById('edit-fields').getElementsByTagName('tr'); var trs = qsa('tr', qs('#edit-fields'));
for (var i=0; i < trs.length; i++) { for (var i=0; i < trs.length; i++) {
alterClass(trs[i].getElementsByTagName('td')[column], 'hidden', !checked); alterClass(qsa('td', trs[i])[column], 'hidden', !checked);
} }
} }
@@ -358,76 +377,76 @@ function columnShow(checked, column) {
*/ */
function editingHideDefaults() { function editingHideDefaults() {
if (innerWidth < document.documentElement.scrollWidth) { if (innerWidth < document.documentElement.scrollWidth) {
document.getElementById('form')['defaults'].checked = false; qs('#form')['defaults'].checked = false;
columnShow(false, 5); columnShow(false, 5);
} }
} }
/** Display partition options /** Display partition options
* @param HTMLSelectElement * @this HTMLSelectElement
*/ */
function partitionByChange(el) { function partitionByChange() {
var partitionTable = /RANGE|LIST/.test(selectValue(el)); var partitionTable = /RANGE|LIST/.test(selectValue(this));
alterClass(el.form['partitions'], 'hidden', partitionTable || !el.selectedIndex); alterClass(this.form['partitions'], 'hidden', partitionTable || !this.selectedIndex);
alterClass(document.getElementById('partition-table'), 'hidden', !partitionTable); alterClass(qs('#partition-table'), 'hidden', !partitionTable);
helpClose(); helpClose();
} }
/** Add next partition row /** Add next partition row
* @param HTMLInputElement * @this HTMLInputElement
*/ */
function partitionNameChange(el) { function partitionNameChange() {
var row = cloneNode(parentTag(el, 'tr')); var row = cloneNode(parentTag(this, 'tr'));
row.firstChild.firstChild.value = ''; row.firstChild.firstChild.value = '';
parentTag(el, 'table').appendChild(row); parentTag(this, 'table').appendChild(row);
el.onchange = function () {}; this.oninput = function () {};
} }
/** Add row for foreign key /** Add row for foreign key
* @param HTMLSelectElement * @this HTMLSelectElement
*/ */
function foreignAddRow(field) { function foreignAddRow() {
field.onchange = function () { }; this.onchange = function () { };
var row = cloneNode(parentTag(field, 'tr')); var row = cloneNode(parentTag(this, 'tr'));
var selects = row.getElementsByTagName('select'); var selects = qsa('select', row);
for (var i=0; i < selects.length; i++) { for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/\]/, '1$&'); selects[i].name = selects[i].name.replace(/\]/, '1$&');
selects[i].selectedIndex = 0; selects[i].selectedIndex = 0;
} }
parentTag(field, 'table').appendChild(row); parentTag(this, 'table').appendChild(row);
} }
/** Add row for indexes /** Add row for indexes
* @param HTMLSelectElement * @this HTMLSelectElement
*/ */
function indexesAddRow(field) { function indexesAddRow() {
field.onchange = function () { }; this.onchange = function () { };
var row = cloneNode(parentTag(field, 'tr')); var row = cloneNode(parentTag(this, 'tr'));
var selects = row.getElementsByTagName('select'); var selects = qsa('select', row);
for (var i=0; i < selects.length; i++) { for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/indexes\[\d+/, '$&1'); selects[i].name = selects[i].name.replace(/indexes\[\d+/, '$&1');
selects[i].selectedIndex = 0; selects[i].selectedIndex = 0;
} }
var inputs = row.getElementsByTagName('input'); var inputs = qsa('input', row);
for (var i=0; i < inputs.length; i++) { for (var i=0; i < inputs.length; i++) {
inputs[i].name = inputs[i].name.replace(/indexes\[\d+/, '$&1'); inputs[i].name = inputs[i].name.replace(/indexes\[\d+/, '$&1');
inputs[i].value = ''; inputs[i].value = '';
} }
parentTag(field, 'table').appendChild(row); parentTag(this, 'table').appendChild(row);
} }
/** Change column in index /** Change column in index
* @param HTMLSelectElement
* @param string name prefix * @param string name prefix
* @this HTMLSelectElement
*/ */
function indexesChangeColumn(field, prefix) { function indexesChangeColumn(prefix) {
var names = []; var names = [];
for (var tag in { 'select': 1, 'input': 1 }) { for (var tag in { 'select': 1, 'input': 1 }) {
var columns = parentTag(field, 'td').getElementsByTagName(tag); var columns = qsa(tag, parentTag(this, 'td'));
for (var i=0; i < columns.length; i++) { for (var i=0; i < columns.length; i++) {
if (/\[columns\]/.test(columns[i].name)) { if (/\[columns\]/.test(columns[i].name)) {
var value = selectValue(columns[i]); var value = selectValue(columns[i]);
@@ -437,17 +456,15 @@ function indexesChangeColumn(field, prefix) {
} }
} }
} }
field.form[field.name.replace(/\].*/, '][name]')].value = prefix + names.join('_'); this.form[this.name.replace(/\].*/, '][name]')].value = prefix + names.join('_');
} }
/** Add column for index /** Add column for index
* @param HTMLSelectElement
* @param string name prefix * @param string name prefix
* @this HTMLSelectElement
*/ */
function indexesAddColumn(field, prefix) { function indexesAddColumn(prefix) {
field.onchange = function () { var field = this;
indexesChangeColumn(field, prefix);
};
var select = field.form[field.name.replace(/\].*/, '][type]')]; var select = field.form[field.name.replace(/\].*/, '][type]')];
if (!select.selectedIndex) { if (!select.selectedIndex) {
while (selectValue(select) != "INDEX" && select.selectedIndex < select.options.length) { while (selectValue(select) != "INDEX" && select.selectedIndex < select.options.length) {
@@ -456,13 +473,14 @@ function indexesAddColumn(field, prefix) {
select.onchange(); select.onchange();
} }
var column = cloneNode(field.parentNode); var column = cloneNode(field.parentNode);
var selects = column.getElementsByTagName('select'); var selects = qsa('select', column);
for (var i = 0; i < selects.length; i++) { for (var i = 0; i < selects.length; i++) {
select = selects[i]; select = selects[i];
select.name = select.name.replace(/\]\[\d+/, '$&1'); select.name = select.name.replace(/\]\[\d+/, '$&1');
select.selectedIndex = 0; select.selectedIndex = 0;
} }
var inputs = column.getElementsByTagName('input'); field.onchange = partial(indexesChangeColumn, prefix);
var inputs = qsa('input', column);
for (var i = 0; i < inputs.length; i++) { for (var i = 0; i < inputs.length; i++) {
var input = inputs[i]; var input = inputs[i];
input.name = input.name.replace(/\]\[\d+/, '$&1'); input.name = input.name.replace(/\]\[\d+/, '$&1');
@@ -494,48 +512,47 @@ function triggerChange(tableRe, table, form) {
var that, x, y; // em and tablePos defined in schema.inc.php var that, x, y; // em and tablePos defined in schema.inc.php
/** Get mouse position /** Get mouse position
* @param HTMLElement
* @param MouseEvent * @param MouseEvent
* @this HTMLElement
*/ */
function schemaMousedown(el, event) { function schemaMousedown(event) {
if ((event.which ? event.which : event.button) == 1) { if ((event.which ? event.which : event.button) == 1) {
that = el; that = this;
x = event.clientX - el.offsetLeft; x = event.clientX - this.offsetLeft;
y = event.clientY - el.offsetTop; y = event.clientY - this.offsetTop;
} }
} }
/** Move object /** Move object
* @param MouseEvent * @param MouseEvent
*/ */
function schemaMousemove(ev) { function schemaMousemove(event) {
if (that !== undefined) { if (that !== undefined) {
ev = ev || event; var left = (event.clientX - x) / em;
var left = (ev.clientX - x) / em; var top = (event.clientY - y) / em;
var top = (ev.clientY - y) / em; var divs = qsa('div', that);
var divs = that.getElementsByTagName('div');
var lineSet = { }; var lineSet = { };
for (var i=0; i < divs.length; i++) { for (var i=0; i < divs.length; i++) {
if (divs[i].className == 'references') { if (divs[i].className == 'references') {
var div2 = document.getElementById((/^refs/.test(divs[i].id) ? 'refd' : 'refs') + divs[i].id.substr(4)); var div2 = qs('[id="' + (/^refs/.test(divs[i].id) ? 'refd' : 'refs') + divs[i].id.substr(4) + '"]');
var ref = (tablePos[divs[i].title] ? tablePos[divs[i].title] : [ div2.parentNode.offsetTop / em, 0 ]); var ref = (tablePos[divs[i].title] ? tablePos[divs[i].title] : [ div2.parentNode.offsetTop / em, 0 ]);
var left1 = -1; var left1 = -1;
var id = divs[i].id.replace(/^ref.(.+)-.+/, '$1'); var id = divs[i].id.replace(/^ref.(.+)-.+/, '$1');
if (divs[i].parentNode != div2.parentNode) { if (divs[i].parentNode != div2.parentNode) {
left1 = Math.min(0, ref[1] - left) - 1; left1 = Math.min(0, ref[1] - left) - 1;
divs[i].style.left = left1 + 'em'; divs[i].style.left = left1 + 'em';
divs[i].getElementsByTagName('div')[0].style.width = -left1 + 'em'; divs[i].querySelector('div').style.width = -left1 + 'em';
var left2 = Math.min(0, left - ref[1]) - 1; var left2 = Math.min(0, left - ref[1]) - 1;
div2.style.left = left2 + 'em'; div2.style.left = left2 + 'em';
div2.getElementsByTagName('div')[0].style.width = -left2 + 'em'; div2.querySelector('div').style.width = -left2 + 'em';
} }
if (!lineSet[id]) { if (!lineSet[id]) {
var line = document.getElementById(divs[i].id.replace(/^....(.+)-.+$/, 'refl$1')); var line = qs('[id="' + divs[i].id.replace(/^....(.+)-.+$/, 'refl$1') + '"]');
var top1 = top + divs[i].offsetTop / em; var top1 = top + divs[i].offsetTop / em;
var top2 = top + div2.offsetTop / em; var top2 = top + div2.offsetTop / em;
if (divs[i].parentNode != div2.parentNode) { if (divs[i].parentNode != div2.parentNode) {
top2 += ref[0] - top; top2 += ref[0] - top;
line.getElementsByTagName('div')[0].style.height = Math.abs(top1 - top2) + 'em'; line.querySelector('div').style.height = Math.abs(top1 - top2) + 'em';
} }
line.style.left = (left + left1) + 'em'; line.style.left = (left + left1) + 'em';
line.style.top = Math.min(top1, top2) + 'em'; line.style.top = Math.min(top1, top2) + 'em';
@@ -552,17 +569,16 @@ function schemaMousemove(ev) {
* @param MouseEvent * @param MouseEvent
* @param string * @param string
*/ */
function schemaMouseup(ev, db) { function schemaMouseup(event, db) {
if (that !== undefined) { if (that !== undefined) {
ev = ev || event; tablePos[that.firstChild.firstChild.firstChild.data] = [ (event.clientY - y) / em, (event.clientX - x) / em ];
tablePos[that.firstChild.firstChild.firstChild.data] = [ (ev.clientY - y) / em, (ev.clientX - x) / em ];
that = undefined; that = undefined;
var s = ''; var s = '';
for (var key in tablePos) { for (var key in tablePos) {
s += '_' + key + ':' + Math.round(tablePos[key][0] * 10000) / 10000 + 'x' + Math.round(tablePos[key][1] * 10000) / 10000; s += '_' + key + ':' + Math.round(tablePos[key][0] * 10000) / 10000 + 'x' + Math.round(tablePos[key][1] * 10000) / 10000;
} }
s = encodeURIComponent(s.substr(1)); s = encodeURIComponent(s.substr(1));
var link = document.getElementById('schema-link'); var link = qs('#schema-link');
link.href = link.href.replace(/[^=]+$/, '') + s; link.href = link.href.replace(/[^=]+$/, '') + s;
cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db
} }
@@ -573,18 +589,18 @@ function schemaMouseup(ev, db) {
var helpOpen, helpIgnore; // when mouse outs <option> then it mouse overs border of <select> - ignore it var helpOpen, helpIgnore; // when mouse outs <option> then it mouse overs border of <select> - ignore it
/** Display help /** Display help
* @param HTMLElement
* @param MouseEvent * @param MouseEvent
* @param string * @param string
* @param bool display on left side (otherwise on top) * @param bool display on left side (otherwise on top)
* @this HTMLElement
*/ */
function helpMouseover(el, event, text, side) { function helpMouseover(event, text, side) {
var target = getTarget(event); var target = getTarget(event);
if (!text) { if (!text) {
helpClose(); helpClose();
} else if (window.jush && (!helpIgnore || el != target)) { } else if (window.jush && (!helpIgnore || this != target)) {
helpOpen = 1; helpOpen = 1;
var help = document.getElementById('help'); var help = qs('#help');
help.innerHTML = text; help.innerHTML = text;
jush.highlight_tag([ help ]); jush.highlight_tag([ help ]);
alterClass(help, 'hidden'); alterClass(help, 'hidden');
@@ -596,12 +612,12 @@ function helpMouseover(el, event, text, side) {
} }
/** Close help after timeout /** Close help after timeout
* @param HTMLElement
* @param MouseEvent * @param MouseEvent
* @this HTMLElement
*/ */
function helpMouseout(el, event) { function helpMouseout(event) {
helpOpen = 0; helpOpen = 0;
helpIgnore = (el != getTarget(event)); helpIgnore = (this != getTarget(event));
setTimeout(function () { setTimeout(function () {
if (!helpOpen) { if (!helpOpen) {
helpClose(); helpClose();
@@ -612,5 +628,5 @@ function helpMouseout(el, event) {
/** Close help /** Close help
*/ */
function helpClose() { function helpClose() {
alterClass(document.getElementById('help'), 'hidden', true); alterClass(qs('#help'), 'hidden', true);
} }

View File

@@ -1,4 +1,66 @@
/** Get first element by selector
* @param string
* @return HTMLElement
*/
function qs(selector) {
return document.querySelector(selector);
}
/** Get last element by selector
* @param string
* @param [HTMLElement] defaults to document
* @return HTMLElement
*/
function qsl(selector, context) {
var els = qsa(selector, context || document);
return els[els.length - 1];
}
/** Get all elements by selector
* @param string
* @param HTMLElement
* @return NodeList
*/
function qsa(selector, context) {
return context.querySelectorAll(selector);
}
/** Return a function calling fn with the next arguments
* @param function
* @param ...
* @return function with preserved this
*/
function partial(fn) {
var args = Array.apply(null, arguments).slice(1);
return function () {
return fn.apply(this, args);
};
}
/** Return a function calling fn with the first parameter and then the next arguments
* @param function
* @param ...
* @return function with preserved this
*/
function partialArg(fn) {
var args = Array.apply(null, arguments);
return function (arg) {
args[0] = arg;
return fn.apply(this, args);
};
}
/** Assign values from source to target
* @param Object
* @param Object
*/
function mixin(target, source) {
for (var key in source) {
target[key] = source[key];
}
}
/** Add or remove CSS class /** Add or remove CSS class
* @param HTMLElement * @param HTMLElement
* @param string * @param string
@@ -12,12 +74,12 @@ function alterClass(el, className, enable) {
/** Toggle visibility /** Toggle visibility
* @param string * @param string
* @return boolean * @return boolean false
*/ */
function toggle(id) { function toggle(id) {
var el = document.getElementById(id); var el = qs('#' + id);
el.className = (el.className == 'hidden' ? '' : 'hidden'); el.className = (el.className == 'hidden' ? '' : 'hidden');
return true; return false;
} }
/** Set permanent cookie /** Set permanent cookie
@@ -33,8 +95,10 @@ function cookie(assign, days) {
/** Verify current Adminer version /** Verify current Adminer version
* @param string * @param string
* @param string own URL base
* @param string
*/ */
function verifyVersion(current) { function verifyVersion(current, url, token) {
cookie('adminer_version=0', 1); cookie('adminer_version=0', 1);
var iframe = document.createElement('iframe'); var iframe = document.createElement('iframe');
iframe.src = 'https://www.adminer.org/version/?current=' + current; iframe.src = 'https://www.adminer.org/version/?current=' + current;
@@ -50,11 +114,13 @@ function verifyVersion(current) {
var match = /version=(.+)/.exec(event.data); var match = /version=(.+)/.exec(event.data);
if (match) { if (match) {
cookie('adminer_version=' + match[1], 1); cookie('adminer_version=' + match[1], 1);
ajax(url + 'script=version', function () {
}, event.data + '&token=' + token);
} }
} }
}, false); }, false);
} }
document.getElementById('version').appendChild(iframe); qs('#version').appendChild(iframe);
} }
/** Get value of select /** Get value of select
@@ -108,7 +174,9 @@ function trCheck(el) {
*/ */
function selectCount(id, count) { function selectCount(id, count) {
setHtml(id, (count === '' ? '' : '(' + (count + '').replace(/\B(?=(\d{3})+$)/g, ' ') + ')')); setHtml(id, (count === '' ? '' : '(' + (count + '').replace(/\B(?=(\d{3})+$)/g, ' ') + ')'));
var inputs = document.getElementById(id).parentNode.parentNode.getElementsByTagName('input'); var el = qs('#' + id);
if (el) {
var inputs = qsa('input', el.parentNode.parentNode);
for (var i = 0; i < inputs.length; i++) { for (var i = 0; i < inputs.length; i++) {
var input = inputs[i]; var input = inputs[i];
if (input.type == 'submit') { if (input.type == 'submit') {
@@ -116,16 +184,17 @@ function selectCount(id, count) {
} }
} }
} }
}
/** Check all elements matching given name /** Check all elements matching given name
* @param HTMLInputElement
* @param RegExp * @param RegExp
* @this HTMLInputElement
*/ */
function formCheck(el, name) { function formCheck(name) {
var elems = el.form.elements; var elems = this.form.elements;
for (var i=0; i < elems.length; i++) { for (var i=0; i < elems.length; i++) {
if (name.test(elems[i].name)) { if (name.test(elems[i].name)) {
elems[i].checked = el.checked; elems[i].checked = this.checked;
trCheck(elems[i]); trCheck(elems[i]);
} }
} }
@@ -134,10 +203,10 @@ function formCheck(el, name) {
/** Check all rows in <table class="checkable"> /** Check all rows in <table class="checkable">
*/ */
function tableCheck() { function tableCheck() {
var tables = document.getElementsByTagName('table'); var tables = qsa('table', document);
for (var i=0; i < tables.length; i++) { for (var i=0; i < tables.length; i++) {
if (/(^|\s)checkable(\s|$)/.test(tables[i].className)) { if (/(^|\s)checkable(\s|$)/.test(tables[i].className)) {
var trs = tables[i].getElementsByTagName('tr'); var trs = qsa('tr', tables[i]);
for (var j=0; j < trs.length; j++) { for (var j=0; j < trs.length; j++) {
trCheck(trs[j].firstChild.firstChild); trCheck(trs[j].firstChild.firstChild);
} }
@@ -149,7 +218,7 @@ function tableCheck() {
* @param string * @param string
*/ */
function formUncheck(id) { function formUncheck(id) {
var el = document.getElementById(id); var el = qs('#' + id);
el.checked = false; el.checked = false;
trCheck(el); trCheck(el);
} }
@@ -182,7 +251,7 @@ function tableClick(event, click) {
if (el.type != 'checkbox') { if (el.type != 'checkbox') {
return; return;
} }
checkboxClick(event, el); checkboxClick.call(el, event);
click = false; click = false;
} }
el = el.parentNode; el = el.parentNode;
@@ -202,24 +271,24 @@ var lastChecked;
/** Shift-click on checkbox for multiple selection. /** Shift-click on checkbox for multiple selection.
* @param MouseEvent * @param MouseEvent
* @param HTMLInputElement * @this HTMLInputElement
*/ */
function checkboxClick(event, el) { function checkboxClick(event) {
if (!el.name) { if (!this.name) {
return; return;
} }
if (event.shiftKey && (!lastChecked || lastChecked.name == el.name)) { if (event.shiftKey && (!lastChecked || lastChecked.name == this.name)) {
var checked = (lastChecked ? lastChecked.checked : true); var checked = (lastChecked ? lastChecked.checked : true);
var inputs = parentTag(el, 'table').getElementsByTagName('input'); var inputs = qsa('input', parentTag(this, 'table'));
var checking = !lastChecked; var checking = !lastChecked;
for (var i=0; i < inputs.length; i++) { for (var i=0; i < inputs.length; i++) {
var input = inputs[i]; var input = inputs[i];
if (input.name === el.name) { if (input.name === this.name) {
if (checking) { if (checking) {
input.checked = checked; input.checked = checked;
trCheck(input); trCheck(input);
} }
if (input === el || input === lastChecked) { if (input === this || input === lastChecked) {
if (checking) { if (checking) {
break; break;
} }
@@ -228,7 +297,7 @@ function checkboxClick(event, el) {
} }
} }
} else { } else {
lastChecked = el; lastChecked = this;
} }
} }
@@ -237,9 +306,9 @@ function checkboxClick(event, el) {
* @param string undefined to set parentNode to &nbsp; * @param string undefined to set parentNode to &nbsp;
*/ */
function setHtml(id, html) { function setHtml(id, html) {
var el = document.getElementById(id); var el = qs('#' + id);
if (el) { if (el) {
if (html == undefined) { if (html == null) {
el.parentNode.innerHTML = '&nbsp;'; el.parentNode.innerHTML = '&nbsp;';
} else { } else {
el.innerHTML = html; el.innerHTML = html;
@@ -262,88 +331,89 @@ function nodePosition(el) {
/** Go to the specified page /** Go to the specified page
* @param string * @param string
* @param string * @param string
* @param [MouseEvent]
*/ */
function pageClick(href, page, event) { function pageClick(href, page) {
if (!isNaN(page) && page) { if (!isNaN(page) && page) {
href += (page != 1 ? '&page=' + (page - 1) : ''); location.href = href + (page != 1 ? '&page=' + (page - 1) : '');
location.href = href;
} }
} }
/** Display items in menu /** Display items in menu
* @param HTMLElement
* @param MouseEvent * @param MouseEvent
* @this HTMLElement
*/ */
function menuOver(el, event) { function menuOver(event) {
var a = getTarget(event); var a = getTarget(event);
if (isTag(a, 'a|span') && a.offsetLeft + a.offsetWidth > a.parentNode.offsetWidth - 15) { // 15 - ellipsis if (isTag(a, 'a|span') && a.offsetLeft + a.offsetWidth > a.parentNode.offsetWidth - 15) { // 15 - ellipsis
el.style.overflow = 'visible'; this.style.overflow = 'visible';
} }
} }
/** Hide items in menu /** Hide items in menu
* @param HTMLElement * @this HTMLElement
*/ */
function menuOut(el) { function menuOut() {
el.style.overflow = 'auto'; this.style.overflow = 'auto';
} }
/** Add row in select fieldset /** Add row in select fieldset
* @param HTMLSelectElement * @this HTMLSelectElement
*/ */
function selectAddRow(field) { function selectAddRow() {
field.onchange = function () { var field = this;
selectFieldChange(field.form);
};
field.onchange();
var row = cloneNode(field.parentNode); var row = cloneNode(field.parentNode);
var selects = row.getElementsByTagName('select'); field.onchange = selectFieldChange;
field.onchange();
var selects = qsa('select', row);
for (var i=0; i < selects.length; i++) { for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/[a-z]\[\d+/, '$&1'); selects[i].name = selects[i].name.replace(/[a-z]\[\d+/, '$&1');
selects[i].selectedIndex = 0; selects[i].selectedIndex = 0;
} }
var inputs = row.getElementsByTagName('input'); var inputs = qsa('input', row);
for (var i=0; i < inputs.length; i++) { for (var i=0; i < inputs.length; i++) {
inputs[i].name = inputs[i].name.replace(/[a-z]\[\d+/, '$&1'); inputs[i].name = inputs[i].name.replace(/[a-z]\[\d+/, '$&1');
inputs[i].value = '';
inputs[i].className = ''; inputs[i].className = '';
if (inputs[i].type == 'checkbox') {
inputs[i].checked = false;
} else {
inputs[i].value = '';
}
} }
field.parentNode.parentNode.appendChild(row); field.parentNode.parentNode.appendChild(row);
} }
/** Prevent onsearch handler on Enter /** Prevent onsearch handler on Enter
* @param HTMLInputElement
* @param KeyboardEvent * @param KeyboardEvent
* @this HTMLInputElement
*/ */
function selectSearchKeydown(el, event) { function selectSearchKeydown(event) {
if (event.keyCode == 13 || event.keyCode == 10) { if (event.keyCode == 13 || event.keyCode == 10) {
el.onsearch = function () { this.onsearch = function () {
}; };
} }
} }
/** Clear column name after resetting search /** Clear column name after resetting search
* @param HTMLInputElement * @this HTMLInputElement
*/ */
function selectSearchSearch(el) { function selectSearchSearch() {
if (!el.value) { if (!this.value) {
el.parentNode.firstChild.selectedIndex = 0; this.parentNode.firstChild.selectedIndex = 0;
} }
} }
/** Toggles column context menu /** Toggles column context menu
* @param HTMLElement
* @param [string] extra class name * @param [string] extra class name
* @this HTMLElement
*/ */
function columnMouse(el, className) { function columnMouse(className) {
var spans = el.getElementsByTagName('span'); var spans = qsa('span', this);
for (var i=0; i < spans.length; i++) { for (var i=0; i < spans.length; i++) {
if (/column/.test(spans[i].className)) { if (/column/.test(spans[i].className)) {
spans[i].className = 'column' + (className || ''); spans[i].className = 'column' + (className || '');
@@ -355,11 +425,12 @@ function columnMouse(el, className) {
/** Fill column in search field /** Fill column in search field
* @param string * @param string
* @return boolean false
*/ */
function selectSearch(name) { function selectSearch(name) {
var el = document.getElementById('fieldset-search'); var el = qs('#fieldset-search');
el.className = ''; el.className = '';
var divs = el.getElementsByTagName('div'); var divs = qsa('div', el);
for (var i=0; i < divs.length; i++) { for (var i=0; i < divs.length; i++) {
var div = divs[i]; var div = divs[i];
if (isTag(div.firstChild, 'select') && selectValue(div.firstChild) == name) { if (isTag(div.firstChild, 'select') && selectValue(div.firstChild) == name) {
@@ -370,7 +441,8 @@ function selectSearch(name) {
div.firstChild.value = name; div.firstChild.value = name;
div.firstChild.onchange(); div.firstChild.onchange();
} }
div.lastChild.focus(); qs('[name$="[val]"]', div).focus();
return false;
} }
@@ -398,6 +470,7 @@ function getTarget(event) {
* @return boolean * @return boolean
*/ */
function bodyKeydown(event, button) { function bodyKeydown(event, button) {
eventStop(event);
var target = getTarget(event); var target = getTarget(event);
if (target.jushTextarea) { if (target.jushTextarea) {
target = target.jushTextarea; target = target.jushTextarea;
@@ -446,55 +519,56 @@ function editingKeydown(event) {
return false; return false;
} }
if (event.shiftKey && !bodyKeydown(event, 'insert')) { if (event.shiftKey && !bodyKeydown(event, 'insert')) {
eventStop(event);
return false; return false;
} }
return true; return true;
} }
/** Disable maxlength for functions /** Disable maxlength for functions
* @param HTMLSelectElement * @this HTMLSelectElement
*/ */
function functionChange(select) { function functionChange() {
var input = select.form[select.name.replace(/^function/, 'fields')]; var input = this.form[this.name.replace(/^function/, 'fields')];
if (selectValue(select)) { if (selectValue(this)) {
if (input.origType === undefined) { if (input.origType === undefined) {
input.origType = input.type; input.origType = input.type;
input.origMaxLength = input.maxLength; input.origMaxLength = input.getAttribute('data-maxlength');
} }
input.removeAttribute('maxlength'); input.removeAttribute('data-maxlength');
input.type = 'text'; input.type = 'text';
} else if (input.origType) { } else if (input.origType) {
input.type = input.origType; input.type = input.origType;
if (input.origMaxLength >= 0) { if (input.origMaxLength >= 0) {
input.maxLength = input.origMaxLength; input.setAttribute('data-maxlength', input.origMaxLength);
} }
} }
oninput({target: input});
helpClose(); helpClose();
} }
/** Call this.onchange() if value changes /** Skip 'original' when typing
* @this HTMLInputElement * @param number
* @this HTMLTableCellElement
*/ */
function keyupChange() { function skipOriginal(first) {
if (this.value != this.getAttribute('value')) { var fnSelect = this.previousSibling.firstChild;
this.onchange(); if (fnSelect.selectedIndex < first) {
this.setAttribute('value', this.value); fnSelect.selectedIndex = first;
} }
} }
/** Add new field in schema-less edit /** Add new field in schema-less edit
* @param HTMLInputElement * @this HTMLInputElement
*/ */
function fieldChange(field) { function fieldChange() {
var row = cloneNode(parentTag(field, 'tr')); var row = cloneNode(parentTag(this, 'tr'));
var inputs = row.getElementsByTagName('input'); var inputs = qsa('input', row);
for (var i = 0; i < inputs.length; i++) { for (var i = 0; i < inputs.length; i++) {
inputs[i].value = ''; inputs[i].value = '';
} }
// keep value in <select> (function) // keep value in <select> (function)
parentTag(field, 'table').appendChild(row); parentTag(this, 'table').appendChild(row);
field.onchange = function () { }; this.oninput = function () { };
} }
@@ -509,7 +583,7 @@ function fieldChange(field) {
function ajax(url, callback, data, message) { function ajax(url, callback, data, message) {
var request = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false)); var request = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false));
if (request) { if (request) {
var ajaxStatus = document.getElementById('ajaxstatus'); var ajaxStatus = qs('#ajaxstatus');
if (message) { if (message) {
ajaxStatus.innerHTML = '<div class="message">' + message + '</div>'; ajaxStatus.innerHTML = '<div class="message">' + message + '</div>';
ajaxStatus.className = ajaxStatus.className.replace(/ hidden/g, ''); ajaxStatus.className = ajaxStatus.className.replace(/ hidden/g, '');
@@ -538,11 +612,11 @@ function ajax(url, callback, data, message) {
/** Use setHtml(key, value) for JSON response /** Use setHtml(key, value) for JSON response
* @param string * @param string
* @return XMLHttpRequest or false in case of an error * @return boolean false for success
*/ */
function ajaxSetHtml(url) { function ajaxSetHtml(url) {
return ajax(url, function (request) { return !ajax(url, function (request) {
var data = eval('(' + request.responseText + ')'); var data = window.JSON ? JSON.parse(request.responseText) : eval('(' + request.responseText + ')');
for (var key in data) { for (var key in data) {
setHtml(key, data[key]); setHtml(key, data[key]);
} }
@@ -579,7 +653,7 @@ function ajaxForm(form, message, button) {
return ajax(url, function (request) { return ajax(url, function (request) {
setHtml('ajaxstatus', request.responseText); setHtml('ajaxstatus', request.responseText);
if (window.jush) { if (window.jush) {
jush.highlight_tag(document.getElementById('ajaxstatus').getElementsByTagName('code'), 0); jush.highlight_tag(qsa('code', qs('#ajaxstatus')), 0);
} }
}, data, message); }, data, message);
} }
@@ -587,12 +661,13 @@ function ajaxForm(form, message, button) {
/** Display edit field /** Display edit field
* @param HTMLElement
* @param MouseEvent * @param MouseEvent
* @param number display textarea instead of input, 2 - load long text * @param number display textarea instead of input, 2 - load long text
* @param string warning to display * @param string warning to display
* @this HTMLElement
*/ */
function selectClick(td, event, text, warning) { function selectClick(event, text, warning) {
var td = this;
var target = getTarget(event); var target = getTarget(event);
if (!isCtrl(event) || isTag(td.firstChild, 'input|textarea') || isTag(target, 'a')) { if (!isCtrl(event) || isTag(td.firstChild, 'input|textarea') || isTag(target, 'a')) {
return; return;
@@ -622,7 +697,7 @@ function selectClick(td, event, text, warning) {
}); });
input.rows = rows; input.rows = rows;
} }
if (value == '\u00A0' || td.getElementsByTagName('i').length) { // &nbsp; or i - NULL if (value == '\u00A0' || qsa('i', td).length) { // &nbsp; or i - NULL
value = ''; value = '';
} }
if (document.selection) { if (document.selection) {
@@ -659,21 +734,22 @@ function selectClick(td, event, text, warning) {
/** Load and display next page in select /** Load and display next page in select
* @param HTMLLinkElement
* @param number * @param number
* @param string * @param string
* @return boolean * @return boolean false for success
* @this HTMLLinkElement
*/ */
function selectLoadMore(a, limit, loading) { function selectLoadMore(limit, loading) {
var a = this;
var title = a.innerHTML; var title = a.innerHTML;
var href = a.href; var href = a.href;
a.innerHTML = loading; a.innerHTML = loading;
if (href) { if (href) {
a.removeAttribute('href'); a.removeAttribute('href');
return ajax(href, function (request) { return !ajax(href, function (request) {
var tbody = document.createElement('tbody'); var tbody = document.createElement('tbody');
tbody.innerHTML = request.responseText; tbody.innerHTML = request.responseText;
document.getElementById('table').appendChild(tbody); qs('#table').appendChild(tbody);
if (tbody.children.length < limit) { if (tbody.children.length < limit) {
a.parentNode.removeChild(a); a.parentNode.removeChild(a);
} else { } else {
@@ -706,7 +782,7 @@ function eventStop(event) {
*/ */
function setupSubmitHighlight(parent) { function setupSubmitHighlight(parent) {
for (var key in { input: 1, select: 1, textarea: 1 }) { for (var key in { input: 1, select: 1, textarea: 1 }) {
var inputs = parent.getElementsByTagName(key); var inputs = qsa(key, parent);
for (var i = 0; i < inputs.length; i++) { for (var i = 0; i < inputs.length; i++) {
setupSubmitHighlightInput(inputs[i]) setupSubmitHighlightInput(inputs[i])
} }
@@ -751,7 +827,10 @@ function findDefaultSubmit(el) {
if (el.jushTextarea) { if (el.jushTextarea) {
el = el.jushTextarea; el = el.jushTextarea;
} }
var inputs = el.form.getElementsByTagName('input'); if (!el.form) {
return null;
}
var inputs = qsa('input', el.form);
for (var i = 0; i < inputs.length; i++) { for (var i = 0; i < inputs.length; i++) {
var input = inputs[i]; var input = inputs[i];
if (input.type == 'submit' && !input.style.zIndex) { if (input.type == 'submit' && !input.style.zIndex) {
@@ -790,6 +869,23 @@ function focus(el) {
*/ */
function cloneNode(el) { function cloneNode(el) {
var el2 = el.cloneNode(true); var el2 = el.cloneNode(true);
var selector = 'input, select';
var origEls = qsa(selector, el);
var cloneEls = qsa(selector, el2);
for (var i=0; i < origEls.length; i++) {
var origEl = origEls[i];
for (var key in origEl) {
if (/^on/.test(key) && origEl[key]) {
cloneEls[i][key] = origEl[key];
}
}
}
setupSubmitHighlight(el2); setupSubmitHighlight(el2);
return el2; return el2;
} }
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
};

View File

@@ -6,27 +6,16 @@ if (!$fields) {
} }
$table_status = table_status1($TABLE, true); $table_status = table_status1($TABLE, true);
page_header(($fields && is_view($table_status) ? lang('View') : lang('Table')) . ": " . h($TABLE), $error); page_header(($fields && is_view($table_status) ? $table_status['Engine'] == 'materialized view' ? lang('Materialized view') : lang('View') : lang('Table')) . ": " . h($TABLE), $error);
$adminer->selectLinks($table_status); $adminer->selectLinks($table_status);
$comment = $table_status["Comment"]; $comment = $table_status["Comment"];
if ($comment != "") { if ($comment != "") {
echo "<p>" . lang('Comment') . ": " . h($comment) . "\n"; echo "<p class='nowrap'>" . lang('Comment') . ": " . h($comment) . "\n";
} }
if ($fields) { if ($fields) {
echo "<table cellspacing='0'>\n"; $adminer->tableStructurePrint($fields);
echo "<thead><tr><th>" . lang('Column') . "<td>" . lang('Type') . (support("comment") ? "<td>" . lang('Comment') : "") . "</thead>\n";
foreach ($fields as $field) {
echo "<tr" . odd() . "><th>" . h($field["field"]);
echo "<td><span title='" . h($field["collation"]) . "'>" . h($field["full_type"]) . "</span>";
echo ($field["null"] ? " <i>NULL</i>" : "");
echo ($field["auto_increment"] ? " <i>" . lang('Auto Increment') . "</i>" : "");
echo (isset($field["default"]) ? " <span title='" . lang('Default value') . "'>[<b>" . h($field["default"]) . "</b>]</span>" : "");
echo (support("comment") ? "<td>" . nbsp($field["comment"]) : "");
echo "\n";
}
echo "</table>\n";
} }
if (!is_view($table_status)) { if (!is_view($table_status)) {
@@ -34,19 +23,7 @@ if (!is_view($table_status)) {
echo "<h3 id='indexes'>" . lang('Indexes') . "</h3>\n"; echo "<h3 id='indexes'>" . lang('Indexes') . "</h3>\n";
$indexes = indexes($TABLE); $indexes = indexes($TABLE);
if ($indexes) { if ($indexes) {
echo "<table cellspacing='0'>\n"; $adminer->tableIndexesPrint($indexes);
foreach ($indexes as $name => $index) {
ksort($index["columns"]); // enforce correct columns order
$print = array();
foreach ($index["columns"] as $key => $val) {
$print[] = "<i>" . h($val) . "</i>"
. ($index["lengths"][$key] ? "(" . $index["lengths"][$key] . ")" : "")
. ($index["descs"][$key] ? " DESC" : "")
;
}
echo "<tr title='" . h($name) . "'><th>$index[type]<td>" . implode(", ", $print) . "\n";
}
echo "</table>\n";
} }
echo '<p class="links"><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n"; echo '<p class="links"><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n";
} }

View File

@@ -40,10 +40,10 @@ 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"]); ?> <tr><th><?php echo lang('Type'); ?><td><?php echo html_select("Type", $trigger_options["Type"], $row["Type"]); ?>
</table> </table>
<p><?php echo lang('Name'); ?>: <input name="Trigger" value="<?php echo h($row["Trigger"]); ?>" maxlength="64" autocapitalize="off"> <p><?php echo lang('Name'); ?>: <input name="Trigger" value="<?php echo h($row["Trigger"]); ?>" maxlength="64" autocapitalize="off">
<script type="text/javascript">document.getElementById('form')['Timing'].onchange();</script> <?php echo script("qs('#form')['Timing'].onchange();"); ?>
<p><?php textarea("Statement", $row["Statement"]); ?> <p><?php textarea("Statement", $row["Statement"]); ?>
<p> <p>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?> <?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $name)); ?><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -22,7 +22,7 @@ if (!$row) {
<p> <p>
<?php <?php
if ($TYPE != "") { if ($TYPE != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n"; echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop %s?', $TYPE)) . "\n";
} else { } else {
echo "<input name='name' value='" . h($row['name']) . "' autocapitalize='off'>\n"; echo "<input name='name' value='" . h($row['name']) . "' autocapitalize='off'>\n";
textarea("as", $row["as"]); textarea("as", $row["as"]);

View File

@@ -135,7 +135,7 @@ if ($_POST) {
<tr><th><?php echo lang('Server'); ?><td><input name="host" maxlength="60" value="<?php echo h($row["host"]); ?>" autocapitalize="off"> <tr><th><?php echo lang('Server'); ?><td><input name="host" maxlength="60" value="<?php echo h($row["host"]); ?>" autocapitalize="off">
<tr><th><?php echo lang('Username'); ?><td><input name="user" maxlength="16" value="<?php echo h($row["user"]); ?>" autocapitalize="off"> <tr><th><?php echo lang('Username'); ?><td><input name="user" maxlength="16" 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"]); ?>"> <tr><th><?php echo lang('Password'); ?><td><input name="pass" id="pass" value="<?php echo h($row["pass"]); ?>">
<?php if (!$row["hashed"]) { ?><script type="text/javascript">typePassword(document.getElementById('pass'));</script><?php } ?> <?php if (!$row["hashed"]) { echo script("typePassword(qs('#pass'));"); } ?>
<?php echo checkbox("hashed", 1, $row["hashed"], lang('Hashed'), "typePassword(this.form['pass'], this.checked);"); ?> <?php echo checkbox("hashed", 1, $row["hashed"], lang('Hashed'), "typePassword(this.form['pass'], this.checked);"); ?>
</table> </table>
@@ -169,7 +169,11 @@ foreach (array(
} elseif (isset($_GET["grant"])) { } elseif (isset($_GET["grant"])) {
echo "<td><select name=$name><option><option value='1'" . ($value ? " selected" : "") . ">" . lang('Grant') . "<option value='0'" . ($value == "0" ? " selected" : "") . ">" . lang('Revoke') . "</select>"; echo "<td><select name=$name><option><option value='1'" . ($value ? " selected" : "") . ">" . lang('Grant') . "<option value='0'" . ($value == "0" ? " selected" : "") . ">" . lang('Revoke') . "</select>";
} else { } else {
echo "<td align='center'><label class='block'><input type='checkbox' name=$name value='1'" . ($value ? " checked" : "") . ($privilege == "All privileges" ? " id='grants-$i-all'" : ($privilege == "Grant option" ? "" : " onclick=\"if (this.checked) formUncheck('grants-$i-all');\"")) . "></label>"; //! uncheck all except grant if all is checked echo "<td align='center'><label class='block'>";
echo "<input type='checkbox' name=$name value='1'" . ($value ? " checked" : "") . ($privilege == "All privileges"
? " id='grants-$i-all'>" //! uncheck all except grant if all is checked
: ">" . ($privilege == "Grant option" ? "" : script("qsl('input').onclick = function () { if (this.checked) formUncheck('grants-$i-all'); };")));
echo "</label>";
} }
$i++; $i++;
} }
@@ -180,6 +184,6 @@ echo "</table>\n";
?> ?>
<p> <p>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php if (isset($_GET["host"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?> <?php if (isset($_GET["host"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', "$USER@$_GET[host]")); ?><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -1,6 +1,11 @@
<?php <?php
$TABLE = $_GET["view"]; $TABLE = $_GET["view"];
$row = $_POST; $row = $_POST;
$orig_type = "VIEW";
if ($jush == "pgsql" && $TABLE != "") {
$status = table_status($TABLE);
$orig_type = strtoupper($status["Engine"]);
}
if ($_POST && !$error) { if ($_POST && !$error) {
$name = trim($row["name"]); $name = trim($row["name"]);
@@ -8,22 +13,14 @@ if ($_POST && !$error) {
$location = ME . "table=" . urlencode($name); $location = ME . "table=" . urlencode($name);
$message = lang('View has been altered.'); $message = lang('View has been altered.');
if ($_GET["materialized"]) { $type = ($_POST["materialized"] ? "MATERIALIZED VIEW" : "VIEW");
$type = "MATERIALIZED VIEW";
} else {
$type = "VIEW";
if ($jush == "pgsql") {
$status = table_status($name);
$type = ($status ? strtoupper($status["Engine"]) : $type);
}
}
if (!$_POST["drop"] && $TABLE == $name && $jush != "sqlite" && $type != "MATERIALIZED VIEW") { if (!$_POST["drop"] && $TABLE == $name && $jush != "sqlite" && $type == "VIEW" && $orig_type == "VIEW") {
query_redirect(($jush == "mssql" ? "ALTER" : "CREATE OR REPLACE") . " VIEW " . table($name) . $as, $location, $message); query_redirect(($jush == "mssql" ? "ALTER" : "CREATE OR REPLACE") . " VIEW " . table($name) . $as, $location, $message);
} else { } else {
$temp_name = $name . "_adminer_" . uniqid(); $temp_name = $name . "_adminer_" . uniqid();
drop_create( drop_create(
"DROP $type " . table($TABLE), "DROP $orig_type " . table($TABLE),
"CREATE $type " . table($name) . $as, "CREATE $type " . table($name) . $as,
"DROP $type " . table($name), "DROP $type " . table($name),
"CREATE $type " . table($temp_name) . $as, "CREATE $type " . table($temp_name) . $as,
@@ -41,6 +38,7 @@ if ($_POST && !$error) {
if (!$_POST && $TABLE != "") { if (!$_POST && $TABLE != "") {
$row = view($TABLE); $row = view($TABLE);
$row["name"] = $TABLE; $row["name"] = $TABLE;
$row["materialized"] = ($orig_type != "VIEW");
if (!$error) { if (!$error) {
$error = error(); $error = error();
} }
@@ -51,9 +49,10 @@ page_header(($TABLE != "" ? lang('Alter view') : lang('Create view')), $error, a
<form action="" method="post"> <form action="" method="post">
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64" autocapitalize="off"> <p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64" autocapitalize="off">
<?php echo (support("materializedview") ? " " . checkbox("materialized", 1, $row["materialized"], lang('Materialized view')) : ""); ?>
<p><?php textarea("select", $row["select"]); ?> <p><?php textarea("select", $row["select"]); ?>
<p> <p>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($_GET["view"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?> <?php if ($TABLE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $TABLE)); ?><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -1,3 +1,64 @@
Adminer 4.5.0 (released 2018-01-24):
Display name of the object in confirmation when dropping it
Display newlines in column comments (bug #573)
Support current_timestamp() as default of time fields (bug #572)
Hide window.opener from pages opened in a new window (bug #561)
Display error when getting row to edit
Store current Adminer version server-side to avoid excessive requests
Adminer: Fix Search data in tables (regression from 4.4.0)
CSP: Allow any styles, images, media and fonts, disallow base-uri
MySQL: Support geometry in MySQL 8 (bug #574)
MySQL: Support routines with comments in parameters (bug #460)
MariaDB: Support fulltext and spatial indexes in InnoDB (bug #583)
SQLite: Enable foreign key checks
PostgreSQL: Respect NULL default value
PostgreSQL: Display foreign tables (bug #576)
PostgreSQL: Do not export triggers if not requested
PostgreSQL: Export DROP SEQUENCE if dropping table
PostgreSQL: Display boolean values as code (bug #562)
MS SQL: Support freetds
non-MySQL: Avoid CONVERT() (bug #509)
Elasticsearch: Insert, update, delete
MongoDB: Support mongodb PHP extension
Editor: Fix displaying of false values in PostgreSQL (bug #568)
Adminer 4.4.0 (released 2018-01-17):
Add Content Security Policy
Disallow scripts without nonce
Rate limit password-less login attempts from the same IP address
Disallow connecting to privileged ports
Add nosniff header
PHP 7.1: Prevent warning when using empty limit
PHP 7.2: Prevent warning when searching in select
MySQL: Remove dedicated view for replication status (added in 4.3.0)
PostgreSQL: Sort table names (regression from 4.3.1)
Editor: Don't set time zone from PHP, fixes DST
Editor: Display field comment's text inside [] only in edit form
Editor: Fix doubleclick on database page
Editor: Fix Search data in tables
Customization: Always send security headers
Hebrew translation
Adminer 4.3.1 (released 2017-04-14):
Fix permanent login after logout (bug #539)
Fix SQL command autofocus (regression from 4.0.0)
PostgreSQL: Support JSON and JSONB data types
PostgreSQL: Fix index size computation in PostgreSQL < 9.0 (regression from 4.3.0)
PostgreSQL: Fix nullable fields in export
Adminer 4.3.0 (released 2017-03-15):
Make maxlength in edit fields a soft limit
Add accessibility labels
Add Cache-Control: immutable to static files
MySQL: Support MySQL 8
MySQL: Support JSON data type
MySQL: Add dedicated view for replication status
MySQL: Support spatial indexes
PostgreSQL: Export
PostgreSQL: Don't treat partial indexes as unique
MS SQL: Support pdo_dblib
Elasticsearch: Support HTTPS by inputting https://server
Adminer 4.2.5 (released 2016-06-01): Adminer 4.2.5 (released 2016-06-01):
Fix remote execution in SQLite query Fix remote execution in SQLite query
SQLite: Require credentials to use SQLite: Require credentials to use

View File

@@ -134,7 +134,7 @@ function put_file_lang($match) {
case "' . $lang . '": $compressed = "' . add_quo_slashes(lzw_compress(implode("\n", $translation_ids))) . '"; break;'; case "' . $lang . '": $compressed = "' . add_quo_slashes(lzw_compress(implode("\n", $translation_ids))) . '"; break;';
} }
$translations_version = crc32($return); $translations_version = crc32($return);
return '$translations = &$_SESSION["translations"]; return '$translations = $_SESSION["translations"];
if ($_SESSION["translations_version"] != ' . $translations_version . ') { if ($_SESSION["translations_version"] != ' . $translations_version . ') {
$translations = array(); $translations = array();
$_SESSION["translations_version"] = ' . $translations_version . '; $_SESSION["translations_version"] = ' . $translations_version . ';
@@ -152,6 +152,7 @@ function get_translations($lang) {
if (!$translations) { if (!$translations) {
$translations = get_translations($LANG); $translations = get_translations($LANG);
$_SESSION["translations"] = $translations;
} }
'; ';
} }
@@ -326,10 +327,12 @@ if ($_SERVER["argv"][1]) {
} }
// check function definition in drivers // check function definition in drivers
$filename = dirname(__FILE__) . "/adminer/drivers/mysql.inc.php"; $file = file_get_contents(dirname(__FILE__) . "/adminer/drivers/mysql.inc.php");
preg_match_all('~\\bfunction ([^(]+)~', file_get_contents($filename), $matches); //! respect context (extension, class) $file = preg_replace('~( *)class Min_Driver.*}~sU', '', $file);
preg_match_all('~\\bfunction ([^(]+)~', $file, $matches); //! respect context (extension, class)
$functions = array_combine($matches[1], $matches[0]); $functions = array_combine($matches[1], $matches[0]);
unset($functions["__destruct"], $functions["Min_DB"], $functions["Min_Result"], $functions["Min_Driver"]); //! do not warn about functions without declared support()
unset($functions["__construct"], $functions["__destruct"], $functions["set_charset"]);
foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($driver ? $driver : "*") . ".inc.php") as $filename) { foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($driver ? $driver : "*") . ".inc.php") as $filename) {
if ($filename != "mysql.inc.php") { if ($filename != "mysql.inc.php") {
$file = file_get_contents($filename); $file = file_get_contents($filename);
@@ -375,9 +378,9 @@ if ($driver) {
} }
} }
if (count($drivers) == 1) { if (count($drivers) == 1) {
$file = str_replace('<?php echo html_select("driver", $drivers, DRIVER); ?>', "<input type='hidden' name='driver' value='" . ($driver == "mysql" ? "server" : $driver) . "'>" . reset($drivers), $file); $file = str_replace('<?php echo html_select("auth[driver]", $drivers, DRIVER) . "\n"; ?>', "<input type='hidden' name='auth[driver]' value='" . ($driver == "mysql" ? "server" : $driver) . "'>" . reset($drivers), $file);
} }
$file = preg_replace('(;../externals/jush/modules/jush-(?!textarea\.|txt\.|' . preg_quote($driver == "mysql" ? "sql" : $driver) . '\.)[^.]+.js)', '', $file); $file = preg_replace('(;../externals/jush/modules/jush-(?!textarea\.|txt\.|js\.|' . preg_quote($driver == "mysql" ? "sql" : $driver) . '\.)[^.]+.js)', '', $file);
} }
if ($project == "editor") { if ($project == "editor") {
$file = preg_replace('~;../externals/jush/jush.css~', '', $file); $file = preg_replace('~;../externals/jush/jush.css~', '', $file);
@@ -392,16 +395,15 @@ if ($_SESSION["lang"]) {
$file = str_replace("<?php switch_lang(); ?>\n", "", $file); $file = str_replace("<?php switch_lang(); ?>\n", "", $file);
$file = str_replace('<?php echo $LANG; ?>', $_SESSION["lang"], $file); $file = str_replace('<?php echo $LANG; ?>', $_SESSION["lang"], $file);
} }
$file = str_replace('<script type="text/javascript" src="static/editing.js"></script>' . "\n", "", $file); $file = str_replace('<?php echo script_src("static/editing.js"); ?>' . "\n", "", $file);
$file = str_replace('<script type="text/javascript" src="../externals/jush/modules/jush-textarea.js"></script>' . "\n", "", $file); $file = preg_replace('~\\s+echo script_src\\("\\.\\./externals/jush/modules/jush-(textarea|txt|js|\\$jush)\\.js"\\);~', '', $file);
$file = str_replace('<script type="text/javascript" src="../externals/jush/modules/jush-txt.js"></script>' . "\n", "", $file);
$file = str_replace('<script type="text/javascript" src="../externals/jush/modules/jush-<?php echo $jush; ?>.js"></script>' . "\n", "", $file);
$file = str_replace('<link rel="stylesheet" type="text/css" href="../externals/jush/jush.css">' . "\n", "", $file); $file = str_replace('<link rel="stylesheet" type="text/css" href="../externals/jush/jush.css">' . "\n", "", $file);
$file = preg_replace_callback("~compile_file\\('([^']+)'(?:, '([^']*)')?\\)~", 'compile_file', $file); // integrate static files $file = preg_replace_callback("~compile_file\\('([^']+)'(?:, '([^']*)')?\\)~", 'compile_file', $file); // integrate static files
$replace = 'h(preg_replace("~\\\\\\\\?.*~", "", ME)) . "?file=\\1&amp;version=' . $VERSION . ($driver ? '&amp;driver=' . $driver : ''); $replace = 'preg_replace("~\\\\\\\\?.*~", "", ME) . "?file=\\1&version=' . $VERSION . ($driver ? '&driver=' . $driver : '') . '"';
$file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file); $file = preg_replace('~\\.\\./adminer/static/(default\\.css|favicon\\.ico)~', '<?php echo h(' . $replace . '); ?>', $file);
$file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file); $file = preg_replace('~"\\.\\./adminer/static/(functions\\.js)"~', $replace, $file);
$file = preg_replace('~\\.\\./externals/jush/modules/(jush\\.js)~', '<?php echo ' . $replace . '"; ?>', $file); $file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . h(' . $replace . ') . "', $file);
$file = preg_replace('~"\\.\\./externals/jush/modules/(jush\\.js)"~', $replace, $file);
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file); $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
$file = php_shrink($file); $file = php_shrink($file);

View File

@@ -13,7 +13,7 @@
"authors": [ "authors": [
{ {
"name": "Jakub Vrána", "name": "Jakub Vrána",
"homepage": "http://www.vrana.cz/" "homepage": "https://www.vrana.cz/"
} }
], ],
"autoload": { "autoload": {
@@ -23,7 +23,7 @@
}, },
"license": [ "license": [
"Apache-2.0", "Apache-2.0",
"GPL-2.0" "GPL-2.0-only"
], ],
"scripts": { "scripts": {
"compile": "php compile.php" "compile": "php compile.php"

View File

@@ -46,7 +46,7 @@ border:5px solid #ccc;margin:0}
#menu a:hover{background:#333;color:#fff;border-color:#333} #menu a:hover{background:#333;color:#fff;border-color:#333}
#menu a.h1,#menu a.h1:hover{display:block;height:0;width:175px;padding:40px 0 0 0;overflow:hidden;float:left;border:0;margin:0; #menu a.h1,#menu a.h1:hover{display:block;height:0;width:175px;padding:40px 0 0 0;overflow:hidden;float:left;border:0;margin:0;
outline:0;background:url(//www.bradezone.com/random/adminer_logo.gif) no-repeat;line-height:32px} outline:0;background:url(//www.bradezone.com/random/adminer_logo.gif) no-repeat;line-height:32px}
#menu p{white-space:nowrap;border:0;padding:0 0 4px 0;margin:0 0 4px 0} #menu p,#tables{white-space:nowrap;border:0;padding:0 0 4px 0;margin:0 0 4px 0}
#breadcrumb{background:#333;color:#fff;position:fixed;top:0;left:320px;width:100%;line-height:40px;padding:0;z-index:1;margin:0} #breadcrumb{background:#333;color:#fff;position:fixed;top:0;left:320px;width:100%;line-height:40px;padding:0;z-index:1;margin:0}
#breadcrumb a{color:#ff9} #breadcrumb a{color:#ff9}
#breadcrumb a:hover{background:transparent;color:#ff9;border-color:#ff9} #breadcrumb a:hover{background:transparent;color:#ff9;border-color:#ff9}

View File

@@ -339,7 +339,7 @@ border: 1px solid #E3E3E3;
#menu form { #menu form {
margin: 0; margin: 0;
} }
#menu p { #menu p, #tables {
padding-left: 8px; padding-left: 8px;
border-bottom: none; border-bottom: none;
} }

View File

@@ -173,13 +173,14 @@ h3{
margin:0;} margin:0;}
#menu form{ #menu form{
margin:0;} margin:0;}
#menu p{ #menu p,#tables{
padding-left:8px; padding-left:8px;
border-bottom:none;} border-bottom:none;}
#menu form p{ #menu form p{
padding-left:0; padding-left:0;
text-align:center;} text-align:center;}
#tables a,#tables a b{ #logins a,#tables a,#tables a b{
background: transparent none repeat scroll 0 0;
color:#c00; color:#c00;
padding:0 0.3ex;} padding:0 0.3ex;}
/*#tables a b{background-color:#ff7400;color:black;}*/ /*#tables a b{background-color:#ff7400;color:black;}*/

108
designs/flat/adminer.css Executable file
View File

@@ -0,0 +1,108 @@
/**
* Adminer "flat" theme by Israel Viana
*
* Color palette from https://kuler.adobe.com/Copy-of-Flat-UI-color-theme-3785174/
* Navy: 2c3e50
* Red: e74c3c
* Gray: ecf0f1
* Light blue: 3498db
* Blue: 2980b9
*/
/*
* Basic tags
*/
a {
color: #2980b9;
}
a:visited {
color: #3498db
}
a:link:hover, a:visited:hover {
color: #e74c3c;
}
h1 {
border-bottom: 1px solid #e74c3c;
background: #ecf0f1;
}
h2 {
border-bottom: 1px solid #e74c3c;
background: #ecf0f1;
}
/*
* Tables
*/
table {
border-top: 0;
border-left: 1px solid silver;
}
td, th {
border-right: 1px solid silver;
border-bottom: 1px solid silver;
padding: .3em .5em;
}
thead th, thead td {
background: #3498db;
color: white;
border-right: 1px solid white;
border-bottom: 1px solid white;
padding: .3em .5em;
}
thead th a, thead td a {
color: #eee;
}
.js span.column {
background: white;
}
th span.column a.text {
color: #2980b9;
}
.js .checkable .checked td, .js .checkable .checked th {
background: rgba(52, 152, 219, .3);
}
.pages {
border: none;
box-shadow: -1px -1px 4px silver;
}
/*
* Common sections
*/
#breadcrumb a {
color: #e74c3c;
}
#logout {
font-weight: bold;
}
/*
* Elements
*/
sup {
padding: 3px 7px;
background: #3498db;
color: white;
border-radius: 2em;
}
code.jush-sql {
display: block;
padding: .4em .7em;
line-height: 1.5em;
}

View File

@@ -733,7 +733,7 @@ legend{
} }
/* tables */ /* tables */
#menu p#tables{ #tables{
border-bottom: none; border-bottom: none;
line-height: 20px; line-height: 20px;
padding: 18px 0; padding: 18px 0;

View File

@@ -3,7 +3,8 @@
* *
* Klemens Häckel [http://clickdimension.wordpress.com/] * Klemens Häckel [http://clickdimension.wordpress.com/]
* *
* update 2014-01 * update 2017-03
* adapted for adminer 4.3.0
* *
* new remaster based on style for WT-NMP 13.12 * new remaster based on style for WT-NMP 13.12
* *
@@ -77,7 +78,7 @@ html>/**/body input[name="logout"], #logout {
right: 8px; right: 8px;
text-indent: 8px; text-indent: 8px;
top: 6px; top: 6px;
width: 80px; width: 120px;
position:fixed; position:fixed;
z-index: 10; z-index: 10;
} }
@@ -154,10 +155,10 @@ html>/**/body form>table a[href*="&edit="][href*="&where"] {
} }
/* Select data */ /* Select data */
html>/**/body #menu p a[href*="&select="], html>/**/body .links a[href*="&select="] { html>/**/body #menu li a[href*="&select="], html>/**/body .links a[href*="&select="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdVJREFUeNqck8tO21AQhn8bB8ehRe0SUEBOlIsSVFGqqlK3oey6K+9A96wTKU/RFU/AG7CrKhAg7gmKiJKIplFWqItWIQEfuzOT2LmsSo408j+2/5lvjo+1rULhM4AFTLfahuu6i3vF4rdp3F/y+W3DVUrzKNk8BTzPC4IKS3h8Hc0Hz49zr8BeXSml8wu8PsU1uW7EhjpHOmd7wX1fs4e9hnIcTUkBDfs1DzGjS5N1pPOGRR3bLjR6ztoNNJm9ebDXcBxnjMD99YCdzGvJT25v8T6ZFH1QLuNjNiv6++UlESyDvSMEEIKcCZzX6zLvXDiMo0pFZn5hWfhxfS2aF3sCAkUvDwmA1ZUVyS9qNawnEn0aKvQhkxF9WCqBPUIgBSYISnd3QmCZJs6qVekaYZqbmzGCfoGnp2AEnyAdjUpeajTwJh4XfU778S6d7tNQISlA3rFN9AkqzaYQmLOzuKIxuGuYaE4H++F/RvbqVEVXE+cgsbSEFFH0Hh+RtW2sxmLo9npYoy/yNpUajkBeo9ftzkwSVFstIeBVpjH8rhc0xigBe43f9/dmKBTCburv4ISb//VvsYe9mmXbX/VIZHman8ntdH7y0BbFSwrjmX6H4s8/AQYAQChL+KIinhAAAAAASUVORK5CYII=") no-repeat left bottom background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdVJREFUeNqck8tO21AQhn8bB8ehRe0SUEBOlIsSVFGqqlK3oey6K+9A96wTKU/RFU/AG7CrKhAg7gmKiJKIplFWqItWIQEfuzOT2LmsSo408j+2/5lvjo+1rULhM4AFTLfahuu6i3vF4rdp3F/y+W3DVUrzKNk8BTzPC4IKS3h8Hc0Hz49zr8BeXSml8wu8PsU1uW7EhjpHOmd7wX1fs4e9hnIcTUkBDfs1DzGjS5N1pPOGRR3bLjR6ztoNNJm9ebDXcBxnjMD99YCdzGvJT25v8T6ZFH1QLuNjNiv6++UlESyDvSMEEIKcCZzX6zLvXDiMo0pFZn5hWfhxfS2aF3sCAkUvDwmA1ZUVyS9qNawnEn0aKvQhkxF9WCqBPUIgBSYISnd3QmCZJs6qVekaYZqbmzGCfoGnp2AEnyAdjUpeajTwJh4XfU778S6d7tNQISlA3rFN9AkqzaYQmLOzuKIxuGuYaE4H++F/RvbqVEVXE+cgsbSEFFH0Hh+RtW2sxmLo9npYoy/yNpUajkBeo9ftzkwSVFstIeBVpjH8rhc0xigBe43f9/dmKBTCburv4ISb//VvsYe9mmXbX/VIZHman8ntdH7y0BbFSwrjmX6H4s8/AQYAQChL+KIinhAAAAAASUVORK5CYII=") no-repeat left bottom
} }
html>/**/body #menu p a[href*="&select="] { html>/**/body #menu li a[href*="&select="] {
clear: left; clear: left;
display: block; display: block;
float: left; float: left;
@@ -305,8 +306,12 @@ a, a:visited {
box-shadow: 0px 0px 3px rgba(0,0,0,0.30) !important; box-shadow: 0px 0px 3px rgba(0,0,0,0.30) !important;
margin: 0; margin: 0;
padding-bottom: 0; padding-bottom: 0;
padding-top: 30px;
top: 0; top: 0;
} }
#menu > h1:first-child {
margin-top: -30px;
}
/*** Forms ***/ /*** Forms ***/
fieldset { fieldset {
border-radius: 1px !important border-radius: 1px !important
@@ -316,7 +321,7 @@ fieldset {
background: transparent; background: transparent;
font-size: .9em; font-size: .9em;
left: auto; left: auto;
right: 90px; right: 120px;
position:fixed; position:fixed;
z-index: 10; z-index: 10;
padding-top: 2px; padding-top: 2px;
@@ -333,10 +338,6 @@ p {
margin: 0.8em 0 0 0 margin: 0.8em 0 0 0
} }
#menu form {
padding-top: 30px;
}
.view { .view {
background-color: #FFFFAA !important; background-color: #FFFFAA !important;
} }

View File

@@ -27,11 +27,9 @@ a[href$="&import="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEU
#menu .links a:hover {color:red;} #menu .links a:hover {color:red;}
} }
#menu p a[href*="&select="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHISURBVDjLpVPNK0RRFP+9D98syMwUspHkm9I0YkFZWBFKkZ0s7a3Ewh+ilChK7FgoZCJFKYlYKB8zk2+Z5t0P577He29kQU7dd+6575zf+d1zztWklPiPmOozt/U4SThjXIoyIQS4AJjSXO0lGGlvcXAm6Vzsz4xUhm0AIeX4QLig+C+ZpxbOG1wGhGYHr1zMUmZGWRgs0ha3PE1nX/8mWmdgWTzLB+DUYbhm9FfZ35IEyrhXA3VXJfPbsV8B9LQUIeUHYJ8ASobag1jcucNgW8g9W4reYSDi2YnnZDoDiwCokDANct6NwTB0LEdj0HRA/wxa2SN25JNBEdWluUhZ366gqmAaGvrCAXKOozccTGPgt8+vn8GYSGcgyTYp3dpBnBg42nbQPRBTo5bTvqYkmxL6AQhNTWQGBXY3B7BxlEBXozcW64dxRKoKUZBju+P06gl5WaaviMJBM3TNDlbypemIZgHYOnlwASsCmW7nHADGnBoQ3c76YmweJ9BR5zFYjsbRHwm4tmJg6PhWA7pCXXk+bu7fURHKweXtq/sWaksz7SC/CCGFrwtyZ3r+rCnFRZ7qr1qc6mLZj4f9OEyPL8lVpbX/PucPv5QPKHB1TdEAAAAASUVORK5CYII=") no-repeat scroll left bottom; clear:left; display:block; float:left; height:16px; margin-right:8px; padding-top:1px; overflow:hidden; padding-left:16px; width:0; text-decoration:none;} #tables li a[href*="&select="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHISURBVDjLpVPNK0RRFP+9D98syMwUspHkm9I0YkFZWBFKkZ0s7a3Ewh+ilChK7FgoZCJFKYlYKB8zk2+Z5t0P577He29kQU7dd+6575zf+d1zztWklPiPmOozt/U4SThjXIoyIQS4AJjSXO0lGGlvcXAm6Vzsz4xUhm0AIeX4QLig+C+ZpxbOG1wGhGYHr1zMUmZGWRgs0ha3PE1nX/8mWmdgWTzLB+DUYbhm9FfZ35IEyrhXA3VXJfPbsV8B9LQUIeUHYJ8ASobag1jcucNgW8g9W4reYSDi2YnnZDoDiwCokDANct6NwTB0LEdj0HRA/wxa2SN25JNBEdWluUhZ366gqmAaGvrCAXKOozccTGPgt8+vn8GYSGcgyTYp3dpBnBg42nbQPRBTo5bTvqYkmxL6AQhNTWQGBXY3B7BxlEBXozcW64dxRKoKUZBju+P06gl5WaaviMJBM3TNDlbypemIZgHYOnlwASsCmW7nHADGnBoQ3c76YmweJ9BR5zFYjsbRHwm4tmJg6PhWA7pCXXk+bu7fURHKweXtq/sWaksz7SC/CCGFrwtyZ3r+rCnFRZ7qr1qc6mLZj4f9OEyPL8lVpbX/PucPv5QPKHB1TdEAAAAASUVORK5CYII=") no-repeat scroll left bottom; clear:left; display:block; float:left; height:16px; margin-right:8px; padding-top:1px; overflow:hidden; padding-left:16px; width:0; text-decoration:none;}
#menu p a[href*="&table="], #menu p a[href*="&view="] {clear:right; margin-left:24px; display:block; height:17px; padding-bottom:1px; text-decoration:none;} #tables li a[href*="&table="], tables li a[href*="&view="] {clear:right; margin-left:24px; display:block; height:17px; padding-bottom:1px; text-decoration:none;}
#menu p#tables br {display:none;}
.links a[href*="&create="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ6SURBVDjLpZNZSNRRGMV//2XGsjFrMg2z0so2K21xIFpepYUiAsGIICLffI8eWiBBeg3qQV+KwBYKLB8qpHUmrahcKLc0QsxldNSxdPz/79LD1ChBUXTh8sG93POdc75zDa01/7NsgGvPR09rzQmpVZZSCqlAKIWUCqk0QqoZWyKFRir1uvxIbsAGUFqXHQqkpP1L57M3Pm5MMJBKpQHUdF9BKIGQAlcJXOlOVykSdye3leO6MmkGQNyHw+uO/1X3bzGBK+S0B1IqAKqDg3986HeCZPffwvJtoNT7lOZLvUdtAPEDAKBkRzo3QwMUb89InN1uGGD3spdE214xe8MRUnM2MfppNW0Pqy7YAK5UKK2xLbhdP4hlmdxpGMQwwQT8ziNiI534c7cT6WrFazikzF2Eb8HS1IQEDdiWwcHAQmpehTkQSAcgNvSMiYFW5uUUMdV3HW+ywefGNqITJsbUUL75k4FWYJtQ+yaMZcXrk1ANk/33mbdiD7EvlRieETy+FJLkMFcjRRSW3emIAwiF1hqPBfu2LGSWbbA1uZ41SfWkrtxPrPcypsfFiWYzFGzGKTjFV28WEJeIUHETLdOgrmkI1VdHpCdEet5enP4qLK9mKrqMgedv6cyrAP+qxOTiUxAi7oEJi8frELoFoTLpa7nI/HQvscgSRt+0kV1SSW7qYtp7xrBMphm4Mi5h/VIfTcEq1u0oJaknSEdNiMYHET7UvcMpPEN31Ed7zxgASmk1I0g6dK66s8CRak5mVxjnfS05+TsZCw/T9baTx1nnGb47DrQksjE6HrsHYPz6nYt3+Sc3L8+wA2tz0J6pF5OD4WP7Kpq7f5fO79DfSxjdtCtDAAAAAElFTkSuQmCC") no-repeat scroll 2px bottom; padding-left:22px;} .links a[href*="&create="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ6SURBVDjLpZNZSNRRGMV//2XGsjFrMg2z0so2K21xIFpepYUiAsGIICLffI8eWiBBeg3qQV+KwBYKLB8qpHUmrahcKLc0QsxldNSxdPz/79LD1ChBUXTh8sG93POdc75zDa01/7NsgGvPR09rzQmpVZZSCqlAKIWUCqk0QqoZWyKFRir1uvxIbsAGUFqXHQqkpP1L57M3Pm5MMJBKpQHUdF9BKIGQAlcJXOlOVykSdye3leO6MmkGQNyHw+uO/1X3bzGBK+S0B1IqAKqDg3986HeCZPffwvJtoNT7lOZLvUdtAPEDAKBkRzo3QwMUb89InN1uGGD3spdE214xe8MRUnM2MfppNW0Pqy7YAK5UKK2xLbhdP4hlmdxpGMQwwQT8ziNiI534c7cT6WrFazikzF2Eb8HS1IQEDdiWwcHAQmpehTkQSAcgNvSMiYFW5uUUMdV3HW+ywefGNqITJsbUUL75k4FWYJtQ+yaMZcXrk1ANk/33mbdiD7EvlRieETy+FJLkMFcjRRSW3emIAwiF1hqPBfu2LGSWbbA1uZ41SfWkrtxPrPcypsfFiWYzFGzGKTjFV28WEJeIUHETLdOgrmkI1VdHpCdEet5enP4qLK9mKrqMgedv6cyrAP+qxOTiUxAi7oEJi8frELoFoTLpa7nI/HQvscgSRt+0kV1SSW7qYtp7xrBMphm4Mi5h/VIfTcEq1u0oJaknSEdNiMYHET7UvcMpPEN31Ed7zxgASmk1I0g6dK66s8CRak5mVxjnfS05+TsZCw/T9baTx1nnGb47DrQksjE6HrsHYPz6nYt3+Sc3L8+wA2tz0J6pF5OD4WP7Kpq7f5fO79DfSxjdtCtDAAAAAElFTkSuQmCC") no-repeat scroll 2px bottom; padding-left:22px;}
.links a[href$="&create="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIpSURBVDjLpZNPSFRRFMZ/749/Kt3IqFTSRoSMmrGIYTTbpEJtjBCCok1Em9JVG1dRC8FFEES5aGFEgRRZWq1iLKKxBiNqLDcltQgmHR9hY6LOu+feFm+YGVsZXbh8nHO53/nud8+xjDH8z3IB7r5avGgMZ8XoBq01okFpjYhGtEGJLtmCKINo/XbgVFPUBdDG9PVEq0P/UvnSvdlwQYFoHQIY/3obpRVKFL5W+OIXUVThrL91AN+XihKCwIeTu85sqPryqsJXUvRARAMwkshsiKB7fw25UgKVJwA40V7H/cl5jh+oL+RGk/P0xIqxl11dr8AXjTYG14HRNxkcx+ZhMoNlg52/ND6VAWMoc6F5+2Zy/l9PMIDrWByL1jI+tcDRaN06BaXxbDqLUnq9AqPBteHpuwUcJ0AIcgBXH93h+/wEyyuLrPk5cmv7gNY8gdIYYyhz4PDeWuIpj85IsS2ujQ2zJAk6DkZpqGnixcwYyU+PifUOX7Eh6DoAx7aIpzwA4imPeMrj+bTH+88PaNkZQWwhsrULsXxie9oAzgcESgUe2NAZCeE6AXZGQhwKh/Cyc5RZVXQ39wFwoeMmjXVhgMqiB8awe0cVP36u0Fi/iW9zvwuzkF3+xUz6Nal0gv6uWww+O02lUwGwmv8FM3l55EtLTvQWXwm+EkRpfNEoUZRXHCE5PUFbuJ0nH4cot1wSH14C3LA2Os6x3m2DwDmgGlgChpLX0/1/AIu8MA7WsWBMAAAAAElFTkSuQmCC") no-repeat scroll left bottom; padding-left:22px;} .links a[href$="&create="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIpSURBVDjLpZNPSFRRFMZ/749/Kt3IqFTSRoSMmrGIYTTbpEJtjBCCok1Em9JVG1dRC8FFEES5aGFEgRRZWq1iLKKxBiNqLDcltQgmHR9hY6LOu+feFm+YGVsZXbh8nHO53/nud8+xjDH8z3IB7r5avGgMZ8XoBq01okFpjYhGtEGJLtmCKINo/XbgVFPUBdDG9PVEq0P/UvnSvdlwQYFoHQIY/3obpRVKFL5W+OIXUVThrL91AN+XihKCwIeTu85sqPryqsJXUvRARAMwkshsiKB7fw25UgKVJwA40V7H/cl5jh+oL+RGk/P0xIqxl11dr8AXjTYG14HRNxkcx+ZhMoNlg52/ND6VAWMoc6F5+2Zy/l9PMIDrWByL1jI+tcDRaN06BaXxbDqLUnq9AqPBteHpuwUcJ0AIcgBXH93h+/wEyyuLrPk5cmv7gNY8gdIYYyhz4PDeWuIpj85IsS2ujQ2zJAk6DkZpqGnixcwYyU+PifUOX7Eh6DoAx7aIpzwA4imPeMrj+bTH+88PaNkZQWwhsrULsXxie9oAzgcESgUe2NAZCeE6AXZGQhwKh/Cyc5RZVXQ39wFwoeMmjXVhgMqiB8awe0cVP36u0Fi/iW9zvwuzkF3+xUz6Nal0gv6uWww+O02lUwGwmv8FM3l55EtLTvQWXwm+EkRpfNEoUZRXHCE5PUFbuJ0nH4cot1wSH14C3LA2Os6x3m2DwDmgGlgChpLX0/1/AIu8MA7WsWBMAAAAAElFTkSuQmCC") no-repeat scroll left bottom; padding-left:22px;}

View File

@@ -18,9 +18,10 @@ img { vertical-align: middle; margin: 0; padding: 0; }
.message { color: black; background: #dedede; padding: .5em .8em; border: 1px solid black; } .message { color: black; background: #dedede; padding: .5em .8em; border: 1px solid black; }
#menu { overflow: scroll; position: absolute; top: 0; left: 0; width: 270px; white-space: nowrap; background: #FFE594 url('data:image/gif;base64,R0lGODlhXgEBAIIAAPzabPzijvzihPzefvzmnPzedPzmlPzadCwAAAAAXgEBAAIDYEi63P5wGTXJvNZew7sJBNiBwWeWaPoFbNq+cCzPs8DaeJDvuGAPOh9wIBgWAwMjMblsOpnQqHRKrRaY1+sguz1sB4esN0wulM+HtNqMZqsBafgBTp/PAfQ8fs/v+/8ACQA7') top left repeat-y; height: 100%; _height: 650px; border: 1px solid #a3a3a3; } #menu { overflow: scroll; position: absolute; top: 0; left: 0; width: 270px; white-space: nowrap; background: #FFE594 url('data:image/gif;base64,R0lGODlhXgEBAIIAAPzabPzijvzihPzefvzmnPzedPzmlPzadCwAAAAAXgEBAAIDYEi63P5wGTXJvNZew7sJBNiBwWeWaPoFbNq+cCzPs8DaeJDvuGAPOh9wIBgWAwMjMblsOpnQqHRKrRaY1+sguz1sB4esN0wulM+HtNqMZqsBafgBTp/PAfQ8fs/v+/8ACQA7') top left repeat-y; height: 100%; _height: 650px; border: 1px solid #a3a3a3; }
#menu form { margin: 0; } #menu form { margin: 0; }
#menu p { text-align: center; font-size: 11px; } #menu p, #tables li { text-align: center; font-size: 11px; }
#menu p a { color: black; } #menu p a, #tables li a { color: black; }
#menu p a:hover { color: #626262; text-decoration: none; } #menu p a:hover, #tables li a:hover { color: #626262; text-decoration: none; }
#tables a, #tables span { background: #FFE594; }
#content { margin: 1.5em 0 0 293px; padding: 10px 20px 20px 0; } #content { margin: 1.5em 0 0 293px; padding: 10px 20px 20px 0; }
#lang { margin: 0; padding: 0; text-align: center; font-size: 10px; width: 270px; background-color: #d9dadb; border-bottom: 1px solid black; } #lang { margin: 0; padding: 0; text-align: center; font-size: 10px; width: 270px; background-color: #d9dadb; border-bottom: 1px solid black; }
#lang a { color: black; font-weight: bold; } #lang a { color: black; font-weight: bold; }

Some files were not shown because too many files have changed in this diff Show More