summaryrefslogtreecommitdiffstats
path: root/lib/private/files
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-03-08 11:23:20 +0100
committerVincent Petry <pvince81@owncloud.com>2016-03-08 14:46:42 +0100
commite5a107cc455122edf729b61ee249c35caedda02f (patch)
tree8c4547d8a43de747554bbcd1fc6c2abc15c7dec4 /lib/private/files
parent15833d9843c3ff7c0cb51b95f8610bddb044472d (diff)
downloadnextcloud-server-e5a107cc455122edf729b61ee249c35caedda02f.tar.gz
nextcloud-server-e5a107cc455122edf729b61ee249c35caedda02f.zip
Fix share mounting recursion
Diffstat (limited to 'lib/private/files')
-rw-r--r--lib/private/files/config/usermountcache.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/files/config/usermountcache.php b/lib/private/files/config/usermountcache.php
index 58e7e9d156d..78b19972787 100644
--- a/lib/private/files/config/usermountcache.php
+++ b/lib/private/files/config/usermountcache.php
@@ -24,6 +24,7 @@ namespace OC\Files\Config;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OC\Files\Filesystem;
+use OCA\Files_Sharing\SharedMount;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\Config\ICachedMountInfo;
use OCP\Files\Config\IUserMountCache;
@@ -75,12 +76,16 @@ class UserMountCache implements IUserMountCache {
public function registerMounts(IUser $user, array $mounts) {
// filter out non-proper storages coming from unit tests
$mounts = array_filter($mounts, function (IMountPoint $mount) {
- return $mount->getStorage() && $mount->getStorage()->getCache();
+ return $mount instanceof SharedMount || $mount->getStorage() && $mount->getStorage()->getCache();
});
/** @var ICachedMountInfo[] $newMounts */
$newMounts = array_map(function (IMountPoint $mount) use ($user) {
$storage = $mount->getStorage();
- $rootId = (int)$storage->getCache()->getId('');
+ if ($storage->instanceOfStorage('\OC\Files\Storage\Shared')) {
+ $rootId = (int)$storage->getShare()['file_source'];
+ } else {
+ $rootId = (int)$storage->getCache()->getId('');
+ }
$storageId = (int)$storage->getStorageCache()->getNumericId();
// filter out any storages which aren't scanned yet since we aren't interested in files from those storages (yet)
if ($rootId === -1) {