From 615106c70c1449f2da2fb80ed5c22a35da4e9ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20M=C3=BCller?= Date: Wed, 29 Aug 2001 17:15:56 +0000 Subject: [PATCH] * left.php3: on login with std_auth, only the databases on which the user has rights will be shown (test = @mysql_select_db($dbname)). --- ChangeLog | 4 ++++ left.php3 | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ade4c2d5e..20b02d70c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2001-08-29 Olivier Müller + * left.php3: on login with std_auth, only the databases on which + the user has rights will be shown (tested with @mysql_select_db($dbname)). + 2001-08-29 Marc Delisle * lang/romanian.inc.php3 updates, thanks to Valics Lehel * Documentation.html, added a FAQ about "too many fields" diff --git a/left.php3 b/left.php3 index 00d593731..536045f56 100755 --- a/left.php3 +++ b/left.php3 @@ -24,7 +24,7 @@ if ($server > 0) { if ($num_dbs) { $true_dblist = array(); for ($i = 0; $i < $num_dbs; $i++) { -// $dblink = @mysql_select_db(backquote($dblist[$i])); + // $dblink = @mysql_select_db(backquote($dblist[$i])); $dblink = @mysql_select_db($dblist[$i]); if ($dblink) { $true_dblist[] = $dblist[$i]; @@ -39,9 +39,16 @@ if ($server > 0) { else { $dbs = mysql_list_dbs() or mysql_die('', 'mysql_list_dbs()', FALSE, FALSE); $num_dbs = @mysql_num_rows($dbs); + $real_num_dbs = 0; for ($i = 0; $i < $num_dbs; $i++) { - $dblist[] = mysql_dbname($dbs, $i); + $db_name_tmp = mysql_dbname($dbs, $i); + $dblink = @mysql_select_db($db_name_tmp); + if ($dblink) { + $dblist[] = $db_name_tmp; + $real_num_dbs++; + } } // end for + $num_dbs = $real_num_dbs; } // end else } else { $num_dbs = 0;