]> source.dussan.org Git - nextcloud-server.git/commitdiff
Keep Search Provider but remove actual search and display on the searchlist dialog...
authorsorbaugh <stephan_orbaugh@hotmail.com>
Wed, 13 Sep 2023 12:24:32 +0000 (14:24 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Thu, 12 Oct 2023 10:36:18 +0000 (12:36 +0200)
Usage:
1. Type a string in the search bar
2. Add in:users filter to avoid unnecessary searches in other apps

apps/settings/lib/Search/UserSearch.php

index 181d8554772f09098ab46f74edb7ebc6169aa8ec..8ae2eeafaa8a5e13fff3a5f25986083a6a857a3f 100644 (file)
@@ -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
+                       []
                );
        }
 }