Merge pull request #20772 from nextcloud/fix/sharee-integration-test
Properly search for users when limittogroups is enabled
This commit is contained in:
commit
8261d7e07f
|
@ -95,7 +95,15 @@ class UserPlugin implements ISearchPlugin {
|
||||||
$usersInGroup = $this->groupManager->displayNamesInGroup($userGroupId, $search, $limit, $offset);
|
$usersInGroup = $this->groupManager->displayNamesInGroup($userGroupId, $search, $limit, $offset);
|
||||||
foreach ($usersInGroup as $userId => $displayName) {
|
foreach ($usersInGroup as $userId => $displayName) {
|
||||||
$userId = (string) $userId;
|
$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 {
|
} else {
|
||||||
|
|
|
@ -328,7 +328,7 @@ class UserPluginTest extends TestCase {
|
||||||
['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'status' => []],
|
['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'status' => []],
|
||||||
['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'status' => []],
|
['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'status' => []],
|
||||||
],
|
],
|
||||||
false,
|
true,
|
||||||
false,
|
false,
|
||||||
[
|
[
|
||||||
['test1', $this->getUserMock('test1', 'Test One')],
|
['test1', $this->getUserMock('test1', 'Test One')],
|
||||||
|
|
Loading…
Reference in New Issue