From 91e650791de6dbb320e5163f626c754d42e0bc35 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 27 Mar 2017 16:06:31 +0200 Subject: Return the paths for the users without setting them all up Signed-off-by: Joas Schilling --- apps/federatedfilesharing/lib/FederatedShareProvider.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'apps/federatedfilesharing') 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]; -- cgit v1.2.3