From 62e4f55f721971dacd06649cecefe0487626aa75 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 14 Aug 2012 14:30:03 +0200 Subject: LDAP: adjust usersInGroup to updated interface --- apps/user_ldap/group_ldap.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index d0d1ae30350..709144539e9 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -133,12 +133,17 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { * @brief get a list of all users in a group * @returns array with user ids */ - public function usersInGroup($gid) { + public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { if(!$this->enabled) { return array(); } + $this->groupSearch = $search; if($this->connection->isCached('usersInGroup'.$gid)) { - return $this->connection->getFromCache('usersInGroup'.$gid); + $groupUsers = $this->connection->getFromCache('usersInGroup'.$gid); + if(!empty($this->groupSearch)) { + $groupUsers = array_filter($groupUsers, array($this, 'groupMatchesFilter')); + } + return array_slice($groupUsers, $offset, $limit); } $groupDN = $this->groupname2dn($gid); @@ -176,7 +181,11 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { $groupUsers = array_unique($result, SORT_LOCALE_STRING); $this->connection->writeToCache('usersInGroup'.$gid, $groupUsers); - return $groupUsers; + if(!empty($this->groupSearch)) { + $groupUsers = array_filter($groupUsers, array($this, 'groupMatchesFilter')); + } + return array_slice($groupUsers, $offset, $limit); + } /** -- cgit v1.2.3