diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-10-22 18:04:36 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-23 13:21:52 +0300 |
commit | e3642f2f3dd9a60893f4c130276968288a72fbac (patch) | |
tree | 55f5e8a4cba80c6df4aad538cd2f469a1a04d55f | |
parent | 5e8f0a893d33fe35c0a41a97142533ef67e50dc5 (diff) |
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
-rw-r--r-- | apps/files_sharing/lib/cache.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index a5d6474dc3c..b8ef29e3436 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -31,6 +31,7 @@ namespace OC\Files\Cache; +use OC\User\NoUserException; use OCP\Share_Backend_Collection; /** @@ -62,7 +63,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']; |