errors when invalid login

This commit is contained in:
Marc Delisle
2004-06-15 00:16:59 +00:00
parent 567f7f1815
commit 0123495cb7
2 changed files with 6 additions and 4 deletions

View File

@@ -20,6 +20,8 @@ $Source$
* libraries/common.lib.php: proper revision check * libraries/common.lib.php: proper revision check
* libraries/select_theme.lib.php: remove unneeded counter, and fix * libraries/select_theme.lib.php: remove unneeded counter, and fix
undefined $PHP_SELF undefined $PHP_SELF
* libraries/dbi/mysql.dbi.lib.php: errors on mysql_errno() when the
login is invalid
2004-06-13 Marc Delisle <lem9@users.sourceforge.net> 2004-06-13 Marc Delisle <lem9@users.sourceforge.net>
* many files: redesign part 3, thanks to Michael Keck (mkkeck). * many files: redesign part 3, thanks to Michael Keck (mkkeck).

View File

@@ -1,7 +1,7 @@
<?php <?php
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
error_reporting(E_ALL);
/** /**
* Interface to the classic MySQL extension * Interface to the classic MySQL extension
*/ */
@@ -197,13 +197,13 @@ function PMA_DBI_getError($link = NULL) {
if (mysql_errno()) { if (mysql_errno()) {
$error = mysql_errno(); $error = mysql_errno();
$error_message = mysql_error(); $error_message = mysql_error();
} else { } elseif ($link) {
$error = mysql_errno($link); $error = mysql_errno($link);
$error_message = mysql_error($link); $error_message = mysql_error($link);
} }
// keep the error number for further check after the call to PMA_DBI_getError() // keep the error number for further check after the call to PMA_DBI_getError()
if ($error) { if (isset($error) && $error) {
$GLOBALS['errno'] = $error; $GLOBALS['errno'] = $error;
} else { } else {
return FALSE; return FALSE;
@@ -212,7 +212,7 @@ function PMA_DBI_getError($link = NULL) {
// Some errors messages cannot be obtained by mysql_error() // Some errors messages cannot be obtained by mysql_error()
if ($error && $error == 2003) { if ($error && $error == 2003) {
$error = '#' . ((string) $error) . ' - ' . $GLOBALS['strServerNotResponding']; $error = '#' . ((string) $error) . ' - ' . $GLOBALS['strServerNotResponding'];
} elseif ($error && PMA_MYSQL_INT_VERSION >= 40100) { } elseif ($error && defined('PMA_MYSQL_INT_VERSION') && PMA_MYSQL_INT_VERSION >= 40100) {
$error = '#' . ((string) $error) . ' - ' . $error_message; $error = '#' . ((string) $error) . ' - ' . $error_message;
} elseif ($error) { } elseif ($error) {
$error = '#' . ((string) $error) . ' - ' . PMA_convert_display_charset($error_message); $error = '#' . ((string) $error) . ' - ' . PMA_convert_display_charset($error_message);