diff options
author | Andreas Gohr <andi@splitbrain.org> | 2006-06-11 19:07:48 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2006-06-11 19:07:48 +0200 |
commit | edb16ad562c5896924ac8ef324235847d7e353c0 (patch) | |
tree | f31ca3b897b23c0031c056f792ee4ef07a17b8f5 | |
parent | 2f3dc51dfd3a547d110bd7c74738db705a75a963 (diff) | |
download | rpg-edb16ad562c5896924ac8ef324235847d7e353c0.tar.gz rpg-edb16ad562c5896924ac8ef324235847d7e353c0.tar.bz2 |
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
-rw-r--r-- | inc/auth/pgsql.class.php | 30 |
1 files changed, 29 insertions, 1 deletions
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 <matthiasgrimm@users.sourceforge.net> + */ + 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) { |