From edb16ad562c5896924ac8ef324235847d7e353c0 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 11 Jun 2006 19:07:48 +0200 Subject: changed inheritance for pgsql auth backend Because of incompatible SQL syntax the postgres backend can no longer inherit the retrieveUsers method from the MySQL backend darcs-hash:20060611170748-7ad00-83c69718da2f391e44504638b795956cf412fca0.gz --- inc/auth/pgsql.class.php | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'inc/auth') diff --git a/inc/auth/pgsql.class.php b/inc/auth/pgsql.class.php index 96ad8acb7..60c36e258 100644 --- a/inc/auth/pgsql.class.php +++ b/inc/auth/pgsql.class.php @@ -129,7 +129,35 @@ class auth_pgsql extends auth_mysql { return $rc; } - // @inherit function retrieveUsers($first=0,$limit=10,$filter=array()) + /** + * Bulk retrieval of user data. [public function] + * + * @param first index of first user to be returned + * @param limit max number of users to be returned + * @param filter array of field/pattern pairs + * @return array of userinfo (refer getUserData for internal userinfo details) + * + * @author Matthias Grimm + */ + function retrieveUsers($first=0,$limit=10,$filter=array()) { + $out = array(); + + if($this->_openDB()) { + $this->_lockTables("READ"); + $sql = $this->_createSQLFilter($this->cnf['getUsers'], $filter); + $sql .= " ".$this->cnf['SortOrder']." LIMIT $limit OFFSET $first"; + $result = $this->_queryDB($sql); + + foreach ($result as $user) + if (($info = $this->_getUserInfo($user['user']))) + $out[$user['user']] = $info; + + $this->_unlockTables(); + $this->_closeDB(); + } + return $out; + } + // @inherit function joinGroup($user, $group) // @inherit function leaveGroup($user, $group) { -- cgit v1.2.3