mirror of
https://github.com/vrana/adminer.git
synced 2025-08-13 01:54:00 +02:00
First available database or current user without list
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@949 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -10,8 +10,12 @@ class Adminer {
|
||||
}
|
||||
|
||||
function database() {
|
||||
global $dbh;
|
||||
$dbs = get_databases(false);
|
||||
return (count($dbs) == 1 ? $dbs[0] : (count($dbs) == 2 && information_schema($dbs[0]) ? $dbs[1] : 'test'));
|
||||
return (!$dbs
|
||||
? $dbh->result($dbh->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1)")) // username without the database list
|
||||
: $dbs[(information_schema($dbs[0]) ? 1 : 0)] // first available database
|
||||
);
|
||||
}
|
||||
|
||||
function loginForm($username) {
|
||||
|
Reference in New Issue
Block a user