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:
parent
cd8ff96a09
commit
b8bea7fc56
|
@ -199,7 +199,7 @@ if (isset($_GET["pgsql"])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_databases() {
|
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 = " ") {
|
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
|
||||||
|
|
Loading…
Reference in a new issue