Commit Graph

108 Commits

Author SHA1 Message Date
Michal Čihař
85747b9ae9 Use usort() instead of natsort()
The natsoft has side effect of producit associated array, what is later
represented as object if encoded to JSON and breaking code expect array
instead.

Fixes #13465

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-07-10 14:34:12 +02:00
Michal Čihař
8a98c29700 Fixed natural sorting in several places
Fixes #12976

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-06-06 13:48:49 +02:00
Michal Čihař
17599c3387 Simplify Amazon RDS detection
Issue #13258

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-05-09 15:01:58 +02:00
Craig Duncan
ac3a35bc97 Correct the check for Amazon RDS
Signed-off-by: Craig Duncan <git@duncanc.co.uk>
2017-05-09 14:55:52 +02:00
Michal Čihař
a05bbd55e6 Correctly fail if user specifies null as one of connection parameters
See https://github.com/phpmyadmin/docker/issues/118

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-11 17:17:47 +02:00
Michal Čihař
a72a048f1e Correctly handle case when CURRENT_USER() fails
It's not likely, but the code path was obviously returning wrong value.

Maybe it did happen in issue #13037

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-01 10:53:19 +01:00
Michal Čihař
ce49be7e07 Fix condition to activate tracker
Invoking empty() on the result might work in most cases as false is
empty and false is result from failure, but on the other side empty can
be true for valid results as well.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-01 10:45:51 +01:00
Michal Čihař
1b7914a4e5 Remove connect_type setting
It is really not necessary as MySQL decides connection type rather based
on hostname than on anything else.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-02 16:08:44 +01:00
Michal Čihař
4f151204d2 Fix more tables where table sorting is not honored
Issue #12941

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-02 15:11:22 +01:00
Isaac Bennetch
b853299cba Add closelog() call after writing to syslog.
See http://php.net/manual/en/function.syslog.php#79554
and our issue #6146

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-01-28 22:39:51 -05:00
Michal Čihař
6bf4f3bf39 Merge branch 'QA_4_6' 2016-12-19 16:20:57 +01:00
Michal Čihař
ffe68c7219 Honor user configured connection collation
* the user set collation is now honored
* default value has been changed to utf8mb4
* it is downgraded to utf8 if server does not support it

Fixes #12826

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-19 16:18:21 +01:00
Michal Čihař
06d13fc715 Merge branch 'QA_4_6' 2016-12-14 15:34:54 +01:00
Michal Čihař
eec9d3f3dd Use === to avoid suprises with numeric table names
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-14 15:34:39 +01:00
Michal Čihař
beea41fc96 Merge branch 'QA_4_6' 2016-12-14 15:31:29 +01:00
Michal Čihař
715bdf3a49 Fixed operation with lower_case_table_names=2
The problem is that mysqli_fields_meta returns orgtable as lowercase
making phpMyAdmin treat it as alias later nad finding no fields for
original table.

Fixes issue #11816

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-14 15:29:43 +01:00
Michal Čihař
a34e314952 Reuse getCurrentUser method
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-02 11:12:07 +01:00
Michal Čihař
0fc20266a4 Merge branch 'QA_4_6' 2016-12-02 11:10:55 +01:00
Deven Bansod
7d4f188c72 Current user might vary from the actual defined user
Use CURRENT_USER instead, which would give the actual user defined in User accounts table

Fix #12769

ChangeLog entry for #12769

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
2016-12-02 01:07:48 +05:30
Deven Bansod
ace8d9c945 Merge branch 'QA_4_6' 2016-11-16 09:24:49 +05:30
Deven Bansod
74fd7986eb Remove debugging calls
Fix #12706

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
2016-11-16 09:23:06 +05:30
Michal Čihař
dad93483c1 Merge branch 'QA_4_6' 2016-11-10 11:08:36 +01:00
Deven Bansod
cb7abad0b5 Remove call to old methods, fix tests
Remove definition of old method. Remove related tests

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
2016-11-09 10:40:00 +05:30
Deven Bansod
956f3179cb Fix Navigation tests and Export tests
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
2016-11-04 11:55:46 +05:30
Deven Bansod
f14cffdbe7 Properly escape strings in MySQL statement values
Use *_real_escape string functions provided by connectors to escape strings while exporting

Fix #12453

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>

Conflicts:
	libraries/server_privileges.lib.php
2016-10-29 10:45:12 +05:30
Deven Bansod
5f84046759 Make PHPCS happy
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
2016-09-29 09:21:50 +05:30
Michal Čihař
7fc28626fd Merge branch 'QA_4_6' 2016-09-19 10:51:50 +02:00
Deven Bansod
f8ea67f2bc Fix #12530: Show enabled links for Edit and Execute after proper priv checks
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
2016-09-16 13:51:34 +05:30
Michal Čihař
42d54a938a Remove MySQL version caching
In my testing the session/cache access is slower than fetching single
value from MySQL and calculating the values.

Also the caching would need some logic for invalidation as the server
can be upgraded or configuration changed.

Fixes #11924

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-07 09:28:13 +02:00
Michal Čihař
aee8184faf Merge branch 'QA_4_6' 2016-09-02 14:40:23 +02:00
Michal Čihař
e01f404804 Remove unused variable
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-02 14:40:18 +02:00
Michal Čihař
bfd6a76819 Merge branch 'QA_4_6' 2016-09-02 14:39:45 +02:00
Michal Čihař
eb3e3b73c3 Simplified handling of connection errors
There is no need to retrigger errors, just let the handler know to
handle them without backtrace.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-02 14:35:36 +02:00
Michal Čihař
ae79ceb3a4 Do not error on unset server port
Fixes #12339

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-02 08:53:06 +02:00
Michal Čihař
4054228e1b Always merge control user configuration
Issue #12218

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 13:25:29 +02:00
Michal Čihař
9d0c745aa5 Add missing documentation
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 12:48:57 +02:00
Michal Čihař
90498afe76 Allow to specify further parameters for control connection
Fixes #12218

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 12:38:03 +02:00
Michal Čihař
a36367bafb Always provide default for ssl and compress settings
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 12:27:06 +02:00
Michal Čihař
0fdc46eb55 Always set default connection params
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 12:24:39 +02:00
Michal Čihař
8a41fd3f63 Fix fallback value for MySQL port
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 12:24:28 +02:00
Michal Čihař
94ff41a97f Add safety check for invalid method call
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 12:22:01 +02:00
Michal Čihař
061c620723 Generate connection settings at one place
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 12:19:40 +02:00
Michal Čihař
9592f66bd5 Share socket/port/host sanitization in DatabaseInterface
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 12:09:26 +02:00
Michal Čihař
6fd55f968a Pass user link parameter in server array as well
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 12:04:25 +02:00
Michal Čihař
95064ed9fb Move control user connection calculation to DatabaseInterface
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:58:02 +02:00
Michal Čihař
2dce033943 Move configuration management in DBI to separate method
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:57:51 +02:00
Michal Čihař
25a38b2067 Determine correct user/password for connect in DatabaseInterface
The API only specifies what kind of link we want and we will get it.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:51:09 +02:00
Michal Čihař
f30f65c67a Indentify connection type by one flag
Use integer values rather than set of boolean flags. This makes it
easier to make decision and makes the code more readable. Also removes
confusion what should happen in case both boolean flags are set.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:36:07 +02:00
Michal Čihař
f46fd34081 Remove is_controluser flag from DBI backends
They no longer need it (it was used only for empty password fallback).

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:34:55 +02:00
Michal Čihař
bee2805b34 Remove auxiliary_connection flag from DBI backends
They do not use it anyway.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:23:29 +02:00