[Pkg-owncloud-commits] [owncloud] 80/129: handle NoUserException in sharing code

David Prévot taffit at moszumanska.debian.org
Thu Nov 5 01:04:25 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 eb12cac9732834e656d4dcd27bba24e048de6601
Author: Morris Jobke <hey at morrisjobke.de>
Date:   Thu Oct 22 17:04:36 2015 +0200

    handle NoUserException in sharing code
    
    * setup LDAP users
    * share from an LDAP user
    * delete that LDAP user
    * log in as share recipient
    * before: unhandled NoUserException
    * after: NoUserEception is logged and share is not shown anymore
---
 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 fa6c2d4..9f3bf65 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -32,6 +32,7 @@
 
 namespace OC\Files\Cache;
 
+use OC\User\NoUserException;
 use OCP\Share_Backend_Collection;
 
 /**
@@ -64,7 +65,12 @@ class Shared_Cache extends Cache {
 		}
 		$source = \OC_Share_Backend_File::getSource($target, $this->storage->getShare());
 		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()->logException($e, ['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