When only_db matches no database, do not show any (bug #943626).

This commit is contained in:
Michal Čihař
2004-04-28 10:57:25 +00:00
parent 5a396ebd2e
commit 23f8ddfdbd
2 changed files with 5 additions and 2 deletions

View File

@@ -7,6 +7,8 @@ $Source$
2004-04-28 Michal Cihar <michal@cihar.com> 2004-04-28 Michal Cihar <michal@cihar.com>
* css/phpmyadmin.css.php: Force <button> to be displayed inline. * css/phpmyadmin.css.php: Force <button> to be displayed inline.
* libraries/common.lib.php: When only_db matches no database, do not show
any (bug #943626).
2004-04-28 Garvin Hicking <pma@supergarv.de> 2004-04-28 Garvin Hicking <pma@supergarv.de>
* left.php, libraries/left.js: Fixed unneeded spacing between items * left.php, libraries/left.js: Fixed unneeded spacing between items

View File

@@ -1117,11 +1117,13 @@ if ($is_minimum_common == FALSE) {
* *
* @global array the list of available databases * @global array the list of available databases
* @global integer the number of available databases * @global integer the number of available databases
* @global array current configuration
*/ */
function PMA_availableDatabases($error_url = '') function PMA_availableDatabases($error_url = '')
{ {
global $dblist; global $dblist;
global $num_dbs; global $num_dbs;
global $cfg;
$num_dbs = count($dblist); $num_dbs = count($dblist);
@@ -1140,10 +1142,9 @@ if ($is_minimum_common == FALSE) {
unset($true_dblist); unset($true_dblist);
$num_dbs = count($dblist); $num_dbs = count($dblist);
} // end if } // end if
// 2. Allowed database list is empty -> gets the list of all databases // 2. Allowed database list is empty -> gets the list of all databases
// on the server // on the server
else { else if (!isset($cfg['Server']['only_db']) || $cfg['Server']['only_db'] == '') {
$dblist = PMA_DBI_get_dblist(); // needed? or PMA_mysqlDie('', 'SHOW DATABASES;', FALSE, $error_url); $dblist = PMA_DBI_get_dblist(); // needed? or PMA_mysqlDie('', 'SHOW DATABASES;', FALSE, $error_url);
$num_dbs = count($dblist); $num_dbs = count($dblist);
} // end else } // end else