bug #1536112, config not loaded on MySQL error 2002 or 2003

This commit is contained in:
Marc Delisle
2006-08-12 15:33:55 +00:00
parent 5e0722a9db
commit 8642016a3a
2 changed files with 14 additions and 15 deletions

View File

@@ -8,6 +8,8 @@ $Source$
2006-08-11 Marc Delisle <lem9@users.sourceforge.net> 2006-08-11 Marc Delisle <lem9@users.sourceforge.net>
* sql.php, import.php, libraries/parse_analyze.lib.php: * sql.php, import.php, libraries/parse_analyze.lib.php:
bug #1533945, wrong table name in header (SELECT from query window) 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 <cybot_tm@users.sourceforge.net> 2006-08-11 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* css\phpmyadmin.css.php, themes\*: * css\phpmyadmin.css.php, themes\*:

View File

@@ -107,24 +107,21 @@ function PMA_auth_fails()
<div id="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div> <div id="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
<?php <?php
// 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
if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) { if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
echo '<p>' . $GLOBALS['strAccessDenied'] . '</p>' . "\n"; echo '<p>' . $GLOBALS['strAccessDenied'] . '</p>' . "\n";
} else { } else {
if (!isset($GLOBALS['errno']) || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) { // Check whether user has configured something
// Check whether user has configured something if ($_SESSION['PMA_Config']->source_mtime == 0) {
if ($_SESSION['PMA_Config']->source_mtime == 0) { echo '<p>' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '<a href="scripts/setup.php">', '</a>') . '</p>' . "\n";
echo '<p>' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '<a href="scripts/setup.php">', '</a>') . '</p>' . "\n"; } elseif (!isset($GLOBALS['errno']) || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) {
} else { // if we display the "Server not responding" error, do not confuse users
echo '<p>' . $GLOBALS['strAccessDeniedExplanation'] . '</p>' . "\n"; // 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 '<p>' . $GLOBALS['strAccessDeniedExplanation'] . '</p>' . "\n";
} }
PMA_mysqlDie($conn_error, '', true, '', false); PMA_mysqlDie($conn_error, '', true, '', false);
} }