diff options
Diffstat (limited to 'lib/public/Group/Backend/ABackend.php')
-rw-r--r-- | lib/public/Group/Backend/ABackend.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/public/Group/Backend/ABackend.php b/lib/public/Group/Backend/ABackend.php index 7f5cf732335..e76285dfda9 100644 --- a/lib/public/Group/Backend/ABackend.php +++ b/lib/public/Group/Backend/ABackend.php @@ -26,6 +26,10 @@ declare(strict_types=1); namespace OCP\Group\Backend; use OCP\GroupInterface; +use OCP\IUserManager; +use OCP\Server; +use OC\User\LazyUser; +use OC\User\DisplayNameCache; /** * @since 14.0.0 @@ -65,4 +69,15 @@ abstract class ABackend implements GroupInterface { return (bool)($actions & $implements); } + + public function searchInGroup(string $gid, string $search = '', int $limit = -1, int $offset = 0): array { + // Default implementation for compatibility reasons + $displayNameCache = Server::get(DisplayNameCache::class); + $userManager = Server::get(IUserManager::class); + $users = []; + foreach ($this->usersInGroup($gid, $search, $limit, $offset) as $userId) { + $users[$userId] = new LazyUser($userId, $displayNameCache, $userManager); + } + return $users; + } } |