From: Bo Peng Date: Wed, 28 Feb 2018 07:52:50 +0000 (+0900) Subject: Improve isSuperUser() function to make pgpoolAdmin more useful. X-Git-Tag: V4_0_0~2 X-Git-Url: http://git.postgresql.org/gitweb/static/%7B%7Bpgdulink%28?a=commitdiff_plain;h=5a1d1a2a16d0a808c8b075553b56daf14620fa42;p=pgpooladmin.git Improve isSuperUser() function to make pgpoolAdmin more useful. --- diff --git a/common.php b/common.php index f45f979..e35c0bf 100644 --- a/common.php +++ b/common.php @@ -226,7 +226,7 @@ function isSuperUser($user_name) // Try to connect the backend by login user $conn = openDBConnection(array( - 'host' => 'localhost', + 'host' => PGPOOLADMIN_HOST, 'port' => $params['port'], 'dbname' => 'template1', 'user' => $_SESSION[SESSION_LOGIN_USER], @@ -238,6 +238,7 @@ function isSuperUser($user_name) if ($conn === FALSE) { $params = readConfigParams(array('port', 'health_check_user', 'health_check_password')); $conn = openDBConnection(array( + 'host' => PGPOOLADMIN_HOST, 'port' => $params['port'], 'dbname' => 'template1', 'user' => $params['health_check_user'],