summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-07-25 09:46:19 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2016-07-27 11:17:53 +0200
commit1177c70b9d153e0c50c703182a11447bd3e30f95 (patch)
tree9c49a4daf39e0acb6871f6a3c359ae94d496e057 /apps/user_ldap/lib
parent318d68a9a95cc710aa30c24a84d78da280327aef (diff)
downloadnextcloud-server-1177c70b9d153e0c50c703182a11447bd3e30f95.tar.gz
nextcloud-server-1177c70b9d153e0c50c703182a11447bd3e30f95.zip
[stable9.1] Fix undefined OfflineUser::composeAndStoreDisplayName() - fixes #23248
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/User_LDAP.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index a2a65bb8406..3128f0de83c 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -384,8 +384,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;
}