[Pkg-owncloud-commits] [owncloud] 01/15: [sharing] handle shares of users that aren't available anymore

David Prévot taffit at moszumanska.debian.org
Thu Jul 2 18:39:08 UTC 2015


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

taffit pushed a commit to annotated tag v8.0.5RC1
in repository owncloud.

commit d6733e9ca7f441f0a53313ad6d3bb627ebd68322
Author: Morris Jobke <hey at morrisjobke.de>
Date:   Tue Jun 23 18:03:25 2015 +0200

    [sharing] handle shares of users that aren't available anymore
    
    * properly handle the case where an abandoned share is left and
      simply skip it
---
 apps/files_sharing/lib/cache.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index c56af6b..1fbb35d 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -22,6 +22,7 @@
 
 namespace OC\Files\Cache;
 
+use OC\User\NoUserException;
 use OCP\Share_Backend_Collection;
 
 /**
@@ -53,7 +54,12 @@ class Shared_Cache extends Cache {
 		}
 		$source = \OC_Share_Backend_File::getSource($target, $this->storage->getMountPoint(), $this->storage->getItemType());
 		if (isset($source['path']) && isset($source['fileOwner'])) {
-			\OC\Files\Filesystem::initMountPoints($source['fileOwner']);
+			try {
+				\OC\Files\Filesystem::initMountPoints($source['fileOwner']);
+			} catch(NoUserException $e) {
+				\OC::$server->getLogger()->warning('The user \'' . $source['uid_owner'] . '\' of a share can\'t be retrieved.', array('app' => 'files_sharing'));
+				return false;
+			}
 			$mounts = \OC\Files\Filesystem::getMountByNumericId($source['storage']);
 			if (is_array($mounts) and !empty($mounts)) {
 				$fullPath = $mounts[0]->getMountPoint() . $source['path'];

-- 
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