[Pkg-owncloud-commits] [owncloud] 01/18: Delay setting up the filesystem for a share owner untill the share is used

David Prévot taffit at moszumanska.debian.org
Sat Sep 19 14:16:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 4676f398550542096ac5598ca2b117382fa6ad04
Author: Robin Appelman <icewind at owncloud.com>
Date:   Thu Sep 3 13:46:08 2015 +0200

    Delay setting up the filesystem for a share owner untill the share is used
---
 apps/files_sharing/lib/mountprovider.php | 6 ------
 apps/files_sharing/lib/sharedstorage.php | 7 ++++++-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/apps/files_sharing/lib/mountprovider.php b/apps/files_sharing/lib/mountprovider.php
index 3f59fd1..14a7962 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 66803db..ab17203 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list