Ignore deactivated users in collaborators user search plugin
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
a311798674
commit
03f1fef160
2 changed files with 8 additions and 2 deletions
|
@ -79,7 +79,9 @@ class UserPlugin implements ISearchPlugin {
|
|||
$usersTmp = $this->userManager->searchDisplayName($search, $limit, $offset);
|
||||
|
||||
foreach ($usersTmp as $user) {
|
||||
$users[$user->getUID()] = $user->getDisplayName();
|
||||
if ($user->isEnabled()) { // Don't keep deactivated users
|
||||
$users[$user->getUID()] = $user->getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ class UserPluginTest extends TestCase {
|
|||
);
|
||||
}
|
||||
|
||||
public function getUserMock($uid, $displayName) {
|
||||
public function getUserMock($uid, $displayName, $enabled = true) {
|
||||
$user = $this->createMock(IUser::class);
|
||||
|
||||
$user->expects($this->any())
|
||||
|
@ -100,6 +100,10 @@ class UserPluginTest extends TestCase {
|
|||
->method('getDisplayName')
|
||||
->willReturn($displayName);
|
||||
|
||||
$user->expects($this->any())
|
||||
->method('isEnabled')
|
||||
->willReturn($enabled);
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue