aboutsummaryrefslogtreecommitdiffstats
path: root/apps/sharebymail
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2024-03-25 12:40:10 +0100
committerGitHub <noreply@github.com>2024-03-25 12:40:10 +0100
commit46906b7d69642f7e5b1dc031e00921b39b27dce8 (patch)
tree0df20e15b045891d4b4113f79a51bfaf80a2c2bf /apps/sharebymail
parentc352f0198b502b0efa004252b204f7f68b3421ea (diff)
parentf45eb75e3de1d82695f38f49f28e69278b7f9dbb (diff)
downloadnextcloud-server-46906b7d69642f7e5b1dc031e00921b39b27dce8.tar.gz
nextcloud-server-46906b7d69642f7e5b1dc031e00921b39b27dce8.zip
Merge pull request #32631 from nextcloud/feature/32629/getAccessList-share-by-email-recipients
Get access list share by email recipients
Diffstat (limited to 'apps/sharebymail')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index 5a840b895ff..f1bb3fe94ca 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -1098,21 +1098,32 @@ class ShareByMailProvider implements IShareProvider {
}
$qb = $this->dbConnection->getQueryBuilder();
- $qb->select('share_with')
+ $qb->select('share_with', 'file_source', 'token')
->from('share')
->where($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_EMAIL)))
->andWhere($qb->expr()->in('file_source', $qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)))
->andWhere($qb->expr()->orX(
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
- ))
- ->setMaxResults(1);
+ ));
$cursor = $qb->executeQuery();
- $mail = $cursor->fetch() !== false;
+ $public = false;
+ $mail = [];
+ while ($row = $cursor->fetch()) {
+ $public = true;
+ if ($currentAccess === false) {
+ $mail[] = $row['share_with'];
+ } else {
+ $mail[$row['share_with']] = [
+ 'node_id' => $row['file_source'],
+ 'token' => $row['token']
+ ];
+ }
+ }
$cursor->closeCursor();
- return ['public' => $mail];
+ return ['public' => $public, 'mail' => $mail];
}
public function getAllShares(): iterable {