diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/federatedfilesharing/lib/FederatedShareProvider.php | 11 | ||||
-rw-r--r-- | apps/files_sharing/lib/Updater.php | 2 | ||||
-rw-r--r-- | apps/sharebymail/lib/ShareByMailProvider.php | 12 |
3 files changed, 17 insertions, 8 deletions
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php index 52b10cd9315..d504a3e2acc 100644 --- a/apps/federatedfilesharing/lib/FederatedShareProvider.php +++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php @@ -638,7 +638,7 @@ class FederatedShareProvider implements IShareProvider { } - public function getSharesInFolder($userId, Folder $node, $reshares) { + public function getSharesInFolder($userId, Folder $node, $reshares, $shallow = true) { $qb = $this->dbConnection->getQueryBuilder(); $qb->select('*') ->from('share', 's') @@ -664,8 +664,13 @@ class FederatedShareProvider implements IShareProvider { ); } - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); - $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); + + if ($shallow) { + $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); + } else { + $qb->andWhere($qb->expr()->like('f.path', $qb->createNamedParameter($this->dbConnection->escapeLikeParameter($node->getInternalPath()) . '/%'))); + } $qb->orderBy('id'); diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php index 071d4d3cca9..59e06e60299 100644 --- a/apps/files_sharing/lib/Updater.php +++ b/apps/files_sharing/lib/Updater.php @@ -69,7 +69,7 @@ class Updater { $shares = array_merge($shares, $shareManager->getSharesBy($userFolder->getOwner()->getUID(), IShare::TYPE_ROOM, $src, false, -1)); if ($src instanceof Folder) { - $subShares = $shareManager->getSharesInFolderRecursive($userFolder->getOwner()->getUID(), $src, false); + $subShares = $shareManager->getSharesInFolder($userFolder->getOwner()->getUID(), $src, false, false); foreach ($subShares as $subShare) { $shares = array_merge($shares, array_values($subShare)); } diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index ee14e354c52..01dd3b428d1 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -75,7 +75,6 @@ use OCP\Share\IShareProvider; * @package OCA\ShareByMail */ class ShareByMailProvider implements IShareProvider { - private IConfig $config; /** @var IDBConnection */ @@ -1159,7 +1158,7 @@ class ShareByMailProvider implements IShareProvider { return $data; } - public function getSharesInFolder($userId, Folder $node, $reshares) { + public function getSharesInFolder($userId, Folder $node, $reshares, $shallow = true) { $qb = $this->dbConnection->getQueryBuilder(); $qb->select('*') ->from('share', 's') @@ -1185,8 +1184,13 @@ class ShareByMailProvider implements IShareProvider { ); } - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); - $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); + + if ($shallow) { + $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); + } else { + $qb->andWhere($qb->expr()->like('f.path', $qb->createNamedParameter($this->dbConnection->escapeLikeParameter($node->getInternalPath()) . '/%'))); + } $qb->orderBy('id'); |