From d3d52dd23f3da9a3d9ed2b50b1abd1a229dc4be8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20M=C3=BCller?= Date: Fri, 20 Sep 2013 21:57:48 +0200 Subject: [PATCH] PHPDoc & get UserManager from container for RooFolder --- lib/server.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/server.php b/lib/server.php index 57e7f4ab4f1..804af6b0eac 100644 --- a/lib/server.php +++ b/lib/server.php @@ -4,6 +4,7 @@ namespace OC; use OC\AppFramework\Http\Request; use OC\AppFramework\Utility\SimpleContainer; +use OC\Cache\UserCache; use OC\Files\Node\Root; use OC\Files\View; use OCP\IServerContainer; @@ -49,9 +50,11 @@ class Server extends SimpleContainer implements IServerContainer { return new PreviewManager(); }); $this->registerService('RootFolder', function($c) { - // TODO: get user and user manager from container as well + // TODO: get user from container as well $user = \OC_User::getUser(); - $user = \OC_User::getManager()->get($user); + /** @var $c SimpleContainer */ + $userManager = $c->query('UserManager'); + $user = $userManager->get($user); $manager = \OC\Files\Filesystem::getMountManager(); $view = new View(); return new Root($manager, $view, $user); @@ -60,6 +63,7 @@ class Server extends SimpleContainer implements IServerContainer { return new \OC\User\Manager(); }); $this->registerService('UserSession', function($c) { + /** @var $c SimpleContainer */ $manager = $c->query('UserManager'); $userSession = new \OC\User\Session($manager, \OC::$session); $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { -- 2.39.5