diff options
author | Louis Chemineau <louis@chmn.me> | 2022-06-23 16:32:52 +0200 |
---|---|---|
committer | Louis (Rebase PR Action) <artonge@users.noreply.github.com> | 2022-07-26 12:17:46 +0000 |
commit | f52506793083d44674586257eadb230d02b15bba (patch) | |
tree | e35095be933f48a86d43a86cb48175c645c3bf00 /apps/sharebymail/lib | |
parent | 256ed34b7e4a3b151f7d94c5be22628e4872757a (diff) | |
download | nextcloud-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/sharebymail/lib')
-rw-r--r-- | apps/sharebymail/lib/ShareByMailProvider.php | 12 |
1 files changed, 8 insertions, 4 deletions
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'); |