aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-20 21:57:48 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-20 21:57:48 +0200
commitd3d52dd23f3da9a3d9ed2b50b1abd1a229dc4be8 (patch)
treee5c4815762b21f20cb3d95fba3ce64fa9bc1a7f4
parentf83f32326949d6bc16c2b0d7aefcdbb48f9119d7 (diff)
downloadnextcloud-server-d3d52dd23f3da9a3d9ed2b50b1abd1a229dc4be8.tar.gz
nextcloud-server-d3d52dd23f3da9a3d9ed2b50b1abd1a229dc4be8.zip
PHPDoc & get UserManager from container for RooFolder
-rw-r--r--lib/server.php8
1 files 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) {