diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-18 16:46:00 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-18 16:46:00 +0100 |
commit | 48f6ae0b2dbee9cb230c4d934a501948525cab01 (patch) | |
tree | b056b57c80701dd315958a76775604076656e4cb | |
parent | 2a9b0aaaa1249c47cd9cc9bfe7223a6b143ec3da (diff) | |
parent | b539bb15e1ef3a7d65d33ab7b99492e4f91e680e (diff) | |
download | nextcloud-server-48f6ae0b2dbee9cb230c4d934a501948525cab01.tar.gz nextcloud-server-48f6ae0b2dbee9cb230c4d934a501948525cab01.zip |
Merge pull request #22493 from owncloud/issue_22467
getRootFolder should not setup the FS for any user
-rw-r--r-- | lib/private/files/filesystem.php | 4 | ||||
-rw-r--r-- | lib/private/files/node/root.php | 2 | ||||
-rw-r--r-- | lib/private/server.php | 12 | ||||
-rw-r--r-- | lib/private/util.php | 4 |
4 files changed, 9 insertions, 13 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index 9d4a2c0aa05..d6fc9648c1e 100644 --- a/lib/private/files/filesystem.php +++ b/lib/private/files/filesystem.php @@ -237,9 +237,9 @@ class Filesystem { * * @return \OC\Files\Mount\Manager */ - public static function getMountManager() { + public static function getMountManager($user = '') { if (!self::$mounts) { - \OC_Util::setupFS(); + \OC_Util::setupFS($user); } return self::$mounts; } diff --git a/lib/private/files/node/root.php b/lib/private/files/node/root.php index 40ed531d5df..a9343e72220 100644 --- a/lib/private/files/node/root.php +++ b/lib/private/files/node/root.php @@ -71,7 +71,7 @@ class Root extends Folder implements IRootFolder { /** * @param \OC\Files\Mount\Manager $manager * @param \OC\Files\View $view - * @param \OC\User\User $user + * @param \OC\User\User|null $user */ public function __construct($manager, $view, $user) { parent::__construct($this, $view, ''); diff --git a/lib/private/server.php b/lib/private/server.php index ef4764d07cf..7c8ecce71a5 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -40,7 +40,6 @@ namespace OC; use bantu\IniGetWrapper\IniGetWrapper; use OC\AppFramework\Http\Request; use OC\AppFramework\Db\Db; -use OC\AppFramework\Utility\SimpleContainer; use OC\AppFramework\Utility\TimeFactory; use OC\Command\AsyncBus; use OC\Diagnostics\EventLogger; @@ -164,15 +163,10 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService('SystemTagObjectMapper', function (Server $c) { return $c->query('SystemTagManagerFactory')->getObjectMapper(); }); - $this->registerService('RootFolder', function (Server $c) { - // TODO: get user and user manager from container as well - $user = \OC_User::getUser(); - /** @var $c SimpleContainer */ - $userManager = $c->query('UserManager'); - $user = $userManager->get($user); - $manager = \OC\Files\Filesystem::getMountManager(); + $this->registerService('RootFolder', function () { + $manager = \OC\Files\Filesystem::getMountManager(null); $view = new View(); - $root = new Root($manager, $view, $user); + $root = new Root($manager, $view, null); $connector = new HookConnector($root, $view); $connector->viewToNode(); return $root; diff --git a/lib/private/util.php b/lib/private/util.php index 6ad668dedaa..35ae3e3090b 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -128,7 +128,9 @@ class OC_Util { \OC::$server->getEventLogger()->start('setup_fs', 'Setup filesystem'); // If we are not forced to load a specific user we load the one that is logged in - if ($user == "" && OC_User::isLoggedIn()) { + if ($user === null) { + $user = ''; + } else if ($user == "" && OC_User::isLoggedIn()) { $user = OC_User::getUser(); } |