diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-04-08 17:47:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 17:47:36 +0200 |
commit | 1b819b8649811891262e66c3459e1d4f04589243 (patch) | |
tree | 93862d52be770a4fc671112e1ee0f00c83aaeb42 /lib/private/Files | |
parent | 0d7d28e530cf84e3780e7935b5f0818e48bd68a6 (diff) | |
parent | 499749dbc1dc3be1b223914926f3889883987d1e (diff) | |
download | nextcloud-server-1b819b8649811891262e66c3459e1d4f04589243.tar.gz nextcloud-server-1b819b8649811891262e66c3459e1d4f04589243.zip |
Merge pull request #31901 from nextcloud/fs-setup-tweaks
Filesystem setup tweaks
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Node/LazyFolder.php | 11 | ||||
-rw-r--r-- | lib/private/Files/Node/LazyUserFolder.php | 3 | ||||
-rw-r--r-- | lib/private/Files/SetupManager.php | 9 |
3 files changed, 21 insertions, 2 deletions
diff --git a/lib/private/Files/Node/LazyFolder.php b/lib/private/Files/Node/LazyFolder.php index 7d5038e85a2..1bae0f52e59 100644 --- a/lib/private/Files/Node/LazyFolder.php +++ b/lib/private/Files/Node/LazyFolder.php @@ -23,6 +23,7 @@ declare(strict_types=1); * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ + namespace OC\Files\Node; use OC\Files\Utils\PathHelper; @@ -310,6 +311,9 @@ class LazyFolder implements \OCP\Files\Folder { * @inheritDoc */ public function getMimetype() { + if (isset($this->data['mimetype'])) { + return $this->data['mimetype']; + } return $this->__call(__FUNCTION__, func_get_args()); } @@ -317,6 +321,10 @@ class LazyFolder implements \OCP\Files\Folder { * @inheritDoc */ public function getMimePart() { + if (isset($this->data['mimetype'])) { + [$part,] = explode('/', $this->data['mimetype']); + return $part; + } return $this->__call(__FUNCTION__, func_get_args()); } @@ -331,6 +339,9 @@ class LazyFolder implements \OCP\Files\Folder { * @inheritDoc */ public function getType() { + if (isset($this->data['type'])) { + return $this->data['type']; + } return $this->__call(__FUNCTION__, func_get_args()); } diff --git a/lib/private/Files/Node/LazyUserFolder.php b/lib/private/Files/Node/LazyUserFolder.php index d91759117c1..c85a356ddd3 100644 --- a/lib/private/Files/Node/LazyUserFolder.php +++ b/lib/private/Files/Node/LazyUserFolder.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace OC\Files\Node; +use OCP\Files\FileInfo; use OCP\Constants; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; @@ -49,6 +50,8 @@ class LazyUserFolder extends LazyFolder { }, [ 'path' => $this->path, 'permissions' => Constants::PERMISSION_ALL, + 'type' => FileInfo::TYPE_FOLDER, + 'mimetype' => FileInfo::MIMETYPE_FOLDER, ]); } diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index d091b5c5e35..e0575ea92a5 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -368,8 +368,12 @@ class SetupManager { } // for the user's home folder, it's always the home mount - if (rtrim($path) === "/" . $user->getUID() . "/files" && !$includeChildren) { - $this->oneTimeUserSetup($user); + if (rtrim($path) === "/" . $user->getUID() . "/files") { + if ($includeChildren) { + $this->setupForUser($user); + } else { + $this->oneTimeUserSetup($user); + } return; } @@ -460,6 +464,7 @@ class SetupManager { if (in_array('', $providers)) { $this->setupForUser($user); + return; } $setupProviders = $this->setupUserMountProviders[$user->getUID()] ?? []; |