mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Keep Search Provider but remove actual search and display on the searchlist dialog. Will revisit in future search result list in future issue.
Usage: 1. Type a string in the search bar 2. Add in:users filter to avoid unnecessary searches in other apps
This commit is contained in:
parent
157f2a7062
commit
d657ded9bf
1 changed files with 1 additions and 29 deletions
|
|
@ -101,37 +101,9 @@ class UserSearch implements IProvider {
|
|||
*/
|
||||
public function search(IUser $user, ISearchQuery $query): SearchResult {
|
||||
|
||||
$users = $this->userManager->search($query->getTerm(), $query->getLimit(), 0);
|
||||
|
||||
if (!$this->groupManager->isAdmin($user->getUID())) {
|
||||
return SearchResult::complete(
|
||||
$this->l->t('Users'),
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($users as $user) {
|
||||
$targetUserObject = $this->userManager->get($user->getUid());
|
||||
|
||||
if ($targetUserObject === null) {
|
||||
throw new OCSNotFoundException('User does not exist');
|
||||
}
|
||||
|
||||
$userAccount = $this->accountManager->getAccount($targetUserObject);
|
||||
$avatar = $userAccount->getProperty(IAccountManager::PROPERTY_AVATAR)->getScope();
|
||||
|
||||
$result[] = new SearchResultEntry(
|
||||
'',
|
||||
$targetUserObject->getDisplayName(),
|
||||
$user->getUid(),
|
||||
$this->urlGenerator->linkToRouteAbsolute('settings.Users.usersList'),
|
||||
'icon-user-dark'
|
||||
);
|
||||
}
|
||||
|
||||
return SearchResult::complete(
|
||||
$this->l->t('Users'),
|
||||
$result
|
||||
[]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue