[stable9.1] Fix undefined OfflineUser::composeAndStoreDisplayName() - fixes #23248

This commit is contained in:
Thomas Müller 2016-07-25 09:46:19 +02:00 committed by Bjoern Schiessle
parent cb10ca5c23
commit ac5987a017
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6
1 changed files with 8 additions and 2 deletions

View File

@ -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;
}