mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 09:34:10 +02:00
Hide databases the user can't connect to
pg_database lists all databases including the ones the user can't connect to. There is little point in showing them when we know connecting will fail.
This commit is contained in:
@@ -199,7 +199,7 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
|
||||
function get_databases() {
|
||||
return get_vals("SELECT datname FROM pg_database ORDER BY datname");
|
||||
return get_vals("SELECT datname FROM pg_database WHERE has_database_privilege(datname, 'CONNECT') ORDER BY datname");
|
||||
}
|
||||
|
||||
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
|
||||
|
Reference in New Issue
Block a user