Do pagination on the dummy group backend

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-11-19 16:09:11 +01:00
parent afa0f2c0d8
commit b367027798
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 2 additions and 1 deletions

View File

@ -177,7 +177,8 @@ class Dummy extends Backend {
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
if(isset($this->groups[$gid])) {
if(empty($search)) {
return $this->groups[$gid];
$length = $limit < 0 ? null : $limit;
return array_slice($this->groups[$gid], $offset, $length);
}
$result = array();
foreach($this->groups[$gid] as $user) {