summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-09-03 15:09:57 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-03 15:09:57 +0200
commit1f9974894dd282e7a453544f082bdd0aa7dcaa67 (patch)
tree16a06c85592ba354f3876ca3bf51aedb6c6107c6
parent3a99ef7077eeabc7a0a1f0eee9054061dcd27f65 (diff)
parent8123df948960423489a1476a6dce3456161c4982 (diff)
downloadnextcloud-server-1f9974894dd282e7a453544f082bdd0aa7dcaa67.tar.gz
nextcloud-server-1f9974894dd282e7a453544f082bdd0aa7dcaa67.zip
Merge pull request #18810 from owncloud/shared-mount-delay-setup
Delay setting up the filesystem for a share owner untill the share is used
-rw-r--r--apps/files_sharing/lib/mountprovider.php6
-rw-r--r--apps/files_sharing/lib/sharedstorage.php7
-rw-r--r--lib/private/share/share.php2
3 files changed, 8 insertions, 7 deletions
diff --git a/apps/files_sharing/lib/mountprovider.php b/apps/files_sharing/lib/mountprovider.php
index 3f59fd131d0..14a79625993 100644
--- a/apps/files_sharing/lib/mountprovider.php
+++ b/apps/files_sharing/lib/mountprovider.php
@@ -66,12 +66,6 @@ class MountProvider implements IMountProvider {
return $share['permissions'] > 0;
});
$shares = array_map(function ($share) use ($user, $storageFactory) {
- try {
- Filesystem::initMountPoints($share['uid_owner']);
- } catch(NoUserException $e) {
- \OC::$server->getLogger()->warning('The user \'' . $share['uid_owner'] . '\' of share with ID \'' . $share['id'] . '\' can\'t be retrieved.', array('app' => 'files_sharing'));
- return null;
- }
// for updating etags for the share owner when we make changes to this share.
$ownerPropagator = $this->propagationManager->getChangePropagator($share['uid_owner']);
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index c7529df0617..1ac401f3cf8 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -55,6 +55,10 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
$this->ownerView = $arguments['ownerView'];
}
+ private function init() {
+ Filesystem::initMountPoints($this->share['uid_owner']);
+ }
+
/**
* get id of the mount point
*
@@ -80,6 +84,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
* @return array Returns array with the keys path, permissions, and owner or false if not found
*/
public function getFile($target) {
+ $this->init();
if (!isset($this->files[$target])) {
// Check for partial files
if (pathinfo($target, PATHINFO_EXTENSION) === 'part') {
@@ -319,7 +324,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
}
public function rename($path1, $path2) {
-
+ $this->init();
// we need the paths relative to data/user/files
$relPath1 = $this->getMountPoint() . '/' . $path1;
$relPath2 = $this->getMountPoint() . '/' . $path2;
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index d0c69badb46..e1735dbf92e 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -37,6 +37,7 @@
namespace OC\Share;
+use OC\Files\Filesystem;
use OCP\IUserSession;
use OCP\IDBConnection;
use OCP\IConfig;
@@ -120,6 +121,7 @@ class Share extends Constants {
*/
public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false) {
+ Filesystem::initMountPoints($ownerUser);
$shares = $sharePaths = $fileTargets = array();
$publicShare = false;
$remoteShare = false;