Properly search for users when limittogroups is enabled

Searching just for the uid is not enough.
This makes sure this done properly again now.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2020-05-01 16:27:44 +02:00 committed by Morris Jobke
parent 6e4b089265
commit 51922caa5f
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 9 additions and 1 deletions

View File

@ -95,7 +95,15 @@ class UserPlugin implements ISearchPlugin {
$usersInGroup = $this->groupManager->displayNamesInGroup($userGroupId, $search, $limit, $offset);
foreach ($usersInGroup as $userId => $displayName) {
$userId = (string) $userId;
$users[$userId] = $this->userManager->get($userId);
$user = $this->userManager->get($userId);
if (!$user->isEnabled()) {
// Ignore disabled users
continue;
}
$users[$userId] = $user;
}
if (count($usersInGroup) >= $limit) {
$hasMoreResults = true;
}
}
} else {