From b0fba362592950f506fb5c91994f05132c9ddd9c Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 12 Aug 2006 15:30:40 +0000 Subject: [PATCH] bug #1536112, config not loaded on MySQL error 2002 or 2003 --- ChangeLog | 4 ++++ libraries/auth/config.auth.lib.php | 27 ++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd1b3c660..56362703a 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog $Id$ $Source$ +2006-08-11 Marc Delisle + * libraries/auth/config.auth.lib.php: bug #1536112, config not loaded + (MySQL error 2002 or 2003) + 2006-08-10 Marc Delisle * lang/danish: Updated, thanks to AlleyKat - dk_alleykat * lang/catalan update, thanks to Xavier Navarro (xavin) 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); }