From c35b4f12ff49505126594c71952e8f1ccf1cd7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 26 Jul 2016 22:36:47 +0200 Subject: [PATCH] Fix undefined OfflineUser::composeAndStoreDisplayName() - fixes #23248 (#25598) --- apps/user_ldap/user_ldap.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index 70cceefded..c403f03e8d 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -385,8 +385,14 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn } $user = $this->access->userManager->get($uid); - $displayName = $user->composeAndStoreDisplayName($displayName, $displayName2); - $this->access->connection->writeToCache($cacheKey, $displayName); + if ($user instanceof User) { + $displayName = $user->composeAndStoreDisplayName($displayName, $displayName2); + $this->access->connection->writeToCache($cacheKey, $displayName); + } + if ($user instanceof OfflineUser) { + /** @var OfflineUser $user*/ + $displayName = $user->getDisplayName(); + } return $displayName; }