[Pkg-owncloud-commits] [owncloud] 11/27: handle NoUserException in sharing code
David Prévot
taffit at moszumanska.debian.org
Wed Oct 28 17:03:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v8.1.4RC2
in repository owncloud.
commit e3642f2f3dd9a60893f4c130276968288a72fbac
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 a5d6474..b8ef29e 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'];
--
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