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

Compare commits

..

167 Commits

Author SHA1 Message Date
Jakub Vrana
ba1bb263b3 Release 3.7.1 2013-06-29 08:26:37 -07:00
Jakub Vrana
82a63f335b SQLite: Load information about descending indexes 2013-06-25 15:28:57 -07:00
Jakub Vrana
50d2054e36 PostgreSQL: Properly mark ascending index columns 2013-06-25 15:01:38 -07:00
Jakub Vrana
13f34d1ea9 Highlight table being altered in navigation 2013-06-25 10:12:10 -07:00
Jakub Vrana
2cf2021995 Open schema to new tab on Ctrl+click 2013-06-25 09:58:08 -07:00
Jakub Vrana
5f370927f1 Descending indexes 2013-06-25 09:42:47 -07:00
Jakub Vrana
c8248bb19c Allow changing PostgreSQL indexes with same name 2013-06-24 17:54:04 -07:00
Jakub Vrana
3a8191b7ac SQLite: Preselect index type after adding a column 2013-06-24 10:04:59 -07:00
Jakub Vrana
7dd454f0b4 Allow changing SQLite indexes with same name 2013-06-24 10:04:07 -07:00
Jakub Vrana
e51640eb98 Display error on invalid alter table and view pages 2013-06-24 09:08:26 -07:00
Jakub Vrana
2e32bf1f97 Suggest using adminer.sql 2013-06-24 06:12:13 -07:00
Jakub Vrana
27c7a218bd Save bytes 2013-06-24 05:53:48 -07:00
Jakub Vrana
2e4a7121a9 Fix title and links on invalid table pages 2013-06-24 05:53:23 -07:00
Jakub Vrana
81e134f872 Send 404 for invalid database and schema 2013-06-24 05:43:13 -07:00
Jakub Vrana
e680d22023 Avoid fatal in PostgreSQL without implemented database()
https://sourceforge.net/p/adminer/discussion/1095138/thread/5e29e380/
2013-06-13 07:46:12 +02:00
Jakub Vrana
aae2289095 Simplify translation 2013-06-11 14:56:54 +02:00
Jakub Vrana
4660ff852c Suggest that Import is available in SQL command 2013-06-11 11:03:17 +02:00
Jakub Vrana
f29a7cb140 Notify user about expired master password for permanent login 2013-06-11 11:02:17 +02:00
Jakub Vrana
64297aea60 Add design from https://gist.github.com/pappu687/5589922 2013-06-05 18:45:33 -07:00
Jakub Vrana
41cde565d5 Fix tests 2013-06-05 18:44:06 -07:00
Jakub Vrana
e80eb058e9 Support &null[]=F(c) 2013-06-04 19:42:46 -07:00
Jakub Vrana
7dd90f56f1 MySQL: Speed up updating rows without numeric or UTF-8 primary key 2013-06-04 19:40:17 -07:00
Jakub Vrana
8e0ead4678 Verify UTF-8 encoding of CSV import 2013-06-03 14:57:26 -07:00
Jakub Vrana
c05e332ca3 Sort languages 2013-06-03 10:00:16 -07:00
Jakub Vrana
717f4535a9 Fix Korean date format and hint 2013-06-03 09:46:55 -07:00
Jakub Vrana
d100a1ed9a Fix Korean translation identifiers 2013-06-03 09:24:30 -07:00
dalli
21756c492a Add Korean translation 2013-06-03 09:23:58 -07:00
Jakub Vrana
26ad18bab2 Avoid duplicate values of HTML id attributes (bug #3614245)
Unsupports <label> in IE6.
2013-06-03 08:56:18 -07:00
Jakub Vrana
e04be3a996 Handle timestamp PostgreSQL types (bug #3614086) 2013-05-29 17:24:27 -07:00
Jakub Vrana
0869ff02c6 Stricter check 2013-05-28 11:23:48 -07:00
Jakub Vrana
1dc9044ff4 Order table list by name (bug #3613974) 2013-05-28 11:14:15 -07:00
Jakub Vrana
5eb3eaa06e Add Bzip2 export plugin 2013-05-28 10:28:47 -07:00
Jakub Vrana
55c494b767 Don't use LIMIT 1 if inline updating unique row 2013-05-24 13:38:54 -07:00
Jakub Vrana
005c963e2d Fix detecting oid column in PDO_PGSQL 2013-05-23 21:05:45 -07:00
Jakub Vrana
2c381345b4 Use variable instead of literal value 2013-05-23 18:31:48 -07:00
Jakub Vrana
15e698d302 Order PostgreSQL table list by name 2013-05-23 09:22:12 -07:00
Jakub Vrana
7be9d5c7ca Simplify box-shadow 2013-05-20 10:58:06 -07:00
Jakub Vrana
2dfe2640db Don't highlight rows in uncheckable tables 2013-05-20 10:14:04 -07:00
Jakub Vrana
68aba96c72 Increase click target for checkboxes (thanks to Roman) 2013-05-20 10:13:54 -07:00
Jakub Vrana
bf94b88503 Use shadow for highlighting default button (thanks to srigi) 2013-05-20 09:13:06 -07:00
Jakub Vrana
b51d4ab105 Release 3.7.0 2013-05-19 20:37:27 -07:00
Jakub Vrana
fabfb8a0bc Get number of rows on export page asynchronously 2013-05-17 17:40:08 -07:00
Jakub Vrana
5a4d1b3704 Add server placeholder to login form 2013-05-17 14:08:15 -07:00
Jakub Vrana
982974fe27 Use ALTER VIEW and don't use temporary object if changing name 2013-05-13 11:12:28 -07:00
Jakub Vrana
3ed0ce926c Fix table links for existing but invalid views 2013-05-13 10:12:13 -07:00
Jakub Vrana
65fae98558 Don't rely on 't' and 'f' PostgreSQL boolean return values
https://sourceforge.net/projects/adminer/forums/forum/1095138/topic/8119905
2013-05-13 08:40:06 -07:00
Jakub Vrana
af30f59737 Don't use LIMIT 1 if updating unique row (bug #3613109) 2013-05-11 13:05:40 -07:00
Jakub Vrana
2f996ba014 Restrict editing rows without unique identifier to search results 2013-05-11 12:47:04 -07:00
Jakub Vrana
b7e0f1d81c Fix EXPLAIN in MySQL < 5.1, bug since Adminer 3.6.4 (thanks to Coudy) 2013-05-11 08:02:28 -07:00
Jakub Vrana
20915b1764 Save bytes 2013-05-08 12:13:04 -07:00
Jakub Vrana
516416e72b Fix tables list in Editor 2013-05-08 11:58:21 -07:00
Jakub Vrana
c38655418b Simplify process_fields() 2013-05-08 11:43:53 -07:00
Jakub Vrana
046da00eb6 Strip trailing spaces 2013-05-08 11:29:19 -07:00
Jakub Vrana
22f0a5ded8 Display navigation bellow main content on mobile browsers 2013-05-08 11:27:20 -07:00
Jakub Vrana
6a41240c42 Move common function 2013-05-08 10:46:16 -07:00
Jakub Vrana
a09916737e Simplify initializing post variables 2013-05-08 08:54:26 -07:00
Jakub Vrana
e99463b295 Don't drop original view and routine before creating the new one 2013-05-08 07:55:08 -07:00
Jakub Vrana
b7021c9c7f Highlight default submit button 2013-05-06 09:27:35 -07:00
Jakub Vrana
94a0cc8de8 Fix resetting search (bug #3612507) 2013-05-03 18:53:13 -07:00
Jakub Vrana
9c78b3bb34 Add empty lines to source code 2013-05-01 18:28:04 -07:00
Jakub Vrana
0e6003e833 Send export headers sooner 2013-05-01 09:44:07 -07:00
Jakub Vrana
601cdd43c1 Constraint memory used in TAR export 2013-05-01 09:33:23 -07:00
Jakub Vrana
17a8495c2e Display logout button in Nette design. 2013-04-30 12:02:02 -07:00
Jakub Vrana
40c61f6cfc Reduce memory used by TAR export 2013-04-29 15:45:15 -07:00
Jakub Vrana
63c400f95d Allow exporting views dependent on each other (bug #3459151) 2013-04-29 15:42:39 -07:00
Jakub Vrana
34adf46293 Export SQLite views 2013-04-29 15:37:50 -07:00
Jakub Vrana
1ecdde0500 Remove bzip2 compression support
It didn't work for exports bigger than 1 MB.
An alternative would be to remove the limit from output buffer which would need memory for the whole export.
Another alternative would be to create a temporary file in output handler and bzwrite() to this file - that would work but it's complicated, especially if we want to output the file progressively - bzopen($tmp, 'w'), fopen($tmp, 'r').
2013-04-29 15:37:33 -07:00
Jakub Vrana
7f05141b89 Save memory in get_file() 2013-04-28 08:17:50 -07:00
Jakub Vrana
d513de4d71 Allow using lang() in plugins 2013-04-28 08:17:40 -07:00
Jakub Vrana
18d51c6b6e Allow using lang() in plugin with single language Adminer version 2013-04-27 23:36:43 -07:00
Jakub Vrana
5eda7e547f Add anchors to database and table sections to allow linking 2013-04-27 23:17:07 -07:00
Jakub Vrana
f7e671448c Select only required routine columns (possible fix for bug #3515776) 2013-04-27 13:04:54 -07:00
Jakub Vrana
d97ae22fb4 Properly unescape apostrophe in column name 2013-04-26 23:25:35 -07:00
Jakub Vrana
49c1484722 Display bit default value same as existing values 2013-04-26 23:21:09 -07:00
Jakub Vrana
7541ceb1ca Improve export of binary data types (bug #3526494) 2013-04-26 22:57:44 -07:00
Jakub Vrana
2afd915f00 Save bytes 2013-04-26 22:22:38 -07:00
Jakub Vrana
5a0be7e7fe Convert fields with selected columns 2013-04-26 22:20:04 -07:00
Jakub Vrana
de2c3968d4 Display bit type as binary number, also fix bit outside MySQLnd 2013-04-26 22:20:03 -07:00
Jakub Vrana
e24d1fcb02 Optimize table_status() 2013-04-26 22:19:54 -07:00
Jakub Vrana
3cae3e2f7f Fix LIKE backslash escaping 2013-04-26 19:34:15 -07:00
Jakub Vrana
fd5e6ef343 Use standard view detection in schema 2013-04-26 19:34:15 -07:00
Jakub Vrana
8ae8507972 Save bytes 2013-04-26 19:34:03 -07:00
Jakub Vrana
b0b4cb1576 Allow more SQL files to be uploaded at the same time (thanks to Frantisek Svoboda) 2013-04-26 13:26:08 -07:00
Jakub Vrana
ada8917e43 Rename = edit operator to SQL 2013-04-26 12:20:47 -07:00
Jakub Vrana
e287642e26 Rename empty select operator to SQL 2013-04-26 12:20:17 -07:00
Jakub Vrana
4858f332c8 Disable SQL export when applying functions in select 2013-04-26 11:57:21 -07:00
Jakub Vrana
91dbaca3c4 Don't export binary and geometry columns twice in select 2013-04-26 11:52:26 -07:00
Jakub Vrana
741cd5b4b6 Fix handling of POINT data type (bug #3582578) 2013-04-26 11:42:18 -07:00
Étienne Deparis
0f47ae8e0f Update Nette design 2013-04-26 10:54:16 -07:00
Jakub Vrana
01a2722c94 Print run time next to executed queries 2013-04-25 23:41:46 -07:00
Jakub Vrana
3bc5c17d03 Develop 2013-04-25 19:00:37 -07:00
Jakub Vrana
a199998f54 Fix documentation comment 2013-04-25 18:19:27 -07:00
Jakub Vrana
c4040f03d9 Release 3.6.4 2013-04-25 17:53:50 -07:00
Jakub Vrana
db7d05b3ec Allow storing empty user password 2013-04-25 09:46:37 -07:00
Jakub Vrana
3d07d8bbd8 Display approx. number of last page in select 2013-04-24 21:22:30 -07:00
Jakub Vrana
bcd1e059f5 Delete Last page link from Editor 2013-04-24 21:16:54 -07:00
Jakub Vrana
0eadfc2b3f Do not store plain text password to history in creating user 2013-04-24 19:04:17 -07:00
Jakub Vrana
c270a06fb1 Fix unsetting permanent login after logout 2013-04-24 18:27:18 -07:00
Jakub Vrana
2b58ebe327 Compensate menuOver() for ellipsis 2013-04-23 17:12:48 -07:00
Jakub Vrana
a72347f3c7 Rename Edit link to Clone in processlist 2013-04-22 13:48:39 -07:00
Étienne Deparis
6f58f5af44 Update Nette admine.css
Fix glitches around #breadcrumb while scrolling.
2013-04-17 21:39:29 -07:00
EauLand
6bdfec0a1a Update fr.inc.php
Replace "sauvegarder" by "enregistrer"
Reduce strings to see all sentence
2013-04-17 21:26:34 -07:00
Jakub Vrana
93f581175f Update test format 2013-04-17 18:02:52 -07:00
Jakub Vrana
971c51783f Fix test 2013-04-17 18:01:40 -07:00
Jakub Vrana
ba5e7a1b53 Link processlist documentation 2013-04-17 17:57:14 -07:00
Jakub Vrana
46a7e7eea0 Selectable ON UPDATE CURRENT_TIMESTAMP field in create table 2013-04-17 09:41:58 -07:00
Jakub Vrana
7af362554a Respect global errors in dump 2013-04-17 08:48:59 -07:00
Jakub Vrana
a8947b62b8 Avoid using same id="" in more messages 2013-04-16 17:53:53 -07:00
Jakub Vrana
37adf537c9 Respect checked tables in export filename (bug #3245464) 2013-04-16 10:37:10 -07:00
Jakub Vrana
e8e95e5fd7 Display SQL history from oldest 2013-04-16 09:50:32 -07:00
Jakub Vrana
285afc202a Increase default select limit to 50 2013-04-15 14:45:49 -07:00
Jakub Vrana
8cce005b70 Increase limit for using MD5 in select 2013-04-12 09:08:44 -07:00
Jakub Vrana
433357f824 Use numeric time zone in export (thanks to Martin Dzubak) 2013-04-11 10:12:53 -07:00
Jakub Vrana
d97300dd5a MSSQL: Don't seek to top (bug #3610309) 2013-04-11 09:37:55 -07:00
Jakub Vrana
99221f3265 Display help cursor over documentation links 2013-04-11 09:37:55 -07:00
Jakub Vrana
fee31e73c1 Display help cursor over documentation links 2013-04-04 18:45:54 -07:00
Jakub Vrana
2c626c7fc7 Explain partitions in SQL query (bug #3600150) 2013-04-04 18:40:49 -07:00
Jakub Vrana
3093f58157 Clear column name after resetting search (bug #3601200) 2013-04-04 18:32:05 -07:00
Jakub Vrana
1a1b800b40 Edit select SQL query on Ctrl+click 2013-04-04 18:15:18 -07:00
Jakub Vrana
e4d5835dab Open database to a new window after selecting it with Ctrl 2013-04-04 10:35:15 -07:00
Jakub Vrana
aba9d23ba2 Move comment 2013-04-04 09:44:48 -07:00
Jakub Vrana
190812456f Move ALTER export to plugin 2013-04-04 09:42:02 -07:00
Jakub Vrana
58a8df7c86 Export SQLite indexes (bug #3609741) 2013-04-03 10:46:51 -07:00
Jakub Vrana
cb57afd0e5 Handle empty integer values in SQLite export 2013-04-03 10:41:14 -07:00
Jakub Vrana
b14a2a5330 Revert "Order by auto_increment column by default"
This reverts commit 79b61855e5.
2013-04-03 10:41:05 -07:00
Jakub Vrana
0cd85c1ce9 Plugin for displaying JSON data 2013-04-02 18:49:32 -07:00
Jakub Vrana
c69d9fcfdf Delete confusing link to the last page 2013-04-02 18:40:07 -07:00
Jakub Vrana
5739e03e97 Display pagination on a fixed position 2013-04-02 18:35:23 -07:00
Jakub Vrana
79b61855e5 Order by auto_increment column by default 2013-04-02 18:15:35 -07:00
Jakub Vrana
7769cab32c Handle max_input_vars and generalize Suhosin compatibility 2013-04-02 18:14:27 -07:00
Jakub Vrana
f3920f381d Use ellipsis in overflowed texts 2013-04-01 18:03:58 -07:00
Jakub Vrana
f697486884 Revert indeterminate checkbox state 2013-04-01 17:57:08 -07:00
Jakub Vrana
5d68a29b3e Open full edit SQL with Ctrl 2013-04-01 11:22:20 -07:00
Jakub Vrana
e531d6ef41 Don't convert columns which are not selected 2013-03-27 21:11:46 -07:00
Jakub Vrana
a38ea926f2 Use class_exists() instead of extension_loaded() for checking SQLite
https://sourceforge.net/projects/adminer/forums/forum/1095138/topic/6780041
2013-03-27 21:11:14 -07:00
Pavel Sedlák
5b36472a45 Remove unused external/CodeMirror2 dir 2013-03-27 10:16:09 -07:00
Jakub Vrana
e139f94561 Refresh database list after dropping database 2013-03-27 09:24:51 -07:00
Jakub Vrana
50528be5cb Jump to first page after deleting all records 2013-03-26 19:08:58 -07:00
Jakub Vrana
2323f433c4 Stay on the same page after deleting rows (bug #3605845) 2013-03-26 18:46:56 -07:00
Jakub Vrana
f43ef7b083 Allow loading more data with inline edit (bug #3605531) 2013-03-26 18:31:03 -07:00
Jakub Vrana
e1545065f0 Display select SQL edit form inline 2013-03-26 10:11:35 -07:00
Jakub Vrana
9a4b30a646 Add master-slave plugin 2013-02-22 04:23:06 -08:00
Jakub Vrana
2b2d6987ef Compatibility with MySQL 5.6 2013-02-20 03:40:20 -08:00
Jakub Vrana
356cadf2b2 Avoid variable collision 2013-02-19 16:46:29 -08:00
Jakub Vrana
8caa889635 Add iOS touch icon 2013-02-19 16:31:51 -08:00
Jakub Vrana
dd9167a101 JSON export plugin (http://forum.zdrojak.cz/?topic=808) 2013-02-07 19:04:36 -08:00
Jakub Vrana
34633a4e60 Separate link for altering event 2013-01-30 23:47:53 -08:00
Jakub Vrana
3d2b869f2e Add typehint to event fields 2013-01-30 23:47:53 -08:00
Jakub Vrana
737c2bdc0e Recover original view, trigger, routine if creating fails (bug #3601088) 2013-01-30 23:47:53 -08:00
Jakub Vrana
1e310977b6 Display information for processing no tables 2013-01-30 23:47:53 -08:00
Jakub Vrana
79fd0238b5 Indeterminate state of select all checkboxes 2013-01-30 23:47:53 -08:00
Jakub Vrana
f86cb5f837 Use autocapitalize="off" 2013-01-30 23:47:53 -08:00
Jakub Vrana
de0d3aca84 Allow editing rows without unique key and long text 2013-01-30 23:47:53 -08:00
Jakub Vrana
51b7104342 Allow editing function results 2013-01-30 23:47:52 -08:00
Jakub Vrana
15e83e9396 Fix displaying length of blob columns 2013-01-30 23:47:52 -08:00
Jakub Vrana
0448bd118c Add Nette design 2013-01-26 21:26:17 -08:00
Jakub Vrana
632cc7c014 Release 3.6.3 2013-01-23 01:23:45 -08:00
Jakub Vrana
7a62838510 Fix XSS in displaying non-UTF-8 strings 2013-01-18 14:23:45 -08:00
srsbiz
da2a0190a4 Update Polish translation 2013-01-12 12:26:19 -08:00
Jakub Vrana
8eaad7475c Add a new design 2013-01-12 11:20:52 -08:00
Jakub Vrana
f6e1c589f9 Allow specifying external links (bug #3392685) 2013-01-11 12:46:44 -08:00
Jakub Vrana
61dc40a512 Fix PDO error handling 2013-01-10 13:01:48 -08:00
Jakub Vrana
35b6491a3c Respect empty default value of type set 2013-01-09 22:57:13 -08:00
Jakub Vrana
0cd81fddb0 Use function instead of INI for multibyte encoding 2013-01-09 22:41:46 -08:00
Jakub Vrana
a9262d8752 Display error code in SQL query 2013-01-09 22:19:38 -08:00
Jakub Vrana
588cb7c0c3 Don't use type="number" for decimal numbers
Google Chrome formats decimal point according to locale, treats it as invalid character and trims full stop
2013-01-09 18:42:46 -08:00
Jakub Vrana
b5ad37ff2b Treat Meta key same as Ctrl (bug #3599405) 2013-01-09 17:38:53 -08:00
120 changed files with 3058 additions and 909 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/adminer/adminer.css
/adminer*.php /adminer*.php
/editor*.php /editor*.php

View File

@@ -28,8 +28,10 @@ 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") . " " . idf_escape($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)) {
echo "<p class='error'>" . error() . "\n"; echo "<p class='error'>" . error() . "\n";
} else { } else {
@@ -37,6 +39,7 @@ if (!$error && $_POST) {
if (is_object($connection2)) { if (is_object($connection2)) {
$connection2->select_db(DB); $connection2->select_db(DB);
} }
do { do {
$result = $connection->store_result(); $result = $connection->store_result();
if (is_object($result)) { if (is_object($result)) {
@@ -45,6 +48,7 @@ if (!$error && $_POST) {
echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $connection->affected_rows) . "\n"; echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $connection->affected_rows) . "\n";
} }
} while ($connection->next_result()); } while ($connection->next_result());
if ($out) { if ($out) {
select($connection->query("SELECT " . implode(", ", $out))); select($connection->query("SELECT " . implode(", ", $out)));
} }

View File

@@ -9,16 +9,22 @@ foreach ($referencable_primary as $table_name => $field) {
} }
$orig_fields = array(); $orig_fields = array();
$orig_status = array(); $table_status = array();
if ($TABLE != "") { if ($TABLE != "") {
$orig_fields = fields($TABLE); $orig_fields = fields($TABLE);
$orig_status = table_status($TABLE); $table_status = table_status($TABLE);
} if (!$table_status) {
if ($_POST && !$_POST["fields"]) { $error = lang('No tables.');
$_POST["fields"] = array(); }
} }
if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] && !$_POST["down"]) { $row = $_POST;
$row["fields"] = (array) $row["fields"];
if ($row["auto_increment_col"]) {
$row["fields"][$row["auto_increment_col"]]["auto_increment"] = true;
}
if ($_POST && !process_fields($row["fields"]) && !$error) {
if ($_POST["drop"]) { if ($_POST["drop"]) {
query_redirect("DROP TABLE " . table($TABLE), substr(ME, 0, -1), lang('Table has been dropped.')); query_redirect("DROP TABLE " . table($TABLE), substr(ME, 0, -1), lang('Table has been dropped.'));
} else { } else {
@@ -26,22 +32,18 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
$all_fields = array(); $all_fields = array();
$use_all_fields = false; $use_all_fields = false;
$foreign = array(); $foreign = array();
ksort($_POST["fields"]); ksort($row["fields"]);
$orig_field = reset($orig_fields); $orig_field = reset($orig_fields);
$after = " FIRST"; $after = " FIRST";
foreach ($_POST["fields"] as $key => $field) {
foreach ($row["fields"] as $key => $field) {
$foreign_key = $foreign_keys[$field["type"]]; $foreign_key = $foreign_keys[$field["type"]];
$type_field = ($foreign_key !== null ? $referencable_primary[$foreign_key] : $field); //! can collide with user defined type $type_field = ($foreign_key !== null ? $referencable_primary[$foreign_key] : $field); //! can collide with user defined type
if ($field["field"] != "") { if ($field["field"] != "") {
if (!$field["has_default"]) { if (!$field["has_default"]) {
$field["default"] = null; $field["default"] = null;
} }
$default = eregi_replace(" *on update CURRENT_TIMESTAMP", "", $field["default"]); if ($key == $row["auto_increment_col"]) {
if ($default != $field["default"]) { // preg_replace $count is available since PHP 5.1.0
$field["on_update"] = "CURRENT_TIMESTAMP";
$field["default"] = $default;
}
if ($key == $_POST["auto_increment_col"]) {
$field["auto_increment"] = true; $field["auto_increment"] = true;
} }
$process_field = process_field($field, $type_field); $process_field = process_field($field, $type_field);
@@ -67,37 +69,40 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
} }
} }
} }
$partitioning = ""; $partitioning = "";
if (in_array($_POST["partition_by"], $partition_by)) { if (in_array($row["partition_by"], $partition_by)) {
$partitions = array(); $partitions = array();
if ($_POST["partition_by"] == 'RANGE' || $_POST["partition_by"] == 'LIST') { if ($row["partition_by"] == 'RANGE' || $row["partition_by"] == 'LIST') {
foreach (array_filter($_POST["partition_names"]) as $key => $val) { foreach (array_filter($row["partition_names"]) as $key => $val) {
$value = $_POST["partition_values"][$key]; $value = $row["partition_values"][$key];
$partitions[] = "\nPARTITION " . idf_escape($val) . " VALUES " . ($_POST["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . ($value != "" ? " ($value)" : " MAXVALUE"); //! SQL injection $partitions[] = "\n PARTITION " . idf_escape($val) . " VALUES " . ($row["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . ($value != "" ? " ($value)" : " MAXVALUE"); //! SQL injection
} }
} }
$partitioning .= "\nPARTITION BY $_POST[partition_by]($_POST[partition])" . ($partitions // $_POST["partition"] can be expression, not only column $partitioning .= "\nPARTITION BY $row[partition_by]($row[partition])" . ($partitions // $row["partition"] can be expression, not only column
? " (" . implode(",", $partitions) . "\n)" ? " (" . implode(",", $partitions) . "\n)"
: ($_POST["partitions"] ? " PARTITIONS " . (+$_POST["partitions"]) : "") : ($row["partitions"] ? " PARTITIONS " . (+$row["partitions"]) : "")
); );
} elseif (support("partitioning") && ereg("partitioned", $orig_status["Create_options"])) { } elseif (support("partitioning") && ereg("partitioned", $table_status["Create_options"])) {
$partitioning .= "\nREMOVE PARTITIONING"; $partitioning .= "\nREMOVE PARTITIONING";
} }
$message = lang('Table has been altered.'); $message = lang('Table has been altered.');
if ($TABLE == "") { if ($TABLE == "") {
cookie("adminer_engine", $_POST["Engine"]); cookie("adminer_engine", $row["Engine"]);
$message = lang('Table has been created.'); $message = lang('Table has been created.');
} }
$name = trim($_POST["name"]); $name = trim($row["name"]);
queries_redirect(ME . "table=" . urlencode($name), $message, alter_table( queries_redirect(ME . "table=" . urlencode($name), $message, alter_table(
$TABLE, $TABLE,
$name, $name,
($jush == "sqlite" && ($use_all_fields || $foreign) ? $all_fields : $fields), ($jush == "sqlite" && ($use_all_fields || $foreign) ? $all_fields : $fields),
$foreign, $foreign,
$_POST["Comment"], $row["Comment"],
($_POST["Engine"] && $_POST["Engine"] != $orig_status["Engine"] ? $_POST["Engine"] : ""), ($row["Engine"] && $row["Engine"] != $table_status["Engine"] ? $row["Engine"] : ""),
($_POST["Collation"] && $_POST["Collation"] != $orig_status["Collation"] ? $_POST["Collation"] : ""), ($row["Collation"] && $row["Collation"] != $table_status["Collation"] ? $row["Collation"] : ""),
($_POST["Auto_increment"] != "" ? +$_POST["Auto_increment"] : ""), ($row["Auto_increment"] != "" ? +$row["Auto_increment"] : ""),
$partitioning $partitioning
)); ));
} }
@@ -105,51 +110,38 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
page_header(($TABLE != "" ? lang('Alter table') : lang('Create table')), $error, array("table" => $TABLE), $TABLE); page_header(($TABLE != "" ? lang('Alter table') : lang('Create table')), $error, array("table" => $TABLE), $TABLE);
$row = array( if (!$_POST) {
"Engine" => $_COOKIE["adminer_engine"], $row = array(
"fields" => array(array("field" => "", "type" => (isset($types["int"]) ? "int" : (isset($types["integer"]) ? "integer" : "")))), "Engine" => $_COOKIE["adminer_engine"],
"partition_names" => array(""), "fields" => array(array("field" => "", "type" => (isset($types["int"]) ? "int" : (isset($types["integer"]) ? "integer" : "")))),
); "partition_names" => array(""),
if ($_POST) { );
$row = $_POST;
if ($row["auto_increment_col"]) { if ($TABLE != "") {
$row["fields"][$row["auto_increment_col"]]["auto_increment"] = true; $row = $table_status;
} $row["name"] = $TABLE;
process_fields($row["fields"]); $row["fields"] = array();
} elseif ($TABLE != "") { if (!$_GET["auto_increment"]) { // don't prefill by original Auto_increment for the sake of performance and not reusing deleted ids
$row = $orig_status; $row["Auto_increment"] = "";
$row["name"] = $TABLE;
$row["fields"] = array();
if (!$_GET["auto_increment"]) { // don't prefill by original Auto_increment for the sake of performance and not reusing deleted ids
$row["Auto_increment"] = "";
}
foreach ($orig_fields as $field) {
$field["has_default"] = isset($field["default"]);
if ($field["on_update"]) {
$field["default"] .= " ON UPDATE $field[on_update]"; // CURRENT_TIMESTAMP
} }
$row["fields"][] = $field; foreach ($orig_fields as $field) {
} $field["has_default"] = isset($field["default"]);
if (support("partitioning")) { $row["fields"][] = $field;
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q(DB) . " AND TABLE_NAME = " . q($TABLE); }
$result = $connection->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
list($row["partition_by"], $row["partitions"], $row["partition"]) = $result->fetch_row(); if (support("partitioning")) {
$row["partition_names"] = array(); $from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q(DB) . " AND TABLE_NAME = " . q($TABLE);
$row["partition_values"] = array(); $result = $connection->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
foreach (get_rows("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $from AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION") as $row1) { list($row["partition_by"], $row["partitions"], $row["partition"]) = $result->fetch_row();
$row["partition_names"][] = $row1["PARTITION_NAME"]; $partitions = get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $from AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");
$row["partition_values"][] = $row1["PARTITION_DESCRIPTION"]; $partitions[""] = "";
$row["partition_names"] = array_keys($partitions);
$row["partition_values"] = array_values($partitions);
} }
$row["partition_names"][] = "";
} }
} }
$collations = collations(); $collations = collations();
$suhosin = floor(extension_loaded("suhosin") ? (min(ini_get("suhosin.request.max_vars"), ini_get("suhosin.post.max_vars")) - 13) / 10 : 0); // 10 - number of fields per row, 13 - number of other fields
if ($suhosin && count($row["fields"]) > $suhosin) {
echo "<p class='error'>" . h(lang('Maximum number of allowed fields exceeded. Please increase %s and %s.', 'suhosin.post.max_vars', 'suhosin.request.max_vars')) . "\n";
}
$engines = engines(); $engines = engines();
// case of engine may differ // case of engine may differ
foreach ($engines as $engine) { foreach ($engines as $engine) {
@@ -162,8 +154,8 @@ foreach ($engines as $engine) {
<form action="" method="post" id="form"> <form action="" method="post" id="form">
<p> <p>
<?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo h($row["name"]); ?>"> <?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'>document.getElementById('form')['name'].focus();</script><?php } ?> <?php if ($TABLE == "" && !$_POST) { ?><script type='text/javascript'>focus(document.getElementById('form')['name']);</script><?php } ?>
<?php echo ($engines ? html_select("Engine", array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) : ""); ?> <?php echo ($engines ? html_select("Engine", array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) : ""); ?>
<?php echo ($collations && !ereg("sqlite|mssql", $jush) ? html_select("Collation", array("" => "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?> <?php echo ($collations && !ereg("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'); ?>">
@@ -178,18 +170,21 @@ if (!$_POST && !$comments) {
} }
} }
} }
edit_fields($row["fields"], $collations, "TABLE", $suhosin, $foreign_keys, $comments); edit_fields($row["fields"], $collations, "TABLE", $foreign_keys, $comments);
?> ?>
</table> </table>
<p> <p>
<?php echo lang('Auto Increment'); ?>: <input 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"]); ?>">
<label class="jsonly"><input type="checkbox" id="defaults" name="defaults" value="1" checked onclick="columnShow(this.checked, 5);"><?php echo lang('Default values'); ?></label> <?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"]) { ?><script type="text/javascript">editingHideDefaults()</script><?php } ?>
<?php echo (support("comment") ? checkbox("comments", 1, $comments, lang('Comment'), "columnShow(this.checked, 6); toggle('Comment'); if (this.checked) this.form['Comment'].focus();", true) . ' <input id="Comment" name="Comment" value="' . h($row["Comment"]) . '" maxlength="' . ($connection->server_info >= 5.5 ? 2048 : 60) . '"' . ($comments ? '' : ' class="hidden"') . '>' : ''); ?> <?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>"
. ' <input name="Comment" id="Comment" value="' . h($row["Comment"]) . '" maxlength="' . ($connection->server_info >= 5.5 ? 2048 : 60) . '"' . ($comments ? '' : ' class="hidden"') . '>'
: '')
; ?>
<p> <p>
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($_GET["create"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?> <?php if ($_GET["create"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<?php <?php
if (support("partitioning")) { if (support("partitioning")) {
$partition_table = ereg('RANGE|LIST', $row["partition_by"]); $partition_table = ereg('RANGE|LIST', $row["partition_by"]);
@@ -204,7 +199,7 @@ 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);"' : '') . '>'; 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_values[]" value="' . h($row["partition_values"][$key]) . '">'; echo '<td><input name="partition_values[]" value="' . h($row["partition_values"][$key]) . '">';
} }
?> ?>
@@ -213,4 +208,5 @@ foreach ($row["partition_names"] as $key => $val) {
<?php <?php
} }
?> ?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -1,7 +1,9 @@
<?php <?php
$row = $_POST;
if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP changes add.x to add_x if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP changes add.x to add_x
restart_session(); restart_session();
$name = trim($_POST["name"]); $name = trim($row["name"]);
if ($_POST["drop"]) { if ($_POST["drop"]) {
$_GET["db"] = ""; // to save in global history $_GET["db"] = ""; // to save in global history
queries_redirect(remove_from_uri("db|database"), lang('Database has been dropped.'), drop_databases(array(DB))); queries_redirect(remove_from_uri("db|database"), lang('Database has been dropped.'), drop_databases(array(DB)));
@@ -9,14 +11,14 @@ if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP c
// create or rename database // create or rename database
if (DB != "") { if (DB != "") {
$_GET["db"] = $name; $_GET["db"] = $name;
queries_redirect(preg_replace('~db=[^&]*&~', '', ME) . "db=" . urlencode($name), lang('Database has been renamed.'), rename_database($name, $_POST["collation"])); queries_redirect(preg_replace('~db=[^&]*&~', '', ME) . "db=" . urlencode($name), lang('Database has been renamed.'), rename_database($name, $row["collation"]));
} else { } else {
$databases = explode("\n", str_replace("\r", "", $name)); $databases = explode("\n", str_replace("\r", "", $name));
$success = true; $success = true;
$last = ""; $last = "";
foreach ($databases as $db) { foreach ($databases as $db) {
if (count($databases) == 1 || $db != "") { // ignore empty lines but always try to create single database if (count($databases) == 1 || $db != "") { // ignore empty lines but always try to create single database
if (!create_database($db, $_POST["collation"])) { if (!create_database($db, $row["collation"])) {
$success = false; $success = false;
} }
$last = $db; $last = $db;
@@ -26,10 +28,10 @@ if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP c
} }
} else { } else {
// alter database // alter database
if (!$_POST["collation"]) { if (!$row["collation"]) {
redirect(substr(ME, 0, -1)); redirect(substr(ME, 0, -1));
} }
query_redirect("ALTER DATABASE " . idf_escape($name) . (eregi('^[a-z0-9_]+$', $_POST["collation"]) ? " COLLATE $_POST[collation]" : ""), substr(ME, 0, -1), lang('Database has been altered.')); query_redirect("ALTER DATABASE " . idf_escape($name) . (eregi('^[a-z0-9_]+$', $row["collation"]) ? " COLLATE $row[collation]" : ""), substr(ME, 0, -1), lang('Database has been altered.'));
} }
} }
@@ -37,12 +39,10 @@ page_header(DB != "" ? lang('Alter database') : lang('Create database'), $error,
$collations = collations(); $collations = collations();
$name = DB; $name = DB;
$collate = null;
if ($_POST) { if ($_POST) {
$name = $_POST["name"]; $name = $row["name"];
$collate = $_POST["collation"];
} elseif (DB != "") { } elseif (DB != "") {
$collate = db_collation(DB, $collations); $row["collation"] = db_collation(DB, $collations);
} elseif ($jush == "sql") { } elseif ($jush == "sql") {
// propose database name with limited privileges // propose database name with limited privileges
foreach (get_vals("SHOW GRANTS") as $grant) { foreach (get_vals("SHOW GRANTS") as $grant) {
@@ -59,10 +59,10 @@ if ($_POST) {
<?php <?php
echo ($_POST["add_x"] || strpos($name, "\n") echo ($_POST["add_x"] || strpos($name, "\n")
? '<textarea id="name" name="name" rows="10" cols="40">' . h($name) . '</textarea><br>' ? '<textarea id="name" name="name" rows="10" cols="40">' . h($name) . '</textarea><br>'
: '<input id="name" name="name" value="' . h($name) . '" maxlength="64">' : '<input name="name" id="name" value="' . h($name) . '" maxlength="64" autocapitalize="off">'
) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $collate) : ""); ) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $row["collation"]) : "");
?> ?>
<script type='text/javascript'>document.getElementById('name').focus();</script> <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 != "") {

View File

@@ -7,6 +7,7 @@ if ($tables_views && !$error && !$_POST["search"]) {
if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) { if ($jush == "sql" && 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
} }
if ($_POST["truncate"]) { if ($_POST["truncate"]) {
if ($_POST["tables"]) { if ($_POST["tables"]) {
$result = truncate_tables($_POST["tables"]); $result = truncate_tables($_POST["tables"]);
@@ -32,11 +33,14 @@ if ($tables_views && !$error && !$_POST["search"]) {
: apply_queries("VACUUM" . ($_POST["optimize"] ? "" : " ANALYZE"), $_POST["tables"]) : apply_queries("VACUUM" . ($_POST["optimize"] ? "" : " ANALYZE"), $_POST["tables"])
); );
$message = lang('Tables have been optimized.'); $message = lang('Tables have been optimized.');
} elseif ($_POST["tables"] && ($result = queries(($_POST["optimize"] ? "OPTIMIZE" : ($_POST["check"] ? "CHECK" : ($_POST["repair"] ? "REPAIR" : "ANALYZE"))) . " TABLE " . implode(", ", array_map('idf_escape', $_POST["tables"]))))) { } elseif (!$_POST["tables"]) {
$message = lang('No tables.');
} elseif ($result = queries(($_POST["optimize"] ? "OPTIMIZE" : ($_POST["check"] ? "CHECK" : ($_POST["repair"] ? "REPAIR" : "ANALYZE"))) . " TABLE " . implode(", ", array_map('idf_escape', $_POST["tables"])))) {
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
$message .= "<b>" . h($row["Table"]) . "</b>: " . h($row["Msg_text"]) . "<br>"; $message .= "<b>" . h($row["Table"]) . "</b>: " . h($row["Msg_text"]) . "<br>";
} }
} }
queries_redirect(substr(ME, 0, -1), $message, $result); queries_redirect(substr(ME, 0, -1), $message, $result);
} }
@@ -44,7 +48,7 @@ page_header(($_GET["ns"] == "" ? lang('Database') . ": " . h(DB) : lang('Schema'
if ($adminer->homepage()) { if ($adminer->homepage()) {
if ($_GET["ns"] !== "") { if ($_GET["ns"] !== "") {
echo "<h3>" . lang('Tables and views') . "</h3>\n"; echo "<h3 id='tables-views'>" . lang('Tables and views') . "</h3>\n";
$tables_list = tables_list(); $tables_list = tables_list();
if (!$tables_list) { if (!$tables_list) {
echo "<p class='message'>" . lang('No tables.') . "\n"; echo "<p class='message'>" . lang('No tables.') . "\n";
@@ -55,6 +59,7 @@ if ($adminer->homepage()) {
search_tables(); search_tables();
} }
echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n"; 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)\[/);">'; echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);">';
echo '<th>' . lang('Table'); echo '<th>' . lang('Table');
echo '<td>' . lang('Engine'); echo '<td>' . lang('Engine');
@@ -66,6 +71,7 @@ if ($adminer->homepage()) {
echo '<td>' . lang('Rows'); echo '<td>' . lang('Rows');
echo (support("comment") ? '<td>' . lang('Comment') : ''); echo (support("comment") ? '<td>' . lang('Comment') : '');
echo "</thead>\n"; echo "</thead>\n";
foreach ($tables_list as $name => $type) { foreach ($tables_list as $name => $type) {
$view = ($type !== null && !eregi("table", $type)); $view = ($type !== null && !eregi("table", $type));
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');"); echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');");
@@ -88,12 +94,14 @@ if ($adminer->homepage()) {
} }
echo (support("comment") ? "<td id='Comment-" . h($name) . "'>&nbsp;" : ""); echo (support("comment") ? "<td id='Comment-" . h($name) . "'>&nbsp;" : "");
} }
echo "<tr><td>&nbsp;<th>" . lang('%d in total', count($tables_list)); echo "<tr><td>&nbsp;<th>" . lang('%d in total', count($tables_list));
echo "<td>" . nbsp($jush == "sql" ? $connection->result("SELECT @@storage_engine") : ""); echo "<td>" . nbsp($jush == "sql" ? $connection->result("SELECT @@storage_engine") : "");
echo "<td>" . nbsp(db_collation(DB, collations())); echo "<td>" . nbsp(db_collation(DB, collations()));
foreach (array("Data_length", "Index_length", "Data_free") as $key) { foreach (array("Data_length", "Index_length", "Data_free") as $key) {
echo "<td align='right' id='sum-$key'>&nbsp;"; echo "<td align='right' id='sum-$key'>&nbsp;";
} }
echo "</table>\n"; echo "</table>\n";
echo "<script type='text/javascript'>tableCheck();</script>\n"; echo "<script type='text/javascript'>tableCheck();</script>\n";
if (!information_schema(DB)) { if (!information_schema(DB)) {
@@ -105,7 +113,7 @@ if ($adminer->homepage()) {
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));
echo "<p>" . lang('Move to other database') . ": "; echo "<p>" . lang('Move to other database') . ": ";
echo ($databases ? html_select("target", $databases, $db) : '<input name="target" value="' . h($db) . '">'); echo ($databases ? html_select("target", $databases, $db) : '<input name="target" value="' . h($db) . '" autocapitalize="off">');
echo " <input type='submit' name='move' value='" . lang('Move') . "'>"; echo " <input type='submit' name='move' value='" . lang('Move') . "'>";
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";
@@ -121,7 +129,7 @@ if ($adminer->homepage()) {
} }
if (support("routine")) { if (support("routine")) {
echo "<h3>" . lang('Routines') . "</h3>\n"; echo "<h3 id='routines'>" . lang('Routines') . "</h3>\n";
$routines = routines(); $routines = routines();
if ($routines) { if ($routines) {
echo "<table cellspacing='0'>\n"; echo "<table cellspacing='0'>\n";
@@ -140,7 +148,7 @@ if ($adminer->homepage()) {
} }
if (support("sequence")) { if (support("sequence")) {
echo "<h3>" . lang('Sequences') . "</h3>\n"; echo "<h3 id='sequences'>" . lang('Sequences') . "</h3>\n";
$sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema()"); $sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema()");
if ($sequences) { if ($sequences) {
echo "<table cellspacing='0'>\n"; echo "<table cellspacing='0'>\n";
@@ -155,13 +163,13 @@ if ($adminer->homepage()) {
} }
if (support("type")) { if (support("type")) {
echo "<h3>" . lang('User types') . "</h3>\n"; echo "<h3 id='user-types'>" . lang('User types') . "</h3>\n";
$types = types(); $user_types = types();
if ($types) { if ($user_types) {
echo "<table cellspacing='0'>\n"; echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "</thead>\n"; echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
odd(''); odd('');
foreach ($types as $val) { foreach ($user_types as $val) {
echo "<tr" . odd() . "><th><a href='" . h(ME) . "type=" . urlencode($val) . "'>" . h($val) . "</a>\n"; echo "<tr" . odd() . "><th><a href='" . h(ME) . "type=" . urlencode($val) . "'>" . h($val) . "</a>\n";
} }
echo "</table>\n"; echo "</table>\n";
@@ -170,16 +178,17 @@ if ($adminer->homepage()) {
} }
if (support("event")) { if (support("event")) {
echo "<h3>" . lang('Events') . "</h3>\n"; echo "<h3 id='events'>" . lang('Events') . "</h3>\n";
$rows = get_rows("SHOW EVENTS"); $rows = get_rows("SHOW EVENTS");
if ($rows) { if ($rows) {
echo "<table cellspacing='0'>\n"; echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "</thead>\n"; echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "<td></thead>\n";
foreach ($rows as $row) { foreach ($rows as $row) {
echo "<tr>"; echo "<tr>";
echo '<th><a href="' . h(ME) . 'event=' . urlencode($row["Name"]) . '">' . h($row["Name"]) . "</a>"; echo "<th>" . h($row["Name"]);
echo "<td>" . ($row["Execute at"] ? lang('At given time') . "<td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "<td>$row[Starts]"); echo "<td>" . ($row["Execute at"] ? lang('At given time') . "<td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "<td>$row[Starts]");
echo "<td>$row[Ends]"; echo "<td>$row[Ends]";
echo '<td><a href="' . h(ME) . 'event=' . urlencode($row["Name"]) . '">' . lang('Alter') . '</a>';
} }
echo "</table>\n"; echo "</table>\n";
$event_scheduler = $connection->result("SELECT @@event_scheduler"); $event_scheduler = $connection->result("SELECT @@event_scheduler");

View File

@@ -12,11 +12,12 @@ if (isset($_GET["mssql"])) {
define("DRIVER", "mssql"); define("DRIVER", "mssql");
if (extension_loaded("sqlsrv")) { if (extension_loaded("sqlsrv")) {
class Min_DB { class Min_DB {
var $extension = "sqlsrv", $_link, $_result, $server_info, $affected_rows, $error; var $extension = "sqlsrv", $_link, $_result, $server_info, $affected_rows, $errno, $error;
function _get_error() { function _get_error() {
$this->error = ""; $this->error = "";
foreach (sqlsrv_errors() as $error) { foreach (sqlsrv_errors() as $error) {
$this->errno = $error["code"];
$this->error .= "$error[message]\n"; $this->error .= "$error[message]\n";
} }
$this->error = rtrim($this->error); $this->error = rtrim($this->error);
@@ -292,7 +293,7 @@ if (isset($_GET["mssql"])) {
function table_status($name = "") { function table_status($name = "") {
$return = array(); $return = array();
foreach (get_rows("SELECT name AS Name, type_desc AS Engine FROM sys.all_objects WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V')" . ($name != "" ? " AND name = " . q($name) : "")) as $row) { foreach (get_rows("SELECT name AS Name, type_desc AS Engine FROM sys.all_objects WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V') " . ($name != "" ? "AND name = " . q($name) : "ORDER BY name")) as $row) {
if ($name != "") { if ($name != "") {
return $row; return $row;
} }
@@ -339,15 +340,17 @@ WHERE o.schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND o.type IN ('S', 'U',
function indexes($table, $connection2 = null) { function indexes($table, $connection2 = null) {
$return = array(); $return = array();
// sp_statistics doesn't return information about primary key // sp_statistics doesn't return information about primary key
foreach (get_rows("SELECT i.name, key_ordinal, is_unique, is_primary_key, c.name AS column_name foreach (get_rows("SELECT i.name, key_ordinal, is_unique, is_primary_key, c.name AS column_name, is_descending_key
FROM sys.indexes i FROM sys.indexes i
INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id
INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id
WHERE OBJECT_NAME(i.object_id) = " . q($table) WHERE OBJECT_NAME(i.object_id) = " . q($table)
, $connection2) as $row) { , $connection2) as $row) {
$return[$row["name"]]["type"] = ($row["is_primary_key"] ? "PRIMARY" : ($row["is_unique"] ? "UNIQUE" : "INDEX")); $name = $row["name"];
$return[$row["name"]]["lengths"] = array(); $return[$name]["type"] = ($row["is_primary_key"] ? "PRIMARY" : ($row["is_unique"] ? "UNIQUE" : "INDEX"));
$return[$row["name"]]["columns"][$row["key_ordinal"]] = $row["column_name"]; $return[$name]["lengths"] = array();
$return[$name]["columns"][$row["key_ordinal"]] = $row["column_name"];
$return[$name]["descs"][$row["key_ordinal"]] = ($row["is_descending_key"] ? '1' : null);
} }
return $return; return $return;
} }
@@ -374,10 +377,6 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
return nl_br(h(preg_replace('~^(\\[[^]]*])+~m', '', $connection->error))); return nl_br(h(preg_replace('~^(\\[[^]]*])+~m', '', $connection->error)));
} }
function exact_value($val) {
return q($val);
}
function create_database($db, $collation) { function create_database($db, $collation) {
return queries("CREATE DATABASE " . idf_escape($db) . (eregi('^[a-z0-9_]+$', $collation) ? " COLLATE $collation" : "")); return queries("CREATE DATABASE " . idf_escape($db) . (eregi('^[a-z0-9_]+$', $collation) ? " COLLATE $collation" : ""));
} }

View File

@@ -54,6 +54,7 @@ if (!defined("DRIVER")) {
$extension = "MySQL", ///< @var string extension name $extension = "MySQL", ///< @var string extension name
$server_info, ///< @var string server version $server_info, ///< @var string server version
$affected_rows, ///< @var int number of affected rows $affected_rows, ///< @var int number of affected rows
$errno, ///< @var int last error code
$error, ///< @var string last error message $error, ///< @var string last error message
$_link, $_result ///< @access private $_link, $_result ///< @access private
; ;
@@ -110,6 +111,7 @@ if (!defined("DRIVER")) {
$result = @($unbuffered ? mysql_unbuffered_query($query, $this->_link) : mysql_query($query, $this->_link)); // @ - mute mysql.trace_mode $result = @($unbuffered ? mysql_unbuffered_query($query, $this->_link) : mysql_query($query, $this->_link)); // @ - mute mysql.trace_mode
$this->error = ""; $this->error = "";
if (!$result) { if (!$result) {
$this->errno = mysql_errno($this->_link);
$this->error = mysql_error($this->_link); $this->error = mysql_error($this->_link);
return false; return false;
} }
@@ -364,16 +366,21 @@ if (!defined("DRIVER")) {
/** Get table status /** Get table status
* @param string * @param string
* @param bool return only "Name", "Engine" and "Comment" fields
* @return array array($name => array("Name" => , "Engine" => , "Comment" => , "Oid" => , "Rows" => , "Collation" => , "Auto_increment" => , "Data_length" => , "Index_length" => , "Data_free" => )) or only inner array with $name * @return array array($name => array("Name" => , "Engine" => , "Comment" => , "Oid" => , "Rows" => , "Collation" => , "Auto_increment" => , "Data_length" => , "Index_length" => , "Data_free" => )) or only inner array with $name
*/ */
function table_status($name = "") { function table_status($name = "", $fast = false) {
global $connection;
$return = array(); $return = array();
foreach (get_rows("SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_")) : "")) as $row) { 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")
: "SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_\\")) : "")
) as $row) {
if ($row["Engine"] == "InnoDB") { if ($row["Engine"] == "InnoDB") {
// ignore internal comment, unnecessary since MySQL 5.1.21 // ignore internal comment, unnecessary since MySQL 5.1.21
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]); $row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
} }
if (!isset($row["Rows"])) { if (!isset($row["Engine"])) {
$row["Comment"] = ""; $row["Comment"] = "";
} }
if ($name != "") { if ($name != "") {
@@ -389,7 +396,7 @@ if (!defined("DRIVER")) {
* @return bool * @return bool
*/ */
function is_view($table_status) { function is_view($table_status) {
return !isset($table_status["Rows"]); return $table_status["Engine"] === null;
} }
/** Check if table supports foreign keys /** Check if table supports foreign keys
@@ -414,7 +421,7 @@ if (!defined("DRIVER")) {
"type" => $match[1], "type" => $match[1],
"length" => $match[2], "length" => $match[2],
"unsigned" => ltrim($match[3] . $match[4]), "unsigned" => ltrim($match[3] . $match[4]),
"default" => ($row["Default"] != "" || ereg("char", $match[1]) ? $row["Default"] : null), "default" => ($row["Default"] != "" || ereg("char|set", $match[1]) ? $row["Default"] : null),
"null" => ($row["Null"] == "YES"), "null" => ($row["Null"] == "YES"),
"auto_increment" => ($row["Extra"] == "auto_increment"), "auto_increment" => ($row["Extra"] == "auto_increment"),
"on_update" => (eregi('^on update (.+)', $row["Extra"], $match) ? $match[1] : ""), //! available since MySQL 5.1.23 "on_update" => (eregi('^on update (.+)', $row["Extra"], $match) ? $match[1] : ""), //! available since MySQL 5.1.23
@@ -438,6 +445,7 @@ if (!defined("DRIVER")) {
$return[$row["Key_name"]]["type"] = ($row["Key_name"] == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? "INDEX" : "UNIQUE"))); $return[$row["Key_name"]]["type"] = ($row["Key_name"] == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? "INDEX" : "UNIQUE")));
$return[$row["Key_name"]]["columns"][] = $row["Column_name"]; $return[$row["Key_name"]]["columns"][] = $row["Column_name"];
$return[$row["Key_name"]]["lengths"][] = $row["Sub_part"]; $return[$row["Key_name"]]["lengths"][] = $row["Sub_part"];
$return[$row["Key_name"]]["descs"][] = null;
} }
return $return; return $return;
} }
@@ -525,14 +533,6 @@ if (!defined("DRIVER")) {
} }
} }
/** Return expression for binary comparison
* @param string
* @return string
*/
function exact_value($val) {
return q($val) . " COLLATE utf8_bin";
}
/** Create database /** Create database
* @param string * @param string
* @param string * @param string
@@ -548,6 +548,7 @@ if (!defined("DRIVER")) {
* @return bool * @return bool
*/ */
function drop_databases($databases) { function drop_databases($databases) {
restart_session();
set_session("dbs", null); set_session("dbs", null);
return apply_queries("DROP DATABASE", $databases, 'idf_escape'); return apply_queries("DROP DATABASE", $databases, 'idf_escape');
} }
@@ -730,7 +731,7 @@ if (!defined("DRIVER")) {
*/ */
function triggers($table) { function triggers($table) {
$return = array(); $return = array();
foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_"))) as $row) { foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_\\"))) as $row) {
$return[$row["Trigger"]] = array($row["Timing"], $row["Event"]); $return[$row["Trigger"]] = array($row["Timing"], $row["Event"]);
} }
return $return; return $return;
@@ -789,7 +790,7 @@ if (!defined("DRIVER")) {
* @return array ("ROUTINE_TYPE" => , "ROUTINE_NAME" => , "DTD_IDENTIFIER" => ) * @return array ("ROUTINE_TYPE" => , "ROUTINE_NAME" => , "DTD_IDENTIFIER" => )
*/ */
function routines() { function routines() {
return get_rows("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . q(DB)); return get_rows("SELECT ROUTINE_NAME, ROUTINE_TYPE, DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . q(DB));
} }
/** Get list of available routine languages /** Get list of available routine languages
@@ -843,7 +844,7 @@ if (!defined("DRIVER")) {
* @return Min_Result * @return Min_Result
*/ */
function explain($connection, $query) { function explain($connection, $query) {
return $connection->query("EXPLAIN $query"); return $connection->query("EXPLAIN " . ($connection->server_info >= 5.1 ? "PARTITIONS " : "") . $query);
} }
/** Get approximate number of rows /** Get approximate number of rows
@@ -921,7 +922,7 @@ if (!defined("DRIVER")) {
*/ */
function trigger_sql($table, $style) { function trigger_sql($table, $style) {
$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 .= "\n" . ($style == 'CREATE+ALTER' ? "DROP TRIGGER IF EXISTS " . idf_escape($row["Trigger"]) . ";;\n" : "")
. "CREATE 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";
} }
@@ -957,6 +958,9 @@ if (!defined("DRIVER")) {
if (ereg("binary", $field["type"])) { if (ereg("binary", $field["type"])) {
return "HEX(" . idf_escape($field["field"]) . ")"; return "HEX(" . idf_escape($field["field"]) . ")";
} }
if ($field["type"] == "bit") {
return "BIN(" . idf_escape($field["field"]) . " + 0)"; // + 0 is required outside MySQLnd
}
if (ereg("geometry|point|linestring|polygon", $field["type"])) { if (ereg("geometry|point|linestring|polygon", $field["type"])) {
return "AsWKT(" . idf_escape($field["field"]) . ")"; return "AsWKT(" . idf_escape($field["field"]) . ")";
} }
@@ -971,6 +975,9 @@ if (!defined("DRIVER")) {
if (ereg("binary", $field["type"])) { if (ereg("binary", $field["type"])) {
$return = "UNHEX($return)"; $return = "UNHEX($return)";
} }
if ($field["type"] == "bit") {
$return = "CONV($return, 2, 10) + 0";
}
if (ereg("geometry|point|linestring|polygon", $field["type"])) { if (ereg("geometry|point|linestring|polygon", $field["type"])) {
$return = "GeomFromText($return)"; $return = "GeomFromText($return)";
} }
@@ -1001,7 +1008,7 @@ if (!defined("DRIVER")) {
$structured_types[$key] = array_keys($val); $structured_types[$key] = array_keys($val);
} }
$unsigned = array("unsigned", "zerofill", "unsigned zerofill"); ///< @var array number variants $unsigned = array("unsigned", "zerofill", "unsigned zerofill"); ///< @var array number variants
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", ""); ///< @var array operators used in select $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"); ///< @var array operators used in select
$functions = array("char_length", "date", "from_unixtime", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select $functions = array("char_length", "date", "from_unixtime", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select
$grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); ///< @var array grouping functions used in select $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); ///< @var array grouping functions used in select
$edit_functions = array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only $edit_functions = array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only

View File

@@ -6,7 +6,7 @@ if (isset($_GET["oracle"])) {
define("DRIVER", "oracle"); define("DRIVER", "oracle");
if (extension_loaded("oci8")) { if (extension_loaded("oci8")) {
class Min_DB { class Min_DB {
var $extension = "oci8", $_link, $_result, $server_info, $affected_rows, $error; var $extension = "oci8", $_link, $_result, $server_info, $affected_rows, $errno, $error;
function _error($errno, $error) { function _error($errno, $error) {
if (ini_bool("html_errors")) { if (ini_bool("html_errors")) {
@@ -40,6 +40,7 @@ if (isset($_GET["oracle"])) {
$this->error = ""; $this->error = "";
if (!$result) { if (!$result) {
$error = oci_error($this->_link); $error = oci_error($this->_link);
$this->errno = $error["code"];
$this->error = $error["message"]; $this->error = $error["message"];
return false; return false;
} }
@@ -180,7 +181,8 @@ if (isset($_GET["oracle"])) {
function tables_list() { function tables_list() {
return get_key_vals("SELECT table_name, 'table' FROM all_tables WHERE tablespace_name = " . q(DB) . " return get_key_vals("SELECT table_name, 'table' FROM all_tables WHERE tablespace_name = " . q(DB) . "
UNION SELECT view_name, 'view' FROM user_views" UNION SELECT view_name, 'view' FROM user_views
ORDER BY 1"
); //! views don't have schema ); //! views don't have schema
} }
@@ -192,7 +194,8 @@ UNION SELECT view_name, 'view' FROM user_views"
$return = array(); $return = array();
$search = q($name); $search = q($name);
foreach (get_rows('SELECT table_name "Name", \'table\' "Engine", avg_row_len * num_rows "Data_length", num_rows "Rows" FROM all_tables WHERE tablespace_name = ' . q(DB) . ($name != "" ? " AND table_name = $search" : "") . " foreach (get_rows('SELECT table_name "Name", \'table\' "Engine", avg_row_len * num_rows "Data_length", num_rows "Rows" FROM all_tables WHERE tablespace_name = ' . q(DB) . ($name != "" ? " AND table_name = $search" : "") . "
UNION SELECT view_name, 'view', 0, 0 FROM user_views" . ($name != "" ? " WHERE view_name = $search" : "") UNION SELECT view_name, 'view', 0, 0 FROM user_views" . ($name != "" ? " WHERE view_name = $search" : "") . "
ORDER BY 1"
) as $row) { ) as $row) {
if ($name != "") { if ($name != "") {
return $row; return $row;
@@ -242,9 +245,11 @@ FROM user_ind_columns uic
LEFT JOIN user_constraints uc ON uic.index_name = uc.constraint_name AND uic.table_name = uc.table_name LEFT JOIN user_constraints uc ON uic.index_name = uc.constraint_name AND uic.table_name = uc.table_name
WHERE uic.table_name = " . q($table) . " WHERE uic.table_name = " . q($table) . "
ORDER BY uc.constraint_type, uic.column_position", $connection2) as $row) { ORDER BY uc.constraint_type, uic.column_position", $connection2) as $row) {
$return[$row["INDEX_NAME"]]["type"] = ($row["CONSTRAINT_TYPE"] == "P" ? "PRIMARY" : ($row["CONSTRAINT_TYPE"] == "U" ? "UNIQUE" : "INDEX")); $index_name = $row["INDEX_NAME"];
$return[$row["INDEX_NAME"]]["columns"][] = $row["COLUMN_NAME"]; $return[$index_name]["type"] = ($row["CONSTRAINT_TYPE"] == "P" ? "PRIMARY" : ($row["CONSTRAINT_TYPE"] == "U" ? "UNIQUE" : "INDEX"));
$return[$row["INDEX_NAME"]]["lengths"][] = ($row["CHAR_LENGTH"] && $row["CHAR_LENGTH"] != $row["COLUMN_LENGTH"] ? $row["CHAR_LENGTH"] : null); $return[$index_name]["columns"][] = $row["COLUMN_NAME"];
$return[$index_name]["lengths"][] = ($row["CHAR_LENGTH"] && $row["CHAR_LENGTH"] != $row["COLUMN_LENGTH"] ? $row["CHAR_LENGTH"] : null);
$return[$index_name]["descs"][] = ($row["DESCEND"] ? '1' : null);
} }
return $return; return $return;
} }
@@ -267,10 +272,6 @@ ORDER BY uc.constraint_type, uic.column_position", $connection2) as $row) {
return h($connection->error); //! highlight sqltext from offset return h($connection->error); //! highlight sqltext from offset
} }
function exact_value($val) {
return q($val);
}
function explain($connection, $query) { function explain($connection, $query) {
$connection->query("EXPLAIN PLAN FOR $query"); $connection->query("EXPLAIN PLAN FOR $query");
return $connection->query("SELECT * FROM plan_table"); return $connection->query("SELECT * FROM plan_table");
@@ -385,7 +386,7 @@ ORDER BY PROCESS
$structured_types[$key] = array_keys($val); $structured_types[$key] = array_keys($val);
} }
$unsigned = array(); $unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", ""); $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL");
$functions = array("length", "lower", "round", "upper"); $functions = array("length", "lower", "round", "upper");
$grouping = array("avg", "count", "count distinct", "max", "min", "sum"); $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
$edit_functions = array( $edit_functions = array(

View File

@@ -206,11 +206,11 @@ if (isset($_GET["pgsql"])) {
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' 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 AS \"Oid\", reltuples as \"Rows\" foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN '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\"
FROM pg_class FROM pg_class
WHERE relkind IN ('r','v') WHERE relkind IN ('r','v')
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())" AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())
. ($name != "" ? " AND relname = " . q($name) : "") " . ($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;
} }
@@ -227,7 +227,11 @@ AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema(
function fields($table) { function fields($table) {
$return = array(); $return = array();
foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull, col_description(c.oid, a.attnum) AS comment $aliases = array(
'timestamp without time zone' => 'timestamp',
'timestamp with time zone' => 'timestamptz',
);
foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull::int, col_description(c.oid, a.attnum) AS comment
FROM pg_class c FROM pg_class c
JOIN pg_namespace n ON c.relnamespace = n.oid JOIN pg_namespace n ON c.relnamespace = n.oid
JOIN pg_attribute a ON c.oid = a.attrelid JOIN pg_attribute a ON c.oid = a.attrelid
@@ -239,10 +243,13 @@ AND a.attnum > 0
ORDER BY a.attnum" ORDER BY a.attnum"
) as $row) { ) as $row) {
//! collation, primary //! collation, primary
ereg('(.*)(\\((.*)\\))?', $row["full_type"], $match); $type = $row["full_type"];
list(, $row["type"], , $row["length"]) = $match; if (ereg('(.+)\\((.*)\\)$', $row["full_type"], $match)) {
list(, $type, $row["length"]) = $match;
}
$row["type"] = ($aliases[$type] ? $aliases[$type] : $type);
$row["full_type"] = $row["type"] . ($row["length"] ? "($row[length])" : ""); $row["full_type"] = $row["type"] . ($row["length"] ? "($row[length])" : "");
$row["null"] = ($row["attnotnull"] == "f"); $row["null"] = !$row["attnotnull"];
$row["auto_increment"] = eregi("^nextval\\(", $row["default"]); $row["auto_increment"] = eregi("^nextval\\(", $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)) {
@@ -261,13 +268,18 @@ 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, indisprimary, indkey 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 FROM pg_index i, pg_class ci WHERE i.indrelid = $table_oid AND ci.oid = i.indexrelid", $connection2) as $row) {
$return[$row["relname"]]["type"] = ($row["indisprimary"] == "t" ? "PRIMARY" : ($row["indisunique"] == "t" ? "UNIQUE" : "INDEX")); $relname = $row["relname"];
$return[$row["relname"]]["columns"] = array(); $return[$relname]["type"] = ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX"));
$return[$relname]["columns"] = array();
foreach (explode(" ", $row["indkey"]) as $indkey) { foreach (explode(" ", $row["indkey"]) as $indkey) {
$return[$row["relname"]]["columns"][] = $columns[$indkey]; $return[$relname]["columns"][] = $columns[$indkey];
} }
$return[$row["relname"]]["lengths"] = array(); $return[$relname]["descs"] = array();
foreach (explode(" ", $row["indoption"]) as $indoption) {
$return[$relname]["descs"][] = ($indoption & 1 ? '1' : null); // 1 - INDOPTION_DESC
}
$return[$relname]["lengths"] = array();
} }
return $return; return $return;
} }
@@ -319,10 +331,6 @@ ORDER BY conkey, conname") as $row) {
return nl_br($return); return nl_br($return);
} }
function exact_value($val) {
return q($val);
}
function create_database($db, $collation) { function create_database($db, $collation) {
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " ENCODING " . idf_escape($collation) : "")); return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " ENCODING " . idf_escape($collation) : ""));
} }
@@ -399,21 +407,32 @@ ORDER BY conkey, conname") as $row) {
function alter_indexes($table, $alter) { function alter_indexes($table, $alter) {
$create = array(); $create = array();
$drop = array(); $drop = array();
$queries = array();
foreach ($alter as $val) { foreach ($alter as $val) {
if ($val[0] != "INDEX") { if ($val[0] != "INDEX") {
//! descending UNIQUE indexes results in syntax error
$create[] = ($val[2] == "DROP" $create[] = ($val[2] == "DROP"
? "\nDROP CONSTRAINT " . idf_escape($val[1]) ? "\nDROP CONSTRAINT " . idf_escape($val[1])
: "\nADD $val[0] " . ($val[0] == "PRIMARY" ? "KEY " : "") . $val[2] : "\nADD" . ($val[1] != "" ? " CONSTRAINT " . idf_escape($val[1]) : "") . " $val[0] " . ($val[0] == "PRIMARY" ? "KEY " : "") . $val[2]
); );
} elseif ($val[2] == "DROP") { } elseif ($val[2] == "DROP") {
$drop[] = idf_escape($val[1]); $drop[] = idf_escape($val[1]);
} elseif (!queries("CREATE INDEX " . idf_escape($val[1] != "" ? $val[1] : uniqid($table . "_")) . " ON " . table($table) . " $val[2]")) { } else {
$queries[] = "CREATE INDEX " . idf_escape($val[1] != "" ? $val[1] : uniqid($table . "_")) . " ON " . table($table) . " $val[2]";
}
}
if ($create) {
array_unshift($queries, "ALTER TABLE " . table($table) . implode(",", $create));
}
if ($drop) {
array_unshift($queries, "DROP INDEX " . implode(", ", $drop));
}
foreach ($queries as $query) {
if (!queries($query)) {
return false; return false;
} }
} }
return ((!$create || queries("ALTER TABLE " . table($table) . implode(",", $create))) return true;
&& (!$drop || queries("DROP INDEX " . implode(", ", $drop)))
);
} }
function truncate_tables($tables) { function truncate_tables($tables) {
@@ -607,7 +626,7 @@ AND typelem = 0"
$structured_types[$key] = array_keys($val); $structured_types[$key] = array_keys($val);
} }
$unsigned = array(); $unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "" to avoid SQL injection $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid SQL injection
$functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper"); $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
$grouping = array("avg", "count", "count distinct", "max", "min", "sum"); $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
$edit_functions = array( $edit_functions = array(

View File

@@ -5,11 +5,11 @@ $drivers["sqlite2"] = "SQLite 2";
if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) { if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
$possible_drivers = array((isset($_GET["sqlite"]) ? "SQLite3" : "SQLite"), "PDO_SQLite"); $possible_drivers = array((isset($_GET["sqlite"]) ? "SQLite3" : "SQLite"), "PDO_SQLite");
define("DRIVER", (isset($_GET["sqlite"]) ? "sqlite" : "sqlite2")); define("DRIVER", (isset($_GET["sqlite"]) ? "sqlite" : "sqlite2"));
if (extension_loaded(isset($_GET["sqlite"]) ? "sqlite3" : "sqlite")) { if (class_exists(isset($_GET["sqlite"]) ? "SQLite3" : "SQLiteDatabase")) {
if (isset($_GET["sqlite"])) { if (isset($_GET["sqlite"])) {
class Min_SQLite { class Min_SQLite {
var $extension = "SQLite3", $server_info, $affected_rows, $error, $_link; var $extension = "SQLite3", $server_info, $affected_rows, $errno, $error, $_link;
function Min_SQLite($filename) { function Min_SQLite($filename) {
$this->_link = new SQLite3($filename); $this->_link = new SQLite3($filename);
@@ -21,6 +21,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
$result = @$this->_link->query($query); $result = @$this->_link->query($query);
$this->error = ""; $this->error = "";
if (!$result) { if (!$result) {
$this->errno = $this->_link->lastErrorCode();
$this->error = $this->_link->lastErrorMsg(); $this->error = $this->_link->lastErrorMsg();
return false; return false;
} elseif ($result->numColumns()) { } elseif ($result->numColumns()) {
@@ -252,8 +253,8 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function table_status($name = "") { function table_status($name = "") {
global $connection; global $connection;
$return = array(); $return = array();
foreach (get_rows("SELECT name AS Name, type AS Engine FROM sqlite_master WHERE type IN ('table', 'view')" . ($name != "" ? " AND name = " . q($name) : "")) as $row) { foreach (get_rows("SELECT name AS Name, type AS Engine FROM sqlite_master WHERE type IN ('table', 'view') " . ($name != "" ? "AND name = " . q($name) : "ORDER BY name")) as $row) {
$row["Oid"] = "t"; $row["Oid"] = 1;
$row["Auto_increment"] = ""; $row["Auto_increment"] = "";
$row["Rows"] = $connection->result("SELECT COUNT(*) FROM " . idf_escape($row["Name"])); $row["Rows"] = $connection->result("SELECT COUNT(*) FROM " . idf_escape($row["Name"]));
$return[$row["Name"]] = $row; $return[$row["Name"]] = $row;
@@ -303,12 +304,21 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
if ($primary) { if ($primary) {
$return[""] = array("type" => "PRIMARY", "columns" => $primary, "lengths" => array()); $return[""] = array("type" => "PRIMARY", "columns" => $primary, "lengths" => array());
} }
$sqls = get_key_vals("SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = " . q($table));
foreach (get_rows("PRAGMA index_list(" . table($table) . ")") as $row) { foreach (get_rows("PRAGMA index_list(" . table($table) . ")") as $row) {
if (!ereg("^sqlite_", $row["name"])) { $name = $row["name"];
$return[$row["name"]]["type"] = ($row["unique"] ? "UNIQUE" : "INDEX"); if (!ereg("^sqlite_", $name)) {
$return[$row["name"]]["lengths"] = array(); $return[$name]["type"] = ($row["unique"] ? "UNIQUE" : "INDEX");
foreach (get_rows("PRAGMA index_info(" . idf_escape($row["name"]) . ")") as $row1) { $return[$name]["lengths"] = array();
$return[$row["name"]]["columns"][] = $row1["name"]; foreach (get_rows("PRAGMA index_info(" . idf_escape($name) . ")") as $row1) {
$return[$name]["columns"][] = $row1["name"];
}
$return[$name]["descs"] = array();
if (eregi('^CREATE( UNIQUE)? INDEX ' . quotemeta(idf_escape($name) . ' ON ' . idf_escape($table)) . ' \((.*)\)$', $sqls[$name], $regs)) {
preg_match_all('/("[^"]*+")+( DESC)?/', $regs[2], $matches);
foreach ($matches[2] as $val) {
$return[$name]["descs"][] = ($val ? '1' : null);
}
} }
} }
} }
@@ -347,10 +357,6 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return h($connection->error); return h($connection->error);
} }
function exact_value($val) {
return q($val);
}
function check_sqlite_name($name) { function check_sqlite_name($name) {
// avoid creating PHP files on unsecured servers // avoid creating PHP files on unsecured servers
global $connection; global $connection;
@@ -504,11 +510,19 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return true; return true;
} }
function index_sql($table, $type, $name, $columns) {
return "CREATE $type " . ($type != "INDEX" ? "INDEX " : "")
. idf_escape($name != "" ? $name : uniqid($table . "_"))
. " ON " . table($table)
. " $columns"
;
}
function alter_indexes($table, $alter) { function alter_indexes($table, $alter) {
foreach ($alter as $val) { foreach (array_reverse($alter) as $val) {
if (!queries($val[2] == "DROP" if (!queries($val[2] == "DROP"
? "DROP INDEX " . idf_escape($val[1]) ? "DROP INDEX " . idf_escape($val[1])
: "CREATE $val[0] " . ($val[0] != "INDEX" ? "INDEX " : "") . idf_escape($val[1] != "" ? $val[1] : uniqid($table . "_")) . " ON " . table($table) . " $val[2]" : index_sql($table, $val[0], $val[1], $val[2])
)) { )) {
return false; return false;
} }
@@ -611,7 +625,14 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function create_sql($table, $auto_increment) { function create_sql($table, $auto_increment) {
global $connection; global $connection;
return $connection->result("SELECT sql FROM sqlite_master WHERE type = 'table' 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) {
if ($name == '') {
continue;
}
$return .= ";\n\n" . index_sql($table, $index['type'], $name, "(" . implode(", ", array_map('idf_escape', $index['columns'])) . ")");
}
return $return;
} }
function truncate_sql($table) { function truncate_sql($table) {
@@ -658,7 +679,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
$types = array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0); $types = array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0);
$structured_types = array_keys($types); $structured_types = array_keys($types);
$unsigned = array(); $unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", ""); // REGEXP can be user defined function $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); // REGEXP can be user defined function
$functions = array("hex", "length", "lower", "round", "unixepoch", "upper"); $functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
$grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
$edit_functions = array( $edit_functions = array(

View File

@@ -1,20 +1,24 @@
<?php <?php
$TABLE = $_GET["dump"]; $TABLE = $_GET["dump"];
if ($_POST) { if ($_POST && !$error) {
$cookie = ""; $cookie = "";
foreach (array("output", "format", "db_style", "routines", "events", "table_style", "auto_increment", "triggers", "data_style") as $key) { foreach (array("output", "format", "db_style", "routines", "events", "table_style", "auto_increment", "triggers", "data_style") as $key) {
$cookie .= "&$key=" . urlencode($_POST[$key]); $cookie .= "&$key=" . urlencode($_POST[$key]);
} }
cookie("adminer_export", substr($cookie, 1)); cookie("adminer_export", substr($cookie, 1));
$ext = dump_headers(($TABLE != "" ? $TABLE : DB), (DB == "" || count((array) $_POST["tables"] + (array) $_POST["data"]) > 1)); $tables = array_flip((array) $_POST["tables"]) + array_flip((array) $_POST["data"]);
$is_sql = ($_POST["format"] == "sql"); $ext = dump_headers(
(count($tables) == 1 ? key($tables) : DB),
(DB == "" || count($tables) > 1));
$is_sql = ereg('sql', $_POST["format"]);
if ($is_sql) { if ($is_sql) {
echo "-- Adminer $VERSION " . $drivers[DRIVER] . " dump echo "-- Adminer $VERSION " . $drivers[DRIVER] . " dump
" . ($jush != "sql" ? "" : "SET NAMES utf8; " . ($jush != "sql" ? "" : "SET NAMES utf8;
" . ($_POST["data_style"] ? "SET foreign_key_checks = 0; " . ($_POST["data_style"] ? "SET foreign_key_checks = 0;
SET time_zone = " . q($connection->result("SELECT @@time_zone")) . "; SET time_zone = " . q(substr(preg_replace('~^[^-]~', '+\0', $connection->result("SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP)")), 0, 6)) . ";
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
" : "") . " " : "") . "
"); ");
@@ -28,22 +32,22 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
$databases = explode("\n", rtrim(str_replace("\r", "", $databases), "\n")); $databases = explode("\n", rtrim(str_replace("\r", "", $databases), "\n"));
} }
} }
foreach ((array) $databases as $db) { foreach ((array) $databases as $db) {
$adminer->dumpDatabase($db);
if ($connection->select_db($db)) { if ($connection->select_db($db)) {
if ($is_sql && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) { if ($is_sql && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
if ($style == "DROP+CREATE") { if ($style == "DROP+CREATE") {
echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n"; echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n";
} }
echo ($style == "CREATE+ALTER" ? preg_replace('~^CREATE DATABASE ~', '\\0IF NOT EXISTS ', $create) : $create) . ";\n"; echo "$create;\n";
} }
if ($is_sql) { if ($is_sql) {
if ($style) { if ($style) {
echo use_sql($db) . ";\n\n"; echo use_sql($db) . ";\n\n";
} }
if (in_array("CREATE+ALTER", array($style, $_POST["table_style"]))) {
echo "SET @adminer_alter = '';\n\n";
}
$out = ""; $out = "";
if ($_POST["routines"]) { if ($_POST["routines"]) {
foreach (array("FUNCTION", "PROCEDURE") as $routine) { foreach (array("FUNCTION", "PROCEDURE") as $routine) {
foreach (get_rows("SHOW $routine STATUS WHERE Db = " . q($db), null, "-- ") as $row) { foreach (get_rows("SHOW $routine STATUS WHERE Db = " . q($db), null, "-- ") as $row) {
@@ -52,12 +56,14 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
} }
} }
} }
if ($_POST["events"]) { if ($_POST["events"]) {
foreach (get_rows("SHOW EVENTS", null, "-- ") as $row) { foreach (get_rows("SHOW EVENTS", null, "-- ") as $row) {
$out .= ($style != 'DROP+CREATE' ? "DROP EVENT IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "") $out .= ($style != 'DROP+CREATE' ? "DROP EVENT IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "")
. remove_definer($connection->result("SHOW CREATE EVENT " . idf_escape($row["Name"]), 3)) . ";;\n\n"; . remove_definer($connection->result("SHOW CREATE EVENT " . idf_escape($row["Name"]), 3)) . ";;\n\n";
} }
} }
if ($out) { if ($out) {
echo "DELIMITER ;;\n\n$out" . "DELIMITER ;\n\n"; echo "DELIMITER ;;\n\n$out" . "DELIMITER ;\n\n";
} }
@@ -65,87 +71,53 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
if ($_POST["table_style"] || $_POST["data_style"]) { if ($_POST["table_style"] || $_POST["data_style"]) {
$views = array(); $views = array();
foreach (table_status() as $table_status) { foreach (table_status('', true) as $name => $table_status) {
$table = (DB == "" || in_array($table_status["Name"], (array) $_POST["tables"])); $table = (DB == "" || in_array($name, (array) $_POST["tables"]));
$data = (DB == "" || in_array($table_status["Name"], (array) $_POST["data"])); $data = (DB == "" || in_array($name, (array) $_POST["data"]));
if ($table || $data) { if ($table || $data) {
if (!is_view($table_status)) { if ($ext == "tar") {
if ($ext == "tar") { $tmp_file = new TmpFile;
ob_start(); ob_start(array($tmp_file, 'write'), 1e5);
} }
$adminer->dumpTable($table_status["Name"], ($table ? $_POST["table_style"] : ""));
if ($data) { $adminer->dumpTable($name, ($table ? $_POST["table_style"] : ""), (is_view($table_status) ? 2 : 0));
$adminer->dumpData($table_status["Name"], $_POST["data_style"], "SELECT * FROM " . table($table_status["Name"])); if (is_view($table_status)) {
} $views[] = $name;
if ($is_sql && $_POST["triggers"] && $table && ($triggers = trigger_sql($table_status["Name"], $_POST["table_style"]))) { } elseif ($data) {
echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n"; $fields = fields($name);
} $adminer->dumpData($name, $_POST["data_style"], "SELECT *" . convert_fields($fields, $fields) . " FROM " . table($name));
if ($ext == "tar") { }
echo tar_file((DB != "" ? "" : "$db/") . "$table_status[Name].csv", ob_get_clean()); if ($is_sql && $_POST["triggers"] && $table && ($triggers = trigger_sql($name, $_POST["table_style"]))) {
} elseif ($is_sql) { echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n";
echo "\n"; }
}
if ($ext == "tar") {
ob_end_flush();
tar_file((DB != "" ? "" : "$db/") . "$name.csv", $tmp_file);
} elseif ($is_sql) { } elseif ($is_sql) {
$views[] = $table_status["Name"]; echo "\n";
} }
} }
} }
foreach ($views as $view) { foreach ($views as $view) {
$adminer->dumpTable($view, $_POST["table_style"], true); $adminer->dumpTable($view, $_POST["table_style"], 1);
} }
if ($ext == "tar") { if ($ext == "tar") {
echo pack("x512"); echo pack("x512");
} }
} }
if ($style == "CREATE+ALTER" && $is_sql) {
// drop old tables
$query = "SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()";
echo "DELIMITER ;;
CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
DECLARE _table_name, _engine, _table_collation varchar(64);
DECLARE _table_comment varchar(64);
DECLARE done bool DEFAULT 0;
DECLARE tables CURSOR FOR $query;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN tables;
REPEAT
FETCH tables INTO _table_name, _engine, _table_collation, _table_comment;
IF NOT done THEN
CASE _table_name";
foreach (get_rows($query) as $row) {
$comment = q($row["ENGINE"] == "InnoDB" ? preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["TABLE_COMMENT"]) : $row["TABLE_COMMENT"]);
echo "
WHEN " . q($row["TABLE_NAME"]) . " THEN
" . (isset($row["ENGINE"]) ? "IF _engine != '$row[ENGINE]' OR _table_collation != '$row[TABLE_COLLATION]' OR _table_comment != $comment THEN
ALTER TABLE " . idf_escape($row["TABLE_NAME"]) . " ENGINE=$row[ENGINE] COLLATE=$row[TABLE_COLLATION] COMMENT=$comment;
END IF" : "BEGIN END") . ";";
}
echo "
ELSE
SET alter_command = CONCAT(alter_command, 'DROP TABLE `', REPLACE(_table_name, '`', '``'), '`;\\n');
END CASE;
END IF;
UNTIL done END REPEAT;
CLOSE tables;
END;;
DELIMITER ;
CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
";
}
if (in_array("CREATE+ALTER", array($style, $_POST["table_style"])) && $is_sql) {
echo "SELECT @adminer_alter;\n";
}
} }
} }
if ($is_sql) { if ($is_sql) {
echo "-- " . $connection->result("SELECT NOW()") . "\n"; echo "-- " . $connection->result("SELECT NOW()") . "\n";
} }
exit; exit;
} }
page_header(lang('Export'), "", ($_GET["export"] != "" ? array("table" => $_GET["export"]) : array()), DB); page_header(lang('Export'), $error, ($_GET["export"] != "" ? array("table" => $_GET["export"]) : array()), DB);
?> ?>
<form action="" method="post"> <form action="" method="post">
@@ -154,9 +126,7 @@ page_header(lang('Export'), "", ($_GET["export"] != "" ? array("table" => $_GET[
$db_style = array('', 'USE', 'DROP+CREATE', 'CREATE'); $db_style = array('', 'USE', 'DROP+CREATE', 'CREATE');
$table_style = array('', 'DROP+CREATE', 'CREATE'); $table_style = array('', 'DROP+CREATE', 'CREATE');
$data_style = array('', 'TRUNCATE+INSERT', 'INSERT'); $data_style = array('', 'TRUNCATE+INSERT', 'INSERT');
if ($jush == "sql") { if ($jush == "sql") { //! use insert_update() in all drivers
$db_style[] = 'CREATE+ALTER';
$table_style[] = 'CREATE+ALTER';
$data_style[] = 'INSERT+UPDATE'; $data_style[] = 'INSERT+UPDATE';
} }
parse_str($_COOKIE["adminer_export"], $row); parse_str($_COOKIE["adminer_export"], $row);
@@ -167,20 +137,26 @@ if (!isset($row["events"])) { // backwards compatibility
$row["routines"] = $row["events"] = ($_GET["dump"] == ""); $row["routines"] = $row["events"] = ($_GET["dump"] == "");
$row["triggers"] = $row["table_style"]; $row["triggers"] = $row["table_style"];
} }
echo "<tr><th>" . lang('Output') . "<td>" . html_select("output", $adminer->dumpOutput(), $row["output"], 0) . "\n"; // 0 - radio echo "<tr><th>" . lang('Output') . "<td>" . html_select("output", $adminer->dumpOutput(), $row["output"], 0) . "\n"; // 0 - radio
echo "<tr><th>" . lang('Format') . "<td>" . html_select("format", $adminer->dumpFormat(), $row["format"], 0) . "\n"; // 0 - radio echo "<tr><th>" . lang('Format') . "<td>" . html_select("format", $adminer->dumpFormat(), $row["format"], 0) . "\n"; // 0 - radio
echo ($jush == "sqlite" ? "" : "<tr><th>" . lang('Database') . "<td>" . html_select('db_style', $db_style, $row["db_style"]) echo ($jush == "sqlite" ? "" : "<tr><th>" . lang('Database') . "<td>" . html_select('db_style', $db_style, $row["db_style"])
. (support("routine") ? checkbox("routines", 1, $row["routines"], lang('Routines')) : "") . (support("routine") ? checkbox("routines", 1, $row["routines"], lang('Routines')) : "")
. (support("event") ? checkbox("events", 1, $row["events"], lang('Events')) : "") . (support("event") ? checkbox("events", 1, $row["events"], lang('Events')) : "")
); );
echo "<tr><th>" . lang('Tables') . "<td>" . html_select('table_style', $table_style, $row["table_style"]) echo "<tr><th>" . lang('Tables') . "<td>" . html_select('table_style', $table_style, $row["table_style"])
. checkbox("auto_increment", 1, $row["auto_increment"], lang('Auto Increment')) . checkbox("auto_increment", 1, $row["auto_increment"], lang('Auto Increment'))
. (support("trigger") ? checkbox("triggers", 1, $row["triggers"], lang('Triggers')) : "") . (support("trigger") ? checkbox("triggers", 1, $row["triggers"], lang('Triggers')) : "")
; ;
echo "<tr><th>" . lang('Data') . "<td>" . html_select('data_style', $data_style, $row["data_style"]); echo "<tr><th>" . lang('Data') . "<td>" . html_select('data_style', $data_style, $row["data_style"]);
?> ?>
</table> </table>
<p><input type="submit" value="<?php echo lang('Export'); ?>"> <p><input type="submit" value="<?php echo lang('Export'); ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<table cellspacing="0"> <table cellspacing="0">
<?php <?php
@@ -188,32 +164,37 @@ $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><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 onclick='formCheck(this, /^tables\\[/);'>" . lang('Tables') . "</label>";
echo "<th style='text-align: right;'><label>" . 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 onclick='formCheck(this, /^data\\[/);'></label>";
echo "</thead>\n"; echo "</thead>\n";
$views = ""; $views = "";
//! defer number of rows to JavaScript $tables_list = tables_list();
foreach (table_status() as $table_status) { foreach ($tables_list as $name => $type) {
$name = $table_status["Name"];
$prefix = ereg_replace("_.*", "", $name); $prefix = ereg_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');"); $print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "checkboxClick(event, this); formUncheck('check-tables');", "block");
if (is_view($table_status)) { if ($type !== null && !eregi("table", $type)) {
$views .= "$print\n"; $views .= "$print\n";
} else { } else {
echo "$print<td align='right'><label>" . ($table_status["Engine"] == "InnoDB" && $table_status["Rows"] ? "~ " : "") . $table_status["Rows"] . 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(event, this); formUncheck('check-data');") . "</label>\n";
} }
$prefixes[$prefix]++; $prefixes[$prefix]++;
} }
echo $views; echo $views;
if ($tables_list) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=db');</script>\n";
}
} else { } else {
echo "<thead><tr><th style='text-align: left;'><label><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;'><label class='block'><input type='checkbox' id='check-databases'" . ($TABLE == "" ? " checked" : "") . " onclick='formCheck(this, /^databases\\[/);'>" . lang('Database') . "</label></thead>\n";
$databases = $adminer->databases(); $databases = $adminer->databases();
if ($databases) { if ($databases) {
foreach ($databases as $db) { foreach ($databases as $db) {
if (!information_schema($db)) { if (!information_schema($db)) {
$prefix = ereg_replace("_.*", "", $db); $prefix = ereg_replace("_.*", "", $db);
echo "<tr><td>" . checkbox("databases[]", $db, $TABLE == "" || $TABLE == "$prefix%", $db, "formUncheck('check-databases');") . "</label>\n"; echo "<tr><td>" . checkbox("databases[]", $db, $TABLE == "" || $TABLE == "$prefix%", $db, "formUncheck('check-databases');", "block") . "\n";
$prefixes[$prefix]++; $prefixes[$prefix]++;
} }
} }

View File

@@ -8,6 +8,7 @@ foreach ($fields as $name => $field) {
unset($fields[$name]); unset($fields[$name]);
} }
} }
if ($_POST && !$error && !isset($_GET["select"])) { if ($_POST && !$error && !isset($_GET["select"])) {
$location = $_POST["referer"]; $location = $_POST["referer"];
if ($_POST["insert"]) { // continue edit or insert if ($_POST["insert"]) { // continue edit or insert
@@ -15,8 +16,18 @@ if ($_POST && !$error && !isset($_GET["select"])) {
} elseif (!ereg('^.+&select=.+$', $location)) { } elseif (!ereg('^.+&select=.+$', $location)) {
$location = ME . "select=" . urlencode($TABLE); $location = ME . "select=" . urlencode($TABLE);
} }
$indexes = indexes($TABLE);
$unique_array = unique_array($_GET["where"], $indexes);
$query_where = "\nWHERE $where";
if (isset($_POST["delete"])) { if (isset($_POST["delete"])) {
query_redirect("DELETE" . limit1("FROM " . table($TABLE), " WHERE $where"), $location, lang('Item has been deleted.')); $query = "FROM " . table($TABLE);
query_redirect(
"DELETE" . ($unique_array ? " $query$query_where" : limit1($query, $query_where)),
$location,
lang('Item has been deleted.')
);
} else { } else {
$set = array(); $set = array();
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
@@ -25,11 +36,17 @@ if ($_POST && !$error && !isset($_GET["select"])) {
$set[idf_escape($name)] = ($update ? "\n" . idf_escape($name) . " = $val" : $val); $set[idf_escape($name)] = ($update ? "\n" . idf_escape($name) . " = $val" : $val);
} }
} }
if ($update) { if ($update) {
if (!$set) { if (!$set) {
redirect($location); redirect($location);
} }
query_redirect("UPDATE" . limit1(table($TABLE) . " SET" . implode(",", $set), "\nWHERE $where"), $location, lang('Item has been updated.')); $query = table($TABLE) . " SET" . implode(",", $set);
query_redirect(
"UPDATE" . ($unique_array ? " $query$query_where" : limit1($query, $query_where)),
$location,
lang('Item has been updated.')
);
} else { } else {
$result = insert_into($TABLE, $set); $result = insert_into($TABLE, $set);
$last_id = ($result ? last_id() : 0); $last_id = ($result ? last_id() : 0);
@@ -38,7 +55,7 @@ if ($_POST && !$error && !isset($_GET["select"])) {
} }
} }
$table_name = $adminer->tableName(table_status($TABLE)); $table_name = $adminer->tableName(table_status1($TABLE, true));
page_header( page_header(
($update ? lang('Edit') : lang('Insert')), ($update ? lang('Edit') : lang('Insert')),
$error, $error,
@@ -81,24 +98,32 @@ 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' onkeydown='return editingKeydown(event);'>\n";
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
echo "<tr><th>" . $adminer->fieldName($field); echo "<tr><th>" . $adminer->fieldName($field);
$default = $_GET["set"][bracket_escape($name)]; $default = $_GET["set"][bracket_escape($name)];
if ($default === null) {
$default = $field["default"];
if ($field["type"] == "bit" && ereg("^b'([01]*)'\$", $default, $regs)) {
$default = $regs[1];
}
}
$value = ($row !== null $value = ($row !== null
? ($row[$name] != "" && $jush == "sql" && ereg("enum|set", $field["type"]) ? (is_array($row[$name]) ? array_sum($row[$name]) : +$row[$name]) : $row[$name]) ? ($row[$name] != "" && $jush == "sql" && ereg("enum|set", $field["type"]) ? (is_array($row[$name]) ? array_sum($row[$name]) : +$row[$name]) : $row[$name])
: (!$update && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : ($default !== null ? $default : $field["default"]))) : (!$update && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : $default))
); );
if (!$_POST["save"] && is_string($value)) { if (!$_POST["save"] && is_string($value)) {
$value = $adminer->editVal($value, $field); $value = $adminer->editVal($value, $field);
} }
$function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($update && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : ($value !== null ? '' : 'NULL')))); $function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($update && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : ($value !== null ? '' : 'NULL'))));
if ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") { if (ereg("time", $field["type"]) && $value == "CURRENT_TIMESTAMP") {
$value = ""; $value = "";
$function = "now"; $function = "now";
} }
input($field, $value, $function); input($field, $value, $function);
echo "\n"; echo "\n";
} }
echo "</table>\n"; echo "</table>\n";
} }
?> ?>
@@ -111,7 +136,7 @@ if ($fields) {
} }
} }
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\">\n" echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\">\n"
: ($_POST || !$fields ? "" : "<script type='text/javascript'>document.getElementById('form').getElementsByTagName('td')[1].firstChild.focus();</script>\n") : ($_POST || !$fields ? "" : "<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n")
); );
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,31 +2,32 @@
$EVENT = $_GET["event"]; $EVENT = $_GET["event"];
$intervals = array("YEAR", "QUARTER", "MONTH", "DAY", "HOUR", "MINUTE", "WEEK", "SECOND", "YEAR_MONTH", "DAY_HOUR", "DAY_MINUTE", "DAY_SECOND", "HOUR_MINUTE", "HOUR_SECOND", "MINUTE_SECOND"); $intervals = array("YEAR", "QUARTER", "MONTH", "DAY", "HOUR", "MINUTE", "WEEK", "SECOND", "YEAR_MONTH", "DAY_HOUR", "DAY_MINUTE", "DAY_SECOND", "HOUR_MINUTE", "HOUR_SECOND", "MINUTE_SECOND");
$statuses = array("ENABLED" => "ENABLE", "DISABLED" => "DISABLE", "SLAVESIDE_DISABLED" => "DISABLE ON SLAVE"); $statuses = array("ENABLED" => "ENABLE", "DISABLED" => "DISABLE", "SLAVESIDE_DISABLED" => "DISABLE ON SLAVE");
$row = $_POST;
if ($_POST && !$error) { if ($_POST && !$error) {
if ($_POST["drop"]) { if ($_POST["drop"]) {
query_redirect("DROP EVENT " . idf_escape($EVENT), substr(ME, 0, -1), lang('Event has been dropped.')); query_redirect("DROP EVENT " . idf_escape($EVENT), substr(ME, 0, -1), lang('Event has been dropped.'));
} elseif (in_array($_POST["INTERVAL_FIELD"], $intervals) && isset($statuses[$_POST["STATUS"]])) { } elseif (in_array($row["INTERVAL_FIELD"], $intervals) && isset($statuses[$row["STATUS"]])) {
$schedule = "\nON SCHEDULE " . ($_POST["INTERVAL_VALUE"] $schedule = "\nON SCHEDULE " . ($row["INTERVAL_VALUE"]
? "EVERY " . q($_POST["INTERVAL_VALUE"]) . " $_POST[INTERVAL_FIELD]" ? "EVERY " . q($row["INTERVAL_VALUE"]) . " $row[INTERVAL_FIELD]"
. ($_POST["STARTS"] ? " STARTS " . q($_POST["STARTS"]) : "") . ($row["STARTS"] ? " STARTS " . q($row["STARTS"]) : "")
. ($_POST["ENDS"] ? " ENDS " . q($_POST["ENDS"]) : "") //! ALTER EVENT doesn't drop ENDS - MySQL bug #39173 . ($row["ENDS"] ? " ENDS " . q($row["ENDS"]) : "") //! ALTER EVENT doesn't drop ENDS - MySQL bug #39173
: "AT " . q($_POST["STARTS"]) : "AT " . q($row["STARTS"])
) . " ON COMPLETION" . ($_POST["ON_COMPLETION"] ? "" : " NOT") . " PRESERVE" ) . " ON COMPLETION" . ($row["ON_COMPLETION"] ? "" : " NOT") . " PRESERVE"
; ;
queries_redirect(substr(ME, 0, -1), ($EVENT != "" ? lang('Event has been altered.') : lang('Event has been created.')), queries(($EVENT != "" queries_redirect(substr(ME, 0, -1), ($EVENT != "" ? lang('Event has been altered.') : lang('Event has been created.')), queries(($EVENT != ""
? "ALTER EVENT " . idf_escape($EVENT) . $schedule ? "ALTER EVENT " . idf_escape($EVENT) . $schedule
. ($EVENT != $_POST["EVENT_NAME"] ? "\nRENAME TO " . idf_escape($_POST["EVENT_NAME"]) : "") . ($EVENT != $row["EVENT_NAME"] ? "\nRENAME TO " . idf_escape($row["EVENT_NAME"]) : "")
: "CREATE EVENT " . idf_escape($_POST["EVENT_NAME"]) . $schedule : "CREATE EVENT " . idf_escape($row["EVENT_NAME"]) . $schedule
) . "\n" . $statuses[$_POST["STATUS"]] . " COMMENT " . q($_POST["EVENT_COMMENT"]) ) . "\n" . $statuses[$row["STATUS"]] . " COMMENT " . q($row["EVENT_COMMENT"])
. rtrim(" DO\n$_POST[EVENT_DEFINITION]", ";") . ";" . rtrim(" DO\n$row[EVENT_DEFINITION]", ";") . ";"
)); ));
} }
} }
page_header(($EVENT != "" ? lang('Alter event') . ": " . h($EVENT) : lang('Create event')), $error); page_header(($EVENT != "" ? lang('Alter event') . ": " . h($EVENT) : lang('Create event')), $error);
$row = $_POST;
if (!$row && $EVENT != "") { if (!$row && $EVENT != "") {
$rows = get_rows("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = " . q(DB) . " AND EVENT_NAME = " . q($EVENT)); $rows = get_rows("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = " . q(DB) . " AND EVENT_NAME = " . q($EVENT));
$row = reset($rows); $row = reset($rows);
@@ -35,9 +36,9 @@ if (!$row && $EVENT != "") {
<form action="" method="post"> <form action="" method="post">
<table cellspacing="0"> <table cellspacing="0">
<tr><th><?php echo lang('Name'); ?><td><input name="EVENT_NAME" value="<?php echo h($row["EVENT_NAME"]); ?>" maxlength="64"> <tr><th><?php echo lang('Name'); ?><td><input name="EVENT_NAME" value="<?php echo h($row["EVENT_NAME"]); ?>" maxlength="64" autocapitalize="off">
<tr><th><?php echo lang('Start'); ?><td><input name="STARTS" value="<?php echo h("$row[EXECUTE_AT]$row[STARTS]"); ?>"> <tr><th title="datetime"><?php echo lang('Start'); ?><td><input name="STARTS" value="<?php echo h("$row[EXECUTE_AT]$row[STARTS]"); ?>">
<tr><th><?php echo lang('End'); ?><td><input name="ENDS" value="<?php echo h($row["ENDS"]); ?>"> <tr><th title="datetime"><?php echo lang('End'); ?><td><input name="ENDS" value="<?php echo h($row["ENDS"]); ?>">
<tr><th><?php echo lang('Every'); ?><td><input type="number" name="INTERVAL_VALUE" value="<?php echo h($row["INTERVAL_VALUE"]); ?>" class="size"> <?php echo html_select("INTERVAL_FIELD", $intervals, $row["INTERVAL_FIELD"]); ?> <tr><th><?php echo lang('Every'); ?><td><input type="number" name="INTERVAL_VALUE" value="<?php echo h($row["INTERVAL_VALUE"]); ?>" class="size"> <?php echo html_select("INTERVAL_FIELD", $intervals, $row["INTERVAL_FIELD"]); ?>
<tr><th><?php echo lang('Status'); ?><td><?php echo html_select("STATUS", $statuses, $row["STATUS"]); ?> <tr><th><?php echo lang('Status'); ?><td><?php echo html_select("STATUS", $statuses, $row["STATUS"]); ?>
<tr><th><?php echo lang('Comment'); ?><td><input name="EVENT_COMMENT" value="<?php echo h($row["EVENT_COMMENT"]); ?>" maxlength="64"> <tr><th><?php echo lang('Comment'); ?><td><input name="EVENT_COMMENT" value="<?php echo h($row["EVENT_COMMENT"]); ?>" maxlength="64">

View File

@@ -1,50 +1,50 @@
<?php <?php
$TABLE = $_GET["foreign"]; $TABLE = $_GET["foreign"];
$name = $_GET["name"];
$row = $_POST;
if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-js"]) { if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-js"]) {
if ($_POST["drop"]) { if ($_POST["drop"]) {
query_redirect("ALTER TABLE " . table($TABLE) . "\nDROP " . ($jush == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($_GET["name"]), ME . "table=" . urlencode($TABLE), lang('Foreign key has been dropped.')); query_redirect("ALTER TABLE " . table($TABLE) . "\nDROP " . ($jush == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($name), ME . "table=" . urlencode($TABLE), lang('Foreign key has been dropped.'));
} else { } else {
$source = array_filter($_POST["source"], 'strlen'); $source = array_filter($row["source"], 'strlen');
ksort($source); // enforce input order ksort($source); // enforce input order
$target = array(); $target = array();
foreach ($source as $key => $val) { foreach ($source as $key => $val) {
$target[$key] = $_POST["target"][$key]; $target[$key] = $row["target"][$key];
} }
query_redirect("ALTER TABLE " . table($TABLE) query_redirect("ALTER TABLE " . table($TABLE)
. ($_GET["name"] != "" ? "\nDROP " . ($jush == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($_GET["name"]) . "," : "") . ($name != "" ? "\nDROP " . ($jush == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($name) . "," : "")
. "\nADD FOREIGN KEY (" . implode(", ", array_map('idf_escape', $source)) . ") REFERENCES " . table($_POST["table"]) . " (" . implode(", ", array_map('idf_escape', $target)) . ")" //! reuse $_GET["name"] - check in older MySQL versions . "\nADD FOREIGN KEY (" . implode(", ", array_map('idf_escape', $source)) . ") REFERENCES " . table($row["table"]) . " (" . implode(", ", array_map('idf_escape', $target)) . ")" //! reuse $name - check in older MySQL versions
. (ereg("^($on_actions)\$", $_POST["on_delete"]) ? " ON DELETE $_POST[on_delete]" : "") . (ereg("^($on_actions)\$", $row["on_delete"]) ? " ON DELETE $row[on_delete]" : "")
. (ereg("^($on_actions)\$", $_POST["on_update"]) ? " ON UPDATE $_POST[on_update]" : "") . (ereg("^($on_actions)\$", $row["on_update"]) ? " ON UPDATE $row[on_update]" : "")
, ME . "table=" . urlencode($TABLE), ($_GET["name"] != "" ? lang('Foreign key has been altered.') : lang('Foreign key has been created.'))); , ME . "table=" . urlencode($TABLE), ($name != "" ? lang('Foreign key has been altered.') : lang('Foreign key has been created.')));
$error = lang('Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.') . "<br>$error"; //! no partitioning $error = lang('Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.') . "<br>$error"; //! no partitioning
} }
} }
page_header(lang('Foreign key'), $error, array("table" => $TABLE), $TABLE); page_header(lang('Foreign key'), $error, array("table" => $TABLE), $TABLE);
$row = array("table" => $TABLE, "source" => array(""));
if ($_POST) { if ($_POST) {
$row = $_POST;
ksort($row["source"]); ksort($row["source"]);
if ($_POST["add"]) { if ($_POST["add"]) {
$row["source"][] = ""; $row["source"][] = "";
} elseif ($_POST["change"] || $_POST["change-js"]) { } elseif ($_POST["change"] || $_POST["change-js"]) {
$row["target"] = array(); $row["target"] = array();
} }
} elseif ($_GET["name"] != "") { } elseif ($name != "") {
$foreign_keys = foreign_keys($TABLE); $foreign_keys = foreign_keys($TABLE);
$row = $foreign_keys[$_GET["name"]]; $row = $foreign_keys[$name];
$row["source"][] = ""; $row["source"][] = "";
} else {
$row["table"] = $TABLE;
$row["source"] = array("");
} }
$source = array_keys(fields($TABLE)); //! no text and blob $source = array_keys(fields($TABLE)); //! no text and blob
$target = ($TABLE === $row["table"] ? $source : array_keys(fields($row["table"]))); $target = ($TABLE === $row["table"] ? $source : array_keys(fields($row["table"])));
$referencable = array(); $referencable = array_keys(array_filter(table_status('', true), 'fk_support'));
foreach (table_status() as $name => $table_status) {
if (fk_support($table_status)) {
$referencable[] = $name;
}
}
?> ?>
<form action="" method="post"> <form action="" method="post">
@@ -73,6 +73,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 ($_GET["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(); ?>><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -20,10 +20,11 @@ class Adminer {
} }
/** Get key used for permanent login /** Get key used for permanent login
* @return string cryptic string which gets combined with password * @param bool
* @return string cryptic string which gets combined with password or false in case of an error
*/ */
function permanentLogin() { function permanentLogin($create = false) {
return password_file(); return password_file($create);
} }
/** Identifier of selected database /** Identifier of selected database
@@ -71,14 +72,14 @@ class Adminer {
?> ?>
<table cellspacing="0"> <table cellspacing="0">
<tr><th><?php echo lang('System'); ?><td><?php echo html_select("auth[driver]", $drivers, DRIVER, "loginDriver(this);"); ?> <tr><th><?php echo lang('System'); ?><td><?php echo html_select("auth[driver]", $drivers, DRIVER, "loginDriver(this);"); ?>
<tr><th><?php echo lang('Server'); ?><td><input name="auth[server]" value="<?php echo h(SERVER); ?>" title="hostname[:port]"> <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 id="username" name="auth[username]" value="<?php echo h($_GET["username"]); ?>"> <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"]); ?>"> <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"> <script type="text/javascript">
var username = document.getElementById('username'); var username = document.getElementById('username');
username.focus(); focus(username);
username.form['auth[driver]'].onchange(); username.form['auth[driver]'].onchange();
</script> </script>
<?php <?php
@@ -164,8 +165,11 @@ username.form['auth[driver]'].onchange();
* @return string * @return string
*/ */
function selectQuery($query) { function selectQuery($query) {
global $jush; global $jush, $token;
return "<p><a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Last page') . "'>&gt;&gt;</a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a></p>\n"; // </p> - required for IE9 inline edit return "<form action='" . h(ME) . "sql=' method='post'><p><span onclick=\"return !selectEditSql(event, this, '" . lang('Execute') . "');\">"
. "<code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code>"
. " <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>"
. "</span><input type='hidden' name='token' value='$token'></p></form>\n"; // </p> - required for IE9 inline edit
} }
/** Description of a row in a table /** Description of a row in a table
@@ -185,6 +189,14 @@ username.form['auth[driver]'].onchange();
return $rows; return $rows;
} }
/** Get a link to use in select table
* @param string raw value of the field
* @param array single field returned from fields()
* @return string or null to create the default link
*/
function selectLink($val, $field) {
}
/** Value printed in select table /** Value printed in select table
* @param string HTML-escaped value to print * @param string HTML-escaped value to print
* @param string link to foreign key * @param string link to foreign key
@@ -194,7 +206,7 @@ username.form['auth[driver]'].onchange();
function selectVal($val, $link, $field) { function selectVal($val, $link, $field) {
$return = ($val === null ? "<i>NULL</i>" : (ereg("char|binary", $field["type"]) && !ereg("var", $field["type"]) ? "<code>$val</code>" : $val)); $return = ($val === null ? "<i>NULL</i>" : (ereg("char|binary", $field["type"]) && !ereg("var", $field["type"]) ? "<code>$val</code>" : $val));
if (ereg('blob|bytea|raw|file', $field["type"]) && !is_utf8($val)) { if (ereg('blob|bytea|raw|file', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($val)); $return = lang('%d byte(s)', strlen(html_entity_decode($val, ENT_QUOTES)));
} }
return ($link ? "<a href='" . h($link) . "'>$return</a>" : $return); return ($link ? "<a href='" . h($link) . "'>$return</a>" : $return);
} }
@@ -253,7 +265,7 @@ username.form['auth[driver]'].onchange();
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 name='where[$i][col]' onchange='$change_next'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, $val["col"], true) . "</select>"; echo "<div><select name='where[$i][col]' onchange='$change_next'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, $val["col"], true) . "</select>";
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)") . ";'></div>\n"; echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "' onchange='" . ($val ? "selectFieldChange(this.form)" : "selectAddRow(this)") . ";' onsearch='selectSearchSearch(this);'></div>\n";
} }
} }
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
@@ -276,7 +288,7 @@ username.form['auth[driver]'].onchange();
} }
} }
echo "<div><select name='order[$i]' onchange='selectAddRow(this);'><option>" . optionlist($columns, null, true) . "</select>"; echo "<div><select name='order[$i]' onchange='selectAddRow(this);'><option>" . optionlist($columns, null, true) . "</select>";
echo "<label><input type='checkbox' name='desc[$i]' value='1'>" . lang('descending') . "</label></div>\n"; // not checkbox() to allow selectAddRow() echo checkbox("desc[$i]", 1, false, lang('descending')) . "</div>\n";
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
@@ -389,8 +401,8 @@ username.form['auth[driver]'].onchange();
if (ereg('IN$', $val["op"])) { if (ereg('IN$', $val["op"])) {
$in = process_length($val["val"]); $in = process_length($val["val"]);
$cond .= " (" . ($in != "" ? $in : "NULL") . ")"; $cond .= " (" . ($in != "" ? $in : "NULL") . ")";
} elseif (!$val["op"]) { } elseif ($val["op"] == "SQL") {
$cond .= $val["val"]; // SQL injection $cond = " $val[val]"; // SQL injection
} elseif ($val["op"] == "LIKE %%") { } elseif ($val["op"] == "LIKE %%") {
$cond = " LIKE " . $this->processInput($fields[$val["col"]], "%$val[val]%"); $cond = " LIKE " . $this->processInput($fields[$val["col"]], "%$val[val]%");
} elseif (!ereg('NULL$', $val["op"])) { } elseif (!ereg('NULL$', $val["op"])) {
@@ -403,7 +415,7 @@ username.form['auth[driver]'].onchange();
$cols = array(); $cols = array();
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
$is_text = ereg('char|text|enum|set', $field["type"]); $is_text = ereg('char|text|enum|set', $field["type"]);
if ((is_numeric($val["val"]) || !ereg('int|float|double|decimal|bit', $field["type"])) if ((is_numeric($val["val"]) || !ereg('(^|[^o])int|float|double|decimal|bit', $field["type"]))
&& (!ereg("[\x80-\xFF]", $val["val"]) || $is_text) && (!ereg("[\x80-\xFF]", $val["val"]) || $is_text)
) { ) {
$name = idf_escape($name); $name = idf_escape($name);
@@ -436,7 +448,7 @@ username.form['auth[driver]'].onchange();
* @return string expression to use in LIMIT, will be escaped * @return string expression to use in LIMIT, will be escaped
*/ */
function selectLimitProcess() { function selectLimitProcess() {
return (isset($_GET["limit"]) ? $_GET["limit"] : "30"); return (isset($_GET["limit"]) ? $_GET["limit"] : "50");
} }
/** Process length box in select /** Process length box in select
@@ -474,10 +486,9 @@ username.form['auth[driver]'].onchange();
*/ */
function messageQuery($query) { function messageQuery($query) {
global $jush; global $jush;
static $count = 0;
restart_session(); restart_session();
$id = "sql-" . ($count++);
$history = &get_session("queries"); $history = &get_session("queries");
$id = "sql-" . count($history[$_GET["db"]]);
if (strlen($query) > 1e6) { if (strlen($query) > 1e6) {
$query = ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment $query = ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
} }
@@ -500,7 +511,7 @@ username.form['auth[driver]'].onchange();
} }
} }
if ($key && !ereg('set|blob|bytea|raw|file', $field["type"])) { if ($key && !ereg('set|blob|bytea|raw|file', $field["type"])) {
$return .= "/="; $return .= "/SQL";
} }
} }
} }
@@ -531,11 +542,11 @@ username.form['auth[driver]'].onchange();
* @return string expression to use in a query * @return string expression to use in a query
*/ */
function processInput($field, $value, $function = "") { function processInput($field, $value, $function = "") {
if ($function == "=") { if ($function == "SQL") {
return $value; // SQL injection return $value; // SQL injection
} }
$name = $field["field"]; $name = $field["field"];
$return = ($field["type"] == "bit" && ereg("^([0-9]+|b'[0-1]+')\$", $value) ? $value : q($value)); $return = q($value);
if (ereg('^(now|getdate|uuid)$', $function)) { if (ereg('^(now|getdate|uuid)$', $function)) {
$return = "$function()"; $return = "$function()";
} elseif (ereg('^current_(date|timestamp)$', $function)) { } elseif (ereg('^current_(date|timestamp)$', $function)) {
@@ -560,10 +571,6 @@ username.form['auth[driver]'].onchange();
if (function_exists('gzencode')) { if (function_exists('gzencode')) {
$return['gz'] = 'gzip'; $return['gz'] = 'gzip';
} }
if (function_exists('bzcompress')) {
$return['bz2'] = 'bzip2';
}
// ZipArchive requires temporary file, ZIP can be created by gzcompress - see PEAR File_Archive
return $return; return $return;
} }
@@ -574,99 +581,43 @@ username.form['auth[driver]'].onchange();
return array('sql' => 'SQL', 'csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV'); return array('sql' => 'SQL', 'csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
} }
/** Export database structure
* @param string
* @return null prints data
*/
function dumpDatabase($db) {
}
/** Export table structure /** Export table structure
* @param string * @param string
* @param string * @param string
* @param bool * @param int 0 table, 1 view, 2 temporary view table
* @return null prints data * @return null prints data
*/ */
function dumpTable($table, $style, $is_view = false) { function dumpTable($table, $style, $is_view = 0) {
if ($_POST["format"] != "sql") { if ($_POST["format"] != "sql") {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark echo "\xef\xbb\xbf"; // UTF-8 byte order mark
if ($style) { if ($style) {
dump_csv(array_keys(fields($table))); dump_csv(array_keys(fields($table)));
} }
} elseif ($style) { } elseif ($style) {
$create = create_sql($table, $_POST["auto_increment"]); if ($is_view == 2) {
if ($create) { $fields = array();
if ($style == "DROP+CREATE") { foreach (fields($table) as $name => $field) {
echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . table($table) . ";\n"; $fields[] = idf_escape($name) . " $field[full_type]";
} }
if ($is_view) { $create = "CREATE TABLE " . table($table) . " (" . implode(", ", $fields) . ")";
} else {
$create = create_sql($table, $_POST["auto_increment"]);
}
if ($create) {
if ($style == "DROP+CREATE" || $is_view == 1) {
echo "DROP " . ($is_view == 2 ? "VIEW" : "TABLE") . " IF EXISTS " . table($table) . ";\n";
}
if ($is_view == 1) {
$create = remove_definer($create); $create = remove_definer($create);
} }
echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n"; echo "$create;\n\n";
}
if ($style == "CREATE+ALTER" && !$is_view) {
// create procedure which iterates over original columns and adds new and removes old
$query = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, COLLATION_NAME, COLUMN_TYPE, EXTRA, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = " . q($table) . " ORDER BY ORDINAL_POSITION";
echo "DELIMITER ;;
CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
DECLARE _column_name, _collation_name, after varchar(64) DEFAULT '';
DECLARE _column_type, _column_default text;
DECLARE _is_nullable char(3);
DECLARE _extra varchar(30);
DECLARE _column_comment varchar(255);
DECLARE done, set_after bool DEFAULT 0;
DECLARE add_columns text DEFAULT '";
$fields = array();
$after = "";
foreach (get_rows($query) as $row) {
$default = $row["COLUMN_DEFAULT"];
$row["default"] = ($default !== null ? q($default) : "NULL");
$row["after"] = q($after); //! rgt AFTER lft, lft AFTER id doesn't work
$row["alter"] = escape_string(idf_escape($row["COLUMN_NAME"])
. " $row[COLUMN_TYPE]"
. ($row["COLLATION_NAME"] ? " COLLATE $row[COLLATION_NAME]" : "")
. ($default !== null ? " DEFAULT " . ($default == "CURRENT_TIMESTAMP" ? $default : $row["default"]) : "")
. ($row["IS_NULLABLE"] == "YES" ? "" : " NOT NULL")
. ($row["EXTRA"] ? " $row[EXTRA]" : "")
. ($row["COLUMN_COMMENT"] ? " COMMENT " . q($row["COLUMN_COMMENT"]) : "")
. ($after ? " AFTER " . idf_escape($after) : " FIRST")
);
echo ", ADD $row[alter]";
$fields[] = $row;
$after = $row["COLUMN_NAME"];
}
echo "';
DECLARE columns CURSOR FOR $query;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
SET @alter_table = '';
OPEN columns;
REPEAT
FETCH columns INTO _column_name, _column_default, _is_nullable, _collation_name, _column_type, _extra, _column_comment;
IF NOT done THEN
SET set_after = 1;
CASE _column_name";
foreach ($fields as $row) {
echo "
WHEN " . q($row["COLUMN_NAME"]) . " THEN
SET add_columns = REPLACE(add_columns, ', ADD $row[alter]', IF(
_column_default <=> $row[default] AND _is_nullable = '$row[IS_NULLABLE]' AND _collation_name <=> " . (isset($row["COLLATION_NAME"]) ? "'$row[COLLATION_NAME]'" : "NULL") . " AND _column_type = " . q($row["COLUMN_TYPE"]) . " AND _extra = '$row[EXTRA]' AND _column_comment = " . q($row["COLUMN_COMMENT"]) . " AND after = $row[after]
, '', ', MODIFY $row[alter]'));"
; //! don't replace in comment
}
echo "
ELSE
SET @alter_table = CONCAT(@alter_table, ', DROP ', _column_name);
SET set_after = 0;
END CASE;
IF set_after THEN
SET after = _column_name;
END IF;
END IF;
UNTIL done END REPEAT;
CLOSE columns;
IF @alter_table != '' OR add_columns != '' THEN
SET alter_command = CONCAT(alter_command, 'ALTER TABLE " . table($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
END IF;
END;;
DELIMITER ;
CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
";
//! indexes
} }
} }
} }
@@ -681,10 +632,10 @@ DROP PROCEDURE adminer_alter;
global $connection, $jush; global $connection, $jush;
$max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024 $max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
if ($style) { if ($style) {
if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
echo truncate_sql($table) . ";\n";
}
if ($_POST["format"] == "sql") { if ($_POST["format"] == "sql") {
if ($style == "TRUNCATE+INSERT") {
echo truncate_sql($table) . ";\n";
}
$fields = fields($table); $fields = fields($table);
} }
$result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers $result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers
@@ -693,7 +644,8 @@ DROP PROCEDURE adminer_alter;
$buffer = ""; $buffer = "";
$keys = array(); $keys = array();
$suffix = ""; $suffix = "";
while ($row = $result->fetch_row()) { $fetch_function = ($table != '' ? 'fetch_assoc' : 'fetch_row');
while ($row = $result->$fetch_function()) {
if (!$keys) { if (!$keys) {
$values = array(); $values = array();
foreach ($row as $val) { foreach ($row as $val) {
@@ -715,7 +667,11 @@ DROP PROCEDURE adminer_alter;
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', $keys)) . ") VALUES"; $insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', $keys)) . ") VALUES";
} }
foreach ($row as $key => $val) { foreach ($row as $key => $val) {
$row[$key] = ($val !== null ? (ereg('int|float|double|decimal|bit', $fields[$keys[$key]]["type"]) ? $val : q($val)) : "NULL"); //! columns looking like functions $field = $fields[$key];
$row[$key] = ($val !== null
? unconvert_field($field, ereg('(^|[^o])int|float|double|decimal', $field["type"]) && $val != '' ? $val : q($val))
: "NULL"
);
} }
$s = ($max_packet ? "\n" : " ") . "(" . implode(",\t", $row) . ")"; $s = ($max_packet ? "\n" : " ") . "(" . implode(",\t", $row) . ")";
if (!$buffer) { if (!$buffer) {
@@ -752,16 +708,12 @@ DROP PROCEDURE adminer_alter;
*/ */
function dumpHeaders($identifier, $multi_table = false) { function dumpHeaders($identifier, $multi_table = false) {
$output = $_POST["output"]; $output = $_POST["output"];
$ext = ($_POST["format"] == "sql" ? "sql" : ($multi_table ? "tar" : "csv")); // multiple CSV packed to TAR $ext = (ereg('sql', $_POST["format"]) ? "sql" : ($multi_table ? "tar" : "csv")); // multiple CSV packed to TAR
header("Content-Type: " . header("Content-Type: " .
($output == "bz2" ? "application/x-bzip" :
($output == "gz" ? "application/x-gzip" : ($output == "gz" ? "application/x-gzip" :
($ext == "tar" ? "application/x-tar" : ($ext == "tar" ? "application/x-tar" :
($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8" ($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8"
)))); )));
if ($output == "bz2") {
ob_start('bzcompress', 1e6);
}
if ($output == "gz") { if ($output == "gz") {
ob_start('gzencode', 1e6); ob_start('gzencode', 1e6);
} }
@@ -815,7 +767,7 @@ DROP PROCEDURE adminer_alter;
<p class="logout"> <p class="logout">
<?php <?php
if (DB == "" || !$missing) { if (DB == "" || !$missing) {
echo "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"])) . ">" . lang('SQL command') . "</a>\n"; echo "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"])) . " title='" . lang('Import') . "'>" . lang('SQL command') . "</a>\n";
if (support("dump")) { if (support("dump")) {
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Dump') . "</a>\n"; echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Dump') . "</a>\n";
} }
@@ -829,7 +781,7 @@ DROP PROCEDURE adminer_alter;
$this->databasesPrint($missing); $this->databasesPrint($missing);
if ($_GET["ns"] !== "" && !$missing && DB != "") { if ($_GET["ns"] !== "" && !$missing && DB != "") {
echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n"; echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n";
$tables = tables_list(); $tables = table_status('', true);
if (!$tables) { if (!$tables) {
echo "<p class='message'>" . lang('No tables.') . "\n"; echo "<p class='message'>" . lang('No tables.') . "\n";
} else { } else {
@@ -859,13 +811,17 @@ DROP PROCEDURE adminer_alter;
?> ?>
<form action=""> <form action="">
<p id="dbs"> <p id="dbs">
<?php hidden_fields_get(); ?>
<?php echo ($databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">'); ?>
<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>>
<?php <?php
hidden_fields_get();
$db_events = " onmousedown='dbMouseDown(event, this);' onchange='dbChange(this);'";
echo ($databases
? "<select name='db'$db_events>" . optionlist(array("" => "(" . lang('database') . ")") + $databases, DB) . "</select>"
: '<input name="db" value="' . h(DB) . '" autocapitalize="off">'
);
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>" . html_select("ns", array("" => "(" . lang('schema') . ")") + schemas(), $_GET["ns"], "this.form.submit();"); echo "<br><select name='ns'$db_events>" . optionlist(array("" => "(" . lang('schema') . ")") + schemas(), $_GET["ns"]) . "</select>";
if ($_GET["ns"] != "") { if ($_GET["ns"] != "") {
set_schema($_GET["ns"]); set_schema($_GET["ns"]);
} }
@@ -879,14 +835,14 @@ DROP PROCEDURE adminer_alter;
} }
/** Prints table list in menu /** Prints table list in menu
* @param array * @param array result of table_status('', true)
* @return null * @return null
*/ */
function tablesPrint($tables) { function tablesPrint($tables) {
echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n"; echo "<p id='tables' onmouseover='menuOver(this, event);' onmouseout='menuOut(this);'>\n";
foreach ($tables as $table => $type) { foreach ($tables as $table => $status) {
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> "; echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table) . ">" . lang('select') . "</a> ";
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . " title='" . lang('Show structure') . "'>" . $this->tableName(array("Name" => $table)) . "</a><br>\n"; //! Adminer::tableName may work with full table status echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"]))) . " title='" . lang('Show structure') . "'>" . $this->tableName($status) . "</a><br>\n";
} }
} }

View File

@@ -21,7 +21,7 @@ if ($auth) {
$_SESSION["db"][$auth["driver"]][$auth["server"]][$auth["username"]][$auth["db"]] = true; $_SESSION["db"][$auth["driver"]][$auth["server"]][$auth["username"]][$auth["db"]] = true;
if ($auth["permanent"]) { if ($auth["permanent"]) {
$key = base64_encode($auth["driver"]) . "-" . base64_encode($auth["server"]) . "-" . base64_encode($auth["username"]) . "-" . base64_encode($auth["db"]); $key = base64_encode($auth["driver"]) . "-" . base64_encode($auth["server"]) . "-" . base64_encode($auth["username"]) . "-" . base64_encode($auth["db"]);
$private = $adminer->permanentLogin(); $private = $adminer->permanentLogin(true);
$permanent[$key] = "$key:" . base64_encode($private ? encrypt_string($auth["password"], $private) : ""); $permanent[$key] = "$key:" . base64_encode($private ? encrypt_string($auth["password"], $private) : "");
cookie("adminer_permanent", implode(" ", $permanent)); cookie("adminer_permanent", implode(" ", $permanent));
} }
@@ -33,6 +33,7 @@ if ($auth) {
) { ) {
redirect(auth_url($auth["driver"], $auth["server"], $auth["username"], $auth["db"])); redirect(auth_url($auth["driver"], $auth["server"], $auth["username"], $auth["db"]));
} }
} elseif ($_POST["logout"]) { } elseif ($_POST["logout"]) {
if ($token && $_POST["token"] != $token) { if ($token && $_POST["token"] != $token) {
page_header(lang('Logout'), lang('Invalid CSRF token. Send the form again.')); page_header(lang('Logout'), lang('Invalid CSRF token. Send the form again.'));
@@ -45,9 +46,10 @@ if ($auth) {
unset_permanent(); unset_permanent();
redirect(substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.')); redirect(substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.'));
} }
} elseif ($permanent && !$_SESSION["pwds"]) { } elseif ($permanent && !$_SESSION["pwds"]) {
session_regenerate_id(); session_regenerate_id();
$private = $adminer->permanentLogin(); // try to decode even if not set $private = $adminer->permanentLogin();
foreach ($permanent as $key => $val) { foreach ($permanent as $key => $val) {
list(, $cipher) = explode(":", $val); list(, $cipher) = explode(":", $val);
list($driver, $server, $username, $db) = array_map('base64_decode', explode("-", $key)); list($driver, $server, $username, $db) = array_map('base64_decode', explode("-", $key));
@@ -59,8 +61,8 @@ if ($auth) {
function unset_permanent() { function unset_permanent() {
global $permanent; global $permanent;
foreach ($permanent as $key => $val) { foreach ($permanent as $key => $val) {
list($driver, $server, $username) = array_map('base64_decode', explode("-", $key)); list($driver, $server, $username, $db) = array_map('base64_decode', explode("-", $key));
if ($driver == DRIVER && $server == SERVER && $db == $_GET["username"]) { if ($driver == DRIVER && $server == SERVER && $username == $_GET["username"] && $db == DB) {
unset($permanent[$key]); unset($permanent[$key]);
} }
} }
@@ -80,6 +82,9 @@ function auth_error($exception = null) {
$password = &get_session("pwds"); $password = &get_session("pwds");
if ($password !== null) { if ($password !== null) {
$error = h($exception ? $exception->getMessage() : (is_string($connection) ? $connection : lang('Invalid credentials.'))); $error = h($exception ? $exception->getMessage() : (is_string($connection) ? $connection : lang('Invalid credentials.')));
if ($password === false) {
$error .= '<br>' . lang('Master password expired. <a href="http://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.', '<code>permanentLogin()</code>');
}
$password = null; $password = null;
} }
unset_permanent(); unset_permanent();
@@ -105,6 +110,7 @@ if (isset($_GET["username"])) {
} }
$connection = connect(); $connection = connect();
} }
if (is_string($connection) || !$adminer->login($_GET["username"], get_session("pwds"))) { if (is_string($connection) || !$adminer->login($_GET["username"], get_session("pwds"))) {
auth_error(); auth_error();
exit; exit;
@@ -114,7 +120,31 @@ $token = $_SESSION["token"]; ///< @var string CSRF protection
if ($auth && $_POST["token"]) { if ($auth && $_POST["token"]) {
$_POST["token"] = $token; // reset token after explicit login $_POST["token"] = $token; // reset token after explicit login
} }
$error = ($_POST ///< @var string
? ($_POST["token"] == $token ? "" : lang('Invalid CSRF token. Send the form again.')) $error = ''; ///< @var string
: ($_SERVER["REQUEST_METHOD"] != "POST" ? "" : lang('Too big POST data. Reduce the data or increase the %s configuration directive.', '"post_max_size"')) // posted form with no data means that post_max_size exceeded because Adminer always sends token at least if ($_POST) {
); if ($_POST["token"] != $token) {
$ini = "max_input_vars";
$max_vars = ini_get($ini);
if (extension_loaded("suhosin")) {
foreach (array("suhosin.request.max_vars", "suhosin.post.max_vars") as $key) {
$val = ini_get($key);
if ($val && (!$max_vars || $val < $max_vars)) {
$ini = $key;
$max_vars = $val;
}
}
}
$error = (!$_POST["token"] && $max_vars
? lang('Maximum number of allowed fields exceeded. Please increase %s.', "'$ini'")
: lang('Invalid CSRF token. Send the form again.')
);
}
} elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
// posted form with no data means that post_max_size exceeded because Adminer always sends token at least
$error = lang('Too big POST data. Reduce the data or increase the %s configuration directive.', "'post_max_size'");
if (isset($_GET["sql"])) {
$error .= ' ' . lang('You can upload a big SQL file via FTP and import it from server.');
}
}

View File

@@ -14,7 +14,9 @@ if ($filter || ini_get("filter.default_flags")) {
} }
} }
@ini_set("mbstring.internal_encoding", "8bit"); // @ - can be disabled if (function_exists("mb_internal_encoding")) {
mb_internal_encoding("8bit");
}
// used only in compiled file // used only in compiled file
if (isset($_GET["file"])) { if (isset($_GET["file"])) {
@@ -26,7 +28,7 @@ include "../adminer/include/functions.inc.php";
global $adminer, $connection, $drivers, $edit_functions, $enum_length, $error, $functions, $grouping, $HTTPS, $inout, $jush, $LANG, $langs, $on_actions, $permanent, $structured_types, $token, $translations, $types, $unsigned, $VERSION; // allows including Adminer inside a function global $adminer, $connection, $drivers, $edit_functions, $enum_length, $error, $functions, $grouping, $HTTPS, $inout, $jush, $LANG, $langs, $on_actions, $permanent, $structured_types, $token, $translations, $types, $unsigned, $VERSION; // allows including Adminer inside a function
if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility
$_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"]; $_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"];
} }
if (!strpos($_SERVER["REQUEST_URI"], '?') && $_SERVER["QUERY_STRING"] != "") { // IIS 7 compatibility if (!strpos($_SERVER["REQUEST_URI"], '?') && $_SERVER["QUERY_STRING"] != "") { // IIS 7 compatibility
$_SERVER["REQUEST_URI"] .= "?$_SERVER[QUERY_STRING]"; $_SERVER["REQUEST_URI"] .= "?$_SERVER[QUERY_STRING]";

View File

@@ -3,6 +3,7 @@ function connect_error() {
global $adminer, $connection, $token, $error, $drivers; global $adminer, $connection, $token, $error, $drivers;
$databases = array(); $databases = array();
if (DB != "") { if (DB != "") {
header("HTTP/1.1 404 Not Found");
page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true); page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
} else { } else {
if ($_POST["db"] && !$error) { if ($_POST["db"] && !$error) {
@@ -31,6 +32,7 @@ function connect_error() {
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' onclick='tableClick(event);' ondblclick='tableClick(event, true);'>\n";
echo "<thead><tr><td>&nbsp;<th>" . lang('Database') . "<td>" . lang('Collation') . "<td>" . lang('Tables') . "</thead>\n"; echo "<thead><tr><td>&nbsp;<th>" . lang('Database') . "<td>" . lang('Collation') . "<td>" . lang('Tables') . "</thead>\n";
foreach ($databases as $db) { foreach ($databases as $db) {
$root = h(ME) . "db=" . urlencode($db); $root = h(ME) . "db=" . urlencode($db);
echo "<tr" . odd() . "><td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"])); echo "<tr" . odd() . "><td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]));
@@ -39,6 +41,7 @@ function connect_error() {
echo "<td align='right'><a href='$root&amp;schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>?</a>"; echo "<td align='right'><a href='$root&amp;schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>?</a>";
echo "\n"; echo "\n";
} }
echo "</table>\n"; echo "</table>\n";
echo "<script type='text/javascript'>tableCheck();</script>\n"; echo "<script type='text/javascript'>tableCheck();</script>\n";
echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)") . ">\n"; echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)") . ">\n";
@@ -49,6 +52,7 @@ function connect_error() {
echo "<p>$refresh"; echo "<p>$refresh";
} }
} }
page_footer("db"); page_footer("db");
if ($databases) { if ($databases) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=connect');</script>\n"; echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=connect');</script>\n";
@@ -72,6 +76,7 @@ if (support("scheme") && DB != "" && $_GET["ns"] !== "") {
redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema()); redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
} }
if (!set_schema($_GET["ns"])) { if (!set_schema($_GET["ns"])) {
header("HTTP/1.1 404 Not Found");
page_header(lang('Schema') . ": " . h($_GET["ns"]), lang('Invalid schema.'), true); page_header(lang('Schema') . ": " . h($_GET["ns"]), lang('Invalid schema.'), true);
page_footer("ns"); page_footer("ns");
exit; exit;

View File

@@ -26,7 +26,8 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<script type="text/javascript" src="../adminer/static/functions.js"></script> <script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script> <script type="text/javascript" src="static/editing.js"></script>
<?php if ($adminer->head()) { ?> <?php if ($adminer->head()) { ?>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico" id="favicon"> <link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
<link rel="apple-touch-icon" href="../adminer/static/favicon.ico">
<?php if (file_exists("adminer.css")) { ?> <?php if (file_exists("adminer.css")) { ?>
<link rel="stylesheet" type="text/css" href="adminer.css"> <link rel="stylesheet" type="text/css" href="adminer.css">
<?php } ?> <?php } ?>
@@ -97,5 +98,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
} }

View File

@@ -3,7 +3,7 @@
* @param Min_Result * @param Min_Result
* @param Min_DB connection to examine indexes * @param Min_DB connection to examine indexes
* @param string base link for <th> fields * @param string base link for <th> fields
* @param array * @param array
* @return null * @return null
*/ */
function select($result, $connection2 = null, $href = "", $orgtables = array()) { function select($result, $connection2 = null, $href = "", $orgtables = array()) {
@@ -49,7 +49,9 @@ function select($result, $connection2 = null, $href = "", $orgtables = array())
} }
$types[$j] = $field->type; $types[$j] = $field->type;
$name = h($name); $name = h($name);
echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . ($href ? "<a href='$href" . strtolower($name) . "' target='_blank' rel='noreferrer'>$name</a>" : $name); echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">"
. ($href ? "<a href='$href" . strtolower($name) . "' target='_blank' rel='noreferrer' class='help'>$name</a>" : $name)
;
} }
echo "</thead>\n"; echo "</thead>\n";
} }
@@ -92,7 +94,7 @@ function select($result, $connection2 = null, $href = "", $orgtables = array())
*/ */
function referencable_primary($self) { function referencable_primary($self) {
$return = array(); // table_name => field $return = array(); // table_name => field
foreach (table_status() as $table_name => $table) { foreach (table_status('', true) as $table_name => $table) {
if ($table_name != $self && fk_support($table)) { if ($table_name != $self && fk_support($table)) {
foreach (fields($table_name) as $field) { foreach (fields($table_name) as $field) {
if ($field["primary"]) { if ($field["primary"]) {
@@ -127,15 +129,6 @@ function textarea($name, $value, $rows = 10, $cols = 80) {
echo "</textarea>"; echo "</textarea>";
} }
/** Format time difference
* @param string output of microtime()
* @param string output of microtime()
* @return string HTML code
*/
function format_time($start, $end) {
return " <span class='time'>(" . lang('%.3f s', max(0, array_sum(explode(" ", $end)) - array_sum(explode(" ", $start)))) . ")</span>";
}
/** Print table columns for type edit /** Print table columns for type edit
* @param string * @param string
* @param array * @param array
@@ -149,7 +142,8 @@ function edit_type($key, $field, $collations, $foreign_keys = array()) {
<td><select name="<?php echo $key; ?>[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"><?php echo optionlist((!$field["type"] || isset($types[$field["type"]]) ? array() : array($field["type"])) + $structured_types + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select> <td><select name="<?php echo $key; ?>[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"><?php echo optionlist((!$field["type"] || isset($types[$field["type"]]) ? array() : array($field["type"])) + $structured_types + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
<td><input name="<?php echo $key; ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editingLengthFocus(this);"><td class="options"><?php //! type="number" with enabled JavaScript <td><input name="<?php echo $key; ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editingLengthFocus(this);"><td class="options"><?php //! type="number" with enabled JavaScript
echo "<select name='$key" . "[collation]'" . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>'; echo "<select name='$key" . "[collation]'" . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
echo ($unsigned ? "<select name='$key" . "[unsigned]'" . (!$field["type"] || ereg('(int|float|double|decimal)$', $field["type"]) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : ''); echo ($unsigned ? "<select name='$key" . "[unsigned]'" . (!$field["type"] || ereg('((^|[^o])int|float|double|decimal)$', $field["type"]) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
echo (isset($field['on_update']) ? "<select name='$key" . "[on_update]'" . ($field["type"] == "timestamp" ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), $field["on_update"]) . '</select>' : '');
echo ($foreign_keys ? "<select name='$key" . "[on_delete]'" . (ereg("`", $field["type"]) ? "" : " class='hidden'") . "><option value=''>(" . lang('ON DELETE') . ")" . optionlist(explode("|", $on_actions), $field["on_delete"]) . "</select> " : " "); // space for IE echo ($foreign_keys ? "<select name='$key" . "[on_delete]'" . (ereg("`", $field["type"]) ? "" : " class='hidden'") . "><option value=''>(" . lang('ON DELETE') . ")" . optionlist(explode("|", $on_actions), $field["on_delete"]) . "</select> " : " "); // space for IE
} }
@@ -171,7 +165,7 @@ function process_type($field, $collate = "COLLATE") {
global $unsigned; global $unsigned;
return " $field[type]" return " $field[type]"
. ($field["length"] != "" ? "(" . process_length($field["length"]) . ")" : "") . ($field["length"] != "" ? "(" . process_length($field["length"]) . ")" : "")
. (ereg('int|float|double|decimal', $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "") . (ereg('(^|[^o])int|float|double|decimal', $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "")
. (ereg('char|text|enum|set', $field["type"]) && $field["collation"] ? " $collate " . q($field["collation"]) : "") . (ereg('char|text|enum|set', $field["type"]) && $field["collation"] ? " $collate " . q($field["collation"]) : "")
; ;
} }
@@ -186,8 +180,8 @@ function process_field($field, $type_field) {
idf_escape(trim($field["field"])), idf_escape(trim($field["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($field["default"]) ? " DEFAULT " . (($field["type"] == "timestamp" && eregi('^CURRENT_TIMESTAMP$', $field["default"])) || ($field["type"] == "bit" && ereg("^([0-9]+|b'[0-1]+')\$", $field["default"])) ? $field["default"] : q($field["default"])) : ""), (isset($field["default"]) ? " DEFAULT " . ((ereg("time", $field["type"]) && eregi('^CURRENT_TIMESTAMP$', $field["default"])) || ($field["type"] == "bit" && ereg("^([0-9]+|b'[0-1]+')\$", $field["default"])) ? $field["default"] : q($field["default"])) : ""),
($field["on_update"] ? " ON UPDATE $field[on_update]" : ""), ($field["type"] == "timestamp" && $field["on_update"] ? " ON UPDATE $field[on_update]" : ""),
(support("comment") && $field["comment"] != "" ? " COMMENT " . q($field["comment"]) : ""), (support("comment") && $field["comment"] != "" ? " COMMENT " . q($field["comment"]) : ""),
($field["auto_increment"] ? auto_increment() : null), ($field["auto_increment"] ? auto_increment() : null),
); );
@@ -214,12 +208,11 @@ function type_class($type) {
* @param array * @param array
* @param array * @param array
* @param string TABLE or PROCEDURE * @param string TABLE or PROCEDURE
* @param int number of fields allowed by Suhosin
* @param array returned by referencable_primary() * @param array returned by referencable_primary()
* @param bool display comments column * @param bool display comments column
* @return null * @return null
*/ */
function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $foreign_keys = array(), $comments = false) { function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = array(), $comments = false) {
global $connection, $inout; global $connection, $inout;
?> ?>
<thead><tr class="wrap"> <thead><tr class="wrap">
@@ -245,18 +238,18 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
?> ?>
<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="<?php echo ($field["field"] != "" || count($fields) > 1 ? "" : "editingAddRow(this, $allowed); "); ?>editingNameChange(this);" maxlength="64"><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>"> <th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" onchange="<?php echo ($field["field"] != "" || count($fields) > 1 ? "" : "editingAddRow(this); "); ?>editingNameChange(this);" maxlength="64" autocapitalize="off"><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>">
<?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?> <?php 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"]); ?> <td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block"); ?>
<td><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(); }"> <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><?php echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onchange="this.previousSibling.checked = true;"> echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onchange="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) . "'>" : ""); ?>
<?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, $allowed, 1);'>&nbsp;" "<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='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;"
. "<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;"
: ""); : "");
@@ -267,7 +260,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
/** Move fields up and down or add field /** Move fields up and down or add field
* @param array * @param array
* @return null * @return bool
*/ */
function process_fields(&$fields) { function process_fields(&$fields) {
ksort($fields); ksort($fields);
@@ -285,8 +278,7 @@ function process_fields(&$fields) {
} }
$offset++; $offset++;
} }
} } elseif ($_POST["down"]) {
if ($_POST["down"]) {
$found = false; $found = false;
foreach ($fields as $key => $field) { foreach ($fields as $key => $field) {
if (isset($field["field"]) && $found) { if (isset($field["field"]) && $found) {
@@ -299,11 +291,13 @@ function process_fields(&$fields) {
} }
$offset++; $offset++;
} }
} } elseif ($_POST["add"]) {
$fields = array_values($fields); $fields = array_values($fields);
if ($_POST["add"]) {
array_splice($fields, key($_POST["add"]), 0, array(array())); array_splice($fields, key($_POST["add"]), 0, array(array()));
} elseif (!$_POST["drop_col"]) {
return false;
} }
return true;
} }
/** Callback used in routine() /** Callback used in routine()
@@ -336,25 +330,78 @@ function grant($grant, $privileges, $columns, $on) {
} }
/** Drop old object and create a new one /** Drop old object and create a new one
* @param string drop query * @param string drop old object query
* @param string create query * @param string create new object query
* @param string drop new object query
* @param string create test object query
* @param string drop test object query
* @param string * @param string
* @param string * @param string
* @param string * @param string
* @param string * @param string
* @param string * @param string
* @return bool dropped * @param string
* @return null redirect in success
*/ */
function drop_create($drop, $create, $location, $message_drop, $message_alter, $message_create, $name) { function drop_create($drop, $create, $drop_created, $test, $drop_test, $location, $message_drop, $message_alter, $message_create, $old_name, $new_name) {
if ($_POST["drop"]) { if ($_POST["drop"]) {
return query_redirect($drop, $location, $message_drop, true, !$_POST["dropped"]); query_redirect($drop, $location, $message_drop);
} elseif ($old_name == "") {
query_redirect($create, $location, $message_create);
} elseif ($old_name != $new_name) {
$created = queries($create);
queries_redirect($location, $message_alter, $created && queries($drop));
if ($created) {
queries($drop_created);
}
} else {
queries_redirect(
$location,
$message_alter,
queries($test) && queries($drop_test) && queries($drop) && queries($create)
);
} }
$dropped = $name != "" && ($_POST["dropped"] || queries($drop)); }
$created = queries($create);
if (!queries_redirect($location, ($name != "" ? $message_alter : $message_create), $created) && $dropped) { /** Generate SQL query for creating trigger
redirect(null, $message_drop); * @param string
* @param array result of trigger()
* @return string
*/
function create_trigger($on, $row) {
global $jush;
$timing_event = " $row[Timing] $row[Event]";
return "CREATE TRIGGER "
. idf_escape($row["Trigger"])
. ($jush == "mssql" ? $on . $timing_event : $timing_event . $on)
. rtrim(" $row[Type]\n$row[Statement]", ";")
. ";"
;
}
/** Generate SQL query for creating routine
* @param string "PROCEDURE" or "FUNCTION"
* @param array result of routine()
* @return string
*/
function create_routine($routine, $row) {
global $inout;
$set = array();
$fields = (array) $row["fields"];
ksort($fields); // enforce fields order
foreach ($fields as $field) {
if ($field["field"] != "") {
$set[] = (ereg("^($inout)\$", $field["inout"]) ? "$field[inout] " : "") . idf_escape($field["field"]) . process_type($field, "CHARACTER SET");
}
} }
return $dropped; return "CREATE $routine "
. idf_escape(trim($row["name"]))
. " (" . implode(", ", $set) . ")"
. (isset($_GET["function"]) ? " RETURNS" . process_type($row["returns"], "CHARACTER SET") : "")
. ($row["language"] ? " LANGUAGE $row[language]" : "")
. rtrim("\n$row[definition]", ";")
. ";"
;
} }
/** Remove current user definer from SQL command /** Remove current user definer from SQL command
@@ -365,19 +412,22 @@ function remove_definer($query) {
return preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $query); //! proper escaping of user return preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $query); //! proper escaping of user
} }
/** Get string to add a file in TAR /** Add a file to TAR
* @param string * @param string
* @param string * @param TmpFile
* @return string * @return null prints the output
*/ */
function tar_file($filename, $contents) { function tar_file($filename, $tmp_file) {
$return = pack("a100a8a8a8a12a12", $filename, 644, 0, 0, decoct(strlen($contents)), decoct(time())); $return = pack("a100a8a8a8a12a12", $filename, 644, 0, 0, decoct($tmp_file->size), decoct(time()));
$checksum = 8*32; // space for checksum itself $checksum = 8*32; // space for checksum itself
for ($i=0; $i < strlen($return); $i++) { for ($i=0; $i < strlen($return); $i++) {
$checksum += ord($return[$i]); $checksum += ord($return[$i]);
} }
$return .= sprintf("%06o", $checksum) . "\0 "; $return .= sprintf("%06o", $checksum) . "\0 ";
return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512); echo $return;
echo str_repeat("\0", 512 - strlen($return));
$tmp_file->send();
echo str_repeat("\0", 511 - ($tmp_file->size + 511) % 512);
} }
/** Get INI bytes value /** Get INI bytes value

View File

@@ -95,14 +95,16 @@ function nl_br($string) {
* @param bool * @param bool
* @param string * @param string
* @param string * @param string
* @param bool * @param string
* @return string * @return string
*/ */
function checkbox($name, $value, $checked, $label = "", $onclick = "", $jsonly = false) { function checkbox($name, $value, $checked, $label = "", $onclick = "", $class = "") {
static $id = 0; $return = "<input type='checkbox' name='$name' value='" . h($value) . "'"
$id++; . ($checked ? " checked" : "")
$return = "<input type='checkbox' name='$name' value='" . h($value) . "'" . ($checked ? " checked" : "") . ($onclick ? ' onclick="' . h($onclick) . '"' : '') . ($jsonly ? " class='jsonly'" : "") . " id='checkbox-$id'>"; . ($onclick ? ' onclick="' . h($onclick) . '"' : '')
return ($label != "" ? "<label for='checkbox-$id'>$return" . h($label) . "</label>" : $return); . ">"
;
return ($label != "" || $class ? "<label" . ($class ? " class='$class'" : "") . ">$return" . h($label) . "</label>" : $return);
} }
/** Generate list of HTML options /** Generate list of HTML options
@@ -303,7 +305,7 @@ function get_rows($query, $connection2 = null, $error = "<p class='error'>") {
/** Find unique identifier of a row /** Find unique identifier of a row
* @param array * @param array
* @param array result of indexes() * @param array result of indexes()
* @return array * @return array or null if there is no unique identifier
*/ */
function unique_array($row, $indexes) { function unique_array($row, $indexes) {
foreach ($indexes as $index) { foreach ($indexes as $index) {
@@ -318,13 +320,6 @@ function unique_array($row, $indexes) {
return $return; return $return;
} }
} }
$return = array();
foreach ($row as $key => $val) {
if (!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~', $key)) { //! columns looking like functions
$return[$key] = $val;
}
}
return $return;
} }
/** Create SQL condition from parsed query string /** Create SQL condition from parsed query string
@@ -335,13 +330,22 @@ function unique_array($row, $indexes) {
function where($where, $fields = array()) { function where($where, $fields = array()) {
global $jush; global $jush;
$return = array(); $return = array();
$function_pattern = '(^[\w\(]+' . str_replace("_", ".*", preg_quote(idf_escape("_"))) . '\)+$)'; //! columns looking like functions
foreach ((array) $where["where"] as $key => $val) { foreach ((array) $where["where"] as $key => $val) {
$return[] = idf_escape(bracket_escape($key, 1)) // 1 - back $key = bracket_escape($key, 1); // 1 - back
. (($jush == "sql" && ereg('\\.', $val)) || $jush == "mssql" ? " LIKE " . exact_value(addcslashes($val, "%_\\")) : " = " . unconvert_field($fields[$key], exact_value($val))) // LIKE because of floats, but slow with ints, in MS SQL because of text $column = (preg_match($function_pattern, $key) ? $key : idf_escape($key)); //! SQL injection
$return[] = $column
. (($jush == "sql" && ereg('^[0-9]*\\.[0-9]*$', $val)) || $jush == "mssql"
? " LIKE " . q(addcslashes($val, "%_\\"))
: " = " . unconvert_field($fields[$key], q($val))
) // LIKE because of floats but slow with ints, in MS SQL because of text
; //! enum and set ; //! enum and set
if ($jush == "sql" && ereg("[^ -@]", $val)) { // not just [a-z] to catch non-ASCII characters
$return[] = "$column = " . q($val) . " COLLATE utf8_bin";
}
} }
foreach ((array) $where["null"] as $key) { foreach ((array) $where["null"] as $key) {
$return[] = idf_escape($key) . " IS NULL"; $return[] = (preg_match($function_pattern, $key) ? $key : idf_escape($key)) . " IS NULL";
} }
return implode(" AND ", $return); return implode(" AND ", $return);
} }
@@ -368,6 +372,26 @@ function where_link($i, $column, $value, $operator = "=") {
return "&where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&where%5B$i%5D%5Bop%5D=" . urlencode(($value !== null ? $operator : "IS NULL")) . "&where%5B$i%5D%5Bval%5D=" . urlencode($value); return "&where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&where%5B$i%5D%5Bop%5D=" . urlencode(($value !== null ? $operator : "IS NULL")) . "&where%5B$i%5D%5Bval%5D=" . urlencode($value);
} }
/** Get select clause for convertible fields
* @param array
* @param array
* @param array
* @return string
*/
function convert_fields($columns, $fields, $select = array()) {
$return = "";
foreach ($columns as $key => $val) {
if ($select && !in_array(idf_escape($key), $select)) {
continue;
}
$as = convert_field($fields[$key]);
if ($as) {
$return .= ", $as AS " . idf_escape($key);
}
}
return $return;
}
/** Set cookie valid for 1 month /** Set cookie valid for 1 month
* @param string * @param string
* @param string * @param string
@@ -480,12 +504,15 @@ function redirect($location, $message = null) {
*/ */
function query_redirect($query, $location, $message, $redirect = true, $execute = true, $failed = false) { function query_redirect($query, $location, $message, $redirect = true, $execute = true, $failed = false) {
global $connection, $error, $adminer; global $connection, $error, $adminer;
$time = "";
if ($execute) { if ($execute) {
$start = microtime();
$failed = !$connection->query($query); $failed = !$connection->query($query);
$time = "; -- " . format_time($start, microtime());
} }
$sql = ""; $sql = "";
if ($query) { if ($query) {
$sql = $adminer->messageQuery("$query;"); $sql = $adminer->messageQuery($query . $time);
} }
if ($failed) { if ($failed) {
$error = error() . $sql; $error = error() . $sql;
@@ -506,10 +533,13 @@ function queries($query = null) {
static $queries = array(); static $queries = array();
if ($query === null) { if ($query === null) {
// return executed queries without parameter // return executed queries without parameter
return implode(";\n", $queries); return implode("\n", $queries);
} }
$queries[] = (ereg(';$', $query) ? "DELIMITER ;;\n$query;\nDELIMITER " : $query); $start = microtime();
return $connection->query($query); $return = $connection->query($query);
$queries[] = (ereg(';$', $query) ? "DELIMITER ;;\n$query;\nDELIMITER " : $query)
. "; -- " . format_time($start, microtime());
return $return;
} }
/** Apply command to all array items /** Apply command to all array items
@@ -537,6 +567,15 @@ function queries_redirect($location, $message, $redirect) {
return query_redirect(queries(), $location, $message, $redirect, false, !$redirect); return query_redirect(queries(), $location, $message, $redirect, false, !$redirect);
} }
/** Format time difference
* @param string output of microtime()
* @param string output of microtime()
* @return string HTML code
*/
function format_time($start, $end) {
return lang('%.3f s', max(0, array_sum(explode(" ", $end)) - array_sum(explode(" ", $start))));
}
/** Remove parameter from query string /** Remove parameter from query string
* @param string * @param string
* @return string * @return string
@@ -561,21 +600,34 @@ function pagination($page, $current) {
*/ */
function get_file($key, $decompress = false) { function get_file($key, $decompress = false) {
$file = $_FILES[$key]; $file = $_FILES[$key];
if (!$file || $file["error"]) { if (!$file) {
return $file["error"]; return null;
} }
$return = file_get_contents($decompress && ereg('\\.gz$', $file["name"]) ? "compress.zlib://$file[tmp_name]" foreach ($file as $key => $val) {
: ($decompress && ereg('\\.bz2$', $file["name"]) ? "compress.bzip2://$file[tmp_name]" $file[$key] = (array) $val;
: $file["tmp_name"] }
)); //! may not be reachable because of open_basedir $return = '';
if ($decompress) { foreach ($file["error"] as $key => $error) {
$start = substr($return, 0, 3); if ($error) {
if (function_exists("iconv") && ereg("^\xFE\xFF|^\xFF\xFE", $start, $regs)) { // not ternary operator to save memory return $error;
$return = iconv("utf-16", "utf-8", $return);
} elseif ($start == "\xEF\xBB\xBF") { // UTF-8 BOM
$return = substr($return, 3);
} }
$name = $file["name"][$key];
$tmp_name = $file["tmp_name"][$key];
$content = file_get_contents($decompress && ereg('\\.gz$', $name)
? "compress.zlib://$tmp_name"
: $tmp_name
); //! may not be reachable because of open_basedir
if ($decompress) {
$start = substr($content, 0, 3);
if (function_exists("iconv") && ereg("^\xFE\xFF|^\xFF\xFE", $start, $regs)) { // not ternary operator to save memory
$content = iconv("utf-16", "utf-8", $content);
} elseif ($start == "\xEF\xBB\xBF") { // UTF-8 BOM
$content = substr($content, 3);
}
}
$return .= $content . "\n\n";
} }
//! support SQL files not ending with semicolon
return $return; return $return;
} }
@@ -655,6 +707,16 @@ function hidden_fields_get() {
echo '<input type="hidden" name="username" value="' . h($_GET["username"]) . '">'; echo '<input type="hidden" name="username" value="' . h($_GET["username"]) . '">';
} }
/** Get status of a single table and fall back to name on error
* @param string
* @param bool
* @return array
*/
function table_status1($table, $fast = false) {
$return = table_status($table, $fast);
return ($return ? $return : array("Name" => $table));
}
/** Find out foreign keys for each column /** Find out foreign keys for each column
* @param string * @param string
* @return array array($col => array()) * @return array array($col => array())
@@ -697,7 +759,7 @@ function enum_input($type, $attrs, $field, $value, $empty = null) {
* @return null * @return null
*/ */
function input($field, $value, $function) { function input($field, $value, $function) {
global $types, $adminer, $jush; global $connection, $types, $adminer, $jush;
$name = h(bracket_escape($field["field"])); $name = h(bracket_escape($field["field"]));
echo "<td class='function'>"; echo "<td class='function'>";
$reset = ($jush == "mssql" && $field["auto_increment"]); $reset = ($jush == "mssql" && $field["auto_increment"]);
@@ -742,8 +804,11 @@ function input($field, $value, $function) {
} else { } else {
// int(3) is only a display hint // int(3) is only a display hint
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0)); $maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
if ($jush == 'sql' && $connection->server_info >= 5.6 && ereg('time', $field["type"])) {
$maxlength += 7; // microtime
}
// 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" . (ereg('int|float|double|decimal', $field["type"]) ? " type='number'" : "") . " value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char|binary', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . "$attrs>"; echo "<input" . (ereg('int', $field["type"]) ? " type='number'" : "") . " value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char|binary', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . "$attrs>";
} }
} }
} }
@@ -798,7 +863,7 @@ function search_tables() {
$_GET["where"][0]["op"] = "LIKE %%"; $_GET["where"][0]["op"] = "LIKE %%";
$_GET["where"][0]["val"] = $_POST["query"]; $_GET["where"][0]["val"] = $_POST["query"];
$found = false; $found = false;
foreach (table_status() as $table => $table_status) { foreach (table_status('', true) as $table => $table_status) {
$name = $adminer->tableName($table_status); $name = $adminer->tableName($table_status);
if (isset($table_status["Engine"]) && $name != "" && (!$_POST["tables"] || in_array($table, $_POST["tables"]))) { if (isset($table_status["Engine"]) && $name != "" && (!$_POST["tables"] || in_array($table, $_POST["tables"]))) {
$result = $connection->query("SELECT" . limit("1 FROM " . table($table), " WHERE " . implode(" AND ", $adminer->selectSearchProcess(fields($table), array())), 1)); $result = $connection->query("SELECT" . limit("1 FROM " . table($table), " WHERE " . implode(" AND ", $adminer->selectSearchProcess(fields($table), array())), 1));
@@ -829,6 +894,8 @@ function dump_headers($identifier, $multi_table = false) {
header("Content-Disposition: attachment; filename=" . $adminer->dumpFilename($identifier) . ".$return" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : "")); header("Content-Disposition: attachment; filename=" . $adminer->dumpFilename($identifier) . ".$return" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : ""));
} }
session_write_close(); session_write_close();
ob_flush();
flush();
return $return; return $return;
} }
@@ -855,9 +922,10 @@ function apply_sql_function($function, $column) {
} }
/** 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
* @return string or false if the file can not be created * @return string or false if the file can not be created
*/ */
function password_file() { function password_file($create) {
$dir = ini_get("upload_tmp_dir"); // session_save_path() may contain other storage path $dir = ini_get("upload_tmp_dir"); // session_save_path() may contain other storage path
if (!$dir) { if (!$dir) {
if (function_exists('sys_get_temp_dir')) { if (function_exists('sys_get_temp_dir')) {
@@ -873,7 +941,7 @@ function password_file() {
} }
$filename = "$dir/adminer.key"; $filename = "$dir/adminer.key";
$return = @file_get_contents($filename); // @ - can not exist $return = @file_get_contents($filename); // @ - can not exist
if ($return) { if ($return || !$create) {
return $return; return $return;
} }
$fp = @fopen($filename, "w"); // @ - can have insufficient rights //! is not atomic $fp = @fopen($filename, "w"); // @ - can have insufficient rights //! is not atomic

View File

@@ -3,33 +3,34 @@
$langs = array( $langs = array(
'en' => 'English', // Jakub Vrána - http://www.vrana.cz 'en' => 'English', // Jakub Vrána - http://www.vrana.cz
'cs' => 'Čeština', // Jakub Vrána - http://www.vrana.cz 'ar' => 'العربية', // Y.M Amine - Algeria - nbr7@live.fr
'sk' => 'Slovenčina', // Ivan Suchy - http://www.ivansuchy.com, Juraj Krivda - http://www.jstudio.cz 'bn' => 'বাংলা', // Dipak Kumar - dipak.ndc@gmail.com
'nl' => 'Nederlands', // Maarten Balliauw - http://blog.maartenballiauw.be
'es' => 'Español', // Klemens Häckel - http://clickdimension.wordpress.com
'de' => 'Deutsch', // Klemens Häckel - http://clickdimension.wordpress.com
'fr' => 'Français', // Francis Gagné, Aurélien Royer
'it' => 'Italiano', // Alessandro Fiorotto, Paolo Asperti
'et' => 'Eesti', // Priit Kallas
'hu' => 'Magyar', // Borsos Szilárd (Borsosfi) - http://www.borsosfi.hu, info@borsosfi.hu
'pl' => 'Polski', // Radosław Kowalewski - http://srsbiz.pl/
'ca' => 'Català', // Joan Llosas 'ca' => 'Català', // Joan Llosas
'pt' => 'Português', // Gian Live - gian@live.com, Davi Alexandre davi@davialexandre.com.br 'cs' => 'Čeština', // Jakub Vrána - http://www.vrana.cz
'sl' => 'Slovenski', // Matej Ferlan - www.itdinamik.com, matej.ferlan@itdinamik.com 'de' => 'Deutsch', // Klemens Häckel - http://clickdimension.wordpress.com
'lt' => 'Lietuvių', // Paulius Leščinskas - http://www.lescinskas.lt 'es' => 'Español', // Klemens Häckel - http://clickdimension.wordpress.com
'tr' => 'Türkçe', // Bilgehan Korkmaz - turktron.com 'et' => 'Eesti', // Priit Kallas
'ro' => 'Limba Română', // .nick .messing - dot.nick.dot.messing@gmail.com 'fa' => 'فارسی', // mojtaba barghbani - Iran - mbarghbani@gmail.com
'fr' => 'Français', // Francis Gagné, Aurélien Royer
'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
'ja' => '日本語', // Hitoshi Ozawa - http://sourceforge.jp/projects/oss-ja-jpn/releases/
'ko' => '한국어', // dalli - skcha67@gmail.com
'lt' => 'Lietuvių', // Paulius Leščinskas - http://www.lescinskas.lt
'nl' => 'Nederlands', // Maarten Balliauw - http://blog.maartenballiauw.be
'pl' => 'Polski', // Radosław Kowalewski - http://srsbiz.pl/
'pt' => 'Português', // Gian Live - gian@live.com, Davi Alexandre davi@davialexandre.com.br
'ro' => 'Limba Română', // .nick .messing - dot.nick.dot.messing@gmail.com
'ru' => 'Русский язык', // Maksim Izmaylov 'ru' => 'Русский язык', // Maksim Izmaylov
'uk' => 'Українська', // Valerii Kryzhov '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
'sr' => 'Српски', // Nikola Radovanović - cobisimo@gmail.com 'sr' => 'Српски', // Nikola Radovanović - cobisimo@gmail.com
'ta' => 'த‌மிழ்', // G. Sampath Kumar, Chennai, India, sampathkumar11@gmail.com
'tr' => 'Türkçe', // Bilgehan Korkmaz - turktron.com
'uk' => 'Українська', // Valerii Kryzhov
'zh' => '简体中文', // Mr. Lodar 'zh' => '简体中文', // Mr. Lodar
'zh-tw' => '繁體中文', // http://tzangms.com 'zh-tw' => '繁體中文', // http://tzangms.com
'ja' => '日本語', // Hitoshi Ozawa - http://sourceforge.jp/projects/oss-ja-jpn/releases/
'ta' => 'த‌மிழ்', // G. Sampath Kumar, Chennai, India, sampathkumar11@gmail.com
'bn' => 'বাংলা', // Dipak Kumar - dipak.ndc@gmail.com
'ar' => 'العربية', // Y.M Amine - Algeria - nbr7@live.fr
'fa' => 'فارسی', // mojtaba barghbani - Iran - mbarghbani@gmail.com
); );
/** Get current language /** Get current language

View File

@@ -2,11 +2,11 @@
// PDO can be used in several database drivers // PDO can be used in several database drivers
if (extension_loaded('pdo')) { if (extension_loaded('pdo')) {
/*abstract*/ class Min_PDO extends PDO { /*abstract*/ class Min_PDO extends PDO {
var $_result, $server_info, $affected_rows, $error; var $_result, $server_info, $affected_rows, $errno, $error;
function __construct() { function __construct() {
global $adminer; global $adminer;
$pos = array_search("", $adminer->operators); $pos = array_search("SQL", $adminer->operators);
if ($pos !== false) { if ($pos !== false) {
unset($adminer->operators[$pos]); unset($adminer->operators[$pos]);
} }
@@ -26,8 +26,7 @@ if (extension_loaded('pdo')) {
$result = parent::query($query); $result = parent::query($query);
$this->error = ""; $this->error = "";
if (!$result) { if (!$result) {
$errorInfo = $this->errorInfo(); list(, $this->errno, $this->error) = $this->errorInfo();
$this->error = $errorInfo[2];
return false; return false;
} }
$this->store_result($result); $this->store_result($result);
@@ -41,6 +40,9 @@ if (extension_loaded('pdo')) {
function store_result($result = null) { function store_result($result = null) {
if (!$result) { if (!$result) {
$result = $this->_result; $result = $this->_result;
if (!$result) {
return false;
}
} }
if ($result->columnCount()) { if ($result->columnCount()) {
$result->num_rows = $result->rowCount(); // is not guaranteed to work with all drivers $result->num_rows = $result->rowCount(); // is not guaranteed to work with all drivers
@@ -51,6 +53,9 @@ if (extension_loaded('pdo')) {
} }
function next_result() { function next_result() {
if (!$this->_result) {
return false;
}
$this->_result->_offset = 0; $this->_result->_offset = 0;
return @$this->_result->nextRowset(); // @ - PDO_PgSQL doesn't support it return @$this->_result->nextRowset(); // @ - PDO_PgSQL doesn't support it
} }

View File

@@ -0,0 +1,22 @@
<?php
class TmpFile {
var $handler;
var $size;
function TmpFile() {
$this->handler = tmpfile();
}
function write($contents) {
$this->size += strlen($contents);
fwrite($this->handler, $contents);
}
function send() {
fseek($this->handler, 0);
fpassthru($this->handler);
fclose($this->handler);
}
}

View File

@@ -1,2 +1,2 @@
<?php <?php
$VERSION = "3.6.2"; $VERSION = "3.7.1";

View File

@@ -79,6 +79,9 @@ function decrypt_string($str, $key) {
if ($str == "") { if ($str == "") {
return ""; return "";
} }
if (!$key) {
return false;
}
$key = array_values(unpack("V*", pack("H*", md5($key)))); $key = array_values(unpack("V*", pack("H*", md5($key))));
$v = str2long($str, false); $v = str2long($str, false);
$n = count($v) - 1; $n = count($v) - 1;

View File

@@ -8,6 +8,7 @@
*/ */
include "./include/bootstrap.inc.php"; include "./include/bootstrap.inc.php";
include "./include/tmpfile.inc.php";
$enum_length = "'(?:''|[^'\\\\]|\\\\.)*+'"; $enum_length = "'(?:''|[^'\\\\]|\\\\.)*+'";
$inout = "IN|OUT|INOUT"; $inout = "IN|OUT|INOUT";
@@ -21,6 +22,7 @@ if (isset($_GET["callf"])) {
if (isset($_GET["function"])) { if (isset($_GET["function"])) {
$_GET["procedure"] = $_GET["function"]; $_GET["procedure"] = $_GET["function"];
} }
if (isset($_GET["download"])) { if (isset($_GET["download"])) {
include "./download.inc.php"; include "./download.inc.php";
} elseif (isset($_GET["table"])) { } elseif (isset($_GET["table"])) {

View File

@@ -1,8 +1,8 @@
<?php <?php
$TABLE = $_GET["indexes"]; $TABLE = $_GET["indexes"];
$index_types = array("PRIMARY", "UNIQUE", "INDEX"); $index_types = array("PRIMARY", "UNIQUE", "INDEX");
$table_status = table_status($TABLE); $table_status = table_status($TABLE, true);
if (eregi("MyISAM|M?aria", $table_status["Engine"])) { if (eregi("MyISAM|M?aria" . ($connection->server_info >= 5.6 ? "|InnoDB" : ""), $table_status["Engine"])) {
$index_types[] = "FULLTEXT"; $index_types[] = "FULLTEXT";
} }
$indexes = indexes($TABLE); $indexes = indexes($TABLE);
@@ -10,29 +10,40 @@ if ($jush == "sqlite") { // doesn't support primary key
unset($index_types[0]); unset($index_types[0]);
unset($indexes[""]); unset($indexes[""]);
} }
$row = $_POST;
if ($_POST && !$error && !$_POST["add"]) { if ($_POST && !$error && !$_POST["add"]) {
$alter = array(); $alter = array();
foreach ($_POST["indexes"] as $index) { foreach ($row["indexes"] as $index) {
$name = $index["name"]; $name = $index["name"];
if (in_array($index["type"], $index_types)) { if (in_array($index["type"], $index_types)) {
$columns = array(); $columns = array();
$lengths = array(); $lengths = array();
$descs = array();
$set = array(); $set = array();
ksort($index["columns"]); ksort($index["columns"]);
foreach ($index["columns"] as $key => $column) { foreach ($index["columns"] as $key => $column) {
if ($column != "") { if ($column != "") {
$length = $index["lengths"][$key]; $length = $index["lengths"][$key];
$set[] = idf_escape($column) . ($length ? "(" . (+$length) . ")" : ""); $desc = $index["descs"][$key];
$set[] = idf_escape($column) . ($length ? "(" . (+$length) . ")" : "") . ($desc ? " DESC" : "");
$columns[] = $column; $columns[] = $column;
$lengths[] = ($length ? $length : null); $lengths[] = ($length ? $length : null);
$descs[] = $desc;
} }
} }
if ($columns) { if ($columns) {
$existing = $indexes[$name]; $existing = $indexes[$name];
if ($existing) { if ($existing) {
ksort($existing["columns"]); ksort($existing["columns"]);
ksort($existing["lengths"]); ksort($existing["lengths"]);
if ($index["type"] == $existing["type"] && array_values($existing["columns"]) === $columns && (!$existing["lengths"] || array_values($existing["lengths"]) === $lengths)) { ksort($existing["descs"]);
if ($index["type"] == $existing["type"]
&& array_values($existing["columns"]) === $columns
&& (!$existing["lengths"] || array_values($existing["lengths"]) === $lengths)
&& array_values($existing["descs"]) === $descs
) {
// skip existing index // skip existing index
unset($indexes[$name]); unset($indexes[$name]);
continue; continue;
@@ -42,6 +53,7 @@ if ($_POST && !$error && !$_POST["add"]) {
} }
} }
} }
// drop removed indexes // drop removed indexes
foreach ($indexes as $name => $existing) { foreach ($indexes as $name => $existing) {
$alter[] = array($existing["type"], $name, "DROP"); $alter[] = array($existing["type"], $name, "DROP");
@@ -55,26 +67,28 @@ if ($_POST && !$error && !$_POST["add"]) {
page_header(lang('Indexes'), $error, array("table" => $TABLE), $TABLE); page_header(lang('Indexes'), $error, array("table" => $TABLE), $TABLE);
$fields = array_keys(fields($TABLE)); $fields = array_keys(fields($TABLE));
$row = array("indexes" => $indexes); if ($_POST["add"]) {
if ($_POST) {
$row = $_POST;
if ($_POST["add"]) {
foreach ($row["indexes"] as $key => $index) {
if ($index["columns"][count($index["columns"])] != "") {
$row["indexes"][$key]["columns"][] = "";
}
}
$index = end($row["indexes"]);
if ($index["type"] || array_filter($index["columns"], 'strlen') || array_filter($index["lengths"], 'strlen')) {
$row["indexes"][] = array("columns" => array(1 => ""));
}
}
} else {
foreach ($row["indexes"] as $key => $index) { foreach ($row["indexes"] as $key => $index) {
$row["indexes"][$key]["name"] = $key; if ($index["columns"][count($index["columns"])] != "") {
$row["indexes"][$key]["columns"][] = ""; $row["indexes"][$key]["columns"][] = "";
}
} }
$row["indexes"][] = array("columns" => array(1 => "")); $index = end($row["indexes"]);
if ($index["type"]
|| array_filter($index["columns"], 'strlen')
|| array_filter($index["lengths"], 'strlen')
|| array_filter($index["descs"])
) {
$row["indexes"][] = array("columns" => array(1 => ""));
}
}
if (!$row) {
foreach ($indexes as $key => $index) {
$indexes[$key]["name"] = $key;
$indexes[$key]["columns"][] = "";
}
$indexes[] = array("columns" => array(1 => ""));
$row["indexes"] = $indexes;
} }
?> ?>
@@ -86,13 +100,17 @@ $j = 1;
foreach ($row["indexes"] as $index) { foreach ($row["indexes"] as $index) {
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow(this);" : 1)) . "<td>"; echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow(this);" : 1)) . "<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>" . html_select("indexes[$j][columns][$i]", array(-1 => "") + $fields, $column, ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . "(this, '" . js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_") . "');"); echo "<span>" . html_select("indexes[$j][columns][$i]", array(-1 => "") + $fields, $column, ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . "(this, '" . js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_") . "');");
echo "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "'> </span>"; //! hide for non-MySQL drivers, add ASC|DESC echo ($jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "'>" : "");
echo ($jush != "sql" ? checkbox("indexes[$j][descs][$i]", 1, $index["descs"][$key], lang('descending')) : "");
echo " </span>";
$i++; $i++;
} }
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "'>\n";
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off'>\n";
$j++; $j++;
} }
?> ?>

View File

@@ -188,7 +188,7 @@ $translations = array(
'%d item(s) have been affected.' => 'عدد العناصر المعدلة هو %d.', '%d item(s) have been affected.' => 'عدد العناصر المعدلة هو %d.',
'whole result' => 'نتيجة كاملة', 'whole result' => 'نتيجة كاملة',
'Clone' => 'نسخ', 'Clone' => 'نسخ',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'لقد تجاوزت العدد الأقصى للحقول. يرجى الرفع من %s و %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'لقد تجاوزت العدد الأقصى للحقول. يرجى الرفع من %s.',
'Partition by' => 'مقسم بواسطة', 'Partition by' => 'مقسم بواسطة',
'Partitions' => 'التقسيمات', 'Partitions' => 'التقسيمات',
'Partition name' => 'إسم التقسيم', 'Partition name' => 'إسم التقسيم',
@@ -258,7 +258,6 @@ $translations = array(
'now' => 'الآن', 'now' => 'الآن',
'%d query(s) executed OK.' => array('تم تنفيذ الإستعلام %d بنجاح.', 'تم تنفيذ الإستعلامات %d بنجاح.'), '%d query(s) executed OK.' => array('تم تنفيذ الإستعلام %d بنجاح.', 'تم تنفيذ الإستعلامات %d بنجاح.'),
'Show only errors' => 'إعرض الأخطاء فقط', 'Show only errors' => 'إعرض الأخطاء فقط',
'Last page' => 'الصفحة السابقة',
'Refresh' => 'تحديث', 'Refresh' => 'تحديث',
'Invalid schema.' => 'مخطط خاطئ.', 'Invalid schema.' => 'مخطط خاطئ.',
'Please use one of the extensions %s.' => 'من فضلك إستعمل إحدى الإمتدادات: %s.', 'Please use one of the extensions %s.' => 'من فضلك إستعمل إحدى الإمتدادات: %s.',

View File

@@ -190,7 +190,7 @@ $translations = array(
'%d item(s) have been affected.' => '%d টি বিষয়বস্তু প্রভাবিত হয়েছে', '%d item(s) have been affected.' => '%d টি বিষয়বস্তু প্রভাবিত হয়েছে',
'whole result' => 'সম্পূর্ণ ফলাফল', 'whole result' => 'সম্পূর্ণ ফলাফল',
'Clone' => 'ক্লোন', 'Clone' => 'ক্লোন',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'অনুমোদিত ফিল্ড এর সর্বাধিক সংখ্যা অতিক্রম করে গেছে। অনুগ্রহপূর্বক %s এবং %s বৃদ্ধি করুন।', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'অনুমোদিত ফিল্ড এর সর্বাধিক সংখ্যা অতিক্রম করে গেছে। অনুগ্রহপূর্বক %s বৃদ্ধি করুন।',
'Partition by' => 'পার্টিশন যার মাধ্যমে', 'Partition by' => 'পার্টিশন যার মাধ্যমে',
'Partitions' => 'পার্টিশন', 'Partitions' => 'পার্টিশন',
'Partition name' => 'পার্টিশনের নাম', 'Partition name' => 'পার্টিশনের নাম',
@@ -257,7 +257,6 @@ $translations = array(
'Attachments' => 'সংযুক্তি', 'Attachments' => 'সংযুক্তি',
'%d query(s) executed OK.' => array('SQL-কোয়্যারী সফলভাবে সম্পন্ন হয়েছে', '%d SQL-কোয়্যারীসমূহ সফলভাবে সম্পন্ন হয়েছে'), '%d query(s) executed OK.' => array('SQL-কোয়্যারী সফলভাবে সম্পন্ন হয়েছে', '%d SQL-কোয়্যারীসমূহ সফলভাবে সম্পন্ন হয়েছে'),
'Show only errors' => 'শুধুমাত্র ত্রুটি দেখাও', 'Show only errors' => 'শুধুমাত্র ত্রুটি দেখাও',
'Last page' => 'শেষ পাতা',
'Refresh' => 'রিফ্রেশ', 'Refresh' => 'রিফ্রেশ',
'Invalid schema.' => 'অবৈধ স্কিমা।', 'Invalid schema.' => 'অবৈধ স্কিমা।',
'Please use one of the extensions %s.' => 'কোন একটা এক্সটেনশন %s ব্যবহার করো।', 'Please use one of the extensions %s.' => 'কোন একটা এক্সটেনশন %s ব্যবহার করো।',

View File

@@ -199,7 +199,7 @@ $translations = array(
'Show structure' => 'Mostra l\'estructura', 'Show structure' => 'Mostra l\'estructura',
'Select data' => 'Selecciona dades', 'Select data' => 'Selecciona dades',
'Stop on error' => 'Atura en trobar un error', 'Stop on error' => 'Atura en trobar un error',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'S\'ha assolit el nombre màxim de camps. Incrementa %s i %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'S\'ha assolit el nombre màxim de camps. Incrementa %s.',
'anywhere' => 'a qualsevol lloc', 'anywhere' => 'a qualsevol lloc',
'%.3f s' => '%.3f s', '%.3f s' => '%.3f s',
'$1-$3-$5' => '$5/$3/$1', '$1-$3-$5' => '$5/$3/$1',
@@ -259,7 +259,6 @@ $translations = array(
'now' => 'ara', 'now' => 'ara',
'%d query(s) executed OK.' => array('%d consulta executada correctament.', '%d consultes executades correctament.'), '%d query(s) executed OK.' => array('%d consulta executada correctament.', '%d consultes executades correctament.'),
'Show only errors' => 'Mostra només els errors', 'Show only errors' => 'Mostra només els errors',
'Last page' => 'Darrera plana',
'Refresh' => 'Refresca', 'Refresh' => 'Refresca',
'Invalid schema.' => 'Esquema invàlid.', 'Invalid schema.' => 'Esquema invàlid.',
'Please use one of the extensions %s.' => 'Si us plau, utilitza una de les extensions %s.', 'Please use one of the extensions %s.' => 'Si us plau, utilitza una de les extensions %s.',

View File

@@ -11,6 +11,7 @@ $translations = array(
'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.',
'Invalid credentials.' => 'Neplatné přihlašovací údaje.', 'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
'Master password expired. <a href="http://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Platnost hlavního hesla vypršela. <a href="http://www.adminer.org/cs/extension/" target="_blank">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.',
'No extension' => 'Žádné rozšíření', 'No extension' => 'Žádné rozšíření',
@@ -64,6 +65,7 @@ $translations = array(
'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.', 'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.',
'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.', 'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Příliš velká POST data. Zmenšete data nebo zvyšte hodnotu konfigurační direktivy %s.', 'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Příliš velká POST data. Zmenšete data nebo zvyšte hodnotu konfigurační direktivy %s.',
'You can upload a big SQL file via FTP and import it from server.' => 'Velký SQL soubor můžete nahrát pomocí FTP a importovat ho ze serveru.',
'Export' => 'Export', 'Export' => 'Export',
'Dump' => 'Export', 'Dump' => 'Export',
@@ -166,7 +168,7 @@ $translations = array(
'Move up' => 'Přesunout nahoru', 'Move up' => 'Přesunout nahoru',
'Move down' => 'Přesunout dolů', 'Move down' => 'Přesunout dolů',
'Remove' => 'Odebrat', 'Remove' => 'Odebrat',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s a %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s.',
'Partition by' => 'Rozdělit podle', 'Partition by' => 'Rozdělit podle',
'Partitions' => 'Oddíly', 'Partitions' => 'Oddíly',
@@ -233,7 +235,6 @@ $translations = array(
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'), '%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
'Page' => 'Stránka', 'Page' => 'Stránka',
'last' => 'poslední', 'last' => 'poslední',
'Last page' => 'Poslední stránka',
'Load more data' => 'Nahrát další data', 'Load more data' => 'Nahrát další data',
'Loading' => 'Nahrává se', 'Loading' => 'Nahrává se',
'whole result' => 'celý výsledek', 'whole result' => 'celý výsledek',
@@ -241,6 +242,7 @@ $translations = array(
'Import' => 'Import', 'Import' => 'Import',
'%d row(s) have been imported.' => array('Byl importován %d záznam.', 'Byly importovány %d záznamy.', 'Bylo importováno %d záznamů.'), '%d row(s) have been imported.' => array('Byl importován %d záznam.', 'Byly importovány %d záznamy.', 'Bylo importováno %d záznamů.'),
'File must be in UTF-8 encoding.' => 'Soubor musí být v kódování UTF-8.',
// in-place editing in select // in-place editing in select
'Ctrl+click on a value to modify it.' => 'Ctrl+klikněte na políčko, které chcete změnit.', 'Ctrl+click on a value to modify it.' => 'Ctrl+klikněte na políčko, které chcete změnit.',

View File

@@ -190,7 +190,7 @@ $translations = array(
'%d item(s) have been affected.' => '%d Artikel betroffen.', '%d item(s) have been affected.' => '%d Artikel betroffen.',
'whole result' => 'Gesamtergebnis', 'whole result' => 'Gesamtergebnis',
'Clone' => 'Klonen', 'Clone' => 'Klonen',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Die maximal erlaubte Anzahl der Felder ist überschritten. Bitte %s und %s erhöhen.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Die maximal erlaubte Anzahl der Felder ist überschritten. Bitte %s erhöhen.',
'Partition by' => 'Partitionieren um', 'Partition by' => 'Partitionieren um',
'Partitions' => 'Partitionen', 'Partitions' => 'Partitionen',
'Partition name' => 'Name der Partition', 'Partition name' => 'Name der Partition',
@@ -258,7 +258,6 @@ $translations = array(
'Attachments' => 'Anhänge', 'Attachments' => 'Anhänge',
'%d query(s) executed OK.' => array('SQL-Query erfolgreich ausgeführt.', '%d SQL-Queries erfolgreich ausgeführt.'), '%d query(s) executed OK.' => array('SQL-Query erfolgreich ausgeführt.', '%d SQL-Queries erfolgreich ausgeführt.'),
'Show only errors' => 'Nur Fehler anzeigen', 'Show only errors' => 'Nur Fehler anzeigen',
'Last page' => 'Letzte Seite',
'Refresh' => 'Aktualisieren', 'Refresh' => 'Aktualisieren',
'Invalid schema.' => 'Schema nicht gültig.', 'Invalid schema.' => 'Schema nicht gültig.',
'Please use one of the extensions %s.' => 'Bitte einen der Dateitypen %s benutzen.', 'Please use one of the extensions %s.' => 'Bitte einen der Dateitypen %s benutzen.',

View File

@@ -190,7 +190,7 @@ $translations = array(
'%d item(s) have been affected.' => array('%d ítem afectado.', '%d itemes afectados.'), '%d item(s) have been affected.' => array('%d ítem afectado.', '%d itemes afectados.'),
'whole result' => 'resultado completo', 'whole result' => 'resultado completo',
'Clone' => 'Clonar', 'Clone' => 'Clonar',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Cantida máxima de campos permitidos excedidos. Por favor aumente %s y %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Cantida máxima de campos permitidos excedidos. 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',
@@ -258,7 +258,6 @@ $translations = array(
'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',
'Last page' => 'Ultima página',
'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.',

View File

@@ -190,7 +190,7 @@ $translations = array(
'%d item(s) have been affected.' => 'Mõjutatud kirjeid: %d.', '%d item(s) have been affected.' => 'Mõjutatud kirjeid: %d.',
'whole result' => 'Täielikud tulemused', 'whole result' => 'Täielikud tulemused',
'Clone' => 'Kloon', 'Clone' => 'Kloon',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Maksimaalne väljade arv ületatud. Palun suurendage %s ja %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Maksimaalne väljade arv ületatud. Palun suurendage %s.',
'Partition by' => 'Partitsiooni', 'Partition by' => 'Partitsiooni',
'Partitions' => 'Partitsioonid', 'Partitions' => 'Partitsioonid',
'Partition name' => 'Partitsiooni nimi', 'Partition name' => 'Partitsiooni nimi',
@@ -258,7 +258,6 @@ $translations = array(
'Attachments' => 'Manused', 'Attachments' => 'Manused',
'%d query(s) executed OK.' => array('%d päring edukalt käivitatud.', '%d päringut edukalt käivitatud.'), '%d query(s) executed OK.' => array('%d päring edukalt käivitatud.', '%d päringut edukalt käivitatud.'),
'Show only errors' => 'Kuva vaid veateateid', 'Show only errors' => 'Kuva vaid veateateid',
'Last page' => 'Viimane lehekülg',
'Refresh' => 'Uuenda', 'Refresh' => 'Uuenda',
'Invalid schema.' => 'Sobimatu skeema.', 'Invalid schema.' => 'Sobimatu skeema.',
'Please use one of the extensions %s.' => 'Palun kasuta üht laiendustest %s.', 'Please use one of the extensions %s.' => 'Palun kasuta üht laiendustest %s.',

View File

@@ -165,7 +165,7 @@ $translations = array(
'Move up' => 'انتقال به بالا', 'Move up' => 'انتقال به بالا',
'Move down' => 'انتقال به پایین', 'Move down' => 'انتقال به پایین',
'Remove' => 'حذف', 'Remove' => 'حذف',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'حداکثر مجاز فیلدهای مجاز اشباع شد. لطفا %s و %s را کاهش دهید', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'حداکثر مجاز فیلدهای مجاز اشباع شد. لطفا %s را کاهش دهید',
'Partition by' => 'بخشبندی توسط', 'Partition by' => 'بخشبندی توسط',
'Partitions' => 'بخشبندیها', 'Partitions' => 'بخشبندیها',
@@ -231,7 +231,6 @@ $translations = array(
'%d row(s)' => array('%d سطر', '%d سطر'), '%d row(s)' => array('%d سطر', '%d سطر'),
'Page' => 'صفحه', 'Page' => 'صفحه',
'last' => 'آخری', 'last' => 'آخری',
'Last page' => 'صفحه آخر',
'whole result' => 'همه نتایج', 'whole result' => 'همه نتایج',
'%d byte(s)' => array('%d بایت', '%d بایت'), '%d byte(s)' => array('%d بایت', '%d بایت'),

View File

@@ -22,7 +22,7 @@ $translations = array(
'Length' => 'Longueur', 'Length' => 'Longueur',
'Auto Increment' => 'Auto increment', 'Auto Increment' => 'Auto increment',
'Options' => 'Options', 'Options' => 'Options',
'Save' => 'Sauvegarder', 'Save' => 'Enregistrer',
'Drop' => 'Supprimer', 'Drop' => 'Supprimer',
'Database has been created.' => 'La base de données a été créée.', 'Database has been created.' => 'La base de données a été créée.',
'Database has been renamed.' => 'La base de données a été renommée.', 'Database has been renamed.' => 'La base de données a été renommée.',
@@ -41,7 +41,7 @@ $translations = array(
'Item has been updated.' => 'L\'élément a été modifié.', 'Item has been updated.' => 'L\'élément a été modifié.',
'Edit' => 'Modifier', 'Edit' => 'Modifier',
'Insert' => 'Insérer', 'Insert' => 'Insérer',
'Save and insert next' => 'Sauvegarder et insérer le prochain', 'Save and insert next' => 'Enr. et insérer prochain',
'Delete' => 'Effacer', 'Delete' => 'Effacer',
'Database' => 'Base de données', 'Database' => 'Base de données',
'Routines' => 'Routines', 'Routines' => 'Routines',
@@ -148,7 +148,7 @@ $translations = array(
'Data' => 'Données', 'Data' => 'Données',
'Output' => 'Sortie', 'Output' => 'Sortie',
'open' => 'ouvrir', 'open' => 'ouvrir',
'save' => 'sauvegarder', 'save' => 'enregistrer',
'Format' => 'Format', 'Format' => 'Format',
'Functions' => 'Fonctions', 'Functions' => 'Fonctions',
'Aggregation' => 'Agrégation', 'Aggregation' => 'Agrégation',
@@ -165,7 +165,7 @@ $translations = array(
'Events' => 'Évènements', 'Events' => 'Évènements',
'Schedule' => 'Horaire', 'Schedule' => 'Horaire',
'At given time' => 'À un moment précis', 'At given time' => 'À un moment précis',
'Save and continue edit' => 'Sauvegarder et continuer l\'édition', 'Save and continue edit' => 'Enr. et continuer édition',
'original' => 'original', 'original' => 'original',
'Tables have been truncated.' => 'Les tables ont été tronquées.', 'Tables have been truncated.' => 'Les tables ont été tronquées.',
'Tables have been moved.' => 'Les tables ont été déplacées.', 'Tables have been moved.' => 'Les tables ont été déplacées.',
@@ -188,7 +188,7 @@ $translations = array(
'%d item(s) have been affected.' => array('%d élément a été modifié.', '%d éléments ont été modifiés.'), '%d item(s) have been affected.' => array('%d élément a été modifié.', '%d éléments ont été modifiés.'),
'whole result' => 'résultat entier', 'whole result' => 'résultat entier',
'Clone' => 'Cloner', 'Clone' => 'Cloner',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Le nombre maximum de champs est dépassé. Veuillez augmenter %s et %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Le nombre maximum de champs est dépassé. Veuillez augmenter %s.',
'Partition by' => 'Partitionner par', 'Partition by' => 'Partitionner par',
'Partitions' => 'Partitions', 'Partitions' => 'Partitions',
'Partition name' => 'Nom de la partition', 'Partition name' => 'Nom de la partition',
@@ -259,7 +259,6 @@ $translations = array(
'now' => 'maintenant', 'now' => 'maintenant',
'%d query(s) executed OK.' => array('%d requête exécutée avec succès.', '%d requêtes exécutées avec succès.'), '%d query(s) executed OK.' => array('%d requête exécutée avec succès.', '%d requêtes exécutées avec succès.'),
'Show only errors' => 'Montrer seulement les erreurs', 'Show only errors' => 'Montrer seulement les erreurs',
'Last page' => 'Dernière page',
'Refresh' => 'Rafraîchir', 'Refresh' => 'Rafraîchir',
'Invalid schema.' => 'Schéma invalide.', 'Invalid schema.' => 'Schéma invalide.',
'Please use one of the extensions %s.' => 'Veuillez utiliser l\'une des extensions %s.', 'Please use one of the extensions %s.' => 'Veuillez utiliser l\'une des extensions %s.',

View File

@@ -199,7 +199,7 @@ $translations = array(
'Show structure' => 'Struktúra', 'Show structure' => 'Struktúra',
'Select data' => 'Tartalom', 'Select data' => 'Tartalom',
'Stop on error' => 'Hiba esetén megáll', 'Stop on error' => 'Hiba esetén megáll',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'A maximális mezőszámot elérted. Növeld meg ezeket: %s, %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'A maximális mezőszámot elérted. Növeld meg ezeket: %s.',
'anywhere' => 'bárhol', 'anywhere' => 'bárhol',
'%.3f s' => '%.3f másodperc', '%.3f s' => '%.3f másodperc',
'$1-$3-$5' => '$6.$4.$1', '$1-$3-$5' => '$6.$4.$1',
@@ -258,7 +258,6 @@ $translations = array(
'now' => 'most', 'now' => 'most',
'%d query(s) executed OK.' => '%d sikeres lekérdezés.', '%d query(s) executed OK.' => '%d sikeres lekérdezés.',
'Show only errors' => 'Csak a hibák mutatása', 'Show only errors' => 'Csak a hibák mutatása',
'Last page' => 'Utolsó oldal',
'Refresh' => 'Frissítés', 'Refresh' => 'Frissítés',
'Invalid schema.' => 'Érvénytelen séma.', 'Invalid schema.' => 'Érvénytelen séma.',
'Please use one of the extensions %s.' => 'Használja a(z) %s kiterjesztést.', 'Please use one of the extensions %s.' => 'Használja a(z) %s kiterjesztést.',

View File

@@ -166,7 +166,7 @@ $translations = array(
'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 and %s.' => 'Jumlah ruas maksimum yang diizinkan dilewati. Harap naikkan %s dan %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Jumlah ruas maksimum yang diizinkan dilewati. Harap naikkan %s.',
'Partition by' => 'Partisi menurut', 'Partition by' => 'Partisi menurut',
'Partitions' => 'Partisi', 'Partitions' => 'Partisi',
@@ -233,7 +233,6 @@ $translations = array(
'%d row(s)' => '%d baris', '%d row(s)' => '%d baris',
'Page' => 'Halaman', 'Page' => 'Halaman',
'last' => 'terakhir', 'last' => 'terakhir',
'Last page' => 'Halaman terakhir',
'whole result' => 'Seluruh hasil', 'whole result' => 'Seluruh hasil',
'%d byte(s)' => '%d bita', '%d byte(s)' => '%d bita',

View File

@@ -190,7 +190,7 @@ $translations = array(
'%d item(s) have been affected.' => array('Il risultato consiste in %d elemento.', 'Il risultato consiste in %d elementi.'), '%d item(s) have been affected.' => array('Il risultato consiste in %d elemento.', 'Il risultato consiste in %d elementi.'),
'whole result' => 'intero risultato', 'whole result' => 'intero risultato',
'Clone' => 'Clona', 'Clone' => 'Clona',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Troppi campi. Per favore aumentare %s e %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Troppi campi. Per favore aumentare %s.',
'Partition by' => 'Partiziona per', 'Partition by' => 'Partiziona per',
'Partitions' => 'Partizioni', 'Partitions' => 'Partizioni',
'Partition name' => 'Nome partizione', 'Partition name' => 'Nome partizione',
@@ -258,7 +258,6 @@ $translations = array(
'Attachments' => 'Allegati', 'Attachments' => 'Allegati',
'%d query(s) executed OK.' => array('%d query eseguita con successo.', '%d query eseguite con successo.'), '%d query(s) executed OK.' => array('%d query eseguita con successo.', '%d query eseguite con successo.'),
'Show only errors' => 'Mostra solo gli errori', 'Show only errors' => 'Mostra solo gli errori',
'Last page' => 'Ultima pagina',
'Refresh' => 'Aggiorna', 'Refresh' => 'Aggiorna',
'Invalid schema.' => 'Schema non valido.', 'Invalid schema.' => 'Schema non valido.',
'Please use one of the extensions %s.' => 'Usa una delle estensioni %s.', 'Please use one of the extensions %s.' => 'Usa una delle estensioni %s.',

View File

@@ -189,7 +189,7 @@ $translations = array(
'whole result' => '全結果', 'whole result' => '全結果',
'Tables have been dropped.' => 'テーブルを削除しました', 'Tables have been dropped.' => 'テーブルを削除しました',
'Clone' => 'クローン', 'Clone' => 'クローン',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => '定義可能な最大フィールド数を越えました。%s と %s を増やしてください。', 'Maximum number of allowed fields exceeded. Please increase %s.' => '定義可能な最大フィールド数を越えました。%s を増やしてください。',
'Partition by' => 'パーティション', 'Partition by' => 'パーティション',
'Partitions' => 'パーティション', 'Partitions' => 'パーティション',
'Partition name' => 'パーティション名', 'Partition name' => 'パーティション名',
@@ -258,7 +258,6 @@ $translations = array(
'now' => '現在の日時', 'now' => '現在の日時',
'%d query(s) executed OK.' => '%d クエリーを実行しました', '%d query(s) executed OK.' => '%d クエリーを実行しました',
'Show only errors' => 'エラーのみ表示', 'Show only errors' => 'エラーのみ表示',
'Last page' => '最後のページ',
'Refresh' => 'リフレッシュ', 'Refresh' => 'リフレッシュ',
'Invalid schema.' => '無効なスキーマ', 'Invalid schema.' => '無効なスキーマ',
'Please use one of the extensions %s.' => 'いずれかの拡張機能を使ってください %s', 'Please use one of the extensions %s.' => 'いずれかの拡張機能を使ってください %s',

270
adminer/lang/ko.inc.php Normal file
View File

@@ -0,0 +1,270 @@
<?php
$translations = array(
'Login' => '로그인',
'Logout successful.' => '로그아웃',
'Invalid credentials.' => '잘못된 로그인',
'Server' => '서버',
'Username' => '사용자이름',
'Password' => '비밀번호',
'Select database' => '데이터베이스를 선택하십시오.',
'Invalid database.' => '잘못된 데이터베이스입니다.',
'Create new 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 dropped.' => '데이터베이스를 삭제했습니다.',
'Database has been created.' => '데이터베이스를 만들었습니다.',
'Database has been renamed.' => '데이터베이스의 이름을 바꾸었습니다.',
'Database has been altered.' => '데이터베이스를 변경했습니다.',
'Alter database' => '데이터베이스 변경',
'Create database' => '데이터베이스 만들기',
'SQL command' => 'SQL 명령',
'Dump' => '덤프',
'Logout' => '로그아웃',
'database' => '데이터베이스',
'Use' => '사용',
'No tables.' => '테이블이 없습니다.',
'select' => '선택',
'Create new table' => '테이블 만들기',
'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.' => '잘못된 CSRF 토큰. 다시 보내주십시오.',
'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 DELETE',
'ON UPDATE' => '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' => '이벤트',
'%s version: %s through PHP extension %s' => '%s 버전 %s, PHP 확장 %s',
'%d row(s)' => '%d 행',
'Remove' => '제외',
'Are you sure?' => '실행 하시겠습니까?',
'Privileges' => '권한',
'Create user' => '사용자 만들기',
'User has been dropped.' => '사용자 삭제',
'User has been altered.' => '사용자 변경',
'User has been created.' => '사용자 만들기',
'Hashed' => 'Hashed',
'Column' => '열',
'Routine' => '루틴',
'Grant' => '권한 부여',
'Revoke' => '권한 취소',
'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' => '지정 시간',
'Tables have been truncated.' => '테이블을 truncate했습니다.',
'Tables have been moved.' => '테이블을 옮겼습니다.',
'Tables and views' => '테이블과 뷰',
'Engine' => '엔진',
'Collation' => '정렬',
'Data Length' => '데이터 길이',
'Index Length' => '인덱스 길이',
'Data Free' => '여유',
'Rows' => '행',
',' => ',',
'Analyze' => '분석',
'Optimize' => '최적화',
'Check' => '확인',
'Repair' => '복구',
'Truncate' => 'Truncate',
'Move to other database' => '다른 데이터베이스로 이동',
'Move' => '이동',
'Save and continue edit' => '저장하고 계속',
'original' => '원래',
'%d item(s) have been affected.' => '%d를 갱신했습니다.',
'whole result' => '모든 결과',
'Tables have been dropped.' => '테이블을 삭제했습니다.',
'Clone' => '복제',
'Maximum number of allowed fields exceeded. Please increase %s.' => '정의 가능한 최대 필드 수를 초과했습니다. %s를 늘리십시오.',
'Partition by' => '파티션',
'Partitions' => '파티션',
'Partition name' => '파티션 이름',
'Values' => '값',
'%d row(s) have been imported.' => '%d 행을 가져 왔습니다.',
'Show structure' => '구조',
'anywhere' => '모든',
'Import' => '가져 오기',
'Stop on error' => '오류의 경우 중지',
'Select data' => '데이터',
'%.3f s' => '%.3f 초',
'$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' => 'Web 서버 파일 %s',
'File does not exist.' => '파일이 존재하지 않습니다.',
'%d in total' => '총 %d',
'Permanent login' => '영구적으로 로그인',
'Databases have been dropped.' => '데이터베이스를 삭제했습니다.',
'Search data in tables' => '데이터 검색',
'schema' => '스키마',
'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' => '데이터베이스 형식',
'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' => 'ltr',
'Tables have been copied.' => '테이블을 복사했습니다',
'Copy' => '복사',
'Permanent link' => '영구 링크',
'Edit all' => '모든 편집',
'HH:MM:SS' => '시:분:초',
);

View File

@@ -165,7 +165,7 @@ $translations = array(
'Move up' => 'Perkelti į viršų', 'Move up' => 'Perkelti į viršų',
'Move down' => 'Perkelti žemyn', 'Move down' => 'Perkelti žemyn',
'Remove' => 'Pašalinti', 'Remove' => 'Pašalinti',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Viršytas maksimalus leidžiamų stulpelių kiekis. Padidinkite %s ir %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Viršytas maksimalus leidžiamų stulpelių kiekis. Padidinkite %s.',
'Partition by' => 'Skirstyti pagal', 'Partition by' => 'Skirstyti pagal',
'Partitions' => 'Skirsniai', 'Partitions' => 'Skirsniai',
@@ -231,7 +231,6 @@ $translations = array(
'%d row(s)' => array('%d įrašas', '%d įrašai', '%d įrašų'), '%d row(s)' => array('%d įrašas', '%d įrašai', '%d įrašų'),
'Page' => 'Puslapis', 'Page' => 'Puslapis',
'last' => 'paskutinis', 'last' => 'paskutinis',
'Last page' => 'Paskutinis puslapis',
'whole result' => 'visas rezultatas', 'whole result' => 'visas rezultatas',
'%d byte(s)' => array('%d baitas', '%d baigai', '%d baitų'), '%d byte(s)' => array('%d baitas', '%d baigai', '%d baitų'),

View File

@@ -191,7 +191,7 @@ $translations = array(
'%d item(s) have been affected.' => array('%d item aangepast.', '%d items aangepast.'), '%d item(s) have been affected.' => array('%d item aangepast.', '%d items aangepast.'),
'whole result' => 'volledig resultaat', 'whole result' => 'volledig resultaat',
'Clone' => 'Dupliceer', 'Clone' => 'Dupliceer',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Maximum aantal velden bereikt. Verhoog %s en %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Maximum aantal velden bereikt. Verhoog %s.',
'Partition by' => 'Partitioneren op', 'Partition by' => 'Partitioneren op',
'Partitions' => 'Partities', 'Partitions' => 'Partities',
'Partition name' => 'Partitie naam', 'Partition name' => 'Partitie naam',
@@ -258,7 +258,6 @@ $translations = array(
'Attachments' => 'Bijlagen', 'Attachments' => 'Bijlagen',
'%d query(s) executed OK.' => array('%d query succesvol uitgevoerd.', '%d querys succesvol uitgevoerd'), '%d query(s) executed OK.' => array('%d query succesvol uitgevoerd.', '%d querys succesvol uitgevoerd'),
'Show only errors' => 'Enkel fouten tonen', 'Show only errors' => 'Enkel fouten tonen',
'Last page' => 'Laatste pagina',
'Refresh' => 'Vernieuwen', 'Refresh' => 'Vernieuwen',
'Invalid schema.' => 'Ongeldig schema.', 'Invalid schema.' => 'Ongeldig schema.',
'Please use one of the extensions %s.' => 'Gebruik 1 van volgende extensies: %s.', 'Please use one of the extensions %s.' => 'Gebruik 1 van volgende extensies: %s.',

View File

@@ -166,7 +166,7 @@ $translations = array(
'Move up' => 'Przesuń w górę', 'Move up' => 'Przesuń w górę',
'Move down' => 'Przesuń w dół', 'Move down' => 'Przesuń w dół',
'Remove' => 'Usuń', 'Remove' => 'Usuń',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Przekroczono maksymalną liczbę pól. Zwiększ %s i %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Przekroczono maksymalną liczbę pól. Zwiększ %s.',
'Partition by' => 'Partycjonowanie', 'Partition by' => 'Partycjonowanie',
'Partitions' => 'Partycje', 'Partitions' => 'Partycje',
@@ -227,12 +227,14 @@ $translations = array(
'Limit' => 'Limit', 'Limit' => 'Limit',
'Text length' => 'Długość tekstu', 'Text length' => 'Długość tekstu',
'Action' => 'Czynność', 'Action' => 'Czynność',
'Full table scan' => 'Wymaga pełnego przeskanowania tabeli',
'Unable to select the table' => 'Nie udało się pobrać danych z tabeli', 'Unable to select the table' => 'Nie udało się pobrać danych z tabeli',
'No rows.' => 'Brak rekordów.', 'No rows.' => 'Brak rekordów.',
'%d row(s)' => array('%d rekord', '%d rekordy', '%d rekordów'), '%d row(s)' => array('%d rekord', '%d rekordy', '%d rekordów'),
'Page' => 'Strona', 'Page' => 'Strona',
'last' => 'ostatni', 'last' => 'ostatni',
'Last page' => 'Ostatnia strona', 'Load more data' => 'Wczytaj więcej danych',
'Loading' => 'Wczytywanie',
'whole result' => 'wybierz wszystkie', 'whole result' => 'wybierz wszystkie',
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtów'), '%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtów'),
@@ -260,6 +262,7 @@ $translations = array(
'Save and insert next' => 'Zapisz i dodaj następny', 'Save and insert next' => 'Zapisz i dodaj następny',
'Clone' => 'Duplikuj', 'Clone' => 'Duplikuj',
'Delete' => 'Usuń', 'Delete' => 'Usuń',
'You have no privileges to update this table.' => 'Brak uprawnień do edycji tej tabeli',
'E-mail' => 'E-mail', 'E-mail' => 'E-mail',
'From' => 'Nadawca', 'From' => 'Nadawca',

View File

@@ -190,7 +190,7 @@ $translations = array(
'%d item(s) have been affected.' => array('%d item afetado.', '%d itens afetados.'), '%d item(s) have been affected.' => array('%d item afetado.', '%d itens afetados.'),
'whole result' => 'resultado completo', 'whole result' => 'resultado completo',
'Clone' => 'Clonar', 'Clone' => 'Clonar',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Quantidade máxima de campos permitidos excedidos. Por favor aumente %s e %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Quantidade máxima de campos permitidos excedidos. Por favor aumente %s.',
'Partition by' => 'Particionar por', 'Partition by' => 'Particionar por',
'Partitions' => 'Partições', 'Partitions' => 'Partições',
'Partition name' => 'Nome da Partição', 'Partition name' => 'Nome da Partição',
@@ -258,7 +258,6 @@ $translations = array(
'Attachments' => 'Anexos', 'Attachments' => 'Anexos',
'%d query(s) executed OK.' => array('%d consulta sql executada corretamente.', '%d consultas sql executadas corretamente.'), '%d query(s) executed OK.' => array('%d consulta sql executada corretamente.', '%d consultas sql executadas corretamente.'),
'Show only errors' => 'Mostrar somente erros', 'Show only errors' => 'Mostrar somente erros',
'Last page' => 'Última página',
'Refresh' => 'Atualizar', 'Refresh' => 'Atualizar',
'Invalid schema.' => 'Esquema inválido.', 'Invalid schema.' => 'Esquema inválido.',
'Please use one of the extensions %s.' => 'Por favor use uma das extensões %s.', 'Please use one of the extensions %s.' => 'Por favor use uma das extensões %s.',

View File

@@ -197,7 +197,7 @@ $translations = array(
'%d row(s) have been imported.' => array('%d rînd importat.', '%d rînduri importate.'), '%d row(s) have been imported.' => array('%d rînd importat.', '%d rînduri importate.'),
'Import' => 'Importă', 'Import' => 'Importă',
'Stop on error' => 'Opreștete la eroare', 'Stop on error' => 'Opreștete la eroare',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Numărul maxim de înscrieri disponibile a fost atins. Majorați %s și %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Numărul maxim de înscrieri disponibile a fost atins. Majorați %s.',
'anywhere' => 'oriunde', 'anywhere' => 'oriunde',
'%.3f s' => '%.3f s', '%.3f s' => '%.3f s',
'$1-$3-$5' => '$5.$3.$1', '$1-$3-$5' => '$5.$3.$1',
@@ -258,7 +258,6 @@ $translations = array(
'Attachments' => 'Fișiere atașate', 'Attachments' => 'Fișiere atașate',
'%d query(s) executed OK.' => array('%d query executat.', '%d query-uri executate cu succes.'), '%d query(s) executed OK.' => array('%d query executat.', '%d query-uri executate cu succes.'),
'Show only errors' => 'Arată doar greșeli', 'Show only errors' => 'Arată doar greșeli',
'Last page' => 'Ultima pagină',
'Refresh' => 'Împrospătează', 'Refresh' => 'Împrospătează',
'Invalid schema.' => 'Schemă incorectă.', 'Invalid schema.' => 'Schemă incorectă.',
'Please use one of the extensions %s.' => 'Folosiți una din următoarele extensii %s.', 'Please use one of the extensions %s.' => 'Folosiți una din următoarele extensii %s.',

View File

@@ -197,7 +197,7 @@ $translations = array(
'%d row(s) have been imported.' => array('Импортирована %d строка.', 'Импортировано %d строки.', 'Импортировано %d строк.'), '%d row(s) have been imported.' => array('Импортирована %d строка.', 'Импортировано %d строки.', 'Импортировано %d строк.'),
'Import' => 'Импорт', 'Import' => 'Импорт',
'Stop on error' => 'Остановить при ошибке', 'Stop on error' => 'Остановить при ошибке',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Достигнуто максимальное значение количества доступных полей. Увеличьте %s и %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Достигнуто максимальное значение количества доступных полей. Увеличьте %s.',
'anywhere' => 'в любом месте', 'anywhere' => 'в любом месте',
'%.3f s' => '%.3f s', '%.3f s' => '%.3f s',
'$1-$3-$5' => '$5.$3.$1', '$1-$3-$5' => '$5.$3.$1',
@@ -258,7 +258,6 @@ $translations = array(
'Attachments' => 'Прикрепленные файлы', 'Attachments' => 'Прикрепленные файлы',
'%d query(s) executed OK.' => array('%d запрос выполнен успешно.', '%d запроса выполнено успешно.', '%d запросов выполнено успешно.'), '%d query(s) executed OK.' => array('%d запрос выполнен успешно.', '%d запроса выполнено успешно.', '%d запросов выполнено успешно.'),
'Show only errors' => 'Только ошибки', 'Show only errors' => 'Только ошибки',
'Last page' => 'Последняя страница',
'Refresh' => 'Обновить', 'Refresh' => 'Обновить',
'Invalid schema.' => 'Неправильная схема.', 'Invalid schema.' => 'Неправильная схема.',
'Please use one of the extensions %s.' => 'Используйте одно из этих расширений %s.', 'Please use one of the extensions %s.' => 'Используйте одно из этих расширений %s.',

View File

@@ -198,7 +198,7 @@ $translations = array(
'%d row(s) have been imported.' => array('Bol importovaný %d záznam.', 'Boli importované %d záznamy.', 'Bolo importovaných %d záznamov.'), '%d row(s) have been imported.' => array('Bol importovaný %d záznam.', 'Boli importované %d záznamy.', 'Bolo importovaných %d záznamov.'),
'Import' => 'Import', 'Import' => 'Import',
'Stop on error' => 'Zastaviť pri chybe', 'Stop on error' => 'Zastaviť pri chybe',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Bol prekročený maximálny počet povolených polí. Zvýšte prosím %s a %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Bol prekročený maximálny počet povolených polí. Zvýšte prosím %s.',
'anywhere' => 'kdekoľvek', 'anywhere' => 'kdekoľvek',
'%.3f s' => '%.3f s', '%.3f s' => '%.3f s',
'$1-$3-$5' => '$6.$4.$1', '$1-$3-$5' => '$6.$4.$1',
@@ -258,7 +258,6 @@ $translations = array(
'Attachments' => 'Prílohy', 'Attachments' => 'Prílohy',
'%d query(s) executed OK.' => array('Bol vykonaný %d dotaz.', 'Boli vykonané %d dotazy.', 'Bolo vykonaných %d dotazov.'), '%d query(s) executed OK.' => array('Bol vykonaný %d dotaz.', 'Boli vykonané %d dotazy.', 'Bolo vykonaných %d dotazov.'),
'Show only errors' => 'Zobraziť iba chyby', 'Show only errors' => 'Zobraziť iba chyby',
'Last page' => 'Posledná stránka',
'Refresh' => 'Obnoviť', 'Refresh' => 'Obnoviť',
'Invalid schema.' => 'Neplatné schéma.', 'Invalid schema.' => 'Neplatné schéma.',
'Please use one of the extensions %s.' => 'Prosím vyberte jednu z koncoviek %s.', 'Please use one of the extensions %s.' => 'Prosím vyberte jednu z koncoviek %s.',

View File

@@ -161,7 +161,7 @@ $translations = array(
'Move up' => 'Premakni gor', 'Move up' => 'Premakni gor',
'Move down' => 'Premakni dol', 'Move down' => 'Premakni dol',
'Remove' => 'Odstrani', 'Remove' => 'Odstrani',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Največje število dovoljenih polje je preseženo. Prosimo, povečajte %s in %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Največje število dovoljenih polje je preseženo. Prosimo, povečajte %s.',
'Partition by' => 'Porazdeli po', 'Partition by' => 'Porazdeli po',
'Partitions' => 'Porazdelitve', 'Partitions' => 'Porazdelitve',
@@ -227,7 +227,6 @@ $translations = array(
'%d row(s)' => array('%d vrstica', '%d vrstici', '%d vrstice', '%d vrstic'), '%d row(s)' => array('%d vrstica', '%d vrstici', '%d vrstice', '%d vrstic'),
'Page' => 'Stran', 'Page' => 'Stran',
'last' => 'Zadnja', 'last' => 'Zadnja',
'Last page' => 'Zadnja stran',
'whole result' => 'cel razultat', 'whole result' => 'cel razultat',
'%d byte(s)' => array('%d bajt', '%d bajta', '%d bajti', '%d bajtov'), '%d byte(s)' => array('%d bajt', '%d bajta', '%d bajti', '%d bajtov'),

View File

@@ -166,7 +166,7 @@ $translations = array(
'Move up' => 'Помери на горе', 'Move up' => 'Помери на горе',
'Move down' => 'Помери на доле', 'Move down' => 'Помери на доле',
'Remove' => 'Уклони', 'Remove' => 'Уклони',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Премашен је максимални број дозвољених поља. Молим увећајте %s и %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Премашен је максимални број дозвољених поља. Молим увећајте %s.',
'Partition by' => 'Подели по', 'Partition by' => 'Подели по',
'Partitions' => 'Поделе', 'Partitions' => 'Поделе',
@@ -233,7 +233,6 @@ $translations = array(
'%d row(s)' => array('%d ред', '%d реда', '%d редова'), '%d row(s)' => array('%d ред', '%d реда', '%d редова'),
'Page' => 'Страна', 'Page' => 'Страна',
'last' => 'последња', 'last' => 'последња',
'Last page' => 'Последња страна',
'Loading' => 'Учитавам', 'Loading' => 'Учитавам',
'Load more data' => 'Учитавам још података', 'Load more data' => 'Учитавам још података',
'whole result' => 'цео резултат', 'whole result' => 'цео резултат',

View File

@@ -187,7 +187,7 @@ $translations = array(
'%d item(s) have been affected.' => array('%d உருப்ப‌டி மாற்ற‌ம‌டைந்தது.', '%d உருப்ப‌டிக‌ள் மாற்ற‌ம‌டைந்த‌ன‌.'), '%d item(s) have been affected.' => array('%d உருப்ப‌டி மாற்ற‌ம‌டைந்தது.', '%d உருப்ப‌டிக‌ள் மாற்ற‌ம‌டைந்த‌ன‌.'),
'whole result' => 'முழுமையான‌ முடிவு', 'whole result' => 'முழுமையான‌ முடிவு',
'Clone' => 'ந‌க‌லி (Clone)', 'Clone' => 'ந‌க‌லி (Clone)',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'அனும‌திக்க‌ப்ப‌ட்ட‌ அதிக‌ப‌ட்ச‌ கோப்புக‌ளின் எண்ணிக்கை மீற‌ப்ப‌ட்ட‌து. த‌ய‌வு செய்து %s ம‌ற்றும் %s யை அதிக‌ரிக்க‌வும்.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'அனும‌திக்க‌ப்ப‌ட்ட‌ அதிக‌ப‌ட்ச‌ கோப்புக‌ளின் எண்ணிக்கை மீற‌ப்ப‌ட்ட‌து. த‌ய‌வு செய்து %s ம‌ற்றும் %s யை அதிக‌ரிக்க‌வும்.',
'Partition by' => 'பிரித்த‌து', 'Partition by' => 'பிரித்த‌து',
'Partitions' => 'பிரிவுக‌ள்', 'Partitions' => 'பிரிவுக‌ள்',
'Partition name' => 'பிரிவின் பெய‌ர்', 'Partition name' => 'பிரிவின் பெய‌ர்',
@@ -258,7 +258,6 @@ $translations = array(
'now' => 'இப்பொழுது', 'now' => 'இப்பொழுது',
'%d query(s) executed OK.' => array('%d வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து.', '%d வின‌வ‌ல்க‌ள் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌ன‌.'), '%d query(s) executed OK.' => array('%d வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து.', '%d வின‌வ‌ல்க‌ள் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌ன‌.'),
'Show only errors' => 'பிழைக‌ளை ம‌ட்டும் காண்பிக்க‌வும்', 'Show only errors' => 'பிழைக‌ளை ம‌ட்டும் காண்பிக்க‌வும்',
'Last page' => 'க‌டைசி ப‌க்க‌ம்',
'Refresh' => 'புதுப்பி (Refresh)', 'Refresh' => 'புதுப்பி (Refresh)',
'Invalid schema.' => 'அமைப்புமுறை ச‌ரியான‌த‌ல்ல‌ (Invalid Schema).', 'Invalid schema.' => 'அமைப்புமுறை ச‌ரியான‌த‌ல்ல‌ (Invalid Schema).',
'Please use one of the extensions %s.' => 'த‌ய‌வு செய்து ஒரு விரிவினை %s (extension) உப‌யோகிக்க‌வும்.', 'Please use one of the extensions %s.' => 'த‌ய‌வு செய்து ஒரு விரிவினை %s (extension) உப‌யோகிக்க‌வும்.',

View File

@@ -166,7 +166,7 @@ $translations = array(
'Move up' => 'Yukarı taşı', 'Move up' => 'Yukarı taşı',
'Move down' => 'Aşağı taşı', 'Move down' => 'Aşağı taşı',
'Remove' => 'Sil', 'Remove' => 'Sil',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'İzin verilen en fazla alan sayısııldı. Lütfen %s ve %s değerlerini artırın.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'İzin verilen en fazla alan sayısııldı. Lütfen %s değerlerini artırın.',
'Partition by' => 'Bununla bölümle', 'Partition by' => 'Bununla bölümle',
'Partitions' => 'Bölümler', 'Partitions' => 'Bölümler',
@@ -233,7 +233,6 @@ $translations = array(
'%d row(s)' => array('%d kayıt', '%d adet kayıt'), '%d row(s)' => array('%d kayıt', '%d adet kayıt'),
'Page' => 'Sayfa', 'Page' => 'Sayfa',
'last' => 'son', 'last' => 'son',
'Last page' => 'Son sayfa',
'Load more data' => 'Daha fazla veri yükle', 'Load more data' => 'Daha fazla veri yükle',
'Loading' => 'Yükleniyor', 'Loading' => 'Yükleniyor',
'whole result' => 'tüm sonuç', 'whole result' => 'tüm sonuç',

View File

@@ -166,7 +166,7 @@ $translations = array(
'Move up' => 'Пересунути вгору', 'Move up' => 'Пересунути вгору',
'Move down' => 'Пересунути вниз', 'Move down' => 'Пересунути вниз',
'Remove' => 'Видалити', 'Remove' => 'Видалити',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Досягнута максимальна кількість доступних полів. Будь ласка, збільшіть %s і %s.', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'Досягнута максимальна кількість доступних полів. Будь ласка, збільшіть %s.',
'Partition by' => 'Розділити по', 'Partition by' => 'Розділити по',
'Partitions' => 'Розділи', 'Partitions' => 'Розділи',
@@ -232,7 +232,6 @@ $translations = array(
'%d row(s)' => array('%d рядок', '%d рядки', '%d рядків'), '%d row(s)' => array('%d рядок', '%d рядки', '%d рядків'),
'Page' => 'Сторінка', 'Page' => 'Сторінка',
'last' => 'остання', 'last' => 'остання',
'Last page' => 'Остання сторінка',
'whole result' => 'весь результат', 'whole result' => 'весь результат',
'%d byte(s)' => array('%d байт', '%d байта', '%d байтів'), '%d byte(s)' => array('%d байт', '%d байта', '%d байтів'),

View File

@@ -11,6 +11,7 @@ $translations = array(
'Logged as: %s' => 'xx', 'Logged as: %s' => 'xx',
'Logout successful.' => 'xx', 'Logout successful.' => 'xx',
'Invalid credentials.' => 'xx', 'Invalid credentials.' => 'xx',
'Master password expired. <a href="http://www.adminer.org/en/extension/" target="_blank">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',
'No extension' => 'xx', 'No extension' => 'xx',
@@ -64,6 +65,7 @@ $translations = array(
'Unable to upload a file.' => 'xx', 'Unable to upload a file.' => 'xx',
'Maximum allowed file size is %sB.' => 'xx', 'Maximum allowed file size is %sB.' => 'xx',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'xx', 'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'xx',
'You can upload a big SQL file via FTP and import it from server.' => 'xx',
'Export' => 'xx', 'Export' => 'xx',
'Dump' => 'xx', 'Dump' => 'xx',
@@ -166,7 +168,7 @@ $translations = array(
'Move up' => 'xx', 'Move up' => 'xx',
'Move down' => 'xx', 'Move down' => 'xx',
'Remove' => 'xx', 'Remove' => 'xx',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'xx', 'Maximum number of allowed fields exceeded. Please increase %s.' => 'xx',
'Partition by' => 'xx', 'Partition by' => 'xx',
'Partitions' => 'xx', 'Partitions' => 'xx',
@@ -233,7 +235,6 @@ $translations = array(
'%d row(s)' => array('xx', 'xx'), '%d row(s)' => array('xx', 'xx'),
'Page' => 'xx', 'Page' => 'xx',
'last' => 'xx', 'last' => 'xx',
'Last page' => 'xx',
'Load more data' => 'xx', 'Load more data' => 'xx',
'Loading' => 'xx', 'Loading' => 'xx',
'whole result' => 'xx', 'whole result' => 'xx',
@@ -241,6 +242,7 @@ $translations = array(
'Import' => 'xx', 'Import' => 'xx',
'%d row(s) have been imported.' => array('xx', 'xx'), '%d row(s) have been imported.' => array('xx', 'xx'),
'File must be in UTF-8 encoding.' => 'xx',
// in-place editing in select // in-place editing in select
'Ctrl+click on a value to modify it.' => 'xx', 'Ctrl+click on a value to modify it.' => 'xx',

View File

@@ -188,7 +188,7 @@ $translations = array(
'whole result' => '所有結果', 'whole result' => '所有結果',
'Tables have been dropped.' => '已丟棄表。', 'Tables have been dropped.' => '已丟棄表。',
'Clone' => '複製', 'Clone' => '複製',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => '超過最多允許的字段數量。請增加%s和%s 。', 'Maximum number of allowed fields exceeded. Please increase %s.' => '超過最多允許的字段數量。請增加%s。',
'Partition by' => '分區類型', 'Partition by' => '分區類型',
'Partitions' => '分區', 'Partitions' => '分區',
'Partition name' => '分區名', 'Partition name' => '分區名',
@@ -257,7 +257,6 @@ $translations = array(
'Attachments' => '附件', 'Attachments' => '附件',
'%d query(s) executed OK.' => '已順利執行 %d 個查詢。', '%d query(s) executed OK.' => '已順利執行 %d 個查詢。',
'Show only errors' => '僅顯示錯誤訊息', 'Show only errors' => '僅顯示錯誤訊息',
'Last page' => '最後一頁',
'Refresh' => '重新載入', 'Refresh' => '重新載入',
'Invalid schema.' => '無效的資料表結構。', 'Invalid schema.' => '無效的資料表結構。',
'Please use one of the extensions %s.' => '請使用下列其中一個 extension %s。', 'Please use one of the extensions %s.' => '請使用下列其中一個 extension %s。',

View File

@@ -190,7 +190,7 @@ $translations = array(
'whole result' => '所有结果', 'whole result' => '所有结果',
'Tables have been dropped.' => '已丢弃表。', 'Tables have been dropped.' => '已丢弃表。',
'Clone' => '克隆', 'Clone' => '克隆',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => '超过最多允许的字段数量。请增加 %s 和 %s 。', 'Maximum number of allowed fields exceeded. Please increase %s.' => '超过最多允许的字段数量。请增加 %s。',
'Partition by' => '分区类型', 'Partition by' => '分区类型',
'Partitions' => '分区', 'Partitions' => '分区',
'Partition name' => '分区名', 'Partition name' => '分区名',
@@ -257,7 +257,6 @@ $translations = array(
'Attachments' => '附件', 'Attachments' => '附件',
'%d query(s) executed OK.' => '%d 条查询已成功执行。', '%d query(s) executed OK.' => '%d 条查询已成功执行。',
'Show only errors' => '仅显示错误', 'Show only errors' => '仅显示错误',
'Last page' => '末页',
'Refresh' => '刷新', 'Refresh' => '刷新',
'Invalid schema.' => '非法模式。', 'Invalid schema.' => '非法模式。',
'Please use one of the extensions %s.' => '请使用这些扩展中的一个:%s。', 'Please use one of the extensions %s.' => '请使用这些扩展中的一个:%s。',

View File

@@ -11,13 +11,17 @@ function adminer_object() {
$plugins = array( $plugins = array(
// specify enabled plugins here // specify enabled plugins here
new AdminerDatabaseHide(array('information_schema')), new AdminerDatabaseHide(array('information_schema')),
new AdminerDumpJson,
new AdminerDumpBz2,
new AdminerDumpZip, new AdminerDumpZip,
new AdminerDumpXml, new AdminerDumpXml,
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 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 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(""),
new AdminerJsonColumn,
new AdminerSlugify, new AdminerSlugify,
new AdminerTranslation, new AdminerTranslation,
new AdminerForeignSystem, new AdminerForeignSystem,

View File

@@ -7,18 +7,22 @@ if (!$result) {
// list logged user, information_schema.USER_PRIVILEGES lists just the current user too // list logged user, information_schema.USER_PRIVILEGES lists just the current user too
$result = $connection->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host"); $result = $connection->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
} }
echo "<form action=''><p>\n"; echo "<form action=''><p>\n";
hidden_fields_get(); hidden_fields_get();
echo "<input type='hidden' name='db' value='" . h(DB) . "'>\n"; echo "<input type='hidden' name='db' value='" . h(DB) . "'>\n";
echo ($grant ? "" : "<input type='hidden' name='grant' value=''>\n"); echo ($grant ? "" : "<input type='hidden' name='grant' value=''>\n");
echo "<table cellspacing='0'>\n"; echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Username') . "<th>" . lang('Server') . "<th>&nbsp;</thead>\n"; echo "<thead><tr><th>" . lang('Username') . "<th>" . lang('Server') . "<th>&nbsp;</thead>\n";
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
echo '<tr' . odd() . '><td>' . h($row["User"]) . "<td>" . h($row["Host"]) . '<td><a href="' . h(ME . 'user=' . urlencode($row["User"]) . '&host=' . urlencode($row["Host"])) . '">' . lang('Edit') . "</a>\n"; echo '<tr' . odd() . '><td>' . h($row["User"]) . "<td>" . h($row["Host"]) . '<td><a href="' . h(ME . 'user=' . urlencode($row["User"]) . '&host=' . urlencode($row["Host"])) . '">' . lang('Edit') . "</a>\n";
} }
if (!$grant || DB != "") { if (!$grant || DB != "") {
echo "<tr" . odd() . "><td><input name='user'><td><input name='host' value='localhost'><td><input type='submit' value='" . lang('Edit') . "'>\n"; echo "<tr" . odd() . "><td><input name='user' autocapitalize='off'><td><input name='host' value='localhost' autocapitalize='off'><td><input type='submit' value='" . lang('Edit') . "'>\n";
} }
echo "</table>\n"; echo "</table>\n";
echo "</form>\n"; echo "</form>\n";

View File

@@ -1,46 +1,40 @@
<?php <?php
$PROCEDURE = $_GET["procedure"]; $PROCEDURE = $_GET["procedure"];
$routine = (isset($_GET["function"]) ? "FUNCTION" : "PROCEDURE"); $routine = (isset($_GET["function"]) ? "FUNCTION" : "PROCEDURE");
$routine_languages = routine_languages(); $row = $_POST;
$row["fields"] = (array) $row["fields"];
$dropped = false; if ($_POST && !process_fields($row["fields"]) && !$error) {
if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] && !$_POST["down"]) { $temp_name = "$row[name]_adminer_" . uniqid();
$set = array(); drop_create(
$fields = (array) $_POST["fields"];
ksort($fields); // enforce fields order
foreach ($fields as $field) {
if ($field["field"] != "") {
$set[] = (ereg("^($inout)\$", $field["inout"]) ? "$field[inout] " : "") . idf_escape($field["field"]) . process_type($field, "CHARACTER SET");
}
}
$dropped = drop_create(
"DROP $routine " . idf_escape($PROCEDURE), "DROP $routine " . idf_escape($PROCEDURE),
"CREATE $routine " . idf_escape(trim($_POST["name"])) . " (" . implode(", ", $set) . ")" . (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"], "CHARACTER SET") : "") . (in_array($_POST["language"], $routine_languages) ? " LANGUAGE $_POST[language]" : "") . rtrim("\n$_POST[definition]", ";") . ";", create_routine($routine, $row),
"DROP $routine " . idf_escape($row["name"]),
create_routine($routine, array("name" => $temp_name) + $row),
"DROP $routine " . idf_escape($temp_name),
substr(ME, 0, -1), substr(ME, 0, -1),
lang('Routine has been dropped.'), lang('Routine has been dropped.'),
lang('Routine has been altered.'), lang('Routine has been altered.'),
lang('Routine has been created.'), lang('Routine has been created.'),
$PROCEDURE $PROCEDURE,
$row["name"]
); );
} }
page_header(($PROCEDURE != "" ? (isset($_GET["function"]) ? lang('Alter function') : lang('Alter procedure')) . ": " . h($PROCEDURE) : (isset($_GET["function"]) ? lang('Create function') : lang('Create procedure'))), $error); page_header(($PROCEDURE != "" ? (isset($_GET["function"]) ? lang('Alter function') : lang('Alter procedure')) . ": " . h($PROCEDURE) : (isset($_GET["function"]) ? lang('Create function') : lang('Create procedure'))), $error);
$collations = get_vals("SHOW CHARACTER SET"); if (!$_POST && $PROCEDURE != "") {
sort($collations);
$row = array("fields" => array());
if ($_POST) {
$row = $_POST;
$row["fields"] = (array) $row["fields"];
process_fields($row["fields"]);
} elseif ($PROCEDURE != "") {
$row = routine($PROCEDURE, $routine); $row = routine($PROCEDURE, $routine);
$row["name"] = $PROCEDURE; $row["name"] = $PROCEDURE;
} }
$collations = get_vals("SHOW CHARACTER SET");
sort($collations);
$routine_languages = routine_languages();
?> ?>
<form action="" method="post" id="form"> <form action="" method="post" id="form">
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64"> <p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64" autocapitalize="off">
<?php echo ($routine_languages ? lang('Language') . ": " . html_select("language", $routine_languages, $row["language"]) : ""); ?> <?php echo ($routine_languages ? lang('Language') . ": " . html_select("language", $routine_languages, $row["language"]) : ""); ?>
<table cellspacing="0" class="nowrap"> <table cellspacing="0" class="nowrap">
<?php <?php
@@ -55,6 +49,5 @@ if (isset($_GET["function"])) {
<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(); ?>><?php } ?>
<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1"><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -18,16 +18,25 @@ page_header(lang('Process list'), $error);
// 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) {
if (!$i) { if (!$i) {
echo "<thead><tr lang='en'>" . (support("kill") ? "<th>&nbsp;" : "") . "<th>" . implode("<th>", array_keys($row)) . "</thead>\n"; echo "<thead><tr lang='en'>" . (support("kill") ? "<th>&nbsp;" : "");
foreach ($row as $key => $val) {
echo "<th>" . ($jush == "sql"
? "<a href='http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/show-processlist.html#processlist_" . strtolower($key) . "' target='_blank' rel='noreferrer' class='help'>$key</a>"
: $key
);
}
echo "</thead>\n";
} }
echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row["Id"], 0) : ""); echo "<tr" . odd() . ">" . (support("kill") ? "<td>" . checkbox("kill[]", $row["Id"], 0) : "");
foreach ($row as $key => $val) { foreach ($row as $key => $val) {
echo "<td>" . ( echo "<td>" . (
($jush == "sql" && $key == "Info" && ereg("Query|Killed", $row["Command"]) && $val != "") || ($jush == "sql" && $key == "Info" && ereg("Query|Killed", $row["Command"]) && $val != "") ||
($jush == "pgsql" && $key == "current_query" && $val != "<IDLE>") || ($jush == "pgsql" && $key == "current_query" && $val != "<IDLE>") ||
($jush == "oracle" && $key == "sql_text" && $val != "") ($jush == "oracle" && $key == "sql_text" && $val != "")
? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Edit') . '</a>' ? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Clone') . '</a>'
: nbsp($val) : nbsp($val)
); );
} }

View File

@@ -16,23 +16,23 @@ $base_left = -1;
$schema = array(); // table => array("fields" => array(name => field), "pos" => array(top, left), "references" => array(table => array(left => array(source, target)))) $schema = array(); // table => array("fields" => array(name => field), "pos" => array(top, left), "references" => array(table => array(left => array(source, target))))
$referenced = array(); // target_table => array(table => array(left => target_column)) $referenced = array(); // target_table => array(table => array(left => target_column))
$lefts = array(); // float => bool $lefts = array(); // float => bool
foreach (table_status() as $table_status) { foreach (table_status('', true) as $table => $table_status) {
if (!isset($table_status["Engine"])) { // view if (is_view($table_status)) {
continue; continue;
} }
$pos = 0; $pos = 0;
$schema[$table_status["Name"]]["fields"] = array(); $schema[$table]["fields"] = array();
foreach (fields($table_status["Name"]) as $name => $field) { foreach (fields($table) as $name => $field) {
$pos += 1.25; $pos += 1.25;
$field["pos"] = $pos; $field["pos"] = $pos;
$schema[$table_status["Name"]]["fields"][$name] = $field; $schema[$table]["fields"][$name] = $field;
} }
$schema[$table_status["Name"]]["pos"] = ($table_pos[$table_status["Name"]] ? $table_pos[$table_status["Name"]] : array($top, 0)); $schema[$table]["pos"] = ($table_pos[$table] ? $table_pos[$table] : array($top, 0));
foreach ($adminer->foreignKeys($table_status["Name"]) as $val) { foreach ($adminer->foreignKeys($table) as $val) {
if (!$val["db"]) { if (!$val["db"]) {
$left = $base_left; $left = $base_left;
if ($table_pos[$table_status["Name"]][1] || $table_pos[$val["table"]][1]) { if ($table_pos[$table][1] || $table_pos[$val["table"]][1]) {
$left = min(floatval($table_pos[$table_status["Name"]][1]), floatval($table_pos[$val["table"]][1])) - 1; $left = min(floatval($table_pos[$table][1]), floatval($table_pos[$val["table"]][1])) - 1;
} else { } else {
$base_left -= .1; $base_left -= .1;
} }
@@ -40,12 +40,12 @@ foreach (table_status() as $table_status) {
// find free $left // find free $left
$left -= .0001; $left -= .0001;
} }
$schema[$table_status["Name"]]["references"][$val["table"]][(string) $left] = array($val["source"], $val["target"]); $schema[$table]["references"][$val["table"]][(string) $left] = array($val["source"], $val["target"]);
$referenced[$val["table"]][$table_status["Name"]][(string) $left] = $val["target"]; $referenced[$val["table"]][$table][(string) $left] = $val["target"];
$lefts[(string) $left] = true; $lefts[(string) $left] = true;
} }
} }
$top = max($top, $schema[$table_status["Name"]]["pos"][0] + 2.5 + $pos); $top = max($top, $schema[$table]["pos"][0] + 2.5 + $pos);
} }
?> ?>
@@ -62,10 +62,12 @@ document.onmouseup = function (ev) {
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;' onmousedown='schemaMousedown(this, event);'>";
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>";
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>';
echo "<br>" . ($field["primary"] ? "<i>$val</i>" : $val); echo "<br>" . ($field["primary"] ? "<i>$val</i>" : $val);
} }
foreach ((array) $table["references"] as $target_name => $refs) { foreach ((array) $table["references"] as $target_name => $refs) {
foreach ($refs as $left => $ref) { foreach ($refs as $left => $ref) {
$left1 = $left - $table_pos[$name][1]; $left1 = $left - $table_pos[$name][1];
@@ -75,6 +77,7 @@ foreach ($schema as $name => $table) {
} }
} }
} }
foreach ((array) $referenced[$name] as $target_name => $refs) { foreach ((array) $referenced[$name] as $target_name => $refs) {
foreach ($refs as $left => $columns) { foreach ($refs as $left => $columns) {
$left1 = $left - $table_pos[$name][1]; $left1 = $left - $table_pos[$name][1];
@@ -84,8 +87,10 @@ foreach ($schema as $name => $table) {
} }
} }
} }
echo "\n</div>\n"; echo "\n</div>\n";
} }
foreach ($schema as $name => $table) { foreach ($schema as $name => $table) {
foreach ((array) $table["references"] as $target_name => $refs) { foreach ((array) $table["references"] as $target_name => $refs) {
foreach ($refs as $left => $ref) { foreach ($refs as $left => $ref) {

View File

@@ -1,10 +1,12 @@
<?php <?php
$row = $_POST;
if ($_POST && !$error) { if ($_POST && !$error) {
$link = preg_replace('~ns=[^&]*&~', '', ME) . "ns="; $link = preg_replace('~ns=[^&]*&~', '', ME) . "ns=";
if ($_POST["drop"]) { if ($_POST["drop"]) {
query_redirect("DROP SCHEMA " . idf_escape($_GET["ns"]), $link, lang('Schema has been dropped.')); query_redirect("DROP SCHEMA " . idf_escape($_GET["ns"]), $link, lang('Schema has been dropped.'));
} else { } else {
$name = trim($_POST["name"]); $name = trim($row["name"]);
$link .= urlencode($name); $link .= urlencode($name);
if ($_GET["ns"] == "") { if ($_GET["ns"] == "") {
query_redirect("CREATE SCHEMA " . idf_escape($name), $link, lang('Schema has been created.')); query_redirect("CREATE SCHEMA " . idf_escape($name), $link, lang('Schema has been created.'));
@@ -18,15 +20,14 @@ if ($_POST && !$error) {
page_header($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema'), $error); page_header($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema'), $error);
$row = $_POST;
if (!$row) { if (!$row) {
$row = array("name" => $_GET["ns"]); $row["name"] = $_GET["ns"];
} }
?> ?>
<form action="" method="post"> <form action="" method="post">
<p><input id="name" name="name" value="<?php echo h($row["name"]); ?>"> <p><input name="name" id="name" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
<script type='text/javascript'>document.getElementById('name').focus();</script> <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 ($_GET["ns"] != "") { if ($_GET["ns"] != "") {

View File

@@ -3,8 +3,8 @@ header("Content-Type: text/javascript; charset=utf-8");
if ($_GET["script"] == "db") { if ($_GET["script"] == "db") {
$sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0); $sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);
foreach (table_status() as $table_status) { foreach (table_status() as $name => $table_status) {
$id = js_escape($table_status["Name"]); $id = js_escape($name);
json_row("Comment-$id", nbsp($table_status["Comment"])); json_row("Comment-$id", nbsp($table_status["Comment"]));
if (!is_view($table_status)) { if (!is_view($table_status)) {
foreach (array("Engine", "Collation") as $key) { foreach (array("Engine", "Collation") as $key) {

View File

@@ -1,11 +1,11 @@
<?php <?php
$TABLE = $_GET["select"]; $TABLE = $_GET["select"];
$table_status = table_status($TABLE); $table_status = table_status1($TABLE);
$indexes = indexes($TABLE); $indexes = indexes($TABLE);
$fields = fields($TABLE); $fields = fields($TABLE);
$foreign_keys = column_foreign_keys($TABLE); $foreign_keys = column_foreign_keys($TABLE);
$oid = ""; $oid = "";
if ($table_status["Oid"] == "t") { if ($table_status["Oid"]) {
$oid = ($jush == "sqlite" ? "rowid" : "oid"); $oid = ($jush == "sqlite" ? "rowid" : "oid");
$indexes[] = array("type" => "PRIMARY", "columns" => array($oid)); $indexes[] = array("type" => "PRIMARY", "columns" => array($oid));
} }
@@ -17,7 +17,7 @@ $text_length = null;
foreach ($fields as $key => $field) { foreach ($fields as $key => $field) {
$name = $adminer->fieldName($field); $name = $adminer->fieldName($field);
if (isset($field["privileges"]["select"]) && $name != "") { if (isset($field["privileges"]["select"]) && $name != "") {
$columns[$key] = html_entity_decode(strip_tags($name)); $columns[$key] = html_entity_decode(strip_tags($name), ENT_QUOTES);
if (is_shortable($field)) { if (is_shortable($field)) {
$text_length = $adminer->selectLengthProcess(); $text_length = $adminer->selectLengthProcess();
} }
@@ -30,29 +30,26 @@ $is_group = count($group) < count($select);
$where = $adminer->selectSearchProcess($fields, $indexes); $where = $adminer->selectSearchProcess($fields, $indexes);
$order = $adminer->selectOrderProcess($fields, $indexes); $order = $adminer->selectOrderProcess($fields, $indexes);
$limit = $adminer->selectLimitProcess(); $limit = $adminer->selectLimitProcess();
$from = ($select ? implode(", ", $select) : "*" . ($oid ? ", $oid" : "")); $from = ($select ? implode(", ", $select) : "*" . ($oid ? ", $oid" : ""))
if ($jush == "sql") { . convert_fields($columns, $fields, $select)
foreach ($columns as $key => $val) { . "\nFROM " . table($TABLE);
$as = convert_field($fields[$key]);
if ($as) {
$from .= ", $as AS " . idf_escape($key);
}
}
}
$from .= "\nFROM " . table($TABLE);
$group_by = ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : ""); $group_by = ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : "");
if ($_GET["val"] && is_ajax()) { if ($_GET["val"] && is_ajax()) {
header("Content-Type: text/plain; charset=utf-8"); header("Content-Type: text/plain; charset=utf-8");
foreach ($_GET["val"] as $unique_idf => $row) { foreach ($_GET["val"] as $unique_idf => $row) {
$as = convert_field($fields[key($row)]); $as = convert_field($fields[key($row)]);
echo $connection->result("SELECT" . limit(($as ? $as : idf_escape(key($row))) . " FROM " . table($TABLE), " WHERE " . where_check($unique_idf, $fields) . ($where ? " AND " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : ""), 1)); echo $connection->result("SELECT" . limit($as ? $as : idf_escape(key($row)) . " FROM " . table($TABLE), " WHERE " . where_check($unique_idf, $fields) . ($where ? " AND " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : ""), 1));
} }
exit; exit;
} }
if ($_POST && !$error) { if ($_POST && !$error) {
$where_check = "(" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . ")"; $where_check = $where;
if (is_array($_POST["check"])) {
$where_check[] = "((" . implode(") OR (", array_map('where_check', $_POST["check"])) . "))";
}
$where_check = ($where_check ? "\nWHERE " . implode(" AND ", $where_check) : "");
$primary = $unselected = null; $primary = $unselected = null;
foreach ($indexes as $index) { foreach ($indexes as $index) {
if ($index["type"] == "PRIMARY") { if ($index["type"] == "PRIMARY") {
@@ -66,16 +63,13 @@ if ($_POST && !$error) {
unset($unselected[$key]); unset($unselected[$key]);
} }
} }
if ($_POST["export"]) { if ($_POST["export"]) {
cookie("adminer_import", "output=" . urlencode($_POST["output"]) . "&format=" . urlencode($_POST["format"])); cookie("adminer_import", "output=" . urlencode($_POST["output"]) . "&format=" . urlencode($_POST["format"]));
dump_headers($TABLE); dump_headers($TABLE);
$adminer->dumpTable($TABLE, ""); $adminer->dumpTable($TABLE, "");
if (!is_array($_POST["check"]) || $unselected === array()) { if (!is_array($_POST["check"]) || $unselected === array()) {
$where2 = $where; $query = "SELECT $from$where_check$group_by";
if (is_array($_POST["check"])) {
$where2[] = "($where_check)";
}
$query = "SELECT $from" . ($where2 ? "\nWHERE " . implode(" AND ", $where2) : "") . $group_by;
} else { } else {
$union = array(); $union = array();
foreach ($_POST["check"] as $val) { foreach ($_POST["check"] as $val) {
@@ -87,6 +81,7 @@ if ($_POST && !$error) {
$adminer->dumpData($TABLE, "table", $query); $adminer->dumpData($TABLE, "table", $query);
exit; exit;
} }
if (!$adminer->selectEmailProcess($where, $foreign_keys)) { if (!$adminer->selectEmailProcess($where, $foreign_keys)) {
if ($_POST["save"] || $_POST["delete"]) { // edit if ($_POST["save"] || $_POST["delete"]) { // edit
$result = true; $result = true;
@@ -116,13 +111,13 @@ if ($_POST && !$error) {
$command = "INSERT"; $command = "INSERT";
$query = "INTO $query"; $query = "INTO $query";
} }
if ($_POST["all"] || ($unselected === array() && $_POST["check"]) || $is_group) { if ($_POST["all"] || ($unselected === array() && is_array($_POST["check"])) || $is_group) {
$result = queries("$command $query" . ($_POST["all"] ? ($where ? "\nWHERE " . implode(" AND ", $where) : "") : "\nWHERE $where_check")); $result = queries("$command $query$where_check");
$affected = $connection->affected_rows; $affected = $connection->affected_rows;
} else { } else {
foreach ((array) $_POST["check"] as $val) { foreach ((array) $_POST["check"] as $val) {
// where is not unique so OR can't be used // where is not unique so OR can't be used
$result = queries($command . limit1($query, "\nWHERE " . where_check($val, $fields))); $result = queries($command . limit1($query, "\nWHERE " . ($where ? implode(" AND ", $where) . " AND " : "") . where_check($val, $fields)));
if (!$result) { if (!$result) {
break; break;
} }
@@ -137,8 +132,9 @@ if ($_POST && !$error) {
$message = lang('Item%s has been inserted.', " $last_id"); $message = lang('Item%s has been inserted.', " $last_id");
} }
} }
queries_redirect(remove_from_uri("page"), $message, $result); queries_redirect(remove_from_uri($_POST["all"] && $_POST["delete"] ? "page" : ""), $message, $result);
//! display edit page in case of an error //! display edit page in case of an error
} elseif (!$_POST["import"]) { // modify } elseif (!$_POST["import"]) { // modify
if (!$_POST["val"]) { if (!$_POST["val"]) {
$error = lang('Ctrl+click on a value to modify it.'); $error = lang('Ctrl+click on a value to modify it.');
@@ -153,7 +149,7 @@ if ($_POST && !$error) {
} }
$query = table($TABLE) . " SET " . implode(", ", $set); $query = table($TABLE) . " SET " . implode(", ", $set);
$where2 = " WHERE " . where_check($unique_idf, $fields) . ($where ? " AND " . implode(" AND ", $where) : ""); $where2 = " WHERE " . where_check($unique_idf, $fields) . ($where ? " AND " . implode(" AND ", $where) : "");
$result = queries("UPDATE" . ($is_group ? " $query$where2" : limit1($query, $where2))); // can change row on a different page without unique key $result = queries("UPDATE" . ($is_group || $unselected === array() ? " $query$where2" : limit1($query, $where2))); // can change row on a different page without unique key
if (!$result) { if (!$result) {
break; break;
} }
@@ -161,8 +157,12 @@ if ($_POST && !$error) {
} }
queries_redirect(remove_from_uri(), lang('%d item(s) have been affected.', $affected), $result); queries_redirect(remove_from_uri(), lang('%d item(s) have been affected.', $affected), $result);
} }
} elseif (is_string($file = get_file("csv_file", true))) {
//! character set } elseif (!is_string($file = get_file("csv_file", true))) {
$error = upload_error($file);
} elseif (!preg_match('~~u', $file)) {
$error = lang('File must be in UTF-8 encoding.');
} else {
cookie("adminer_import", "output=" . urlencode($adminer_import["output"]) . "&format=" . urlencode($_POST["separator"])); cookie("adminer_import", "output=" . urlencode($adminer_import["output"]) . "&format=" . urlencode($_POST["separator"]));
$result = true; $result = true;
$cols = array_keys($fields); $cols = array_keys($fields);
@@ -192,8 +192,7 @@ if ($_POST && !$error) {
} }
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);
queries("ROLLBACK"); // after queries_redirect() to not overwrite error queries("ROLLBACK"); // after queries_redirect() to not overwrite error
} else {
$error = upload_error($file);
} }
} }
} }
@@ -257,7 +256,7 @@ if (!$columns) {
if (!$result) { if (!$result) {
echo "<p class='error'>" . error() . "\n"; echo "<p class='error'>" . error() . "\n";
} else { } else {
if ($jush == "mssql") { if ($jush == "mssql" && $page) {
$result->seek($limit * $page); $result->seek($limit * $page);
} }
$email_fields = array(); $email_fields = array();
@@ -313,6 +312,7 @@ if (!$columns) {
next($select); next($select);
} }
} }
$lengths = array(); $lengths = array();
if ($_GET["modify"]) { if ($_GET["modify"]) {
foreach ($rows as $row) { foreach ($rows as $row) {
@@ -321,26 +321,43 @@ if (!$columns) {
} }
} }
} }
echo ($backward_keys ? "<th>" . lang('Relations') : "") . "</thead>\n"; echo ($backward_keys ? "<th>" . lang('Relations') : "") . "</thead>\n";
if (is_ajax()) { if (is_ajax()) {
if ($limit % 2 == 1 && $page % 2 == 1) { if ($limit % 2 == 1 && $page % 2 == 1) {
odd(); odd();
} }
ob_end_clean(); ob_end_clean();
} }
foreach ($adminer->rowDescriptions($rows, $foreign_keys) as $n => $row) { foreach ($adminer->rowDescriptions($rows, $foreign_keys) as $n => $row) {
$unique_array = unique_array($rows[$n], $indexes); $unique_array = unique_array($rows[$n], $indexes);
if (!$unique_array) {
$unique_array = array();
foreach ($rows[$n] as $key => $val) {
if (!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~', $key)) { //! columns looking like functions
$unique_array[$key] = $val;
}
}
}
$unique_idf = ""; $unique_idf = "";
foreach ($unique_array as $key => $val) { foreach ($unique_array as $key => $val) {
if (strlen($val) > 64) {
$key = "MD5(" . (strpos($key, '(') ? $key : idf_escape($key)) . ")"; //! columns looking like functions
$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));
} }
echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]), "", "this.form['all'].checked = false; formUncheck('all-page');") . ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('edit') . "</a>")); echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]), "", "this.form['all'].checked = false; formUncheck('all-page');") . ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('edit') . "</a>"));
foreach ($row as $key => $val) { foreach ($row as $key => $val) {
if (isset($names[$key])) { if (isset($names[$key])) {
$field = $fields[$key]; $field = $fields[$key];
if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) { if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
$email_fields[$key] = (is_mail($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages $email_fields[$key] = (is_mail($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages
} }
$link = ""; $link = "";
$val = $adminer->editVal($val, $field); $val = $adminer->editVal($val, $field);
if ($val !== null) { if ($val !== null) {
@@ -349,12 +366,10 @@ if (!$columns) {
} }
if ($val === "") { // === - may be int if ($val === "") { // === - may be int
$val = "&nbsp;"; $val = "&nbsp;";
} elseif (is_utf8($val)) { } elseif ($text_length != "" && is_shortable($field)) {
if ($text_length != "" && is_shortable($field)) { $val = shorten_utf8($val, max(0, +$text_length)); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network
$val = shorten_utf8($val, max(0, +$text_length)); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network } else {
} else { $val = h($val);
$val = h($val);
}
} }
if (!$link) { // link related items if (!$link) { // link related items
@@ -371,6 +386,7 @@ if (!$columns) {
} }
} }
} }
if ($key == "COUNT(*)") { //! columns looking like functions if ($key == "COUNT(*)") { //! columns looking like functions
$link = ME . "select=" . urlencode($TABLE); $link = ME . "select=" . urlencode($TABLE);
$i = 0; $i = 0;
@@ -383,10 +399,12 @@ if (!$columns) {
$link .= where_link($i++, $k, $v); $link .= where_link($i++, $k, $v);
} }
} }
} }
if (!$link) {
if (is_mail($val)) { if (!$link && ($link = $adminer->selectLink($row[$key], $field)) === null) {
$link = "mailto:$val"; if (is_mail($row[$key])) {
$link = "mailto:$row[$key]";
} }
if ($protocol = is_url($row[$key])) { if ($protocol = is_url($row[$key])) {
$link = ($protocol == "http" && $HTTPS $link = ($protocol == "http" && $HTTPS
@@ -395,6 +413,7 @@ if (!$columns) {
); );
} }
} }
$id = h("val[$unique_idf][" . bracket_escape($key) . "]"); $id = h("val[$unique_idf][" . bracket_escape($key) . "]");
$value = $_POST["val"][$unique_idf][bracket_escape($key)]; $value = $_POST["val"][$unique_idf][bracket_escape($key)];
$h_value = h($value !== null ? $value : $row[$key]); $h_value = h($value !== null ? $value : $row[$key]);
@@ -407,12 +426,14 @@ if (!$columns) {
); );
} }
} }
if ($backward_keys) { if ($backward_keys) {
echo "<td>"; echo "<td>";
} }
$adminer->backwardKeysPrint($backward_keys, $rows[$n]); $adminer->backwardKeysPrint($backward_keys, $rows[$n]);
echo "</tr>\n"; // close to allow white-space: pre echo "</tr>\n"; // close to allow white-space: pre
} }
if (is_ajax()) { if (is_ajax()) {
exit; exit;
} }
@@ -431,8 +452,9 @@ if (!$columns) {
$exact_count = false; $exact_count = false;
} }
} }
echo "<p class='pages'>";
if (+$limit && ($found_rows === false || $found_rows > $limit)) { if (+$limit && ($found_rows === false || $found_rows > $limit || $page)) {
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
? $page + (count($rows) >= $limit ? 2 : 1) ? $page + (count($rows) >= $limit ? 2 : 1)
@@ -443,11 +465,19 @@ if (!$columns) {
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);
} }
echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count && $found_rows !== false ? pagination($max_page, $page) : ' <a href="' . h(remove_from_uri("page") . "&page=last") . '">' . lang('last') . "</a>"); if ($max_page > 0) {
echo ($page + 5 < $max_page ? " ..." : "");
echo ($exact_count && $found_rows !== false
? pagination($max_page, $page)
: " <a href='" . h(remove_from_uri("page") . "&page=last") . "' title='~$max_page'>" . lang('last') . "</a>"
);
}
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') . '\');">' . lang('Load more data') . '</a>' : '');
} }
echo ($found_rows !== false ? " (" . ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) . ")" : "");
echo (+$limit && ($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') . '\');">' . lang('Load more data') . '</a>' : ''); echo "<p>\n";
echo " " . checkbox("all", 1, 0, lang('whole result')) . "\n"; echo ($found_rows !== false ? "(" . ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) . ") " : "");
echo checkbox("all", 1, 0, lang('whole result')) . "\n";
if ($adminer->selectCommandPrint()) { if ($adminer->selectCommandPrint()) {
?> ?>
@@ -459,7 +489,14 @@ if (!$columns) {
</div></fieldset> </div></fieldset>
<?php <?php
} }
$format = $adminer->dumpFormat(); $format = $adminer->dumpFormat();
foreach ((array) $_GET["columns"] as $column) {
if ($column["fun"]) {
unset($format['sql']);
break;
}
}
if ($format) { if ($format) {
print_fieldset("export", lang('Export')); print_fieldset("export", lang('Export'));
$output = $adminer->dumpOutput(); $output = $adminer->dumpOutput();
@@ -469,6 +506,7 @@ if (!$columns) {
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
} }
if ($adminer->selectImportPrint()) { if ($adminer->selectImportPrint()) {
print_fieldset("import", lang('Import'), !$rows); print_fieldset("import", lang('Import'), !$rows);
echo "<input type='file' name='csv_file'> "; echo "<input type='file' name='csv_file'> ";

View File

@@ -1,9 +1,10 @@
<?php <?php
$SEQUENCE = $_GET["sequence"]; $SEQUENCE = $_GET["sequence"];
$row = $_POST;
if ($_POST && !$error) { if ($_POST && !$error) {
$link = substr(ME, 0, -1); $link = substr(ME, 0, -1);
$name = trim($_POST["name"]); $name = trim($row["name"]);
if ($_POST["drop"]) { if ($_POST["drop"]) {
query_redirect("DROP SEQUENCE " . idf_escape($SEQUENCE), $link, lang('Sequence has been dropped.')); query_redirect("DROP SEQUENCE " . idf_escape($SEQUENCE), $link, lang('Sequence has been dropped.'));
} elseif ($SEQUENCE == "") { } elseif ($SEQUENCE == "") {
@@ -17,14 +18,13 @@ if ($_POST && !$error) {
page_header($SEQUENCE != "" ? lang('Alter sequence') . ": " . h($SEQUENCE) : lang('Create sequence'), $error); page_header($SEQUENCE != "" ? lang('Alter sequence') . ": " . h($SEQUENCE) : lang('Create sequence'), $error);
$row = $_POST;
if (!$row) { if (!$row) {
$row = array("name" => $SEQUENCE); $row["name"] = $SEQUENCE;
} }
?> ?>
<form action="" method="post"> <form action="" method="post">
<p><input name="name" value="<?php echo h($row["name"]); ?>"> <p><input name="name" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
<input type="submit" value="<?php echo lang('Save'); ?>"> <input type="submit" value="<?php echo lang('Save'); ?>">
<?php <?php
if ($SEQUENCE != "") { if ($SEQUENCE != "") {

View File

@@ -20,18 +20,20 @@ if (!$error && $_POST) {
$fp = false; $fp = false;
$query = $_POST["query"]; $query = $_POST["query"];
if ($_POST["webfile"]) { if ($_POST["webfile"]) {
$fp = @fopen((file_exists("adminer.sql") ? "adminer.sql" $fp = @fopen((file_exists("adminer.sql")
: (file_exists("adminer.sql.gz") ? "compress.zlib://adminer.sql.gz" ? "adminer.sql"
: "compress.bzip2://adminer.sql.bz2" : "compress.zlib://adminer.sql.gz"
)), "rb"); ), "rb");
$query = ($fp ? fread($fp, 1e6) : false); $query = ($fp ? fread($fp, 1e6) : false);
} elseif ($_FILES && $_FILES["sql_file"]["error"] != UPLOAD_ERR_NO_FILE) { } elseif ($_FILES && $_FILES["sql_file"]["error"][0] != 4) { // 4 - UPLOAD_ERR_NO_FILE
$query = get_file("sql_file", true); $query = get_file("sql_file", true);
} }
if (is_string($query)) { // get_file() returns error as number, fread() as false if (is_string($query)) { // get_file() returns error as number, fread() as false
if (function_exists('memory_get_usage')) { if (function_exists('memory_get_usage')) {
@ini_set("memory_limit", max(ini_bytes("memory_limit"), 2 * strlen($query) + memory_get_usage() + 8e6)); // @ - may be disabled, 2 - substr and trim, 8e6 - other variables @ini_set("memory_limit", max(ini_bytes("memory_limit"), 2 * strlen($query) + memory_get_usage() + 8e6)); // @ - may be disabled, 2 - substr and trim, 8e6 - other variables
} }
if ($query != "" && strlen($query) < 1e6) { // don't add big queries if ($query != "" && strlen($query) < 1e6) { // don't add big queries
$q = $query . (ereg(";[ \t\r\n]*\$", $query) ? "" : ";"); //! doesn't work with DELIMITER | $q = $query . (ereg(";[ \t\r\n]*\$", $query) ? "" : ";"); //! doesn't work with DELIMITER |
if (!$history || reset(end($history)) != $q) { // no repeated queries if (!$history || reset(end($history)) != $q) { // no repeated queries
@@ -41,6 +43,7 @@ if (!$error && $_POST) {
stop_session(); stop_session();
} }
} }
$space = "(?:\\s|/\\*.*\\*/|(?:#|-- )[^\n]*\n|--\n)"; $space = "(?:\\s|/\\*.*\\*/|(?:#|-- )[^\n]*\n|--\n)";
$delimiter = ";"; $delimiter = ";";
$offset = 0; $offset = 0;
@@ -57,6 +60,7 @@ if (!$error && $_POST) {
parse_str($_COOKIE["adminer_export"], $adminer_export); parse_str($_COOKIE["adminer_export"], $adminer_export);
$dump_format = $adminer->dumpFormat(); $dump_format = $adminer->dumpFormat();
unset($dump_format["sql"]); unset($dump_format["sql"]);
while ($query != "") { while ($query != "") {
if (!$offset && preg_match("~^$space*DELIMITER\\s+(\\S+)~i", $query, $match)) { if (!$offset && preg_match("~^$space*DELIMITER\\s+(\\S+)~i", $query, $match)) {
$delimiter = $match[1]; $delimiter = $match[1];
@@ -71,6 +75,7 @@ if (!$error && $_POST) {
break; break;
} }
$offset = $pos + strlen($found); $offset = $pos + strlen($found);
if ($found && rtrim($found) != $delimiter) { // find matching quote or comment end if ($found && rtrim($found) != $delimiter) { // find matching quote or comment end
while (preg_match('(' . ($found == '/*' ? '\\*/' : ($found == '[' ? ']' : (ereg('^-- |^#', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES while (preg_match('(' . ($found == '/*' ? '\\*/' : ($found == '[' ? ']' : (ereg('^-- |^#', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
$s = $match[0][0]; $s = $match[0][0];
@@ -83,6 +88,7 @@ if (!$error && $_POST) {
} }
} }
} }
} else { // end of a query } else { // end of a query
$empty = false; $empty = false;
$q = substr($query, 0, $pos); $q = substr($query, 0, $pos);
@@ -98,17 +104,22 @@ if (!$error && $_POST) {
if ($connection->multi_query($q) && is_object($connection2) && preg_match("~^$space*USE\\b~isU", $q)) { if ($connection->multi_query($q) && is_object($connection2) && preg_match("~^$space*USE\\b~isU", $q)) {
$connection2->query($q); $connection2->query($q);
} }
do { do {
$result = $connection->store_result(); $result = $connection->store_result();
$end = microtime(); $end = microtime();
$time = format_time($start, $end) . (strlen($q) < 1000 ? " <a href='" . h(ME) . "sql=" . urlencode(trim($q)) . "'>" . lang('Edit') . "</a>" : ""); // 1000 - maximum length of encoded URL in IE is 2083 characters $time = " <span class='time'>(" . format_time($start, $end) . ")</span>"
. (strlen($q) < 1000 ? " <a href='" . h(ME) . "sql=" . urlencode(trim($q)) . "'>" . lang('Edit') . "</a>" : "") // 1000 - maximum length of encoded URL in IE is 2083 characters
;
if ($connection->error) { if ($connection->error) {
echo ($_POST["only_errors"] ? $print : ""); echo ($_POST["only_errors"] ? $print : "");
echo "<p class='error'>" . lang('Error in query') . ": " . error() . "\n"; echo "<p class='error'>" . lang('Error in query') . ($connection->errno ? " ($connection->errno)" : "") . ": " . error() . "\n";
$errors[] = " <a href='#sql-$commands'>$commands</a>"; $errors[] = " <a href='#sql-$commands'>$commands</a>";
if ($_POST["error_stops"]) { if ($_POST["error_stops"]) {
break 2; break 2;
} }
} elseif (is_object($result)) { } elseif (is_object($result)) {
$orgtables = select($result, $connection2); $orgtables = select($result, $connection2);
if (!$_POST["only_errors"]) { if (!$_POST["only_errors"]) {
@@ -132,6 +143,7 @@ if (!$error && $_POST) {
} }
echo "</form>\n"; echo "</form>\n";
} }
} else { } else {
if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) { if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) {
restart_session(); restart_session();
@@ -142,23 +154,29 @@ if (!$error && $_POST) {
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n"; echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n";
} }
} }
$start = $end; $start = $end;
} while ($connection->next_result()); } while ($connection->next_result());
$line += substr_count($q.$found, "\n"); $line += substr_count($q.$found, "\n");
$query = substr($query, $offset); $query = substr($query, $offset);
$offset = 0; $offset = 0;
} }
} }
} }
} }
if ($empty) { if ($empty) {
echo "<p class='message'>" . lang('No commands to execute.') . "\n"; echo "<p class='message'>" . lang('No commands to execute.') . "\n";
} elseif ($_POST["only_errors"]) { } elseif ($_POST["only_errors"]) {
echo "<p class='message'>" . lang('%d query(s) executed OK.', $commands - count($errors)) . format_time($total_start, microtime()) . "\n"; echo "<p class='message'>" . lang('%d query(s) executed OK.', $commands - count($errors));
echo " <span class='time'>(" . format_time($total_start, microtime()) . ")</span>\n";
} elseif ($errors && $commands > 1) { } elseif ($errors && $commands > 1) {
echo "<p class='error'>" . lang('Error in query') . ": " . implode("", $errors) . "\n"; echo "<p class='error'>" . lang('Error in query') . ": " . implode("", $errors) . "\n";
} }
//! MS SQL - SET SHOWPLAN_ALL OFF //! MS SQL - SET SHOWPLAN_ALL OFF
} else { } else {
echo "<p class='error'>" . upload_error($query) . "\n"; echo "<p class='error'>" . upload_error($query) . "\n";
} }
@@ -176,34 +194,31 @@ if ($_POST) {
$q = $history[$_GET["history"]][0]; $q = $history[$_GET["history"]][0];
} }
textarea("query", $q, 20); textarea("query", $q, 20);
echo ($_POST ? "" : "<script type='text/javascript'>document.getElementsByTagName('textarea')[0].focus();</script>\n");
echo ($_POST ? "" : "<script type='text/javascript'>focus(document.getElementsByTagName('textarea')[0]);</script>\n");
echo "<p>" . (ini_bool("file_uploads") echo "<p>" . (ini_bool("file_uploads")
? lang('File upload') . ': <input type="file" name="sql_file"' . ($_FILES && $_FILES["sql_file"]["error"] != 4 ? '' : ' onchange="this.form[\'only_errors\'].checked = true;"') . '> (&lt; ' . ini_get("upload_max_filesize") . 'B)' // ignore post_max_size because it is for all form fields together and bytes computing would be necessary ? lang('File upload') . ': <input type="file" name="sql_file[]" multiple'
. ($_FILES && $_FILES["sql_file"]["error"][0] != 4 ? '' : ' onchange="this.form[\'only_errors\'].checked = true;"') // 4 - UPLOAD_ERR_NO_FILE
. '> (&lt; ' . ini_get("upload_max_filesize") . 'B)' // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
: lang('File uploads are disabled.') : lang('File uploads are disabled.')
); );
?> ?>
<p> <p>
<input type="submit" value="<?php echo lang('Execute'); ?>" title="Ctrl+Enter"> <input type="submit" value="<?php echo lang('Execute'); ?>" title="Ctrl+Enter">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<?php <?php
echo checkbox("error_stops", 1, $_POST["error_stops"], lang('Stop on error')) . "\n"; echo checkbox("error_stops", 1, $_POST["error_stops"], lang('Stop on error')) . "\n";
echo checkbox("only_errors", 1, $_POST["only_errors"], lang('Show only errors')) . "\n"; echo checkbox("only_errors", 1, $_POST["only_errors"], lang('Show only errors')) . "\n";
print_fieldset("webfile", lang('From server'), $_POST["webfile"], "document.getElementById('form')['only_errors'].checked = true; "); print_fieldset("webfile", lang('From server'), $_POST["webfile"], "document.getElementById('form')['only_errors'].checked = true; ");
$compress = array(); echo lang('Webserver file %s', "<code>adminer.sql" . (extension_loaded("zlib") ? "[.gz]" : "") . "</code>");
foreach (array("gz" => "zlib", "bz2" => "bz2") as $key => $val) {
if (extension_loaded($val)) {
$compress[] = ".$key";
}
}
echo lang('Webserver file %s', "<code>adminer.sql" . ($compress ? "[" . implode("|", $compress) . "]" : "") . "</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";
if ($history) { if ($history) {
print_fieldset("history", lang('History'), $_GET["history"] != ""); print_fieldset("history", lang('History'), $_GET["history"] != "");
foreach ($history as $key => $val) { for ($val = end($history); $val; $val = prev($history)) { // not array_reverse() to save memory
$key = key($history);
list($q, $time) = $val; list($q, $time) = $val;
echo '<a href="' . h(ME . "sql=&history=$key") . '">' . lang('Edit') . "</a> <span class='time' title='" . @date('Y-m-d', $time) . "'>" . @date("H:i:s", $time) . "</span> <code class='jush-$jush'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $q)))), 80, "</code>") . "<br>\n"; // @ - time zone may be not set echo '<a href="' . h(ME . "sql=&history=$key") . '">' . lang('Edit') . "</a> <span class='time' title='" . @date('Y-m-d', $time) . "'>" . @date("H:i:s", $time) . "</span> <code class='jush-$jush'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $q)))), 80, "</code>") . "<br>\n"; // @ - time zone may be not set
} }
@@ -212,5 +227,5 @@ if ($history) {
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
?> ?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -21,6 +21,8 @@ code { background: #eee; }
tbody tr:hover td, tbody tr:hover th { background: #eee; } tbody tr:hover td, tbody tr:hover th { background: #eee; }
pre { margin: 1em 0 0; } pre { margin: 1em 0 0; }
input[type=image] { vertical-align: middle; } input[type=image] { vertical-align: middle; }
input.default { box-shadow: 1px 1px 1px #777; }
.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: .3em 1ex .3em 0; margin-top: -.3em; } .js .column { position: absolute; background: #ddf; padding: .3em 1ex .3em 0; margin-top: -.3em; }
@@ -35,7 +37,7 @@ input[type=image] { vertical-align: middle; }
.enum { color: #007F7F; } .enum { color: #007F7F; }
.binary { color: red; } .binary { color: red; }
.odd td { background: #F5F5F5; } .odd td { background: #F5F5F5; }
.js .checked td, .js .checked th { background: #ddf; } .js .checkable .checked td, .js .checkable .checked th { background: #ddf; }
.time { color: silver; font-size: 70%; } .time { color: silver; font-size: 70%; }
.function { text-align: right; } .function { text-align: right; }
.number { text-align: right; } .number { text-align: right; }
@@ -46,10 +48,12 @@ input[type=image] { vertical-align: middle; }
.sqlarea { width: 98%; } .sqlarea { width: 98%; }
.icon { width: 18px; height: 18px; } .icon { width: 18px; height: 18px; }
.size { width: 6ex; } .size { width: 6ex; }
.help { cursor: help; }
.pages { position: fixed; bottom: 0; left: 21em; padding: 5px; background: #ddf; border: 1px solid #999; }
#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 { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
#dbs { overflow: hidden; } #dbs { overflow: hidden; }
#logins, #tables { white-space: nowrap; overflow: auto; } #logins, #tables { white-space: nowrap; overflow: auto; text-overflow: ellipsis; }
#logins a, #tables a { background: #fff; } #logins a, #tables a { background: #fff; }
#logout { background: none; border: none; color: blue; font: inherit; padding: 0; text-decoration: underline; cursor: pointer; } #logout { background: none; border: none; color: blue; font: inherit; padding: 0; text-decoration: underline; cursor: pointer; }
#logout:hover { color: red; } #logout:hover { color: red; }
@@ -68,6 +72,16 @@ input[type=image] { vertical-align: middle; }
.rtl #breadcrumb { left: auto; right: 21em; margin: 0 -18px 0 0; } .rtl #breadcrumb { left: auto; right: 21em; margin: 0 -18px 0 0; }
.rtl #lang, .rtl #menu { left: auto; right: 0; } .rtl #lang, .rtl #menu { left: auto; right: 0; }
@media all and (max-device-width: 880px) {
.pages { left: auto; }
#menu { position: static; width: auto; }
#content { margin-left: 10px; }
#lang { position: static; border-top: 1px solid #999; }
#breadcrumb { left: auto; }
.rtl #content { margin-right: 10px; }
.rtl #breadcrumb { right: auto; }
}
@media print { @media print {
#lang, #menu { display: none; } #lang, #menu { display: none; }
#content { margin-left: 1em; } #content { margin-left: 1em; }

View File

@@ -75,13 +75,44 @@ function loginDriver(driver) {
var dbCtrl;
var dbPrevious = {};
/** Check if database should be opened to a new window
* @param MouseEvent
* @param HTMLSelectElement
*/
function dbMouseDown(event, el) {
dbCtrl = isCtrl(event);
if (dbPrevious[el.name] == undefined) {
dbPrevious[el.name] = el.value;
}
}
/** Load database after selecting it
* @param HTMLSelectElement
*/
function dbChange(el) {
if (dbCtrl) {
el.form.target = '_blank';
}
el.form.submit();
el.form.target = '';
if (dbCtrl && dbPrevious[el.name] != undefined) {
el.value = dbPrevious[el.name];
dbPrevious[el.name] = undefined;
}
}
/** Handle Tab and Esc in textarea /** Handle Tab and Esc in textarea
* @param HTMLTextAreaElement * @param HTMLTextAreaElement
* @param KeyboardEvent * @param KeyboardEvent
* @return boolean * @return boolean
*/ */
function textareaKeydown(target, event) { function textareaKeydown(target, event) {
if (!event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) { if (!event.shiftKey && !event.altKey && !isCtrl(event)) {
if (event.keyCode == 9) { // 9 - Tab if (event.keyCode == 9) { // 9 - Tab
// inspired by http://pallieter.org/Projects/insertTab/ // inspired by http://pallieter.org/Projects/insertTab/
if (target.setSelectionRange) { if (target.setSelectionRange) {
@@ -168,6 +199,30 @@ function selectFieldChange(form) {
setHtml('noindex', (ok ? '' : '!')); setHtml('noindex', (ok ? '' : '!'));
} }
/** Create edit query form
* @param MouseEvent
* @param HTMLSpanElement
* @param string
*/
function selectEditSql(event, el, label) {
var a = parentTag(event.target || event.srcElement, 'a');
if (!isCtrl(event) || (a && a.href)) {
return;
}
var sql = el.firstChild;
var input = document.createElement('input');
input.name = 'query';
input.value = sql.textContent || sql.innerText;
input.style.width = sql.offsetWidth + 'px';
el.innerHTML = '';
el.appendChild(input);
var submit = document.createElement('input');
submit.type = 'submit';
submit.value = label;
el.appendChild(submit);
return true;
}
var added = '.', rowCount; var added = '.', rowCount;
@@ -230,21 +285,17 @@ function editingNameChange(field) {
/** Add table row for next field /** Add table row for next field
* @param HTMLInputElement * @param HTMLInputElement
* @param boolean * @param boolean
* @param boolean
* @return boolean * @return boolean
*/ */
function editingAddRow(button, allowed, focus) { function editingAddRow(button, focus) {
if (allowed && rowCount >= allowed) {
return false;
}
var match = /(\d+)(\.\d+)?/.exec(button.name); var match = /(\d+)(\.\d+)?/.exec(button.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(button, 'tr');
var row2 = row.cloneNode(true); var row2 = cloneNode(row);
var tags = row.getElementsByTagName('select'); var tags = row.getElementsByTagName('select');
var tags2 = row2.getElementsByTagName('select'); var tags2 = row2.getElementsByTagName('select');
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 = row.getElementsByTagName('input');
@@ -312,7 +363,10 @@ function editingTypeChange(type) {
el.className = (/(char|text|enum|set)$/.test(text) ? '' : 'hidden'); el.className = (/(char|text|enum|set)$/.test(text) ? '' : 'hidden');
} }
if (el.name == name + '[unsigned]') { if (el.name == name + '[unsigned]') {
el.className = (/(int|float|double|decimal)$/.test(text) ? '' : 'hidden'); el.className = (/((^|[^o])int|float|double|decimal)$/.test(text) ? '' : 'hidden');
}
if (el.name == name + '[on_update]') {
el.className = (text == 'timestamp' ? '' : 'hidden');
} }
if (el.name == name + '[on_delete]') { if (el.name == name + '[on_delete]') {
el.className = (/`/.test(text) ? '' : 'hidden'); el.className = (/`/.test(text) ? '' : 'hidden');
@@ -362,7 +416,7 @@ function columnShow(checked, column) {
*/ */
function editingHideDefaults() { function editingHideDefaults() {
if (innerWidth < document.documentElement.scrollWidth) { if (innerWidth < document.documentElement.scrollWidth) {
document.getElementById('defaults').checked = false; document.getElementById('form')['defaults'].checked = false;
columnShow(false, 5); columnShow(false, 5);
} }
} }
@@ -380,7 +434,7 @@ function partitionByChange(el) {
* @param HTMLInputElement * @param HTMLInputElement
*/ */
function partitionNameChange(el) { function partitionNameChange(el) {
var row = parentTag(el, 'tr').cloneNode(true); var row = cloneNode(parentTag(el, 'tr'));
row.firstChild.firstChild.value = ''; row.firstChild.firstChild.value = '';
parentTag(el, 'table').appendChild(row); parentTag(el, 'table').appendChild(row);
el.onchange = function () {}; el.onchange = function () {};
@@ -393,7 +447,7 @@ function partitionNameChange(el) {
*/ */
function foreignAddRow(field) { function foreignAddRow(field) {
field.onchange = function () { }; field.onchange = function () { };
var row = parentTag(field, 'tr').cloneNode(true); var row = cloneNode(parentTag(field, 'tr'));
var selects = row.getElementsByTagName('select'); var selects = row.getElementsByTagName('select');
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$&');
@@ -409,7 +463,7 @@ function foreignAddRow(field) {
*/ */
function indexesAddRow(field) { function indexesAddRow(field) {
field.onchange = function () { }; field.onchange = function () { };
var row = parentTag(field, 'tr').cloneNode(true); var row = cloneNode(parentTag(field, 'tr'));
var selects = row.getElementsByTagName('select'); var selects = row.getElementsByTagName('select');
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');
@@ -449,10 +503,10 @@ function indexesAddColumn(field, prefix) {
}; };
var select = field.form[field.name.replace(/\].*/, '][type]')]; var select = field.form[field.name.replace(/\].*/, '][type]')];
if (!select.selectedIndex) { if (!select.selectedIndex) {
select.selectedIndex = 3; select.selectedIndex = select.options.length - 1;
select.onchange(); select.onchange();
} }
var column = field.parentNode.cloneNode(true); var column = cloneNode(field.parentNode);
select = column.getElementsByTagName('select')[0]; select = column.getElementsByTagName('select')[0];
select.name = select.name.replace(/\]\[\d+/, '$&1'); select.name = select.name.replace(/\]\[\d+/, '$&1');
select.selectedIndex = 0; select.selectedIndex = 0;

View File

@@ -40,12 +40,12 @@ function selectValue(select) {
/** Get parent node with specified tag name. /** Get parent node with specified tag name.
* @param HTMLElement * @param HTMLElement
* @param string * @param string regular expression
* @return HTMLElement * @return HTMLElement
*/ */
function parentTag(el, tag) { function parentTag(el, tag) {
var re = new RegExp('^' + tag + '$', 'i'); var re = new RegExp('^' + tag + '$', 'i');
while (!re.test(el.tagName)) { while (el && !re.test(el.tagName)) {
el = el.parentNode; el = el.parentNode;
} }
return el; return el;
@@ -218,7 +218,7 @@ function pageClick(href, page, event) {
*/ */
function menuOver(el, event) { function menuOver(el, event) {
var a = event.target; var a = event.target;
if (/^a$/i.test(a.tagName) && a.offsetLeft + a.offsetWidth > a.parentNode.offsetWidth) { if (/^a$/i.test(a.tagName) && a.offsetLeft + a.offsetWidth > a.parentNode.offsetWidth - 15) { // 15 - ellipsis
el.style.overflow = 'visible'; el.style.overflow = 'visible';
} }
} }
@@ -240,7 +240,7 @@ function selectAddRow(field) {
selectFieldChange(field.form); selectFieldChange(field.form);
}; };
field.onchange(); field.onchange();
var row = field.parentNode.cloneNode(true); var row = cloneNode(field.parentNode);
var selects = row.getElementsByTagName('select'); var selects = row.getElementsByTagName('select');
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');
@@ -255,6 +255,15 @@ function selectAddRow(field) {
field.parentNode.parentNode.appendChild(row); field.parentNode.parentNode.appendChild(row);
} }
/** Clear column name after resetting search
* @param HTMLInputElement
*/
function selectSearchSearch(el) {
if (!el.value) {
el.parentNode.firstChild.selectedIndex = 0;
}
}
/** Toggles column context menu /** Toggles column context menu
@@ -293,6 +302,15 @@ function selectSearch(name) {
} }
/** Check if Ctrl key (Command key on Mac) was pressed
* @param KeyboardEvent|MouseEvent
* @return boolean
*/
function isCtrl(event) {
return (event.ctrlKey || event.metaKey) && !event.altKey; // shiftKey allowed
}
/** Send form by Ctrl+Enter on <select> and <textarea> /** Send form by Ctrl+Enter on <select> and <textarea>
* @param KeyboardEvent * @param KeyboardEvent
@@ -301,7 +319,7 @@ function selectSearch(name) {
*/ */
function bodyKeydown(event, button) { function bodyKeydown(event, button) {
var target = event.target || event.srcElement; var target = event.target || event.srcElement;
if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10) && !event.altKey && !event.metaKey && /select|textarea|input/i.test(target.tagName)) { // 13|10 - Enter, shiftKey allowed if (isCtrl(event) && (event.keyCode == 13 || event.keyCode == 10) && /select|textarea|input/i.test(target.tagName)) { // 13|10 - Enter
target.blur(); target.blur();
if (button) { if (button) {
target.form[button].click(); target.form[button].click();
@@ -318,10 +336,10 @@ function bodyKeydown(event, button) {
*/ */
function bodyClick(event) { function bodyClick(event) {
var target = event.target || event.srcElement; var target = event.target || event.srcElement;
if ((event.ctrlKey || event.shiftKey) && target.type == 'submit' && /input/i.test(target.tagName)) { if ((isCtrl(event) || event.shiftKey) && target.type == 'submit' && /input/i.test(target.tagName)) {
target.form.target = '_blank'; target.form.target = '_blank';
setTimeout(function () { setTimeout(function () {
// if (event.ctrlKey) { focus(); } doesn't work // if (isCtrl(event)) { focus(); } doesn't work
target.form.target = ''; target.form.target = '';
}, 0); }, 0);
} }
@@ -334,7 +352,7 @@ function bodyClick(event) {
* @return boolean * @return boolean
*/ */
function editingKeydown(event) { function editingKeydown(event) {
if ((event.keyCode == 40 || event.keyCode == 38) && event.ctrlKey && !event.altKey && !event.metaKey) { // 40 - Down, 38 - Up, shiftKey allowed if ((event.keyCode == 40 || event.keyCode == 38) && isCtrl(event)) { // 40 - Down, 38 - Up
var target = event.target || event.srcElement; var target = event.target || event.srcElement;
var sibling = (event.keyCode == 40 ? 'nextSibling' : 'previousSibling'); var sibling = (event.keyCode == 40 ? 'nextSibling' : 'previousSibling');
var el = target.parentNode.parentNode[sibling]; var el = target.parentNode.parentNode[sibling];
@@ -416,7 +434,7 @@ function ajaxSetHtml(url) {
*/ */
function selectClick(td, event, text, warning) { function selectClick(td, event, text, warning) {
var target = event.target || event.srcElement; var target = event.target || event.srcElement;
if (!event.ctrlKey || /input|textarea/i.test(td.firstChild.tagName) || /^a$/i.test(target.tagName)) { if (!isCtrl(event) || /input|textarea/i.test(td.firstChild.tagName) || /^a$/i.test(target.tagName)) {
return; return;
} }
if (warning) { if (warning) {
@@ -429,7 +447,7 @@ function selectClick(td, event, text, warning) {
if (!event) { if (!event) {
event = window.event; event = window.event;
} }
if (event.keyCode == 27 && !(event.ctrlKey || event.shiftKey || event.altKey || event.metaKey)) { // 27 - Esc if (event.keyCode == 27 && !event.shiftKey && !event.altKey && !isCtrl(event)) { // 27 - Esc
td.innerHTML = original; td.innerHTML = original;
} }
}; };
@@ -456,6 +474,7 @@ function selectClick(td, event, text, warning) {
} }
td.innerHTML = ''; td.innerHTML = '';
td.appendChild(input); td.appendChild(input);
setupSubmitHighlight(td);
input.focus(); input.focus();
if (text == 2) { // long text if (text == 2) { // long text
return ajax(location.href + '&' + encodeURIComponent(td.id) + '=', function (request) { return ajax(location.href + '&' + encodeURIComponent(td.id) + '=', function (request) {
@@ -491,12 +510,10 @@ function selectLoadMore(a, limit, loading) {
if (href) { if (href) {
a.removeAttribute('href'); a.removeAttribute('href');
return ajax(href, function (request) { return ajax(href, function (request) {
document.getElementById('table').innerHTML += request.responseText; var tbody = document.createElement('tbody');
var rows = 0; tbody.innerHTML = request.responseText;
request.responseText.replace(/(^|\n)<tr/g, function () { document.getElementById('table').appendChild(tbody);
rows++; if (tbody.children.length < limit) {
});
if (rows < limit) {
a.parentNode.removeChild(a); a.parentNode.removeChild(a);
} else { } else {
a.href = href.replace(/\d+$/, function (page) { a.href = href.replace(/\d+$/, function (page) {
@@ -520,3 +537,88 @@ function eventStop(event) {
event.cancelBubble = true; event.cancelBubble = true;
} }
} }
/** Setup highlighting of default submit button on form field focus
* @param HTMLElement
*/
function setupSubmitHighlight(parent) {
for (var key in { input: 1, select: 1, textarea: 1 }) {
var inputs = parent.getElementsByTagName(key);
for (var i = 0; i < inputs.length; i++) {
if (!/submit|image|file/.test(inputs[i].type)) {
addEvent(inputs[i], 'focus', inputFocus);
addEvent(inputs[i], 'blur', inputBlur);
}
}
}
}
/** Highlight default submit button
* @this HTMLInputElement
*/
function inputFocus() {
var submit = findDefaultSubmit(this.form);
if (submit) {
submit.className += ' default';
}
}
/** Unhighlight default submit button
* @this HTMLInputElement
*/
function inputBlur() {
var submit = findDefaultSubmit(this.form);
if (submit) {
submit.className = submit.className.replace(/ default( |$)/, '$1');
}
}
/** Find submit button used by Enter
* @param HTMLFormElement
* @return HTMLInputElement
*/
function findDefaultSubmit(form) {
var inputs = form.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
if (input.type == 'submit') {
return input;
}
}
}
/** Add event listener
* @param HTMLElement
* @param string without 'on'
* @param function
*/
function addEvent(el, action, handler) {
if (el.addEventListener) {
el.addEventListener(action, handler, false);
} else {
el.attachEvent('on' + action, handler);
}
}
/** Defer focusing element
* @param HTMLElement
*/
function focus(el) {
setTimeout(function () { // this has to be an anonymous function because Firefox passes some arguments to setTimeout callback
el.focus();
}, 0);
}
/** Clone node and setup submit highlighting
* @param HTMLElement
* @return HTMLElement
*/
function cloneNode(el) {
var el2 = el.cloneNode(true);
setupSubmitHighlight(el2);
return el2;
}

View File

@@ -4,9 +4,10 @@ $fields = fields($TABLE);
if (!$fields) { if (!$fields) {
$error = error(); $error = error();
} }
$table_status = ($fields ? table_status($TABLE) : array()); $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) ? 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 != "") {
@@ -26,7 +27,7 @@ if ($fields) {
echo "</table>\n"; echo "</table>\n";
if (!is_view($table_status)) { if (!is_view($table_status)) {
echo "<h3>" . 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"; echo "<table cellspacing='0'>\n";
@@ -34,7 +35,10 @@ if ($fields) {
ksort($index["columns"]); // enforce correct columns order ksort($index["columns"]); // enforce correct columns order
$print = array(); $print = array();
foreach ($index["columns"] as $key => $val) { foreach ($index["columns"] as $key => $val) {
$print[] = "<i>" . h($val) . "</i>" . ($index["lengths"][$key] ? "(" . $index["lengths"][$key] . ")" : ""); $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 "<tr title='" . h($name) . "'><th>$index[type]<td>" . implode(", ", $print) . "\n";
} }
@@ -43,7 +47,7 @@ if ($fields) {
echo '<p><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n"; echo '<p><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n";
if (fk_support($table_status)) { if (fk_support($table_status)) {
echo "<h3>" . lang('Foreign keys') . "</h3>\n"; echo "<h3 id='foreign-keys'>" . lang('Foreign keys') . "</h3>\n";
$foreign_keys = foreign_keys($TABLE); $foreign_keys = foreign_keys($TABLE);
if ($foreign_keys) { if ($foreign_keys) {
echo "<table cellspacing='0'>\n"; echo "<table cellspacing='0'>\n";
@@ -68,7 +72,7 @@ if ($fields) {
} }
if (support("trigger")) { if (support("trigger")) {
echo "<h3>" . lang('Triggers') . "</h3>\n"; echo "<h3 id='triggers'>" . lang('Triggers') . "</h3>\n";
$triggers = triggers($TABLE); $triggers = triggers($TABLE);
if ($triggers) { if ($triggers) {
echo "<table cellspacing='0'>\n"; echo "<table cellspacing='0'>\n";
@@ -79,5 +83,6 @@ if ($fields) {
} }
echo '<p><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n"; echo '<p><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n";
} }
} }
} }

View File

@@ -1,29 +1,36 @@
<?php <?php
$TABLE = $_GET["trigger"]; $TABLE = $_GET["trigger"];
$name = $_GET["name"];
$trigger_options = trigger_options(); $trigger_options = trigger_options();
$trigger_event = array("INSERT", "UPDATE", "DELETE"); $trigger_event = array("INSERT", "UPDATE", "DELETE");
$row = (array) trigger($name) + array("Trigger" => $TABLE . "_bi");
$dropped = false; if ($_POST) {
if ($_POST && !$error && in_array($_POST["Timing"], $trigger_options["Timing"]) && in_array($_POST["Event"], $trigger_event) && in_array($_POST["Type"], $trigger_options["Type"])) { if (!$error && in_array($_POST["Timing"], $trigger_options["Timing"]) && in_array($_POST["Event"], $trigger_event) && in_array($_POST["Type"], $trigger_options["Type"])) {
$timing_event = " $_POST[Timing] $_POST[Event]"; // don't use drop_create() because there may not be more triggers for the same action
$on = " ON " . table($TABLE); $on = " ON " . table($TABLE);
$dropped = drop_create( $drop = "DROP TRIGGER " . idf_escape($name) . ($jush == "pgsql" ? $on : "");
"DROP TRIGGER " . idf_escape($_GET["name"]) . ($jush == "pgsql" ? $on : ""), $location = ME . "table=" . urlencode($TABLE);
"CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . ($jush == "mssql" ? $on . $timing_event : $timing_event . $on) . rtrim(" $_POST[Type]\n$_POST[Statement]", ";") . ";", if ($_POST["drop"]) {
ME . "table=" . urlencode($TABLE), query_redirect($drop, $location, lang('Trigger has been dropped.'));
lang('Trigger has been dropped.'), } else {
lang('Trigger has been altered.'), if ($name != "") {
lang('Trigger has been created.'), queries($drop);
$_GET["name"] }
); queries_redirect(
$location,
($name != "" ? lang('Trigger has been altered.') : lang('Trigger has been created.')),
queries(create_trigger($on, $_POST))
);
if ($name != "") {
queries(create_trigger($on, $row + array("Type" => reset($trigger_options["Type"]))));
}
}
}
$row = $_POST;
} }
page_header(($_GET["name"] != "" ? lang('Alter trigger') . ": " . h($_GET["name"]) : lang('Create trigger')), $error, array("table" => $TABLE)); page_header(($name != "" ? lang('Alter trigger') . ": " . h($name) : lang('Create trigger')), $error, array("table" => $TABLE));
$row = $_POST;
if (!$row) {
$row = trigger($_GET["name"]) + array("Trigger" => $TABLE . "_bi");
}
?> ?>
<form action="" method="post" id="form"> <form action="" method="post" id="form">
@@ -32,11 +39,10 @@ if (!$row) {
<tr><th><?php echo lang('Event'); ?><td><?php echo html_select("Event", $trigger_event, $row["Event"], "this.form['Timing'].onchange();"); ?> <tr><th><?php echo lang('Event'); ?><td><?php echo html_select("Event", $trigger_event, $row["Event"], "this.form['Timing'].onchange();"); ?>
<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"> <p><?php echo lang('Name'); ?>: <input name="Trigger" value="<?php echo h($row["Trigger"]); ?>" maxlength="64" autocapitalize="off">
<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 ($_GET["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(); ?>><?php } ?>
<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1"><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">
</form> </form>

View File

@@ -1,20 +1,20 @@
<?php <?php
$TYPE = $_GET["type"]; $TYPE = $_GET["type"];
$row = $_POST;
if ($_POST && !$error) { if ($_POST && !$error) {
$link = substr(ME, 0, -1); $link = substr(ME, 0, -1);
if ($_POST["drop"]) { if ($_POST["drop"]) {
query_redirect("DROP TYPE " . idf_escape($TYPE), $link, lang('Type has been dropped.')); query_redirect("DROP TYPE " . idf_escape($TYPE), $link, lang('Type has been dropped.'));
} else { } else {
query_redirect("CREATE TYPE " . idf_escape(trim($_POST["name"])) . " $_POST[as]", $link, lang('Type has been created.')); query_redirect("CREATE TYPE " . idf_escape(trim($row["name"])) . " $row[as]", $link, lang('Type has been created.'));
} }
} }
page_header($TYPE != "" ? lang('Alter type') . ": " . h($TYPE) : lang('Create type'), $error); page_header($TYPE != "" ? lang('Alter type') . ": " . h($TYPE) : lang('Create type'), $error);
$row = $_POST;
if (!$row) { if (!$row) {
$row = array("as" => "AS "); $row["as"] = "AS ";
} }
?> ?>
@@ -24,7 +24,7 @@ if (!$row) {
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() . ">\n";
} else { } else {
echo "<input name='name' value='" . h($row['name']) . "'>\n"; echo "<input name='name' value='" . h($row['name']) . "' autocapitalize='off'>\n";
textarea("as", $row["as"]); textarea("as", $row["as"]);
echo "<p><input type='submit' value='" . lang('Save') . "'>\n"; echo "<p><input type='submit' value='" . lang('Save') . "'>\n";
} }

View File

@@ -26,6 +26,7 @@ if ($_POST) {
} }
$grants = array(); $grants = array();
$old_pass = ""; $old_pass = "";
if (isset($_GET["host"]) && ($result = $connection->query("SHOW GRANTS FOR " . q($USER) . "@" . q($_GET["host"])))) { //! use information_schema for MySQL 5 - column names in column privileges are not escaped if (isset($_GET["host"]) && ($result = $connection->query("SHOW GRANTS FOR " . q($USER) . "@" . q($_GET["host"])))) { //! use information_schema for MySQL 5 - column names in column privileges are not escaped
while ($row = $result->fetch_row()) { while ($row = $result->fetch_row()) {
if (preg_match('~GRANT (.*) ON (.*) TO ~', $row[0], $match) && preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~', $match[1], $matches, PREG_SET_ORDER)) { //! escape the part between ON and TO if (preg_match('~GRANT (.*) ON (.*) TO ~', $row[0], $match) && preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~', $match[1], $matches, PREG_SET_ORDER)) { //! escape the part between ON and TO
@@ -46,18 +47,27 @@ if (isset($_GET["host"]) && ($result = $connection->query("SHOW GRANTS FOR " . q
if ($_POST && !$error) { if ($_POST && !$error) {
$old_user = (isset($_GET["host"]) ? q($USER) . "@" . q($_GET["host"]) : "''"); $old_user = (isset($_GET["host"]) ? q($USER) . "@" . q($_GET["host"]) : "''");
$new_user = q($_POST["user"]) . "@" . q($_POST["host"]); // if $_GET["host"] is not set then $new_user is always different
$pass = q($_POST["pass"]);
if ($_POST["drop"]) { if ($_POST["drop"]) {
query_redirect("DROP USER $old_user", ME . "privileges=", lang('User has been dropped.')); query_redirect("DROP USER $old_user", ME . "privileges=", lang('User has been dropped.'));
} else { } else {
$created = false; $new_user = q($_POST["user"]) . "@" . q($_POST["host"]); // if $_GET["host"] is not set then $new_user is always different
if ($old_user != $new_user) { $pass = $_POST["pass"];
$created = queries(($connection->server_info < 5 ? "GRANT USAGE ON *.* TO" : "CREATE USER") . " $new_user IDENTIFIED BY" . ($_POST["hashed"] ? " PASSWORD" : "") . " $pass"); if ($pass != '' && !$_POST["hashed"]) {
$error = !$created; // compute hash in a separate query so that plain text password is not saved to history
} elseif ($_POST["pass"] != $old_pass || !$_POST["hashed"]) { $pass = $connection->result("SELECT PASSWORD(" . q($pass) . ")");
queries("SET PASSWORD FOR $new_user = " . ($_POST["hashed"] ? $pass : "PASSWORD($pass)")); $error = !$pass;
} }
$created = false;
if (!$error) {
if ($old_user != $new_user) {
$created = queries(($connection->server_info < 5 ? "GRANT USAGE ON *.* TO" : "CREATE USER") . " $new_user IDENTIFIED BY PASSWORD " . q($pass));
$error = !$created;
} elseif ($pass != $old_pass) {
queries("SET PASSWORD FOR $new_user = " . q($pass));
}
}
if (!$error) { if (!$error) {
$revoke = array(); $revoke = array();
foreach ($new_grants as $object => $grant) { foreach ($new_grants as $object => $grant) {
@@ -83,6 +93,7 @@ if ($_POST && !$error) {
} }
} }
} }
if (!$error && isset($_GET["host"])) { if (!$error && isset($_GET["host"])) {
if ($old_user != $new_user) { if ($old_user != $new_user) {
queries("DROP USER $old_user"); queries("DROP USER $old_user");
@@ -94,7 +105,9 @@ if ($_POST && !$error) {
} }
} }
} }
queries_redirect(ME . "privileges=", (isset($_GET["host"]) ? lang('User has been altered.') : lang('User has been created.')), !$error); queries_redirect(ME . "privileges=", (isset($_GET["host"]) ? lang('User has been altered.') : lang('User has been created.')), !$error);
if ($created) { if ($created) {
// delete new user in case of an error // delete new user in case of an error
$connection->query("DROP USER $new_user"); $connection->query("DROP USER $new_user");
@@ -113,15 +126,15 @@ if ($_POST) {
if ($old_pass != "") { if ($old_pass != "") {
$row["hashed"] = true; $row["hashed"] = true;
} }
$grants[(DB == "" || $grants ? "" : idf_escape(addcslashes(DB, "%_"))) . ".*"] = array(); $grants[(DB == "" || $grants ? "" : idf_escape(addcslashes(DB, "%_\\"))) . ".*"] = array();
} }
?> ?>
<form action="" method="post"> <form action="" method="post">
<table cellspacing="0"> <table cellspacing="0">
<tr><th><?php echo lang('Server'); ?><td><input name="host" maxlength="60" value="<?php echo h($row["host"]); ?>"> <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"]); ?>"> <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 id="pass" name="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"]) { ?><script type="text/javascript">typePassword(document.getElementById('pass'));</script><?php } ?>
<?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>
@@ -129,13 +142,14 @@ if ($_POST) {
<?php <?php
//! MAX_* limits, REQUIRE //! MAX_* limits, REQUIRE
echo "<table cellspacing='0'>\n"; echo "<table cellspacing='0'>\n";
echo "<thead><tr><th colspan='2'><a href='http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/grant.html#priv_level' target='_blank' rel='noreferrer'>" . lang('Privileges') . "</a>"; echo "<thead><tr><th colspan='2'><a href='http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/grant.html#priv_level' target='_blank' rel='noreferrer' class='help'>" . lang('Privileges') . "</a>";
$i = 0; $i = 0;
foreach ($grants as $object => $grant) { foreach ($grants as $object => $grant) {
echo '<th>' . ($object != "*.*" ? "<input name='objects[$i]' value='" . h($object) . "' size='10'>" : "<input type='hidden' name='objects[$i]' value='*.*' size='10'>*.*"); //! separate db, table, columns, PROCEDURE|FUNCTION, routine echo '<th>' . ($object != "*.*" ? "<input name='objects[$i]' value='" . h($object) . "' size='10' autocapitalize='off'>" : "<input type='hidden' name='objects[$i]' value='*.*' size='10'>*.*"); //! separate db, table, columns, PROCEDURE|FUNCTION, routine
$i++; $i++;
} }
echo "</thead>\n"; echo "</thead>\n";
foreach (array( foreach (array(
"" => "", "" => "",
"Server Admin" => lang('Server'), "Server Admin" => lang('Server'),
@@ -155,12 +169,13 @@ 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'><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');\"")) . ">"; //! uncheck all except grant if all is checked 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
} }
$i++; $i++;
} }
} }
} }
echo "</table>\n"; echo "</table>\n";
?> ?>
<p> <p>

View File

@@ -1,33 +1,48 @@
<?php <?php
$TABLE = $_GET["view"]; $TABLE = $_GET["view"];
$dropped = false; $row = $_POST;
if ($_POST && !$error) { if ($_POST && !$error) {
$name = trim($_POST["name"]); $name = trim($row["name"]);
$dropped = drop_create( $as = " AS\n$row[select]";
"DROP VIEW " . table($TABLE), $location = ME . "table=" . urlencode($name);
"CREATE VIEW " . table($name) . " AS\n$_POST[select]", $message = lang('View has been altered.');
($_POST["drop"] ? substr(ME, 0, -1) : ME . "table=" . urlencode($name)),
lang('View has been dropped.'), if (!$_POST["drop"] && $TABLE == $name && $jush != "sqlite") {
lang('View has been altered.'), query_redirect(($jush == "mssql" ? "ALTER" : "CREATE OR REPLACE") . " VIEW " . table($name) . $as, $location, $message);
lang('View has been created.'), } else {
$TABLE $temp_name = $name . "_adminer_" . uniqid();
); drop_create(
"DROP VIEW " . table($TABLE),
"CREATE VIEW " . table($name) . $as,
"DROP VIEW " . table($name),
"CREATE VIEW " . table($temp_name) . $as,
"DROP VIEW " . table($temp_name),
($_POST["drop"] ? substr(ME, 0, -1) : $location),
lang('View has been dropped.'),
$message,
lang('View has been created.'),
$TABLE,
$name
);
}
}
if (!$_POST && $TABLE != "") {
$row = view($TABLE);
$row["name"] = $TABLE;
if (!$error) {
$error = $connection->error;
}
} }
page_header(($TABLE != "" ? lang('Alter view') : lang('Create view')), $error, array("table" => $TABLE), $TABLE); page_header(($TABLE != "" ? lang('Alter view') : lang('Create view')), $error, array("table" => $TABLE), $TABLE);
$row = $_POST;
if (!$row && $TABLE != "") {
$row = view($TABLE);
$row["name"] = $TABLE;
}
?> ?>
<form action="" method="post"> <form action="" method="post">
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64"> <p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64" autocapitalize="off">
<p><?php textarea("select", $row["select"]); ?> <p><?php textarea("select", $row["select"]); ?>
<p> <p>
<?php if ($dropped) { // old view was dropped but new wasn't created ?><input type="hidden" name="dropped" value="1"><?php } ?>
<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 ($_GET["view"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>"> <input type="hidden" name="token" value="<?php echo $token; ?>">

View File

@@ -1,3 +1,76 @@
Adminer (released 2013-06-29):
Increase click target for checkboxes
Use shadow for highlighting default button
Don't use LIMIT 1 if inline updating unique row
Don't check previous checkbox on added column in create table (bug #3614245)
Order table list by name
Verify UTF-8 encoding of CSV import
Notify user about expired master password for permanent login
Highlight table being altered in navigation
Send 404 for invalid database and schema
Fix title and links on invalid table pages
Display error on invalid alter table and view pages
MySQL: Speed up updating rows without numeric or UTF-8 primary key
Non-MySQL: Descending indexes
PostgreSQL: Fix detecting oid column in PDO
PostgreSQL: Handle timestamp types (bug #3614086)
Add Korean translation
Adminer 3.7.0 (released 2013-05-19):
Allow more SQL files to be uploaded at the same time
Print run time next to executed queries
Don't drop original view and routine before creating the new one
Highlight default submit button
Add server placeholder to login form
Disable SQL export when applying functions in select
Allow using lang() in plugins (customization)
Remove bzip2 compression support
Constraint memory used in TAR export
Allow exporting views dependent on each other (bug #3459151)
Fix resetting search (bug #3612507)
Don't use LIMIT 1 if updating unique row (bug #3613109)
Restrict editing rows without unique identifier to search results
Display navigation bellow main content on mobile browsers
Get number of rows on export page asynchronously
MySQL: Optimize create table page and Editor navigation
MySQL: Display bit type as binary number
MySQL: Improve export of binary data types
MySQL: Fix handling of POINT data type (bug #3582578)
MySQL: Don't export binary and geometry columns twice in select
MySQL: Fix EXPLAIN in MySQL < 5.1, bug since Adminer 3.6.4
SQLite: Export views
PostgreSQL: Fix swapped NULL and NOT NULL columns in PDO
Adminer 3.6.4 (released 2013-04-26):
Display pagination on a fixed position
Increase default select limit to 50
Display SQL edit form on Ctrl+click on the select query
Display SQL history from newest
Recover original view, trigger, routine if creating fails
Do not store plain text password to history in creating user
Selectable ON UPDATE CURRENT_TIMESTAMP field in create table
Open database to a new window after selecting it with Ctrl
Clear column name after resetting search (bug #3601200)
Explain partitions in SQL query (bug #3600150)
Allow loading more data with inline edit (bug #3605531)
Stay on the same page after deleting rows (bug #3605845)
Respect checked tables in export filename (bug #3245464)
Respect PHP configuration max_input_vars
Fix unsetting permanent login after logout
Disable autocapitalize in identifiers on mobile browsers
MySQL: Compatibility with MySQL 5.6
MySQL: Move ALTER export to plugin
MySQL: Use numeric time zone in export
MySQL: Link processlist documentation
SQLite: Export indexes
Adminer 3.6.3 (released 2013-01-23):
Display error code in SQL query
Allow specifying external links
Treat Meta key same as Ctrl
Fix XSS in displaying non-UTF-8 strings
Don't use type="number" for decimal numbers
Adminer 3.6.2 (released 2012-12-21): Adminer 3.6.2 (released 2012-12-21):
Edit values by Ctrl+click instead of double click Edit values by Ctrl+click instead of double click
Don't select row on double click Don't select row on double click

View File

@@ -42,6 +42,19 @@ function put_file($match) {
} }
$return = file_get_contents(dirname(__FILE__) . "/$project/$match[2]"); $return = file_get_contents(dirname(__FILE__) . "/$project/$match[2]");
if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) { if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) {
if (basename($match[2]) == "lang.inc.php") {
$return = str_replace('function lang($idf, $number = null) {', 'function lang($idf, $number = null) {
if (is_string($idf)) { // compiled version uses numbers, string comes from a plugin
// English translation is closest to the original identifiers //! pluralized translations are not found
$pos = array_search($idf, get_translations("en")); //! this should be cached
if ($pos !== false) {
$idf = $pos;
}
}', $return, $count);
if (!$count) {
echo "lang() not found\n";
}
}
$tokens = token_get_all($return); // to find out the last token $tokens = token_get_all($return); // to find out the last token
return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : ""); return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : "");
} elseif (preg_match('~\\s*(\\$pos = (.+\n).+;)~sU', $return, $match2)) { } elseif (preg_match('~\\s*(\\$pos = (.+\n).+;)~sU', $return, $match2)) {
@@ -50,16 +63,19 @@ function put_file($match) {
return '$_SESSION[lang]'; return '$_SESSION[lang]';
} }
function lang(\$translation, \$number) { function lang(\$translation, \$number = null) {
\$pos = $match2[2]\t\t: " . (preg_match("~\\\$LANG == '$_SESSION[lang]'.* \\? (.+)\n~U", $match2[1], $match3) ? $match3[1] : "1") . ' if (is_array(\$translation)) {
); \$pos = $match2[2]\t\t\t: " . (preg_match("~\\\$LANG == '$_SESSION[lang]'.* \\? (.+)\n~U", $match2[1], $match3) ? $match3[1] : "1") . '
$translation = str_replace("%d", "%s", $translation[$pos]); );
$translation = $translation[$pos];
}
$translation = str_replace("%d", "%s", $translation);
$number = number_format($number, 0, ".", lang(\',\')); $number = number_format($number, 0, ".", lang(\',\'));
return sprintf($translation, $number); return sprintf($translation, $number);
} }
'; ';
} else { } else {
echo "lang() not found\n"; echo "lang() \$pos not found\n";
} }
} }
@@ -123,13 +139,19 @@ if ($_SESSION["translations_version"] != ' . $translations_version . ') {
$translations = array(); $translations = array();
$_SESSION["translations_version"] = ' . $translations_version . '; $_SESSION["translations_version"] = ' . $translations_version . ';
} }
if (!$translations) {
switch ($LANG) {' . $return . ' function get_translations($lang) {
switch ($lang) {' . $return . '
} }
$translations = array(); $translations = array();
foreach (explode("\n", lzw_decompress($compressed)) as $val) { foreach (explode("\n", lzw_decompress($compressed)) as $val) {
$translations[] = (strpos($val, "\t") ? explode("\t", $val) : $val); $translations[] = (strpos($val, "\t") ? explode("\t", $val) : $val);
} }
return $translations;
}
if (!$translations) {
$translations = get_translations($LANG);
} }
'; ';
} }

570
designs/nette/adminer.css Normal file
View File

@@ -0,0 +1,570 @@
/* Theme "Nette" for Adminer, (c) David Grudl */
/*
it is based on some parts of:
- Nette Framework design - http://api.nette.org
- CSS by Brade - http://www.bradezone.com
- Silk icon set 1.3 by Mark James - http://www.famfamfam.com/lab/icons/silk
- CSS icons by Hever - http://hev.cz
*/
body {
background: #FFF;
color: #333;
font: 13px/18px Helvetica, Arial, sans-serif;
}
/* generic */
a, a:visited {
padding: 3px 2px;
color: #006AEB;
text-decoration: none;
}
a:hover {
background-color: #006AEB !important;
border-bottom: 1px solid #006AEB;
color: #FFF;
}
p {
margin-bottom: 4px;
padding-bottom: 4px;
}
h1 {
background: none;
border: none;
color: #666;
font-size: 18px;
font-weight: bold;
height: 40px;
padding: 0 0 8px;
}
h2 {
background: transparent;
border: none;
color: #333;
font: 32px Georgia,serif;
margin: 0;
padding: 10px 0 8px;
}
h3 {
font-size: 18px;
font-weight: bold;
margin: 0;
padding: 4px 0;
}
fieldset {
border: 1px solid #CCC;
float: left;
margin-bottom: 8px;
margin-right: 4px;
min-height: 48px;
padding: 0 4px 4px;
}
fieldset div {
margin-top: 4px;
}
input, select, textarea {
border: 1px solid #CCC;
color: #555;
font: 13px Helvetica,Arial,sans-serif;
padding: 3px;
}
select {
padding: 2px;
}
textarea, .sqlarea {
font-family: Consolas,monospace;
height: 500px;
}
input[type=submit] {
background: #4890E7;
color: white;
cursor: pointer;
padding: 3px;
border: none;
}
input[type=submit]:hover {
background-color: #006AEB;
}
input[type=image], input[type=checkbox] {
border: none;
padding: 0;
vertical-align: middle;
}
label input[type=checkbox], td input[type=radio], td span select {
margin-right: 4px;
}
fieldset select {
margin-right: 4px;
}
option {
padding: 0 5px;
}
optgroup {
font-size: 11px;
}
code {
background: #EEE;
font-family: Consolas,monospace;
padding: 2px 4px;
}
code a:hover {
background-color: transparent !important;
}
table {
border: 1px solid #D0CDC4;
font-size: inherit;
margin: 4px 0 8px;
}
tbody tr:hover td, tbody tr:hover th {
background: #EDF4FF;
}
th, td {
background: inherit;
border: 1px dotted #CCC;
border-width:0 0 0 1px;
font-weight: normal;
margin: 0;
padding: 3px 5px;
text-align: left;
vertical-align: top;
}
.odd th, .odd td {
background: #FCFAF5;
}
.js .checked th, .js .checked td {
background: #CEE0FC;
}
thead th, thead td {
background: #F2EEE1;
border-color: #D0CDC4;
font-weight: bold;
white-space: nowrap;
}
thead tr:hover td, thead tr:hover th,
.js thead .checked th, .js thead .checked td {
background: #F2EEE1;
}
th:first-child, td:first-child {
border-color: transparent;
white-space: nowrap;
}
td[align=right] {
text-align: right;
}
table code {
font-size: 13px;
line-height: 18px;
}
.hidden {
display: none;
}
.error, .message {
background: transparent;
font-weight: bold;
padding: 0;
}
.error {
color: #C00;
}
.message {
color: #090;
}
/* specific */
#content {
height: 100%;
margin: 40px 0 0 300px;
padding: 20px;
background: white;
z-index: 1;
}
#content:after {
clear: both;
content: "";
display: table;
}
#content > h2:before {
display: block;
content: "";
color: #FF9;
font-size: 13px;
background: #333;
line-height: 40px;
margin: 0;
padding: 0 0 0 20px;
position: fixed;
top: 0;
left: 300px;
width: 100%;
height: 40px;
}
#content > #breadcrumb + h2:before {
display: none;
}
#content > p {
clear: left;
}
#lang {
background: #333;
color: #FFF;
height: 40px;
line-height: 40px;
padding: 0 0 0 40px;
position: fixed;
top: 0;
left: 0;
width: 260px;
}
#lang select {
border: none;
background: #5F5F5F;
color: white;
}
#menu {
background: #FCFAF5;
border-right: 5px solid #E4E2DA;
bottom: 0;
margin: 0;
overflow: auto;
padding: 10px 15px;
position: fixed;
top: 40px;
width: 240px;
}
#menu a {
color: #333;
border: none;
margin-right: 4px;
}
#tables a {
padding: 1px 2px;
}
#menu a:hover {
color: #FFF;
}
#menu p {
border: none;
margin: 0 0 4px;
padding: 0 0 4px;
white-space: nowrap;
}
#breadcrumb {
background: #333;
color: #FFF;
line-height: 40px;
margin: 0;
padding: 0 0 0 20px;
position: fixed;
top: 0;
left: 300px;
width: 100%;
height: 40px;
}
#breadcrumb a {
color: #FF9;
}
#breadcrumb a:hover {
background: transparent;
border-color: #FF9;
color: #FF9;
}
#schema .table {
background: #F3F3F3;
padding: 4px 8px;
}
#logins a, #tables a {
background: transparent;
}
/* IE hacks */
* + html th:first-child, * + html td:first-child {
border-color: inherit;
white-space: inherit;
}
* html #lang, * html #menu, * html #breadcrumb {
position: absolute;
}
* html #lang {
height: 30px;
padding-top: 10px;
}
* html form#form {
height: 100%;
}
#content > p.tabs + *:after {
display: table;
clear: both;
content: "";
}
/* icons */
.error {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIsSURBVDjLpVNLSJQBEP7+h6uu62vLVAJDW1KQTMrINQ1vPQzq1GOpa9EppGOHLh0kCEKL7JBEhVCHihAsESyJiE4FWShGRmauu7KYiv6Pma+DGoFrBQ7MzGFmPr5vmDFIYj1mr1WYfrHPovA9VVOqbC7e/1rS9ZlrAVDYHig5WB0oPtBI0TNrUiC5yhP9jeF4X8NPcWfopoY48XT39PjjXeF0vWkZqOjd7LJYrmGasHPCCJbHwhS9/F8M4s8baid764Xi0Ilfp5voorpJfn2wwx/r3l77TwZUvR+qajXVn8PnvocYfXYH6k2ioOaCpaIdf11ivDcayyiMVudsOYqFb60gARJYHG9DbqQFmSVNjaO3K2NpAeK90ZCqtgcrjkP9aUCXp0moetDFEeRXnYCKXhm+uTW0CkBFu4JlxzZkFlbASz4CQGQVBFeEwZm8geyiMuRVntzsL3oXV+YMkvjRsydC1U+lhwZsWXgHb+oWVAEzIwvzyVlk5igsi7DymmHlHsFQR50rjl+981Jy1Fw6Gu0ObTtnU+cgs28AKgDiy+Awpj5OACBAhZ/qh2HOo6i+NeA73jUAML4/qWux8mt6NjW1w599CS9xb0mSEqQBEDAtwqALUmBaG5FV3oYPnTHMjAwetlWksyByaukxQg2wQ9FlccaK/OXA3/uAEUDp3rNIDQ1ctSk6kHh1/jRFoaL4M4snEMeD73gQx4M4PsT1IZ5AfYH68tZY7zv/ApRMY9mnuVMvAAAAAElFTkSuQmCC") no-repeat scroll 0.8em center #FFEEEE;
padding-left: 38px;
}
.message, #menu p.message {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKfSURBVDjLpZPrS1NhHMf9O3bOdmwDCWREIYKEUHsVJBI7mg3FvCxL09290jZj2EyLMnJexkgpLbPUanNOberU5taUMnHZUULMvelCtWF0sW/n7MVMEiN64AsPD8/n83uucQDi/id/DBT4Dolypw/qsz0pTMbj/WHpiDgsdSUyUmeiPt2+V7SrIM+bSss8ySGdR4abQQv6lrui6VxsRonrGCS9VEjSQ9E7CtiqdOZ4UuTqnBHO1X7YXl6Daa4yGq7vWO1D40wVDtj4kWQbn94myPGkCDPdSesczE2sCZShwl8CzcwZ6NiUs6n2nYX99T1cnKqA2EKui6+TwphA5k4yqMayopU5mANV3lNQTBdCMVUA9VQh3GuDMHiVcLCS3J4jSLhCGmKCjBEx0xlshjXYhApfMZRP5CyYD+UkG08+xt+4wLVQZA1tzxthm2tEfD3JxARH7QkbD1ZuozaggdZbxK5kAIsf5qGaKMTY2lAU/rH5HW3PLsEwUYy+YCcERmIjJpDcpzb6l7th9KtQ69fi09ePUej9l7cx2DJbD7UrG3r3afQHOyCo+V3QQzE35pvQvnAZukk5zL5qRL59jsKbPzdheXoBZc4saFhBS6AO7V4zqCpiawuptwQG+UAa7Ct3UT0hh9p9EnXT5Vh6t4C22QaUDh6HwnECOmcO7K+6kW49DKqS2DrEZCtfuI+9GrNHg4fMHVSO5kE7nAPVkAxKBxcOzsajpS4Yh4ohUPPWKTUh3PaQEptIOr6BiJjcZXCwktaAGfrRIpwblqOV3YKdhfXOIvBLeREWpnd8ynsaSJoyESFphwTtfjN6X1jRO2+FxWtCWksqBApeiFIR9K6fiTpPiigDoadqCEag5YUFKl6Yrciw0VOlhOivv/Ff8wtn0KzlebrUYwAAAABJRU5ErkJggg==") no-repeat scroll 0.8em center #EEFFEE;
padding-left: 38px;
}
a[href$="sql="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHGSURBVHjaxFPNLkNREP5aB6WhaKLSVtKFiIUqK1sLT2DhTXgDL2FlxSOw8FOLRiyQWhDRiKSEhKQJou49P9fMnFsLsevCJCcz594z3/m+mTmJKIrQjSXRpXUNoGqbm39qcMbAkbyIvbVwYQhD3tIeWsOQ1+QVH86Xyz+JXJPIOb9iAI4ZpOMd/yN/vb/vAdiC93cP0El2dNA6z4RjYyW2MaPU0BB0u+0BOGGsVML49LSA3J+cYDCblb0l6jeHBwg/26isrOB0a8uzYBlBgKShgD8M53J4aTTQqFaRSCYl+WxnG83zcxTmKpKg+vtFu9W8NDQDMCXW+VivYyAzjKmlJahUSpiYUKPVbCKTz0sCGzOyOpBLzdcXlCMdDDIxO4vboyoyhQIKlYocLi0uIjczIyBcA98dYqx9NywxUEyDi/P29IyF1VU5dFeroS+dRnF+Xvajk5N0ayjx8tq6+FuSyiwUF4LRHi/reLg4o9ijs6xG9RjWGowUi/h4fcXexoa0L4oc0mNZuVgFzID09VKBnFXoUb7Pnb5zQrvVovpkZC4QzwfiN6QM1eBqdxcmnq6IAA395Mlz8eTxTZwg/pcl/v01fgswAESqYZbsIsnLAAAAAElFTkSuQmCC") no-repeat scroll left bottom;
padding-left: 22px;
}
a[href*="dump="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJrSURBVHjajFPPaxNREP72V8ymTbGQbRB/IT0otdV6CcWTgqCoUFQQEXoSEQ/+AypK755E1KsULIpGgw1F9KC22lgstFgQLdoWhSab2PRHTNrs7nvObGhSsRa/ZXjv7c6b+eabWUVKiX9AJQuRRci2k+260N91VwgJIQSEV1mVnjf5axTjvCfFFn7hCcBlBzJNVRA0gAZTQ1ODgXC4gDtjV9AW2QNFUTA0/Q66kPLSqVg4shYF8vEdKQ7mln+i+/VVRM0oFpbmETLq/SS6J4R/OfHtHmV24XouHFo94REDAyE9hMZgBMkvT2GZFqxQE6by0/g4P74SoKLB2ZZzWA8ffqRQLBcxNTuFjRTwxpmbfad7Oo/rHhdN6B20/6JvaKyBCnODhqNbL+PRxHXUGXWINV5kl9TDrkQct/pnZKHkyPsDGcl4MJiWq5Ecsf84LxTL8nbyK2+Pke3XHWJAQkLXgMdDNjRNRTxlQ6UmakRD0vN8NEd7EBsFO6Impu1fzGCCrOSXwCro5HEiZiExnEVnrKlaypNhG4fba02aTC8ik1/ibZrM9RlIkkGnjH0jWWJQWRn8TpLI8fcZ6MSA1WrZFERx2eHPTEPqjksBqASDLh7ZZ+HlWA6H9tYyvhjNomNnI8Km7p8/f5+HGdB46/lJeOoYPHV8mbGy8gA59HngU74asNkKYKVzlQCuW9GA6B5si+DVeA4HWmsM4qksTnZY1TMz0NRauysaUAmt2+oxM1tCM6k8mS74WXjIdm8O+JdWg36oKgXqgnzb3TvRXvZEneN6YPNIFw7MY70W5haXnlUHbp3f+b/wW4ABAAtWTLcKdqLcAAAAAElFTkSuQmCC") no-repeat scroll 2px center;
padding-left: 22px;
}
a[href$="dump="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHzSURBVHjajJPPS+NQEMcnaaxpdWsp6Q8vtWtdkIo9+B948SjIgruCUg8F/wGP/glePe5JcBehwl4qePGm0J6KQj30UBHEzaFLUromTfPizJMnrxhhB4bJvDfzme97SZQgCOB/be98J2AsAMYYMP81KjKg0WhMYljHtS30RSz4gjkGdot559F7OLt8vvi1bJRBURS4vr8CTTQ3m80SFv1MpVJlwzBA13XuNGUwGKyY1p+Vk9aPzWw8C7ZjQXximu+9ATA5KhQK5Uwmw+nCIpEIJBIJOLjah3Q8w7379x5urFsOUEUhTl/C6R+ef35mARzPhW6vC+q/iHvyvaYwXwIQje6j1+tBv98H13VhNBpxxyPA5tw2TI50MPQsrMbXbOo53fmtaJIC7iSZAMPhkOe+73MA5Ruz3yCfz9NlvykLBUSjUR41TQPP8zhE7JNSyj8E0CbJpkiXKRoIRFABeQcQd0DFwlVV5evUTFBZRSiATEwnp4lCAa0LI2AoQC4WimRl4qgyYOw12rYNyWSSX6L4mKiBnukDK5VKYJrmmBpZwW6r1TotFotTuVyOQwQgnU7zV9npdKDdbj+hgnXRN/Yz1ev1zwg6QP+KU2disRiXblkWOI7zhJOPce+wWq2aoQDZarXaJ2xYQGfod5VKxQ2rexFgAI4OiAKxKkWeAAAAAElFTkSuQmCC") no-repeat scroll 2px center ;
padding-left: 22px;
}
select[name="db"] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAEYSURBVBgZBcHPio5hGAfg6/2+R980k6wmJgsJ5U/ZOAqbSc2GnXOwUg7BESgLUeIQ1GSjLFnMwsKGGg1qxJRmPM97/1zXFAAAAEADdlfZzr26miup2svnelq7d2aYgt3rebl585wN6+K3I1/9fJe7O/uIePP2SypJkiRJ0vMhr55FLCA3zgIAOK9uQ4MS361ZOSX+OrTvkgINSjS/HIvhjxNNFGgQsbSmabohKDNoUGLohsls6BaiQIMSs2FYmnXdUsygQYmumy3Nhi6igwalDEOJEjPKP7CA2aFNK8Bkyy3fdNCg7r9/fW3jgpVJbDmy5+PB2IYp4MXFelQ7izPrhkPHB+P5/PjhD5gCgCenx+VR/dODEwD+A3T7nqbxwf1HAAAAAElFTkSuQmCC") no-repeat scroll left center white;
padding-left: 16px;
}
select[name="db"] option {
padding-left: 18px;
}
#menu p a[href*="&select="] {
display: inline-block;
margin-right: 8px;
overflow: hidden;
padding-left: 0;
text-decoration: none;
width: 16px;
height: 16px;
}
#menu p a[href*="&select="]:before {
content: 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=");
padding-right: 5px;
display: inline-block;
margin-top: 2px;
}
#menu p a[href*="&table="], #menu p a[href*="&view="] {
display: inline-block;
text-decoration: none;
}
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 center;
padding-left: 22px;
}
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 center;
padding-left: 22px;
}
a[href*="&default="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ7SURBVHjabFPfa1JhGH6OR88odSKDaTEzS9i0jejXBtVuBzGooOgqoquu+heii27aRUTUaKx1nbAYDCqqm4raoBZDZrqhaCw31janm3r0eOb8+t4PFXW98Jz3O985z/P++j6JMQZJkroAODhk/Mfs/nZrJpLN8eUGxx/OqdQ/kgC3M7qub5fL5T1ujHtGvrYmlEolFggEnvB/j3IYiCe4VYF+IheLRaZpGiNPyOfzLJfLsXQ6zVKZDZZKpfaJkEkkQNEoCs9EeBJSVVUIZDIZkQ3tFQoFNjk5KURE+VWBczyD75VKBaFQCLu7uwJ8T4DWQ0ND1CtUewZZlgc4b65JQKQjSfXe8KggUfIEbf0zMnOvIFv6oKa+gBVWbhsbu03kSCRSj1xDTcSHWTj7bsLmOYXt391Y+jgx0iRAUf1+f+uEBFmNP4TZegHp+CIUSYe13QlLxxGbsTE6WSwWE4RaZIJbmYL9+CWU1gJQDkpYDi5BK5R2VDU3YGw9NF6vt+k9u3gPNu9laKtjMChlmCxumNkKnk0v3B19F48aG9OlLJLJZL1m685LdPZe5eTnMJjK0LMepGaDcA6PYPRWb5R4hsYSSMTlcuGAxhuZGEfniWHofycgKwylrBubM/M4fG0MbY6eeob7pvDz/TgsUhJlfj3WQk9h71SgpV3Y+hGGfP4+TLZDTSUaGodAj+Vfr+G/eAdtyW+ITs8g+CGN6Kcguq48gtt3thaoUi2b0XkmIi+7UiQfS2xCD7+B5+QgzOZurIcS8N14DKXDIzIkMrcCTVeIVZvnql5nw/VB+9fTxxxyf48H+T114cVU+MHb+a3VlmEReYNzk/8EGADOaaVGDf2TtwAAAABJRU5ErkJggg==") no-repeat scroll 2px center;
padding-left: 22px;
}
#content 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 2px center;
padding-left: 22px;
}
#content p a[href*="&page="] {
background-image: none;
padding: .2em .5em;
}
#content p a[href*="&edit="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJvSURBVDjLpZPrS5NhGIf9W7YvBYOkhlkoqCklWChv2WyKik7blnNris72bi6dus0DLZ0TDxW1odtopDs4D8MDZuLU0kXq61CijSIIasOvv94VTUfLiB74fXngup7nvrnvJABJ/5PfLnTTdcwOj4RsdYmo5glBWP6iOtzwvIKSWstI0Wgx80SBblpKtE9KQs/We7EaWoT/8wbWP61gMmCH0lMDvokT4j25TiQU/ITFkek9Ow6+7WH2gwsmahCPdwyw75uw9HEO2gUZSkfyI9zBPCJOoJ2SMmg46N61YO/rNoa39Xi41oFuXysMfh36/Fp0b7bAfWAH6RGi0HglWNCbzYgJaFjRv6zGuy+b9It96N3SQvNKiV9HvSaDfFEIxXItnPs23BzJQd6DDEVM0OKsoVwBG/1VMzpXVWhbkUM2K4oJBDYuGmbKIJ0qxsAbHfRLzbjcnUbFBIpx/qH3vQv9b3U03IQ/HfFkERTzfFj8w8jSpR7GBE123uFEYAzaDRIqX/2JAtJbDat/COkd7CNBva2cMvq0MGxp0PRSCPF8BXjWG3FgNHc9XPT71Ojy3sMFdfJRCeKxEsVtKwFHwALZfCUk3tIfNR8XiJwc1LmL4dg141JPKtj3WUdNFJqLGFVPC4OkR4BxajTWsChY64wmCnMxsWPCHcutKBxMVp5mxA1S+aMComToaqTRUQknLTH62kHOVEE+VQnjahscNCy0cMBWsSI0TCQcZc5ALkEYckL5A5noWSBhfm2AecMAjbcRWV0pUTh0HE64TNf0mczcnnQyu/MilaFJCae1nw2fbz1DnVOxyGTlKeZft/Ff8x1BRssfACjTwQAAAABJRU5ErkJggg==") no-repeat scroll 2px center;
padding-left: 22px;
}
#content p a[href*="&table="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJcSURBVDjLpZPtT5JhFMafrW997I9rscA+FFu2QRurtlw5cQ4InLpwBogIPNFSiNJ4C+JVkj0QTBHQKFPQlJfwlanY1tXz3ARkn2jd27Wz++yc33XOvd0UAOp/RNGR/X5zeH9rOlTDVKAK3fsqJrxlqN27GHPuYHh+G4rXRQzZNjEws47Hli/oo/PxNsAU3qvWT3/gX3TPuHrWBhiC30nSktXDtKLB1NI4NKkxqBMqjDByPFkcxNBCPwbCfXgUeEBq705m0AZM+qsk2e3hau88W+4ANOy+XPLFQrkrcbW31KkOYJx9rBaAOzPR0gVHW6x593q9cDgcqB6e4sZoogMYdXzD0ck5ZhfLsHGKVfAqVoadKcMdzcLr82PuwwZCoRACgQCWVzdhoK2gaVpDAMNzWzhkAXamQpze/I4t13w+j2AwiFwuh7W1NXg8HmQyGSgUCshkssuU3F7AQf0c84kK3n68KFc4hXQ6DavVCqlUCqVSSdaIx+NQq9UGMsHg7Ab2jxtwp5rOvqUqia3CUqnEObWn0mp1KBaLcLlckMvloPpfrhOAl230/SGLxQK3241CoQC9Xg9nskKk1emQzWZZkBZCoRBU3/NP2GMBgXTTObjSjI1GA8lkEgzDwO/3E4iObXY6nYhEIhCJRHoWcIW6b1pF7egMlYNT7NROUKzU8XX3GJ+3D2E0GgmAm4Zbh2s0mUyIRqMcAGKx+BIlMeSiYu1K/fbEMm4+TaFnJIHrSgZX5TFIZNPo7e1Fj9QOs9kMlUqFaw9pCASCnzwe7x15xG6/rUQiAZ/Px9/5XyhZOMVGKlOdAAAAAElFTkSuQmCC") no-repeat scroll 2px center;
padding-left: 22px;
}
#content p a[href*="&database="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKRSURBVDjLhVNLTBNRFD3TTju1FCcBaxuaQEr94ydiZIHGpcFISBOi0YREZWHCVoyRxKUxxq0LXcACQyLsjO6KjSEiDfHDz0S0CLSxlFKd2g7MTDudGd+bMAQCxJucuXfuu+fcO/PeYwzDALVoNMqRuI3guq7rR4g/SEBC/Svxc8T3EUTD4bCGTcZQAUI+RvxLr9d70u/3o6KiAm63G3Qtn89DFEUkk0lks9lRkrvW3t6e2lCgRZFI5F0ikaDtjN1MVVVjYmLCGBoa6qccC7Z1kQafz4f/WSAQAGlyaXOOpQ+SNNUymQxcLhc4joPD4TBzkiRBEASkUimEQiGzdlcBlmWRy+WgKIr5Xi6XUSgUUCwWzTVN+IAzeOOde71orP0eAaOkbrDWf6Cw2+3mBLSYgny3KULXPOUY2BUB/hMd4IOn8XfhMGYjvU+2TECLLRLDMNA0zYw5JYa6Ghke/hyEn9/gZEqo3OuHp7qW3yJgESjoNPSdlb8gWCOCr29BMT0Ip5tBYnIWqlL6o8irzVsEaHcKSqQCen4cweok+FAblNRz2JxlODx1cEkzGWmVbTl7Z/jHhgCF1Z3GYjIKf+U8+ANhQn4Gm6OMUiGI9MhHg5Gl1sbu8UnKNc8B7Ui3ipxEcwvlpVFw6hz2N1xGabkXdqeBYqEOmfefEZWac4e6xz9Z22hbn+BmLBZbi8fjEBdG4NF/QdUDSM88hQ4FawKJR6cxLDZl86qzZdtdoDYwMBAkQg/2LL/ovNLVh++Dd7G0OAau9hTkrKgnnE39GW3f/Z6enpUdBSx7ePu4eq+zi4VNw+TbV0gsxFd5b9X5i4+mpnY63tsErl6okhvrfWzT0SAMR3FMXsnean08Pb/b/fgHqpjCspi90kkAAAAASUVORK5CYII=") no-repeat scroll 2px center;
padding-left: 22px;
}
#content p a[href*="&schema="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFOSURBVDjLtVK7SgNRED0b9iuM2lr4QK1DQIyk0FZsJAj+gH+ilRZb2NjaRHTLmA9QFKz9huzm7t37Hu+u7IJgQjR6YLjDzOXMmcMERIR5EE5qXA4z4sqACYWEC5wfLQXf/WtMIuDSoL0A7DZDjBj/uYI0l8jzEEJYJMkvCEZM4PqZIxlzpGk+kSCY18TGtGYcx9Tv96dOqBUMBgNyzsFaC621312Ac+59yJFlGRhj5VvVoigKvniglEK32w1mkd3r9ejPPAjOhqdknYX18p1/rzo3pYqTh0OSRkJI5UMgPn4s61sX66SkhtEGcISGsQad5gH2FvehfV5BaIF2cwet5RZyKeu68pe5ubKG7dUNP5AQGltMN57Mosgr5EIiVQmYGvtc1PVicqHY+dXpk8Dg7v22XKFo1ARe9v1bDOlXKKKCs4Sn1xdU1v3vIc2CD3bN4xJjfJWvAAAAAElFTkSuQmCC") no-repeat scroll 2px center;
padding-left: 22px;
}
#content p a[href*="&sql="] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ5SURBVHjapFNLaxNRFP4mnZmQZtKYpJ2I8ZE0NSbSWKpgBYNUhIJQUDddCaILwb34C0RcCi60vpa14sZFoSjxUWxTFEubFkxf9kFS+7Jp0yQmM5mH905SF9pSwQt3vnPnnvPNd86cA13Xsds+23XKsdMdQx//s0z/6hi54he3e8/0d3ZuK0FTFGhUJkVVhSbLUAiq5IxSCQrBEkGWOu8Lh38HGrlpWnlXCKhNSbZQo3cEE9FomYAuKZstE2wFa8RR1cpKqK2o4JhxmLVJVAlh5Df6IFj5MgENcHq9EAMBg2RucBDVLpdxVon0iXdvIf8sQHRIsNReht3XjI3ZI8iuPAOrkDyorBq3G6vT08ikUuAsFiN46HkXXL56eI41QV1/BMF+GulvCfCMDFvNXtSIHrC0KDTPhXgc7lAQdQ2thk2XIpewnkzCJvTA4T8PabEbfDWD+ZFxyEUdX94sw6QVCkZlxWAQU+8/YGZgALV+v0HgbWmBNzQMR0M7it8fg+HWwQk2cLkkcvJh5NNFsCVJMgq1ubiE5o4OI5CS8FYrya8b9saLKC48gIlTIG/6sBaLw3PpHrTEMrSXr4kPIaAKFkbjSA0PEVuFlB+DO8Ah2HoB8tITVPE6iplDWOn7jLn0CSQevoDV6TI+zEpUASkkZzaTYrLIrH3C/qMCFEbE4th9OEQexfQBrPYP44d+DuY91eBp+1dGgFVIDb729kKpdJfQtIy2yFNMdN/E5McYzAebUEhOYjZuQXaj5+9W/nOYbl9vLN26doOFScVI9BXmZ6dy9jpnpO1O5dfsRtBxxlk4Xu9mT4Z80DkpVlhZvdp+d3RmpyH7JcAAnHiAVYWMsdkAAAAASUVORK5CYII=") no-repeat scroll 2px center;
padding-left: 24px;
}
table tbody input[type="checkbox"] {
display: block;
float: left;
}
table a[href*="&edit="][href*="&where"] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFUSURBVDjLrZM/SAJxGIZdWwuDlnCplkAEm1zkaIiGFFpyMIwGK5KGoK2lphDKkMDg3LLUSIJsSKhIi+684CokOtTiMizCGuzEU5K3vOEgKvtBDe/2Pc8H3x8NAM1fQlx4H9M3pcOWp6TXWmM8A7j0629v1nraiAVC0IrrwATKIgs5xyG5QiE+Z4iQdoeU2oAsnqCSO1NSTu+D9VhqRLD8nIB8F0Q2MgmJDyipCzjvYJkIfpN2UBLG8MpP4dxvQ3ZzGuyyBQ2H+AnOOCBd9aL6soh81A5hyYSGWyCFvxUcerqI4S+CvYVOFPMHxLAq8I3qdHVY5LbBhJzEsCrwutpRFBlUHy6wO2tEYtWAzLELPN2P03kjfj3luqDycV2F8AgefWbEnVqEHa2IznSD6BdsVDNStB0lfh0FPoQjdx8RrAqGzC0YprSgxzsUMOY2bf37N/6Ud1Vc9yYcH50CAAAAAElFTkSuQmCC") no-repeat scroll right center;
padding-right: 18px;
}
table input + a[href*="&edit="][href*="&where"] {
clear: right;
display: block;
float: left;
line-height: 15px;
margin-right: 8px;
overflow: hidden;
padding: 0;
text-decoration: none;
width: 16px;
}
table input + a[href*="&edit="][href*="&where"]:before {
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFUSURBVDjLrZM/SAJxGIZdWwuDlnCplkAEm1zkaIiGFFpyMIwGK5KGoK2lphDKkMDg3LLUSIJsSKhIi+684CokOtTiMizCGuzEU5K3vOEgKvtBDe/2Pc8H3x8NAM1fQlx4H9M3pcOWp6TXWmM8A7j0629v1nraiAVC0IrrwATKIgs5xyG5QiE+Z4iQdoeU2oAsnqCSO1NSTu+D9VhqRLD8nIB8F0Q2MgmJDyipCzjvYJkIfpN2UBLG8MpP4dxvQ3ZzGuyyBQ2H+AnOOCBd9aL6soh81A5hyYSGWyCFvxUcerqI4S+CvYVOFPMHxLAq8I3qdHVY5LbBhJzEsCrwutpRFBlUHy6wO2tEYtWAzLELPN2P03kjfj3luqDycV2F8AgefWbEnVqEHa2IznSD6BdsVDNStB0lfh0FPoQjdx8RrAqGzC0YprSgxzsUMOY2bf37N/6Ud1Vc9yYcH50CAAAAAElFTkSuQmCC");
padding-right: 5px;
}
table input + a[href*="&edit="][href*="&where"]:hover {
background: #FFC;
color: white;
margin-left: 19px;
margin-top: -1px;
overflow: visible;
padding: 1px 2px;
position: absolute;
width: auto;
}
table a[href*="&clone="] {
clear: right;
display: block;
float: left;
line-height: 15px;
margin-right: 8px;
overflow: hidden;
padding-top: 0;
text-decoration: none;
width: 16px;
}
table a[href*="&clone="]:before {
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADHSURBVCjPdZFNbsIwFAa/5B5FuQPCOQ9HQuqCq3SHUAtrrgFCSKQk8Y80XTjYJqiajRfj55GftNBKJtGoRiXSytlAZORzM1ckExjouHEm0LPdqHkTRnruXAgEPGpVq1JVCJ6RB3dOfHFEa7W5RzLx3kjPDse8ZxKisue9JwkByzevPQGZQnD8kHuunEvB43EcyD0dt/kEzzGdLD2/k9Ckb261zs9ZhiggVRO12jzN4Z5C+tQq90T+ETK20/J1tU2xeCOjpT7+APfbTaDnTb/mAAAAAElFTkSuQmCC");
padding-right: 5px;
}
table a[href*="&clone="]:hover {
background: #FFC;
border: 1px solid #CCC;
color: white;
font-size: .9em;
margin-left: 42px;
margin-top: -2px;
overflow: visible;
padding: 1px 2px;
position: absolute;
width: auto;
}
input[name="delete"], input[name="drop"] {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHSSURBVHjapFM5bsJQEB2zSIDFJrHYpEtyAyoKJAp6CrqIkBPkNDlBAKXjBEgUpKOBCyQNijFiEZvZl8z7wsjESYpkpNFfPO/Nmz9j6Xg80n/M9fWi3W7fMOnd4XAo8qogAbvO5xKvL6lU6s0aL1kVMDjP5ye/36+Gw2FyOp3EQFqtVtTr9WixWHT5/JhOp6s2ghP4ORaLyaFQiGazGa3Xa0HgdrvJ6/WSpmk0Go0MjnvIZDLVM0Gr1brm/WskEkkA3O/3abvdQjq5XC6xgoiVka7rNB6PNT6ns9nsu+OkpODxeBLBYJAGgwHt9/uzQ8Vms6Hdbie+KYqC+ASTFrARBMx2HwgEaDKZiHqn0yktl0uxtzrMMAyKx+MCc+4Cs13hwQCC1GQy+W3Lms2mUIUygbEqEBLNun8z8zswVgUfLO0WD4Z6kekn8/l8okNM8GFVUMYDoVWQ6HA4bEAzoyzL1O12kbRsJajwhYZhiUajJEnShWSAQaqqKnU6HahEGysXg9RoNPJ8+cwZZLSKp47m8/k5Kxzg4XBocNxDLper2ka5Xq+LUeatilahJLN1mEJ+ZDHKJthGAKvVauJnYi9ysHIqQee1xOsLg3/+mf5inwIMAJMhb74NwG5wAAAAAElFTkSuQmCC") no-repeat scroll left center;
border: none;
cursor: pointer;
font-size: .9em;
padding: 1px 5px 1px 18px;
color: #999;
}
input[name="delete"]:hover, input[name="drop"]:hover {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJdSURBVDjLpZP7S1NhGMf9W7YfogSJboSEUVCY8zJ31trcps6zTI9bLGJpjp1hmkGNxVz4Q6ildtXKXzJNbJRaRmrXoeWx8tJOTWptnrNryre5YCYuI3rh+8vL+/m8PA/PkwIg5X+y5mJWrxfOUBXm91QZM6UluUmthntHqplxUml2lciF6wrmdHriI0Wx3xw2hAediLwZRWRkCPzdDswaSvGqkGCfq8VEUsEyPF1O8Qu3O7A09RbRvjuIttsRbT6HHzebsDjcB4/JgFFlNv9MnkmsEszodIIY7Oaut2OJcSF68Qx8dgv8tmqEL1gQaaARtp5A+N4NzB0lMXxon/uxbI8gIYjB9HytGYuusfiPIQcN71kjgnW6VeFOkgh3XcHLvAwMSDPohOADdYQJdF1FtLMZPmslvhZJk2ahkgRvq4HHUoWHRDqTEDDl2mDkfheiDgt8pw340/EocuClCuFvboQzb0cwIZgki4KhzlaE6w0InipbVzBfqoK/qRH94i0rgokSFeO11iBkp8EdV8cfJo0yD75aE2ZNRvSJ0lZKcBXLaUYmQrCzDT6tDN5SyRqYlWeDLZAg0H4JQ+Jt6M3atNLE10VSwQsN4Z6r0CBwqzXesHmV+BeoyAUri8EyMfi2FowXS5dhd7doo2DVII0V5BAjigP89GEVAtda8b2ehodU4rNaAW+dGfzlFkyo89GTlcrHYCLpKD+V7yeeHNzLjkp24Uu1Ed6G8/F8qjqGRzlbl2H2dzjpMg1KdwsHxOlmJ7GTeZC/nesXbeZ6c9OYnuxUc3fmBuFft/Ff8xMd0s65SXIb/gAAAABJRU5ErkJggg==") no-repeat scroll left center;
color: red;
}
#logout {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJHSURBVDjLlZPNi81hFMc/z7137p1mTCFvNZfGSzLIWNjZKRvFRoqNhRCSYm8xS3+AxRRZ2JAFJWJHSQqTQkbEzYwIM+6Yid/znJfH4prLXShOnb6r8/nWOd8Tcs78bz0/f+KMu50y05nK/wy+uHDylbutqS5extvGcxaWqtoGDA8PZ3dnrs2srQc2Zko41UXLmLdyDW5OfvsUkUgbYGbU63UAQggdmvMzFmzZCgTi7CQmkZwdEaX0JwDgTnGbTCaE0G4zw80omhPI92lcEtkNkdgJCCHwJX7mZvNaB0A14SaYJlwTrpHsTkoFlV1nt2c3x5YYo1/vM9A/gKpxdfwyu/v3teCayKq4JEwT5EB2R6WgYmrs2bYbcUNNUVfEhIfFYy69uci+1fuRX84mkawFSxd/4nVWUopUVIykwlQxRTJBTIDA4Pp1jBZPuNW4wUAPmCqWIn29X1k4f5Ku8g9mpKCkakRLVEs1auVuauVuyqHMo8ejNCe+sWPVTkQKXCMmkeZUmUZjETF1tc6ooly+fgUVw9So1/tRN6YnZji46QghBFKKuAouERNhMlbAHZFE6e7pB+He8MMw+GGI4xtOMf1+lsl3TQ4NHf19BSlaO1DB9BfMHdX0O0iqSgiBbJkjm491hClJbA1LxCURgpPzXwAHhg63necAIi3XngXLcRU0fof8ETMljIyM5LGxMcbHxzvy/6fuXdWgt6+PWncv1e4euqo1ZmabvHs5+jn8yzufO7hiiZmuNpNBM13rbvVSpbrXJE7/BMkHtU9jFIC/AAAAAElFTkSuQmCC") no-repeat scroll left center;
border: none;
cursor: pointer;
margin-left: 6px;
overflow: hidden;
text-indent: 18px;
width: 16px;
}
/* paginator */
.pages {
margin: 1em 0;
font-size: 90%;
}
.pages a[href*="&page="] {
margin: .2em;
padding: .2em .5em;
border: 1px solid #9AAFE5;
text-decoration: none;
}

View File

@@ -0,0 +1,319 @@
/*
FLAT UI Flavored Adminer Theme by M. Mahbubur Rahman (mahbub@mahbubblog.com)
Screenshot : http://d.pr/i/cznH
Based on work by : Lukáš Brandejs
https://raw.github.com/vrana/adminer/master/designs/ng9/adminer.css
*/
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600);
* {
font: 14px/1.7 "Source Sans Pro","Droid Sans",Arial,Helvetica, sans-serif;
color:#333333;
margin:0px;
padding:0px;
}
a,a:visited {
color:#2980b9;
text-decoration:none;
padding:3px 1px;
}
#content table thead span, #content table thead a {
font-weight:bold;
color:black;
}
#content table thead a:hover {
background:none;
text-decoration:underline;
color:black;
}
a:hover {
text-decoration:underline;
}
h1 {
font-size:1.9em;
font-weight:normal;
background:white;
color:#1e5eb6;
border-bottom:1px solid rgb(85, 112, 139);
padding:20px;
margin:0px;
}
#menu h1 {
padding:0px 0px 5px 20px;
background:none;
}
h2,h3 {
font-size:1.7em;
font-weight:bold;
background:white;
color:#34495e;
border-bottom:1px solid #f4f4f4;
padding:10px 0px;
margin:0px;
}
fieldset {
padding:5px;
border:1px solid #DEDEDE;
}
input,select,textarea {
border:1px solid #e5e5e5;
margin:1px;
padding:3px;
}
input[type=submit] {
color:white;
background:#27ae60;
padding:4px 10px;
cursor:pointer;
border:0px solid;
}
input[type=submit]:hover{
background:#2c3e50;
}
input[type=checkbox]{
margin-right:5px;
}
input[type=image] {
border:1px solid #d0cdc4;
}
input[type=checkbox],input[type=radio]{
border:1px solid #e5e5e5;
padding:2px 5px;
}
code{
background:#f0ffe1;
border:1px dashed #d5f1b9;
padding:2px 4px;
font-family:"Monaco","Courier New";
}
code a:hover{background:transparent}
table{
margin:10px 0px;
border:1px solid #d0cdc4;
border-collapse:collapse;
}
tbody tr:hover td,tbody tr:hover th{
background:#edf4ff
}
thead th, thead td {
text-align:center;
vertical-align:middle;
font-weight:bold;
white-space:nowrap;
background:#ecf0f1;
color:#808080;
}
th,td{
border:1px solid #d0cdc4;
padding:3px 6px;
vertical-align:top;
}
th a {
font-weight:bold;
padding-bottom:0px;
}
th {
background:white;
}
tr.odd td {
background:#fcfaf5;
}
#content tbody tr.checked td, tr.checked.odd td {
background:#fbe2e2;
color:red;
}
.hidden{
display:none
}
.error,.message{
padding:0px;
background:transparent;
font-weight:bold
}
.error{
color:#c00
}
.message{
color:#090
}
#content{
margin:0px 0px 0px 320px;
padding:50px 20px 40px 0px;
height:100%;
}
#lang {
background:#ecf0f1;
color:#808080;
position:fixed;
top:0px;
left:0px;
width:100%;
padding:10px 20px;
z-index:1;
}
#breadcrumb {
position:fixed;
top:0px;
left:300px;
background:#34495e;
z-index:2;
width:100%;
color:#ecf0f1;
padding:10px;
font-size:15px;
font-weight:bold;
}
#breadcrumb a{
color:#ecf0f1;
font-size:15px;
font-weight:bold;
}
#menu {
background:#34495e;
position:fixed;
top:-10px;
color:#FFF;
padding:20px;
padding-top:40px;
bottom:0px;
overflow:auto;
left:0px;
width:240px;
border-right:5px solid #34495e;
}
#menu p{
border-bottom:1px solid rgb(85, 112, 139);
}
#menu a{
color:#FFF;
}
#schema .table {
padding:5px;
background:#fcfaf5;
border:1px solid #d0cdc4;
}
#schema .table b {
color:#006aeb;
font-weight:bold;
text-decoration:underline;
}
#schema .table b:hover {
color:white;
}
input[name=logout] {
color:#fce2e2;
background:#d73e3e;
}
input[name=drop] {
background-color:#c0392b;
}
input[name=logout]:hover {
background:#ea0202;
}
#logins a, #tables a {
background:none;
}
#logins a:hover, #tables a:hover {
}
#logout {
color:#FFF;
text-decoration:none;
}
#logout:hover {
color:red;
}
.js .column {
background:#ecf0f1;
}
#content table thead a.text:hover {
text-decoration:none;
}
#version, .version {
font-size:50%;
}
#h1:hover {
color:white;
}
input[type=submit] {
font-size:13px;
font-weight:normal;
-moz-border-radius:2px;
-webkit-border-radius:2px;
border-radius:2px;
border:0px solid #469df5;
padding:3px 10px;
text-decoration:none;
background:-webkit-gradient( linear, left top, left bottom, color-stop(5%, #63b8ee), color-stop(100%, #468ccf) );
background:-moz-linear-gradient( center top, #63b8ee 5%, #468ccf 100% );
background:-ms-linear-gradient( top, #63b8ee 5%, #468ccf 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#63b8ee', endColorstr='#468ccf');
background-color:#63b8ee;
color:#ffffff;
display:inline-block;
text-shadow:1px 1px 0px #287ace;
-webkit-box-shadow:inset 0px 0px 0px 0px #cae3fc;
-moz-box-shadow:inset 0px 0px 0px 0px #cae3fc;
box-shadow:inset 0px 0px 0px 0px #cae3fc;
}
input[type=submit]:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(5%, #4197ee), color-stop(100%, #79bbff) );
background:-moz-linear-gradient( center top, #4197ee 5%, #79bbff 100% );
background:-ms-linear-gradient( top, #4197ee 5%, #79bbff 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4197ee', endColorstr='#79bbff');
background-color:#4197ee;
}
input[type=submit]:active {
position:relative;
top:1px;
}

76
designs/price/adminer.css Normal file
View File

@@ -0,0 +1,76 @@
/**
* @package Adminer.css - v1.0.0 - January 08, 2013
* @author James Price
* @version $Id$
* @copyright Copyright <20> 2013 Neurotechnics Pty Ltd. http://www.neurotechnics.com/
* @license MIT: http://mit-license.org/
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the <20>Software<72>), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED <20>AS IS<49>, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* IE doesn't support inline images - So, we use a hack that IE cannot interpret */
html/*\*/>/*/*/body .error {background:#FFEEEE url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIsSURBVDjLpVNLSJQBEP7+h6uu62vLVAJDW1KQTMrINQ1vPQzq1GOpa9EppGOHLh0kCEKL7JBEhVCHihAsESyJiE4FWShGRmauu7KYiv6Pma+DGoFrBQ7MzGFmPr5vmDFIYj1mr1WYfrHPovA9VVOqbC7e/1rS9ZlrAVDYHig5WB0oPtBI0TNrUiC5yhP9jeF4X8NPcWfopoY48XT39PjjXeF0vWkZqOjd7LJYrmGasHPCCJbHwhS9/F8M4s8baid764Xi0Ilfp5voorpJfn2wwx/r3l77TwZUvR+qajXVn8PnvocYfXYH6k2ioOaCpaIdf11ivDcayyiMVudsOYqFb60gARJYHG9DbqQFmSVNjaO3K2NpAeK90ZCqtgcrjkP9aUCXp0moetDFEeRXnYCKXhm+uTW0CkBFu4JlxzZkFlbASz4CQGQVBFeEwZm8geyiMuRVntzsL3oXV+YMkvjRsydC1U+lhwZsWXgHb+oWVAEzIwvzyVlk5igsi7DymmHlHsFQR50rjl+981Jy1Fw6Gu0ObTtnU+cgs28AKgDiy+Awpj5OACBAhZ/qh2HOo6i+NeA73jUAML4/qWux8mt6NjW1w599CS9xb0mSEqQBEDAtwqALUmBaG5FV3oYPnTHMjAwetlWksyByaukxQg2wQ9FlccaK/OXA3/uAEUDp3rNIDQ1ctSk6kHh1/jRFoaL4M4snEMeD73gQx4M4PsT1IZ5AfYH68tZY7zv/ApRMY9mnuVMvAAAAAElFTkSuQmCC") no-repeat scroll 0.8em center; padding-left:38px;}
html/*\*/>/*/*/body .message, #menu p.message {background:#EEFFEE url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKfSURBVDjLpZPrS1NhHMf9O3bOdmwDCWREIYKEUHsVJBI7mg3FvCxL09290jZj2EyLMnJexkgpLbPUanNOberU5taUMnHZUULMvelCtWF0sW/n7MVMEiN64AsPD8/n83uucQDi/id/DBT4Dolypw/qsz0pTMbj/WHpiDgsdSUyUmeiPt2+V7SrIM+bSss8ySGdR4abQQv6lrui6VxsRonrGCS9VEjSQ9E7CtiqdOZ4UuTqnBHO1X7YXl6Daa4yGq7vWO1D40wVDtj4kWQbn94myPGkCDPdSesczE2sCZShwl8CzcwZ6NiUs6n2nYX99T1cnKqA2EKui6+TwphA5k4yqMayopU5mANV3lNQTBdCMVUA9VQh3GuDMHiVcLCS3J4jSLhCGmKCjBEx0xlshjXYhApfMZRP5CyYD+UkG08+xt+4wLVQZA1tzxthm2tEfD3JxARH7QkbD1ZuozaggdZbxK5kAIsf5qGaKMTY2lAU/rH5HW3PLsEwUYy+YCcERmIjJpDcpzb6l7th9KtQ69fi09ePUej9l7cx2DJbD7UrG3r3afQHOyCo+V3QQzE35pvQvnAZukk5zL5qRL59jsKbPzdheXoBZc4saFhBS6AO7V4zqCpiawuptwQG+UAa7Ct3UT0hh9p9EnXT5Vh6t4C22QaUDh6HwnECOmcO7K+6kW49DKqS2DrEZCtfuI+9GrNHg4fMHVSO5kE7nAPVkAxKBxcOzsajpS4Yh4ohUPPWKTUh3PaQEptIOr6BiJjcZXCwktaAGfrRIpwblqOV3YKdhfXOIvBLeREWpnd8ynsaSJoyESFphwTtfjN6X1jRO2+FxWtCWksqBApeiFIR9K6fiTpPiigDoadqCEag5YUFKl6Yrciw0VOlhOivv/Ff8wtn0KzlebrUYwAAAABJRU5ErkJggg==") no-repeat scroll 0.8em center; padding-left:38px;}
html/*\*/>/*/*/body a[href$="dump="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHzSURBVHjajJPPS+NQEMcnaaxpdWsp6Q8vtWtdkIo9+B948SjIgruCUg8F/wGP/glePe5JcBehwl4qePGm0J6KQj30UBHEzaFLUromTfPizJMnrxhhB4bJvDfzme97SZQgCOB/be98J2AsAMYYMP81KjKg0WhMYljHtS30RSz4gjkGdot559F7OLt8vvi1bJRBURS4vr8CTTQ3m80SFv1MpVJlwzBA13XuNGUwGKyY1p+Vk9aPzWw8C7ZjQXximu+9ATA5KhQK5Uwmw+nCIpEIJBIJOLjah3Q8w7379x5urFsOUEUhTl/C6R+ef35mARzPhW6vC+q/iHvyvaYwXwIQje6j1+tBv98H13VhNBpxxyPA5tw2TI50MPQsrMbXbOo53fmtaJIC7iSZAMPhkOe+73MA5Ruz3yCfz9NlvykLBUSjUR41TQPP8zhE7JNSyj8E0CbJpkiXKRoIRFABeQcQd0DFwlVV5evUTFBZRSiATEwnp4lCAa0LI2AoQC4WimRl4qgyYOw12rYNyWSSX6L4mKiBnukDK5VKYJrmmBpZwW6r1TotFotTuVyOQwQgnU7zV9npdKDdbj+hgnXRN/Yz1ev1zwg6QP+KU2disRiXblkWOI7zhJOPce+wWq2aoQDZarXaJ2xYQGfod5VKxQ2rexFgAI4OiAKxKkWeAAAAAElFTkSuQmCC") no-repeat scroll 2px bottom; padding-left:22px;}
html/*\*/>/*/*/body select[name="db"] {background:white url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAEYSURBVBgZBcHPio5hGAfg6/2+R980k6wmJgsJ5U/ZOAqbSc2GnXOwUg7BESgLUeIQ1GSjLFnMwsKGGg1qxJRmPM97/1zXFAAAAEADdlfZzr26miup2svnelq7d2aYgt3rebl585wN6+K3I1/9fJe7O/uIePP2SypJkiRJ0vMhr55FLCA3zgIAOK9uQ4MS361ZOSX+OrTvkgINSjS/HIvhjxNNFGgQsbSmabohKDNoUGLohsls6BaiQIMSs2FYmnXdUsygQYmumy3Nhi6igwalDEOJEjPKP7CA2aFNK8Bkyy3fdNCg7r9/fW3jgpVJbDmy5+PB2IYp4MXFelQ7izPrhkPHB+P5/PjhD5gCgCenx+VR/dODEwD+A3T7nqbxwf1HAAAAAElFTkSuQmCC") no-repeat scroll left bottom; padding-left:16px;}
html/*\*/>/*/*/body select[name="db"] option {padding-left:18px;}
html/*\*/>/*/*/body 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;}
html/*\*/>/*/*/body #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:1px 0 0 16px; overflow:hidden; width:0; text-decoration:none; }
html/*\*/>/*/*/body #menu p a[href*="&table="], html/*\*/>/*/*/body #menu p a[href*="&view="] {margin:0; line-height:18px; padding-bottom:1px; text-decoration:none;}
html/*\*/>/*/*/body #content p a[href*="&create="] {padding-left:22px;}
html/*\*/>/*/*/body #content p a[href$="?database="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIkSURBVDjLpVNNiFJRFP7eU1E0KSLTMpAwYSxyaidDtChm0WYQ3NSutv2s2kwwm2igNgMtooUQEQhhA9GqhSDTQsZZFDbNDBgVg5bSw9J8rzFF33udc+HGg0ladOHj3nPe+b7zc99VbNvG/yy30yiVSl4SnCNcsixrivYEgY7WJu0faX9EKGUyGVNyFFkBkY/T+WkoFEpFIhEEAgH4/X7w916vB8Mw0Gg00G63y+S7mM1mm4LIAYxisbhSr9c5nT1pjUYju1qt2oVC4YnkqbIUMk6Ew+F/9hyNRkFJLuyaATmFoqZp8Pl88Hq98Hg8wtfv99HpdNBsNhGPx0XsRAG3241ut4vBYCDs8XgMXdcxHA7FN/b9VUD25HK5RAUczKC+hYgcNpNN05xcAQdLkqIoIlj6VFWdXIEUkAQGV8M2k2vaG3z6sYGfVR39XzsHlm/dX3h5d31xlwAHM5goBd5+LuO75z3OnU3jyP4EVrZeKGub2p309cP7VKcAQ2Znoiz3deMVTk1Nw1RNTB+ahamMkD45w7RrfwSYwFdFf6K4Quf6pmvwKHswl7wh7Jvnc4gfTPHR52zhcqVSeZZMJgOxWEyI8BC5CmOnh63WKtZbZczPPsa94hX4XCLJQHG+xnw+f5SEFghZmvhefgvcTqn2HN3gBmZSZ5CInMaHr1Wsvivjy3ZvSZn0nHO5XJDIxwgWDbW2vL10m9xXCUGCQXi49qA1/xvyq6BCh7yZeQAAAABJRU5ErkJggg==") no-repeat scroll 2px bottom; padding-left:22px;}
html/*\*/>/*/*/body #content a[href*="&database="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKRSURBVDjLhVNLTBNRFD3TTju1FCcBaxuaQEr94ydiZIHGpcFISBOi0YREZWHCVoyRxKUxxq0LXcACQyLsjO6KjSEiDfHDz0S0CLSxlFKd2g7MTDudGd+bMAQCxJucuXfuu+fcO/PeYwzDALVoNMqRuI3guq7rR4g/SEBC/Svxc8T3EUTD4bCGTcZQAUI+RvxLr9d70u/3o6KiAm63G3Qtn89DFEUkk0lks9lRkrvW3t6e2lCgRZFI5F0ikaDtjN1MVVVjYmLCGBoa6qccC7Z1kQafz4f/WSAQAGlyaXOOpQ+SNNUymQxcLhc4joPD4TBzkiRBEASkUimEQiGzdlcBlmWRy+WgKIr5Xi6XUSgUUCwWzTVN+IAzeOOde71orP0eAaOkbrDWf6Cw2+3mBLSYgny3KULXPOUY2BUB/hMd4IOn8XfhMGYjvU+2TECLLRLDMNA0zYw5JYa6Ghke/hyEn9/gZEqo3OuHp7qW3yJgESjoNPSdlb8gWCOCr29BMT0Ip5tBYnIWqlL6o8irzVsEaHcKSqQCen4cweok+FAblNRz2JxlODx1cEkzGWmVbTl7Z/jHhgCF1Z3GYjIKf+U8+ANhQn4Gm6OMUiGI9MhHg5Gl1sbu8UnKNc8B7Ui3ipxEcwvlpVFw6hz2N1xGabkXdqeBYqEOmfefEZWac4e6xz9Z22hbn+BmLBZbi8fjEBdG4NF/QdUDSM88hQ4FawKJR6cxLDZl86qzZdtdoDYwMBAkQg/2LL/ovNLVh++Dd7G0OAau9hTkrKgnnE39GW3f/Z6enpUdBSx7ePu4eq+zi4VNw+TbV0gsxFd5b9X5i4+mpnY63tsErl6okhvrfWzT0SAMR3FMXsnean08Pb/b/fgHqpjCspi90kkAAAAASUVORK5CYII=") no-repeat scroll 2px bottom; padding-left:22px;}
html/*\*/>/*/*/body #content p a[href*="&schema="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFOSURBVDjLtVK7SgNRED0b9iuM2lr4QK1DQIyk0FZsJAj+gH+ilRZb2NjaRHTLmA9QFKz9huzm7t37Hu+u7IJgQjR6YLjDzOXMmcMERIR5EE5qXA4z4sqACYWEC5wfLQXf/WtMIuDSoL0A7DZDjBj/uYI0l8jzEEJYJMkvCEZM4PqZIxlzpGk+kSCY18TGtGYcx9Tv96dOqBUMBgNyzsFaC621312Ac+59yJFlGRhj5VvVoigKvniglEK32w1mkd3r9ejPPAjOhqdknYX18p1/rzo3pYqTh0OSRkJI5UMgPn4s61sX66SkhtEGcISGsQad5gH2FvehfV5BaIF2cwet5RZyKeu68pe5ubKG7dUNP5AQGltMN57Mosgr5EIiVQmYGvtc1PVicqHY+dXpk8Dg7v22XKFo1ARe9v1bDOlXKKKCs4Sn1xdU1v3vIc2CD3bN4xJjfJWvAAAAAElFTkSuQmCC") no-repeat scroll 2px bottom; padding-left:22px;}
html/*\*/>/*/*/body #content p a[href*="&tbsdesc="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFOSURBVDjLtVK7SgNRED0b9iuM2lr4QK1DQIyk0FZsJAj+gH+ilRZb2NjaRHTLmA9QFKz9huzm7t37Hu+u7IJgQjR6YLjDzOXMmcMERIR5EE5qXA4z4sqACYWEC5wfLQXf/WtMIuDSoL0A7DZDjBj/uYI0l8jzEEJYJMkvCEZM4PqZIxlzpGk+kSCY18TGtGYcx9Tv96dOqBUMBgNyzsFaC621312Ac+59yJFlGRhj5VvVoigKvniglEK32w1mkd3r9ejPPAjOhqdknYX18p1/rzo3pYqTh0OSRkJI5UMgPn4s61sX66SkhtEGcISGsQad5gH2FvehfV5BaIF2cwet5RZyKeu68pe5ubKG7dUNP5AQGltMN57Mosgr5EIiVQmYGvtc1PVicqHY+dXpk8Dg7v22XKFo1ARe9v1bDOlXKKKCs4Sn1xdU1v3vIc2CD3bN4xJjfJWvAAAAAElFTkSuQmCC") no-repeat scroll 2px bottom; padding-left:22px;}
html/*\*/>/*/*/body #content p a[href*="&sql="] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ5SURBVHjapFNLaxNRFP4mnZmQZtKYpJ2I8ZE0NSbSWKpgBYNUhIJQUDddCaILwb34C0RcCi60vpa14sZFoSjxUWxTFEubFkxf9kFS+7Jp0yQmM5mH905SF9pSwQt3vnPnnvPNd86cA13Xsds+23XKsdMdQx//s0z/6hi54he3e8/0d3ZuK0FTFGhUJkVVhSbLUAiq5IxSCQrBEkGWOu8Lh38HGrlpWnlXCKhNSbZQo3cEE9FomYAuKZstE2wFa8RR1cpKqK2o4JhxmLVJVAlh5Df6IFj5MgENcHq9EAMBg2RucBDVLpdxVon0iXdvIf8sQHRIsNReht3XjI3ZI8iuPAOrkDyorBq3G6vT08ikUuAsFiN46HkXXL56eI41QV1/BMF+GulvCfCMDFvNXtSIHrC0KDTPhXgc7lAQdQ2thk2XIpewnkzCJvTA4T8PabEbfDWD+ZFxyEUdX94sw6QVCkZlxWAQU+8/YGZgALV+v0HgbWmBNzQMR0M7it8fg+HWwQk2cLkkcvJh5NNFsCVJMgq1ubiE5o4OI5CS8FYrya8b9saLKC48gIlTIG/6sBaLw3PpHrTEMrSXr4kPIaAKFkbjSA0PEVuFlB+DO8Ah2HoB8tITVPE6iplDWOn7jLn0CSQevoDV6TI+zEpUASkkZzaTYrLIrH3C/qMCFEbE4th9OEQexfQBrPYP44d+DuY91eBp+1dGgFVIDb729kKpdJfQtIy2yFNMdN/E5McYzAebUEhOYjZuQXaj5+9W/nOYbl9vLN26doOFScVI9BXmZ6dy9jpnpO1O5dfsRtBxxlk4Xu9mT4Z80DkpVlhZvdp+d3RmpyH7JcAAnHiAVYWMsdkAAAAASUVORK5CYII=") no-repeat scroll 2px bottom; padding-left:24px;}
html/*\*/>/*/*/body table tbody input[name*="check"] {display:block; float:left;}
html/*\*/>/*/*/body table a[href*="&edit="][href*="&where"] {background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFUSURBVDjLrZM/SAJxGIZdWwuDlnCplkAEm1zkaIiGFFpyMIwGK5KGoK2lphDKkMDg3LLUSIJsSKhIi+684CokOtTiMizCGuzEU5K3vOEgKvtBDe/2Pc8H3x8NAM1fQlx4H9M3pcOWp6TXWmM8A7j0629v1nraiAVC0IrrwATKIgs5xyG5QiE+Z4iQdoeU2oAsnqCSO1NSTu+D9VhqRLD8nIB8F0Q2MgmJDyipCzjvYJkIfpN2UBLG8MpP4dxvQ3ZzGuyyBQ2H+AnOOCBd9aL6soh81A5hyYSGWyCFvxUcerqI4S+CvYVOFPMHxLAq8I3qdHVY5LbBhJzEsCrwutpRFBlUHy6wO2tEYtWAzLELPN2P03kjfj3luqDycV2F8AgefWbEnVqEHa2IznSD6BdsVDNStB0lfh0FPoQjdx8RrAqGzC0YprSgxzsUMOY2bf37N/6Ud1Vc9yYcH50CAAAAAElFTkSuQmCC") no-repeat scroll right bottom; padding-right:18px;}
html/*\*/>/*/*/body table input + a[href*="&edit="][href*="&where"] {width:0; float:left; display:block; height:16px; overflow:hidden; text-decoration:none; padding:0 0 0 18px; background-position:2px bottom; margin-left:5px;}
html/*\*/>/*/*/body table tbody td:first-child {white-space:normal;}
html/*\*/>/*/*/body table thead input {margin-right: 5px;}
html/*\*/>/*/*/body input[name="delete"], html/*\*/>/*/*/body input[name="drop"] {background:transparent url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHSSURBVHjapFM5bsJQEB2zSIDFJrHYpEtyAyoKJAp6CrqIkBPkNDlBAKXjBEgUpKOBCyQNijFiEZvZl8z7wsjESYpkpNFfPO/Nmz9j6Xg80n/M9fWi3W7fMOnd4XAo8qogAbvO5xKvL6lU6s0aL1kVMDjP5ye/36+Gw2FyOp3EQFqtVtTr9WixWHT5/JhOp6s2ghP4ORaLyaFQiGazGa3Xa0HgdrvJ6/WSpmk0Go0MjnvIZDLVM0Gr1brm/WskEkkA3O/3abvdQjq5XC6xgoiVka7rNB6PNT6ns9nsu+OkpODxeBLBYJAGgwHt9/uzQ8Vms6Hdbie+KYqC+ASTFrARBMx2HwgEaDKZiHqn0yktl0uxtzrMMAyKx+MCc+4Cs13hwQCC1GQy+W3Lms2mUIUygbEqEBLNun8z8zswVgUfLO0WD4Z6kekn8/l8okNM8GFVUMYDoVWQ6HA4bEAzoyzL1O12kbRsJajwhYZhiUajJEnShWSAQaqqKnU6HahEGysXg9RoNPJ8+cwZZLSKp47m8/k5Kxzg4XBocNxDLper2ka5Xq+LUeatilahJLN1mEJ+ZDHKJthGAKvVauJnYi9ysHIqQee1xOsLg3/+mf5inwIMAJMhb74NwG5wAAAAAElFTkSuQmCC") no-repeat scroll left center; padding:1px 5px 1px 18px; border:0; cursor:pointer; font-size:.9em;}
html/*\*/>/*/*/body input[name="delete"]:hover, html/*\*/>/*/*/body input[name="drop"]:hover {color:red; background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJdSURBVDjLpZP7S1NhGMf9W7YfogSJboSEUVCY8zJ31trcps6zTI9bLGJpjp1hmkGNxVz4Q6ildtXKXzJNbJRaRmrXoeWx8tJOTWptnrNryre5YCYuI3rh+8vL+/m8PA/PkwIg5X+y5mJWrxfOUBXm91QZM6UluUmthntHqplxUml2lciF6wrmdHriI0Wx3xw2hAediLwZRWRkCPzdDswaSvGqkGCfq8VEUsEyPF1O8Qu3O7A09RbRvjuIttsRbT6HHzebsDjcB4/JgFFlNv9MnkmsEszodIIY7Oaut2OJcSF68Qx8dgv8tmqEL1gQaaARtp5A+N4NzB0lMXxon/uxbI8gIYjB9HytGYuusfiPIQcN71kjgnW6VeFOkgh3XcHLvAwMSDPohOADdYQJdF1FtLMZPmslvhZJk2ahkgRvq4HHUoWHRDqTEDDl2mDkfheiDgt8pw340/EocuClCuFvboQzb0cwIZgki4KhzlaE6w0InipbVzBfqoK/qRH94i0rgokSFeO11iBkp8EdV8cfJo0yD75aE2ZNRvSJ0lZKcBXLaUYmQrCzDT6tDN5SyRqYlWeDLZAg0H4JQ+Jt6M3atNLE10VSwQsN4Z6r0CBwqzXesHmV+BeoyAUri8EyMfi2FowXS5dhd7doo2DVII0V5BAjigP89GEVAtda8b2ehodU4rNaAW+dGfzlFkyo89GTlcrHYCLpKD+V7yeeHNzLjkp24Uu1Ed6G8/F8qjqGRzlbl2H2dzjpMg1KdwsHxOlmJ7GTeZC/nesXbeZ6c9OYnuxUc3fmBuFft/Ff8xMd0s65SXIb/gAAAABJRU5ErkJggg==")}
body{background-color:#eee}
form{margin:0;overflow:auto}
#breadcrumb{position:absolute;top:0;left:0;height:2.6em;margin:0;padding:5px 5px 0 22em;width:-moz-available!important;width:100%;line-height:1.6em;border:1px solid #444;white-space:nowrap;color:#fff;background:#7abcff;background:-moz-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7abcff),color-stop(44%,#60abf8),color-stop(100%,#4096ee));background:-webkit-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:-o-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:-ms-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:linear-gradient(to bottom,#7abcff 0,#60abf8 44%,#4096ee 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7abcff',endColorstr='#4096ee',GradientType=0)}
#menu,#content{background-color:#fff;border-radius:10px;border:1px solid #444;box-shadow:0 0 5px #999;margin:5em 1em 2em 0}
#menu{position:absolute;top:0;left:0;margin-left:1em;padding:0 0 30px;width:19em}
#content{border:1px solid #444;margin-left:21.5em;padding:10px 10px 30px 30px}
#menu h1,#content h2{line-height:44px;margin:0;padding:0 20px;border-bottom:1px solid #000;border-radius:9px 9px 0 0;display:block;color:#FFF;background:#1e5799;background:-moz-linear-gradient(top,#1e5799 0,#2989d8 50%,#207cca 51%,#7db9e8 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#1e5799),color-stop(50%,#2989d8),color-stop(51%,#207cca),color-stop(100%,#7db9e8));background:-webkit-linear-gradient(top,#1e5799 0,#2989d8 50%,#207cca 51%,#7db9e8 100%);background:-o-linear-gradient(top,#1e5799 0,#2989d8 50%,#207cca 51%,#7db9e8 100%);background:-ms-linear-gradient(top,#1e5799 0,#2989d8 50%,#207cca 51%,#7db9e8 100%);background:linear-gradient(to bottom,#1e5799 0,#2989d8 50%,#207cca 51%,#7db9e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e5799',endColorstr='#7db9e8',GradientType=0)}
#menu h1,#menu h1 a,#menu h1 span{color:#fff}
#menu h1{line-height:41px}
#content h2{font-weight:normal;position:relative;left:-30px;top:-10px;height:44px;width:100%}
table{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;border-color:#999 -moz-use-text-color -moz-use-text-color #999;border-image:none;border-right:0 none;border-style:solid none none solid;border-width:1px 0 0 1px;font-size:90%;margin:1em 20px 0 0}
td,th{-moz-border-bottom-colors:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;border-color:-moz-use-text-color #999 #999 -moz-use-text-color;border-image:none;border-style:none solid solid none;border-width:0 1px 1px 0;padding:.2em .3em}
thead td,thead th{background:#eee;background:-moz-linear-gradient(top,#eee 0,#ccc 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#eee),color-stop(100%,#ccc));background:-webkit-linear-gradient(top,#eee 0,#ccc 100%);background:-o-linear-gradient(top,#eee 0,#ccc 100%);background:-ms-linear-gradient(top,#eee 0,#ccc 100%);background:linear-gradient(to bottom,#eee 0,#ccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee',endColorstr='#cccccc',GradientType=0)}
td{background-color:#f4f8ff}
.odd td{background-color:#fff}
tbody tr:hover td,tbody tr:hover th{background-color:#FFE}
p.tabs{margin:0 20px 0 0}
.jush-sql{background:0}
.jush{padding:5px 15px 3px;margin:0 20px;background-color:#fff;border:1px solid #369;border-radius:4px}
fieldset{border:1px solid #999;border-radius:5px;display:inline;margin:.8em .5em 0 0;padding:.5em .8em;vertical-align:top}
a{color:#369}
a:hover{color:#28c}
#logout,#logins a,#logins a:link,#breadcrumb a,#breadcrumb a:link,.logout a,.logout a:link,.tabs a,.tabs a:link{display:inline-block;border:1px solid #667eac;border-radius:4px;padding:3px 8px;margin:2px 0;vertical-align:middle;text-decoration:none;color:#fff;background:#7abcff;background:-moz-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7abcff),color-stop(44%,#60abf8),color-stop(100%,#4096ee));background:-webkit-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:-o-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:-ms-linear-gradient(top,#7abcff 0,#60abf8 44%,#4096ee 100%);background:linear-gradient(to bottom,#7abcff 0,#60abf8 44%,#4096ee 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7abcff',endColorstr='#4096ee',GradientType=0)}
.logout a,.logout a:link,#logout{padding:3px 4px}
#logout:hover,#logins a:hover,#tables a:hover,#breadcrumb a:hover,.logout a:hover,.tabs a:hover{color:#fff;text-decoration:none;background:#93c9ff;background:-moz-linear-gradient(top,#93c9ff 0,#79b8f7 44%,#57a2ed 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#93c9ff),color-stop(44%,#79b8f7),color-stop(100%,#57a2ed));background:-webkit-linear-gradient(top,#93c9ff 0,#79b8f7 44%,#57a2ed 100%);background:-o-linear-gradient(top,#93c9ff 0,#79b8f7 44%,#57a2ed 100%);background:-ms-linear-gradient(top,#93c9ff 0,#79b8f7 44%,#57a2ed 100%);background:linear-gradient(to bottom,#93c9ff 0,#79b8f7 44%,#57a2ed 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#93c9ff',endColorstr='#57a2ed',GradientType=0)}
#breadcrumb a,#breadcrumb a:link{border:1px solid #246;padding:2px 6px;margin:1px auto;line-height:1.6em}
#logins a,#tables a{background:none repeat scroll 0 0 #fff;padding:2px 6px;margin:1px 0;font-size:.8em}
a[title='Show structure'],#tables a[title='Show structure']{border:0;background:0;color:#369}
.jush a{border:0;background:0;margin:0;padding:0}
a.active,a.active:link,a.active:hover{text-decoration:underline}

View File

@@ -9,6 +9,7 @@ if ($adminer->homepage()) {
} }
echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);'>\n"; echo "<table cellspacing='0' class='nowrap checkable' onclick='tableClick(event);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^tables\[/);"><th>' . lang('Table') . '<td>' . lang('Rows') . "</thead>\n"; echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^tables\[/);"><th>' . lang('Table') . '<td>' . lang('Rows') . "</thead>\n";
foreach (table_status() as $table => $row) { foreach (table_status() as $table => $row) {
$name = $adminer->tableName($row); $name = $adminer->tableName($row);
if (isset($row["Engine"]) && $name != "") { if (isset($row["Engine"]) && $name != "") {
@@ -18,6 +19,7 @@ if ($adminer->homepage()) {
echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "</a>"; echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "</a>";
} }
} }
echo "</table>\n"; echo "</table>\n";
echo "<script type='text/javascript'>tableCheck();</script>\n"; echo "<script type='text/javascript'>tableCheck();</script>\n";
echo "</form>\n"; echo "</form>\n";

View File

@@ -13,17 +13,19 @@ class Adminer {
return array(SERVER, $_GET["username"], get_session("pwds")); return array(SERVER, $_GET["username"], get_session("pwds"));
} }
function permanentLogin() { function permanentLogin($create = false) {
return password_file(); return password_file($create);
} }
function database() { function database() {
global $connection; global $connection;
$databases = $this->databases(false); if ($connection) {
return (!$databases $databases = $this->databases(false);
? $connection->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1)") // username without the database list return (!$databases
: $databases[(information_schema($databases[0]) ? 1 : 0)] // first available database ? $connection->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1)") // username without the database list
); : $databases[(information_schema($databases[0]) ? 1 : 0)] // first available database
);
}
} }
function databases($flush = true) { function databases($flush = true) {
@@ -45,11 +47,11 @@ class Adminer {
function loginForm() { function loginForm() {
?> ?>
<table cellspacing="0"> <table cellspacing="0">
<tr><th><?php echo lang('Username'); ?><td><input type="hidden" name="auth[driver]" value="server"><input id="username" name="auth[username]" value="<?php echo h($_GET["username"]); ?>"> <tr><th><?php echo lang('Username'); ?><td><input type="hidden" name="auth[driver]" value="server"><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]">
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
document.getElementById('username').focus(); focus(document.getElementById('username'));
</script> </script>
<?php <?php
echo "<p><input type='submit' value='" . lang('Login') . "'>\n"; echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
@@ -75,7 +77,6 @@ document.getElementById('username').focus();
if ($set !== null) { if ($set !== null) {
echo '<p class="tabs"><a href="' . h(ME . 'edit=' . urlencode($TABLE) . $set) . '">' . lang('New item') . "</a>\n"; echo '<p class="tabs"><a href="' . h(ME . 'edit=' . urlencode($TABLE) . $set) . '">' . lang('New item') . "</a>\n";
} }
echo "<a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Last page') . "'>&gt;&gt;</a>\n";
} }
function foreignKeys($table) { function foreignKeys($table) {
@@ -93,7 +94,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$return[$row["TABLE_NAME"]]["keys"][$row["CONSTRAINT_NAME"]][$row["COLUMN_NAME"]] = $row["REFERENCED_COLUMN_NAME"]; $return[$row["TABLE_NAME"]]["keys"][$row["CONSTRAINT_NAME"]][$row["COLUMN_NAME"]] = $row["REFERENCED_COLUMN_NAME"];
} }
foreach ($return as $key => $val) { foreach ($return as $key => $val) {
$name = $this->tableName(table_status($key)); $name = $this->tableName(table_status($key, true));
if ($name != "") { if ($name != "") {
$search = preg_quote($tableName); $search = preg_quote($tableName);
$separator = "(:|\\s*-)?\\s+"; $separator = "(:|\\s*-)?\\s+";
@@ -144,7 +145,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
// find all used ids // find all used ids
$ids = array(); $ids = array();
foreach ($rows as $row) { foreach ($rows as $row) {
$ids[$row[$key]] = exact_value($row[$key]); $ids[$row[$key]] = q($row[$key]);
} }
// uses constant number of queries to get the descriptions, join would be complex, multiple queries would be slow // uses constant number of queries to get the descriptions, join would be complex, multiple queries would be slow
$descriptions = $this->_values[$table]; $descriptions = $this->_values[$table];
@@ -162,6 +163,9 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
return $return; return $return;
} }
function selectLink($val, $field) {
}
function selectVal($val, $link, $field) { function selectVal($val, $link, $field) {
$return = ($val === null ? "&nbsp;" : $val); $return = ($val === null ? "&nbsp;" : $val);
$link = h($link); $link = h($link);
@@ -232,13 +236,13 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
if (($val["col"] == "" || $columns[$val["col"]]) && "$val[col]$val[val]" != "") { if (($val["col"] == "" || $columns[$val["col"]]) && "$val[col]$val[val]" != "") {
echo "<div><select name='where[$i][col]'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, $val["col"], true) . "</select>"; echo "<div><select name='where[$i][col]'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, $val["col"], true) . "</select>";
echo html_select("where[$i][op]", array(-1 => "") + $this->operators, $val["op"]); echo html_select("where[$i][op]", array(-1 => "") + $this->operators, $val["op"]);
echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "'></div>\n"; echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "' onsearch='selectSearchSearch(this);'></div>\n";
$i++; $i++;
} }
} }
echo "<div><select name='where[$i][col]' onchange='this.nextSibling.nextSibling.onchange();'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, null, true) . "</select>"; echo "<div><select name='where[$i][col]' onchange='this.nextSibling.nextSibling.onchange();'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, null, true) . "</select>";
echo html_select("where[$i][op]", array(-1 => "") + $this->operators); echo html_select("where[$i][op]", array(-1 => "") + $this->operators);
echo "<input type='search' name='where[$i][val]' onchange='selectAddRow(this);'></div>\n"; echo "<input type='search' name='where[$i][val]' onchange='selectAddRow(this);' onsearch='selectSearch(this);'></div>\n";
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
@@ -269,7 +273,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
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 html_select("limit", array("", "30", "100"), $limit); echo html_select("limit", array("", "50", "100"), $limit);
echo "</div></fieldset>\n"; echo "</div></fieldset>\n";
} }
@@ -353,6 +357,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
} }
foreach (($index_order != "" ? array($indexes[$index_order]) : $indexes) as $index) { foreach (($index_order != "" ? array($indexes[$index_order]) : $indexes) as $index) {
if ($index_order != "" || $index["type"] == "INDEX") { if ($index_order != "" || $index["type"] == "INDEX") {
$has_desc = array_filter($index["descs"]);
$desc = false; $desc = false;
foreach ($index["columns"] as $val) { foreach ($index["columns"] as $val) {
if (ereg('date|timestamp', $fields[$val]["type"])) { if (ereg('date|timestamp', $fields[$val]["type"])) {
@@ -361,8 +366,8 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
} }
} }
$return = array(); $return = array();
foreach ($index["columns"] as $val) { foreach ($index["columns"] as $key => $val) {
$return[] = idf_escape($val) . ($desc ? " DESC" : ""); $return[] = idf_escape($val) . (($has_desc ? $index["descs"][$key] : $desc) ? " DESC" : "");
} }
return $return; return $return;
} }
@@ -371,7 +376,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
} }
function selectLimitProcess() { function selectLimitProcess() {
return (isset($_GET["limit"]) ? $_GET["limit"] : "30"); return (isset($_GET["limit"]) ? $_GET["limit"] : "50");
} }
function selectLengthProcess() { function selectLengthProcess() {
@@ -495,6 +500,9 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
return array('csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV'); return array('csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
} }
function dumpDatabase($db) {
}
function dumpTable() { function dumpTable() {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark echo "\xef\xbb\xbf"; // UTF-8 byte order mark
} }
@@ -557,7 +565,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
<?php <?php
$this->databasesPrint($missing); $this->databasesPrint($missing);
if ($missing != "db" && $missing != "ns") { if ($missing != "db" && $missing != "ns") {
$table_status = table_status(); $table_status = table_status('', true);
if (!$table_status) { if (!$table_status) {
echo "<p class='message'>" . lang('No tables.') . "\n"; echo "<p class='message'>" . lang('No tables.') . "\n";
} else { } else {
@@ -575,7 +583,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
foreach ($tables as $row) { foreach ($tables as $row) {
$name = $this->tableName($row); $name = $this->tableName($row);
if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name
echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'" . bold($_GET["select"] == $row["Name"]) . " title='" . lang('Select data') . "'>$name</a><br>\n"; echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'" . bold($_GET["select"] == $row["Name"] || $_GET["edit"] == $row["Name"]) . " title='" . lang('Select data') . "'>$name</a><br>\n";
} }
} }
} }

View File

@@ -13,6 +13,7 @@ $drivers[DRIVER] = lang('Login');
if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) { if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) {
$_GET["edit"] = $_GET["select"]; $_GET["edit"] = $_GET["select"];
} }
if (isset($_GET["download"])) { if (isset($_GET["download"])) {
include "../adminer/download.inc.php"; include "../adminer/download.inc.php";
} elseif (isset($_GET["edit"])) { } elseif (isset($_GET["edit"])) {

View File

@@ -3,11 +3,12 @@ if ($_GET["script"] == "kill") {
$connection->query("KILL " . (+$_POST["kill"])); $connection->query("KILL " . (+$_POST["kill"]));
} elseif (list($table, $id, $name) = $adminer->_foreignColumn(column_foreign_keys($_GET["source"]), $_GET["field"])) { } elseif (list($table, $id, $name) = $adminer->_foreignColumn(column_foreign_keys($_GET["source"]), $_GET["field"])) {
$result = $connection->query("SELECT $id, $name FROM " . table($table) . " WHERE " . (ereg('^[0-9]+$', $_GET["value"]) ? "$id = $_GET[value] OR " : "") . "$name LIKE " . q("$_GET[value]%") . " ORDER BY 2 LIMIT 11"); $limit = 11;
for ($i=0; $i < 10 && ($row = $result->fetch_row()); $i++) { $result = $connection->query("SELECT $id, $name FROM " . table($table) . " WHERE " . (ereg('^[0-9]+$', $_GET["value"]) ? "$id = $_GET[value] OR " : "") . "$name LIKE " . q("$_GET[value]%") . " ORDER BY 2 LIMIT $limit");
for ($i=1; ($row = $result->fetch_row()) && $i < $limit; $i++) {
echo "<a href='" . h(ME . "edit=" . urlencode($table) . "&where" . urlencode("[" . bracket_escape(idf_unescape($id)) . "]") . "=" . urlencode($row[0])) . "'>" . h($row[1]) . "</a><br>\n"; echo "<a href='" . h(ME . "edit=" . urlencode($table) . "&where" . urlencode("[" . bracket_escape(idf_unescape($id)) . "]") . "=" . urlencode($row[0])) . "'>" . h($row[1]) . "</a><br>\n";
} }
if ($i == 10) { if ($row) {
echo "...\n"; echo "...\n";
} }
} }

View File

@@ -8,7 +8,7 @@ function selectFieldChange(form) {
function whisperClick(event, field) { function whisperClick(event, field) {
var el = event.target || event.srcElement; var el = event.target || event.srcElement;
if (/^a$/i.test(el.tagName) && !(event.button || event.ctrlKey || event.shiftKey || event.altKey || event.metaKey)) { if (/^a$/i.test(el.tagName) && !(event.button || event.shiftKey || event.altKey || isCtrl(event))) {
field.value = el.firstChild.data; field.value = el.firstChild.data;
field.previousSibling.value = decodeURIComponent(el.href.replace(/.*=/, '')); field.previousSibling.value = decodeURIComponent(el.href.replace(/.*=/, ''));
field.nextSibling.style.display = 'none'; field.nextSibling.style.display = 'none';

Submodule externals/CodeMirror2 deleted from 8feb48b37c

2
externals/jush vendored

151
plugins/dump-alter.php Normal file
View File

@@ -0,0 +1,151 @@
<?php
/** Exports one database (e.g. development) so that it can be synced with other database (e.g. production)
* @link http://www.adminer.org/plugins/#use
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://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)
*/
class AdminerDumpAlter {
function dumpFormat() {
if (DRIVER == 'server') {
return array('sql_alter' => 'Alter');
}
}
function _database() {
// drop old tables
$query = "SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()";
echo "DELIMITER ;;
CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
DECLARE _table_name, _engine, _table_collation varchar(64);
DECLARE _table_comment varchar(64);
DECLARE done bool DEFAULT 0;
DECLARE tables CURSOR FOR $query;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN tables;
REPEAT
FETCH tables INTO _table_name, _engine, _table_collation, _table_comment;
IF NOT done THEN
CASE _table_name";
foreach (get_rows($query) as $row) {
$comment = q($row["ENGINE"] == "InnoDB" ? preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["TABLE_COMMENT"]) : $row["TABLE_COMMENT"]);
echo "
WHEN " . q($row["TABLE_NAME"]) . " THEN
" . (isset($row["ENGINE"]) ? "IF _engine != '$row[ENGINE]' OR _table_collation != '$row[TABLE_COLLATION]' OR _table_comment != $comment THEN
ALTER TABLE " . idf_escape($row["TABLE_NAME"]) . " ENGINE=$row[ENGINE] COLLATE=$row[TABLE_COLLATION] COMMENT=$comment;
END IF" : "BEGIN END") . ";";
}
echo "
ELSE
SET alter_command = CONCAT(alter_command, 'DROP TABLE `', REPLACE(_table_name, '`', '``'), '`;\\n');
END CASE;
END IF;
UNTIL done END REPEAT;
CLOSE tables;
END;;
DELIMITER ;
CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
SELECT @adminer_alter;
";
}
function dumpDatabase($db) {
static $first = true;
if ($_POST["format"] == "sql_alter") {
if ($first) {
$first = false;
echo "SET @adminer_alter = '';\n\n";
register_shutdown_function(array($this, '_database'));
} else {
$this->_database();
}
return true;
}
}
function dumpTable($table, $style, $is_view = false) {
if ($_POST["format"] == "sql_alter") {
$create = create_sql($table, $_POST["auto_increment"]);
if ($is_view) {
echo substr_replace($create, " OR REPLACE", 6, 0) . ";\n\n";
} else {
echo substr_replace($create, " IF NOT EXISTS", 12, 0) . ";\n\n";
// create procedure which iterates over original columns and adds new and removes old
$query = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, COLLATION_NAME, COLUMN_TYPE, EXTRA, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = " . q($table) . " ORDER BY ORDINAL_POSITION";
echo "DELIMITER ;;
CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
DECLARE _column_name, _collation_name, after varchar(64) DEFAULT '';
DECLARE _column_type, _column_default text;
DECLARE _is_nullable char(3);
DECLARE _extra varchar(30);
DECLARE _column_comment varchar(255);
DECLARE done, set_after bool DEFAULT 0;
DECLARE add_columns text DEFAULT '";
$fields = array();
$after = "";
foreach (get_rows($query) as $row) {
$default = $row["COLUMN_DEFAULT"];
$row["default"] = ($default !== null ? q($default) : "NULL");
$row["after"] = q($after); //! rgt AFTER lft, lft AFTER id doesn't work
$row["alter"] = escape_string(idf_escape($row["COLUMN_NAME"])
. " $row[COLUMN_TYPE]"
. ($row["COLLATION_NAME"] ? " COLLATE $row[COLLATION_NAME]" : "")
. ($default !== null ? " DEFAULT " . ($default == "CURRENT_TIMESTAMP" ? $default : $row["default"]) : "")
. ($row["IS_NULLABLE"] == "YES" ? "" : " NOT NULL")
. ($row["EXTRA"] ? " $row[EXTRA]" : "")
. ($row["COLUMN_COMMENT"] ? " COMMENT " . q($row["COLUMN_COMMENT"]) : "")
. ($after ? " AFTER " . idf_escape($after) : " FIRST")
);
echo ", ADD $row[alter]";
$fields[] = $row;
$after = $row["COLUMN_NAME"];
}
echo "';
DECLARE columns CURSOR FOR $query;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
SET @alter_table = '';
OPEN columns;
REPEAT
FETCH columns INTO _column_name, _column_default, _is_nullable, _collation_name, _column_type, _extra, _column_comment;
IF NOT done THEN
SET set_after = 1;
CASE _column_name";
foreach ($fields as $row) {
echo "
WHEN " . q($row["COLUMN_NAME"]) . " THEN
SET add_columns = REPLACE(add_columns, ', ADD $row[alter]', IF(
_column_default <=> $row[default] AND _is_nullable = '$row[IS_NULLABLE]' AND _collation_name <=> " . (isset($row["COLLATION_NAME"]) ? "'$row[COLLATION_NAME]'" : "NULL") . " AND _column_type = " . q($row["COLUMN_TYPE"]) . " AND _extra = '$row[EXTRA]' AND _column_comment = " . q($row["COLUMN_COMMENT"]) . " AND after = $row[after]
, '', ', MODIFY $row[alter]'));"
; //! don't replace in comment
}
echo "
ELSE
SET @alter_table = CONCAT(@alter_table, ', DROP ', _column_name);
SET set_after = 0;
END CASE;
IF set_after THEN
SET after = _column_name;
END IF;
END IF;
UNTIL done END REPEAT;
CLOSE columns;
IF @alter_table != '' OR add_columns != '' THEN
SET alter_command = CONCAT(alter_command, 'ALTER TABLE " . table($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
END IF;
END;;
DELIMITER ;
CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
";
//! indexes
}
return true;
}
}
}

41
plugins/dump-bz2.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
/** Dump to Bzip2 format
* @link http://www.adminer.org/plugins/#use
* @uses bzopen(), tempnam("")
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://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)
*/
class AdminerDumpBz2 {
/** @access protected */
var $filename, $fp;
function dumpOutput() {
if (!function_exists('bzopen')) {
return array();
}
return array('bz2' => 'bzip2');
}
function _bz2($string, $state) {
bzwrite($this->fp, $string);
if ($state & PHP_OUTPUT_HANDLER_END) {
bzclose($this->fp);
$return = file_get_contents($this->filename);
unlink($this->filename);
return $return;
}
return "";
}
function dumpHeaders($identifier, $multi_table = false) {
if ($_POST["output"] == "bz2") {
$this->filename = tempnam("", "bz2");
$this->fp = bzopen($this->filename, 'w');
header("Content-Type: application/x-bzip");
ob_start(array($this, '_bz2'), 1e6);
}
}
}

62
plugins/dump-json.php Normal file
View File

@@ -0,0 +1,62 @@
<?php
/** Dump to JSON format
* @link http://www.adminer.org/plugins/#use
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://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)
*/
class AdminerDumpJson {
/** @access protected */
var $database = false;
function dumpFormat() {
return array('json' => 'JSON');
}
function dumpTable($table, $style, $is_view = false) {
if ($_POST["format"] == "json") {
return true;
}
}
function _database() {
echo "}\n";
}
function dumpData($table, $style, $query) {
if ($_POST["format"] == "json") {
if ($this->database) {
echo ",\n";
} else {
$this->database = true;
echo "{\n";
register_shutdown_function(array($this, '_database'));
}
$connection = connection();
$result = $connection->query($query, 1);
if ($result) {
echo '"' . addcslashes($table, "\r\n\"\\") . "\": [\n";
$first = true;
while ($row = $result->fetch_assoc()) {
echo ($first ? "" : ", ");
$first = false;
foreach ($row as $key => $val) {
json_row($key, $val);
}
json_row("");
}
echo "]";
}
return true;
}
}
function dumpHeaders($identifier, $multi_table = false) {
if ($_POST["format"] == "json") {
header("Content-Type: application/json; charset=utf-8");
return "json";
}
}
}

View File

@@ -19,6 +19,7 @@ class AdminerDumpZip {
} }
function _zip($string, $state) { function _zip($string, $state) {
// ZIP can be created without temporary file by gzcompress - see PEAR File_Archive
$this->data .= $string; $this->data .= $string;
if ($state & PHP_OUTPUT_HANDLER_END) { if ($state & PHP_OUTPUT_HANDLER_END) {
$zip = new ZipArchive; $zip = new ZipArchive;
@@ -34,8 +35,8 @@ class AdminerDumpZip {
} }
function dumpHeaders($identifier, $multi_table = false) { function dumpHeaders($identifier, $multi_table = false) {
$this->filename = "$identifier." . ($multi_table && ereg("[ct]sv", $_POST["format"]) ? "tar" : $_POST["format"]);
if ($_POST["output"] == "zip") { if ($_POST["output"] == "zip") {
$this->filename = "$identifier." . ($multi_table && ereg("[ct]sv", $_POST["format"]) ? "tar" : $_POST["format"]);
header("Content-Type: application/zip"); header("Content-Type: application/zip");
ob_start(array($this, '_zip')); ob_start(array($this, '_zip'));
} }

21
plugins/json-column.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
/** Display JSON values as table in edit
* @link http://www.adminer.org/plugins/#use
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://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)
*/
class AdminerJsonColumn {
function editInput($table, $field, $attrs, $value) {
if (substr($value, 0, 1) == '{' && ($json = json_decode($value, true))) {
echo "<table cellspacing='0'>";
foreach ($json as $key => $val) {
echo "<tr><th>" . h($key) . "<td><code class='jush-js'>" . h(json_encode($val)) . "</code>";
}
echo "</table>";
}
}
}

17
plugins/links-direct.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
/** Avoid redirecting of external links through adminer.org and disclose the URL of installed Adminer to visited links
* @link http://www.adminer.org/plugins/#use
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://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)
*/
class AdminerLinksDirect {
function selectLink($val, $field) {
if (is_url($val)) {
return $val;
}
}
}

43
plugins/master-slave.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
/** Execute writes on master and reads on slave
* @link http://www.adminer.org/plugins/#use
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://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)
*/
class AdminerMasterSlave {
private $masters = array();
/**
* @param array ($slave => $master)
*/
function AdminerMasterSlave($masters) {
$this->masters = $masters;
}
function credentials() {
if ($_POST && isset($this->masters[SERVER])) {
return array($this->masters[SERVER], $_GET["username"], get_session("pwds"));
}
}
function login($login, $password) {
if (!$_POST && ($master = &$_SESSION["master"])) {
$connection = connection();
$connection->query("DO MASTER_POS_WAIT('" . q($master['File']) . "', $master[Position])");
$master = null;
}
}
function messageQuery($query) {
//! doesn't work with sql.inc.php
$connection = connection();
$result = $connection->query('SHOW MASTER STATUS');
if ($result) {
restart_session();
$_SESSION["master"] = $result->fetch_assoc();
}
}
}

View File

@@ -191,6 +191,11 @@ class AdminerPlugin extends Adminer {
return $this->_applyPlugin(__FUNCTION__, $args); return $this->_applyPlugin(__FUNCTION__, $args);
} }
function selectLink() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectVal() { function selectVal() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->_applyPlugin(__FUNCTION__, $args);
@@ -296,6 +301,11 @@ class AdminerPlugin extends Adminer {
return $this->_applyPlugin(__FUNCTION__, $args); return $this->_applyPlugin(__FUNCTION__, $args);
} }
function dumpDatabase() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function dumpTable() { function dumpTable() {
$args = func_get_args(); $args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args); return $this->_applyPlugin(__FUNCTION__, $args);

View File

@@ -56,7 +56,6 @@
<td>Query executed OK</td> <td>Query executed OK</td>
<td></td> <td></td>
</tr> </tr>
</tbody></table> </tbody></table>
</body> </body>
</html> </html>

View File

@@ -41,7 +41,6 @@
<td>Database has been created.</td> <td>Database has been created.</td>
<td></td> <td></td>
</tr> </tr>
</tbody></table> </tbody></table>
</body> </body>
</html> </html>

View File

@@ -41,7 +41,6 @@
<td>Item 2 has been inserted.</td> <td>Item 2 has been inserted.</td>
<td></td> <td></td>
</tr> </tr>
</tbody></table> </tbody></table>
</body> </body>
</html> </html>

View File

@@ -26,7 +26,6 @@
<td>Michael Jackson</td> <td>Michael Jackson</td>
<td></td> <td></td>
</tr> </tr>
</tbody></table> </tbody></table>
</body> </body>
</html> </html>

View File

@@ -31,7 +31,6 @@
<td>Item has been updated.</td> <td>Item has been updated.</td>
<td></td> <td></td>
</tr> </tr>
</tbody></table> </tbody></table>
</body> </body>
</html> </html>

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