]> source.dussan.org Git - nextcloud-server.git/commitdiff
[stable9.1] Fix undefined OfflineUser::composeAndStoreDisplayName() - fixes #23248 590/head
authorThomas Müller <thomas.mueller@tmit.eu>
Mon, 25 Jul 2016 07:46:19 +0000 (09:46 +0200)
committerBjoern Schiessle <bjoern@schiessle.org>
Wed, 27 Jul 2016 09:17:53 +0000 (11:17 +0200)
apps/user_ldap/lib/User_LDAP.php

index a2a65bb8406af7aa5b8349df292ce19580db9267..3128f0de83c264bec47284752e2795ddd61569c3 100644 (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;
                }