diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-05-01 16:27:44 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-08-21 13:14:32 +0200 |
commit | 51922caa5f5c3c4a7bc446b1cfc5348451f0ad62 (patch) | |
tree | 170af662e3a543cf133bbbb8fa677ad9b61869b5 /lib | |
parent | 6e4b0892650c4c90a4a0fb35baacab6c0d4913bf (diff) | |
download | nextcloud-server-51922caa5f5c3c4a7bc446b1cfc5348451f0ad62.tar.gz nextcloud-server-51922caa5f5c3c4a7bc446b1cfc5348451f0ad62.zip |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Collaboration/Collaborators/UserPlugin.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php index 72368e50521..0a603448525 100644 --- a/lib/private/Collaboration/Collaborators/UserPlugin.php +++ b/lib/private/Collaboration/Collaborators/UserPlugin.php @@ -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 { |