aboutsummaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib/ShareByMailProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/sharebymail/lib/ShareByMailProvider.php')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index 5a840b895ff..8c5962e22fc 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -1098,18 +1098,26 @@ class ShareByMailProvider implements IShareProvider {
}
$qb = $this->dbConnection->getQueryBuilder();
- $qb->select('share_with')
+ $qb->select('share_with', 'file_source')
->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;
+ $mail = array();
+ while ($row = $cursor->fetch()) {
+ if ($currentAccess === false) {
+ $mail[] = $row['share_with'];
+ } else {
+ $mail[$row['share_with']] = [
+ 'node_id' => $row['file_source']
+ ];
+ }
+ }
$cursor->closeCursor();
return ['public' => $mail];