Hide current user from user search

This commit is contained in:
brantje 2016-09-26 19:20:48 +02:00
parent e789ad4926
commit 46b82a5b1d

View file

@ -56,11 +56,13 @@ class ShareController extends ApiController {
$usersTmp = $this->userManager->searchDisplayName($search, $this->limit, $this->offset);
foreach ($usersTmp as $user) {
$users[] = array(
'text' => $user->getDisplayName(),
'uid' => $user->getUID(),
'type' => 'user'
);
if($this->userId != $user->getUID()) {
$users[] = array(
'text' => $user->getDisplayName(),
'uid' => $user->getUID(),
'type' => 'user'
);
}
}
$this->result = array_merge($this->result, $users);
}