bug 495112
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2001-12-21 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
|
* test and merge patch from Lo<4C>c for bug 495112:
|
||||||
|
- libraries/common.lib.php3
|
||||||
|
|
||||||
2001-12-19 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
2001-12-19 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||||
* Documentation.html; libraries/display_tbl.lib.php3: updated credits.
|
* Documentation.html; libraries/display_tbl.lib.php3: updated credits.
|
||||||
* libraries/display_tbl.lib.php3:
|
* libraries/display_tbl.lib.php3:
|
||||||
|
@@ -458,19 +458,12 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
|
|||||||
// This maintenance is to fix code to work correctly for regular
|
// This maintenance is to fix code to work correctly for regular
|
||||||
// expressions.
|
// expressions.
|
||||||
if ($row['Select_priv'] != 'Y') {
|
if ($row['Select_priv'] != 'Y') {
|
||||||
|
|
||||||
|
// 1. get allowed dbs from the "mysql.db" table
|
||||||
// lem9: User can be blank (anonymous user)
|
// lem9: User can be blank (anonymous user)
|
||||||
$local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Select_priv = \'Y\' AND (User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\' OR User = \'\')';
|
$local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Select_priv = \'Y\' AND (User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\' OR User = \'\')';
|
||||||
$rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
|
$rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
|
||||||
if (@mysql_numrows($rs) <= 0) {
|
if (@mysql_numrows($rs)) {
|
||||||
$local_query = 'SELECT DISTINCT Db FROM mysql.tables_priv WHERE Table_priv LIKE \'%Select%\' AND User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\'';
|
|
||||||
$rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
|
|
||||||
if (@mysql_numrows($rs)) {
|
|
||||||
while ($row = mysql_fetch_array($rs)) {
|
|
||||||
$dblist[] = $row['Db'];
|
|
||||||
}
|
|
||||||
mysql_free_result($rs);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Will use as associative array of the following 2 code
|
// Will use as associative array of the following 2 code
|
||||||
// lines:
|
// lines:
|
||||||
// the 1st is the only line intact from before
|
// the 1st is the only line intact from before
|
||||||
@@ -526,9 +519,22 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
|
|||||||
} // end else
|
} // end else
|
||||||
mysql_free_result($uva_alldbs);
|
mysql_free_result($uva_alldbs);
|
||||||
unset($uva_mydbs);
|
unset($uva_mydbs);
|
||||||
} // end else
|
} // end if
|
||||||
|
|
||||||
|
// 2. get allowed dbs from the "mysql.tables_priv" table
|
||||||
|
$local_query = 'SELECT DISTINCT Db FROM mysql.tables_priv WHERE Table_priv LIKE \'%Select%\' AND User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\'';
|
||||||
|
$rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
|
||||||
|
if (@mysql_numrows($rs)) {
|
||||||
|
while ($row = mysql_fetch_array($rs)) {
|
||||||
|
if (PMA_isInto($row['Db'], $dblist) == -1) {
|
||||||
|
$dblist[] = $row['Db'];
|
||||||
|
}
|
||||||
|
} // end while
|
||||||
|
mysql_free_result($rs);
|
||||||
|
} // end if
|
||||||
} // end if
|
} // end if
|
||||||
} // end building available dbs from the "mysql" db
|
} // end building available dbs from the "mysql" db
|
||||||
|
|
||||||
} // end server connecting
|
} // end server connecting
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user