Commit 42897ac5 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #21402 from owncloud/view-getuserobject-cache

Cache usermanager instance in view
parents 45c41e2b 2d9d0aed
......@@ -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 {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment