aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/SetupManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/SetupManager.php')
-rw-r--r--lib/private/Files/SetupManager.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php
index f9276ef4171..9726fbef428 100644
--- a/lib/private/Files/SetupManager.php
+++ b/lib/private/Files/SetupManager.php
@@ -48,6 +48,7 @@ use OCP\Files\Mount\IMountPoint;
use OCP\Files\Storage\IStorage;
use OCP\IUser;
use OCP\IUserManager;
+use OCP\IUserSession;
use OCP\Lockdown\ILockdownManager;
class SetupManager {
@@ -60,6 +61,7 @@ class SetupManager {
private IEventDispatcher $eventDispatcher;
private IUserMountCache $userMountCache;
private ILockdownManager $lockdownManager;
+ private IUserSession $userSession;
private bool $listeningForProviders;
public function __construct(
@@ -69,7 +71,8 @@ class SetupManager {
IUserManager $userManager,
IEventDispatcher $eventDispatcher,
IUserMountCache $userMountCache,
- ILockdownManager $lockdownManager
+ ILockdownManager $lockdownManager,
+ IUserSession $userSession
) {
$this->eventLogger = $eventLogger;
$this->mountProviderCollection = $mountProviderCollection;
@@ -78,6 +81,7 @@ class SetupManager {
$this->eventDispatcher = $eventDispatcher;
$this->userMountCache = $userMountCache;
$this->lockdownManager = $lockdownManager;
+ $this->userSession = $userSession;
$this->listeningForProviders = false;
}
@@ -239,7 +243,14 @@ class SetupManager {
* Set up the filesystem for the specified path
*/
public function setupForPath(string $path): void {
- if (substr_count($path, '/') < 2 || strpos($path, '/appdata_' . \OC_Util::getInstanceId()) === 0 || strpos($path, '/files_external/') === 0) {
+ if (substr_count($path, '/') < 2) {
+ if ($user = $this->userSession->getUser()) {
+ $this->setupForUser($user);
+ } else {
+ $this->setupRoot();
+ }
+ return;
+ } elseif (strpos($path, '/appdata_' . \OC_Util::getInstanceId()) === 0 || strpos($path, '/files_external/') === 0) {
$this->setupRoot();
return;
} else {