aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/User
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-10-16 19:57:31 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-04-27 12:00:01 +0200
commita4c599c1c91dcd6e041cbf65198e1f1200513be8 (patch)
tree9a2a0f0b0ecb4c6775f7382402a147ae8ca110d2 /lib/private/User
parent35dc2235001bf61f07c78b50e74ca029bb9fc05d (diff)
downloadnextcloud-server-a4c599c1c91dcd6e041cbf65198e1f1200513be8.tar.gz
nextcloud-server-a4c599c1c91dcd6e041cbf65198e1f1200513be8.zip
Split new method in a new group backend interface
Better for backward compatibility, also move new interfaces to nc 26 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/private/User')
-rw-r--r--lib/private/User/LazyUser.php2
-rw-r--r--lib/private/User/Manager.php6
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/private/User/LazyUser.php b/lib/private/User/LazyUser.php
index c36ff86eff4..5472cf6f2b4 100644
--- a/lib/private/User/LazyUser.php
+++ b/lib/private/User/LazyUser.php
@@ -65,7 +65,7 @@ class LazyUser implements IUser {
return $this->displayName;
}
- return $this->userManager->getDisplayName($this->uid);
+ return $this->userManager->getDisplayName($this->uid) ?? $this->uid;
}
public function setDisplayName($displayName) {
diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php
index c3275934a5a..dcf9bbab2f3 100644
--- a/lib/private/User/Manager.php
+++ b/lib/private/User/Manager.php
@@ -303,12 +303,11 @@ class Manager extends PublicEmitter implements IUserManager {
*/
public function search($pattern, $limit = null, $offset = null) {
$users = [];
- $displayNameCache = \OCP\Server::get(DisplayNameCache::class);
foreach ($this->backends as $backend) {
$backendUsers = $backend->getUsers($pattern, $limit, $offset);
if (is_array($backendUsers)) {
foreach ($backendUsers as $uid) {
- $users[$uid] = new LazyUser($uid, $displayNameCache, $this, null, $backend);
+ $users[$uid] = new LazyUser($uid, $this, null, $backend);
}
}
}
@@ -329,12 +328,11 @@ class Manager extends PublicEmitter implements IUserManager {
*/
public function searchDisplayName($pattern, $limit = null, $offset = null) {
$users = [];
- $displayNameCache = \OCP\Server::get(DisplayNameCache::class);
foreach ($this->backends as $backend) {
$backendUsers = $backend->getDisplayNames($pattern, $limit, $offset);
if (is_array($backendUsers)) {
foreach ($backendUsers as $uid => $displayName) {
- $users[] = new LazyUser($uid, $displayNameCache, $this, $displayName, $backend);
+ $users[] = new LazyUser($uid, $this, $displayName, $backend);
}
}
}