]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix issues where some user settings cannot be loaded when the user id differs in... 1142/head
authorThomas Müller <DeepDiver1975@users.noreply.github.com>
Mon, 22 Aug 2016 18:25:20 +0000 (20:25 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Mon, 29 Aug 2016 12:33:16 +0000 (14:33 +0200)
lib/private/User/Manager.php

index f41468d4926b801a3a2c32cdb3cc2bdb6fbd4da9..7d8c6d48b2c67797e7a15918ab93910333e87ba2 100644 (file)
@@ -157,6 +157,16 @@ class Manager extends PublicEmitter implements IUserManager {
                        return $this->cachedUsers[$uid];
                }
 
+               if (method_exists($backend, 'loginName2UserName')) {
+                       $loginName = $backend->loginName2UserName($uid);
+                       if ($loginName !== false) {
+                               $uid = $loginName;
+                       }
+                       if (isset($this->cachedUsers[$uid])) {
+                               return $this->cachedUsers[$uid];
+                       }
+               }
+
                $user = new User($uid, $backend, $this, $this->config);
                if ($cacheUser) {
                        $this->cachedUsers[$uid] = $user;