LDAP: adjust usersInGroup to updated interface
This commit is contained in:
parent
3c1380b093
commit
62e4f55f72
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue