Merge pull request #587 from nextcloud/fixing-undefined-OfflineUser-composeAndStoreDisplayName-stable9

[stable9] Fix undefined OfflineUser::composeAndStoreDisplayName()
This commit is contained in:
Lukas Reschke 2016-07-28 17:09:43 +02:00 committed by GitHub
commit 0bda5d1823
1 changed files with 8 additions and 2 deletions

View File

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