From 8642016a3a925273c394b6f1c75c08377765bfbd Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 12 Aug 2006 15:33:55 +0000 Subject: [PATCH] bug #1536112, config not loaded on MySQL error 2002 or 2003 --- ChangeLog | 2 ++ libraries/auth/config.auth.lib.php | 27 ++++++++++++--------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 79d60f040..22eaa3fa8 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ $Source$ 2006-08-11 Marc Delisle * sql.php, import.php, libraries/parse_analyze.lib.php: bug #1533945, wrong table name in header (SELECT from query window) + * libraries/auth/config.auth.lib.php: bug #1536112, config not loaded + (MySQL error 2002 or 2003) 2006-08-11 Sebastian Mendel * css\phpmyadmin.css.php, themes\*: diff --git a/libraries/auth/config.auth.lib.php b/libraries/auth/config.auth.lib.php index da86a4611..edf226924 100644 --- a/libraries/auth/config.auth.lib.php +++ b/libraries/auth/config.auth.lib.php @@ -107,24 +107,21 @@ function PMA_auth_fails()
' . $GLOBALS['strAccessDenied'] . '

' . "\n"; } else { - if (!isset($GLOBALS['errno']) || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) { - // Check whether user has configured something - if ($_SESSION['PMA_Config']->source_mtime == 0) { - echo '

' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '', '') . '

' . "\n"; - } else { - echo '

' . $GLOBALS['strAccessDeniedExplanation'] . '

' . "\n"; - } + // Check whether user has configured something + if ($_SESSION['PMA_Config']->source_mtime == 0) { + echo '

' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '', '') . '

' . "\n"; + } elseif (!isset($GLOBALS['errno']) || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) { + // if we display the "Server not responding" error, do not confuse users + // by telling them they have a settings problem + // (note: it's true that they could have a badly typed host name, but + // anyway the current $strAccessDeniedExplanation tells that the server + // rejected the connection, which is not really what happened) + // 2002 is the error given by mysqli + // 2003 is the error given by mysql + echo '

' . $GLOBALS['strAccessDeniedExplanation'] . '

' . "\n"; } PMA_mysqlDie($conn_error, '', true, '', false); }