summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-08-14 14:30:03 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-08-14 14:30:03 +0200
commit62e4f55f721971dacd06649cecefe0487626aa75 (patch)
treedc67cbfc44c75f0ef63c784f85b437d058f346d1 /apps/user_ldap
parent3c1380b093fcfe5d94927529ccc726b4ed56e99f (diff)
downloadnextcloud-server-62e4f55f721971dacd06649cecefe0487626aa75.tar.gz
nextcloud-server-62e4f55f721971dacd06649cecefe0487626aa75.zip
LDAP: adjust usersInGroup to updated interface
Diffstat (limited to 'apps/user_ldap')
-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);
+
}
/**