diff --git a/ChangeLog b/ChangeLog index bc236ed96..ee50b5b33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ $HeadURL$ - bug #1664212 querywindow loses url encoded characters - bug #1682044 Export file even if file not selected - bug #1672789 Undefined offset: 4 in sqlparser.lib.php #1674 +- bug #1662976 Authentication fails when controluser/pass is set - [gui] avoid displaying a wide selector in server selection + [core] added PMA_fatalError() and made use of it . [i18n] use generic $strOptions diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 94b73300e..45bb6300e 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -3378,10 +3378,12 @@ if (! defined('PMA_MINIMUM_COMMON')) { // get the privileges list for the current user but the true user link // must be open after this one so it would be default one for all the // scripts) + $controllink = false; if ($cfg['Server']['controluser'] != '') { $controllink = PMA_DBI_connect($cfg['Server']['controluser'], $cfg['Server']['controlpass'], true); - } else { + } + if (! $controllink) { $controllink = PMA_DBI_connect($cfg['Server']['user'], $cfg['Server']['password'], true); } // end if ... else diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index 489e2b782..187410faf 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -78,7 +78,13 @@ function PMA_DBI_connect($user, $password, $is_controluser = FALSE) { $link = PMA_DBI_real_connect($cfg['Server']['host'] . $server_port . $server_socket, $user, '', empty($client_flags) ? NULL : $client_flags); } - if (empty($link)) { + debug_print_backtrace(); + die; + if (empty($link) && ! $is_controluser) { + if ($is_controluser) { + define('PMA_DBI_CONNECT_FAILED_CONTROLUSER', true); + return false; + } PMA_auth_fails(); } // end if diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index d8149f4b0..3e4e896ac 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -107,6 +107,10 @@ function PMA_DBI_connect($user, $password, $is_controluser = false) } if ($return_value == false) { + if ($is_controluser) { + define('PMA_DBI_CONNECT_FAILED_CONTROLUSER', true); + return false; + } PMA_auth_fails(); } // end if diff --git a/main.php b/main.php index 3b95649b2..6b5611322 100644 --- a/main.php +++ b/main.php @@ -345,8 +345,8 @@ if (! empty($GLOBALS['PMA_errors']) && is_array($GLOBALS['PMA_errors'])) { * modified: 2004-05-05 mkkeck */ if ($server != 0 - && $cfg['Server']['user'] == 'root' - && $cfg['Server']['password'] == '') { + && $cfg['Server']['user'] == 'root' + && $cfg['Server']['password'] == '') { echo '