From 4e7fc159a48612b47e9e9de6b91776d4fa96b732 Mon Sep 17 00:00:00 2001 From: "Jehan-Guillaume (ioguix) de Rorthais" Date: Wed, 1 Jun 2011 21:23:37 +0200 Subject: [PATCH] Fix a bug and support empty username in $data->isSuperUser to check the superUser status of the current role Fixed a bug on the way as in previous version it was checking if function pg_parameter_status exists and used it directly, hence testing only the currently used role. pg_parameter_status is available in PHP 5.* --- classes/database/Postgres.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index 4b019931..588a2cc3 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -6467,10 +6467,10 @@ class Postgres extends ADODB_base { * @param $username The username of the user * @return True if is a super user, false otherwise */ - function isSuperUser($username) { + function isSuperUser($username = '') { $this->clean($username); - if (function_exists('pg_parameter_status')) { + if (empty($usename)) { $val = pg_parameter_status($this->conn->_connectionID, 'is_superuser'); if ($val !== false) return $val == 'on'; } -- 2.39.5