Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #587 from nextcloud/fixing-undefined-OfflineUser-c…
…omposeAndStoreDisplayName-stable9

[stable9] Fix undefined OfflineUser::composeAndStoreDisplayName()
  • Loading branch information
LukasReschke committed Jul 28, 2016
2 parents fe2ca83 + c35b4f1 commit 0bda5d1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/user_ldap/user_ldap.php
Expand Up @@ -385,8 +385,14 @@ public function getDisplayName($uid) {
}

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

Expand Down

0 comments on commit 0bda5d1

Please sign in to comment.