Add support for config auth method

Fixes #8

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař
2015-12-14 13:39:31 +01:00
parent 7d566641b4
commit b0a8bc0bec
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -50,3 +50,4 @@ docker-compose up -d
* ``PMA_ARBITRARY`` - when set to 1 connection to the arbitrary server will be allowed
* ``PMA_HOST`` - define address/host name of the MySQL server
* ``PMA_PORT`` - define port of the MySQL server
* ``PMA_USER`` and ``PMA_PASSWORD`` - define username to use for config authentication method
+7 -1
View File
@@ -10,7 +10,6 @@ if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
/* First server */
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
if (isset($_ENV['PMA_HOST'])) {
$cfg['Servers'][$i]['host'] = $_ENV['PMA_HOST'];
} else {
@@ -19,6 +18,13 @@ if (isset($_ENV['PMA_HOST'])) {
if (isset($_ENV['PMA_PORT'])) {
$cfg['Servers'][$i]['port'] = $_ENV['PMA_PORT'];
}
if (isset($_ENV['PMA_USER']) && isset($_ENV['PMA_PASSWORD']) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = $_ENV['PMA_PASSWORD'];
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;