Merge pull request #22355 from nextcloud/backport/20772/stable19
[stable19] Properly search for users when limittogroups is enabled
This commit is contained in:
commit
9aac6d9251
|
@ -79,7 +79,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 {
|
||||
|
|
|
@ -321,7 +321,7 @@ class UserPluginTest extends TestCase {
|
|||
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1']],
|
||||
['label' => 'Test Two', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2']],
|
||||
],
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
[
|
||||
['test1', $this->getUserMock('test1', 'Test One')],
|
||||
|
|
Loading…
Reference in New Issue