]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cache usermanager instance in view
authorRobin Appelman <icewind@owncloud.com>
Wed, 30 Dec 2015 13:28:53 +0000 (14:28 +0100)
committerRobin Appelman <icewind@owncloud.com>
Wed, 30 Dec 2015 13:28:53 +0000 (14:28 +0100)
lib/private/files/view.php

index fcea4828c49af093ac5b9fe97de1876cbd56b996..045af5fe82c4335aff6dcaf3770ebd6e7ea294b9 100644 (file)
@@ -86,6 +86,8 @@ class View {
 
        private $updaterEnabled = true;
 
+       private $userManager;
+
        /**
         * @param string $root
         * @throws \Exception If $root contains an invalid path
@@ -101,6 +103,7 @@ class View {
                $this->fakeRoot = $root;
                $this->lockingProvider = \OC::$server->getLockingProvider();
                $this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider);
+               $this->userManager = \OC::$server->getUserManager();
        }
 
        public function getAbsolutePath($path = '/') {
@@ -1196,7 +1199,7 @@ class View {
         * @return \OC\User\User
         */
        private function getUserObjectForOwner($ownerId) {
-               $owner = \OC::$server->getUserManager()->get($ownerId);
+               $owner = $this->userManager->get($ownerId);
                if ($owner instanceof IUser) {
                        return $owner;
                } else {