Merge pull request #591 from nextcloud/fixing-undefined-OfflineUser-composeAndStoreDisplayName-stable10

[stable10] Fix undefined OfflineUser::composeAndStoreDisplayName()
This commit is contained in:
Morris Jobke 2016-07-27 15:25:31 +02:00 committed by GitHub
commit 1fc7248dae
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;
}