diff options
author | Joas Schilling <coding@schilljs.com> | 2017-03-27 16:06:31 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-04-13 12:58:50 +0200 |
commit | 91e650791de6dbb320e5163f626c754d42e0bc35 (patch) | |
tree | b6860a90d3b22bfd715cd7ba444673ae72bebfc0 /apps/federatedfilesharing | |
parent | 0c2dc3bc8cdca46afc2bc08da4a985610093f2af (diff) | |
download | nextcloud-server-91e650791de6dbb320e5163f626c754d42e0bc35.tar.gz nextcloud-server-91e650791de6dbb320e5163f626c754d42e0bc35.zip |
Return the paths for the users without setting them all up
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r-- | apps/federatedfilesharing/lib/FederatedShareProvider.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php index 29aa594df54..9e8d9fd9e47 100644 --- a/apps/federatedfilesharing/lib/FederatedShareProvider.php +++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php @@ -983,18 +983,23 @@ class FederatedShareProvider implements IShareProvider { } $qb = $this->dbConnection->getQueryBuilder(); - $qb->select('share_with') + $qb->select('share_with', 'file_source', 'file_target') ->from('share') ->where($qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_REMOTE))) ->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->execute(); - $remote = $cursor->fetch() !== false; + $remote = []; + while ($row = $cursor->fetch()) { + $remote[$row['share_with']] = [ + 'node_id' => $row['file_source'], + 'node_path' => $row['file_target'], + ]; + } $cursor->closeCursor(); return ['remote' => $remote]; |