aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2022-06-23 16:32:52 +0200
committerLouis (Rebase PR Action) <artonge@users.noreply.github.com>2022-07-26 12:17:46 +0000
commitf52506793083d44674586257eadb230d02b15bba (patch)
treee35095be933f48a86d43a86cb48175c645c3bf00 /apps/federatedfilesharing
parent256ed34b7e4a3b151f7d94c5be22628e4872757a (diff)
downloadnextcloud-server-f52506793083d44674586257eadb230d02b15bba.tar.gz
nextcloud-server-f52506793083d44674586257eadb230d02b15bba.zip
Add argument to getSharesInFolder enable deep share lookup
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php11
1 files changed, 8 insertions, 3 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');