bug 528961

This commit is contained in:
Marc Delisle
2002-03-13 17:34:46 +00:00
parent 7905cf53e3
commit d5a817b4cf
2 changed files with 20 additions and 14 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2002-03-13 Marc Delisle <lem9@users.sourceforge.net>
* libraries/common.lib.php3: bug 528961 safe_show_database
2002-03-11 Marc Delisle <lem9@users.sourceforge.net> 2002-03-11 Marc Delisle <lem9@users.sourceforge.net>
* various lang updates * various lang updates
* 2.2.5-rc1 released * 2.2.5-rc1 released

View File

@@ -538,12 +538,14 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
// 'only_db' is empty for the current user... // 'only_db' is empty for the current user...
else { else {
// ... first checks whether the "safe_show_database" is on or not // ... first checks whether the "safe_show_database"
// is on or not (if MYSQL supports this)
if (PMA_MYSQL_INT_VERSION >= 32330) {
$local_query = 'SHOW VARIABLES LIKE \'safe_show_database\''; $local_query = 'SHOW VARIABLES LIKE \'safe_show_database\'';
$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);
$is_safe_show_dbs = mysql_result($rs, 0, 'Value'); $is_safe_show_dbs = mysql_result($rs, 0, 'Value');
// ... and if on, try get the available dbs list,.... // ... and if on, try to get the available dbs list
if ($is_safe_show_dbs && strtoupper($is_safe_show_dbs) != 'OFF') { if ($is_safe_show_dbs && strtoupper($is_safe_show_dbs) != 'OFF') {
$uva_alldbs = mysql_list_dbs($userlink); $uva_alldbs = mysql_list_dbs($userlink);
while ($uva_row = mysql_fetch_array($uva_alldbs)) { while ($uva_row = mysql_fetch_array($uva_alldbs)) {
@@ -553,6 +555,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
unset($uva_alldbs); unset($uva_alldbs);
mysql_free_result($rs); mysql_free_result($rs);
} // end if ($is_safe_show_dbs) } // end if ($is_safe_show_dbs)
} //end if (PMA_MYSQL_INT_VERSION)
// ... else checks for available databases in the "mysql" db // ... else checks for available databases in the "mysql" db
if (!$dblist_cnt) { if (!$dblist_cnt) {