Skip to content
Snippets Groups Projects
Commit 62e4f55f authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

LDAP: adjust usersInGroup to updated interface

parent 3c1380b0
No related branches found
No related tags found
No related merge requests found
...@@ -133,12 +133,17 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { ...@@ -133,12 +133,17 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
* @brief get a list of all users in a group * @brief get a list of all users in a group
* @returns array with user ids * @returns array with user ids
*/ */
public function usersInGroup($gid) { public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
if(!$this->enabled) { if(!$this->enabled) {
return array(); return array();
} }
$this->groupSearch = $search;
if($this->connection->isCached('usersInGroup'.$gid)) { 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); $groupDN = $this->groupname2dn($gid);
...@@ -176,7 +181,11 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { ...@@ -176,7 +181,11 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
$groupUsers = array_unique($result, SORT_LOCALE_STRING); $groupUsers = array_unique($result, SORT_LOCALE_STRING);
$this->connection->writeToCache('usersInGroup'.$gid, $groupUsers); $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);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment