Skip to content

Commit

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

Fix undefined OfflineUser::composeAndStoreDisplayName()
  • Loading branch information
MorrisJobke authored Jul 28, 2016
2 parents bf7afcd + 1177c70 commit 83c64f3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/user_ldap/lib/User_LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,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 83c64f3

Please sign in to comment.