aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/user_ldap/group_ldap.php15
1 files changed, 12 insertions, 3 deletions
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);
+
}
/**