From 9c528d412c677b686d0776a43ec9567d6639a083 Mon Sep 17 00:00:00 2001 From: Adam Serbinski Date: Fri, 27 May 2022 11:29:15 -0400 Subject: [PATCH] ShareByMailProvider: getAccessList: add token to returned array This allows the share URI to be regenerated. Signed-off-by: Adam Serbinski --- apps/sharebymail/lib/ShareByMailProvider.php | 5 +++-- lib/private/Share20/Manager.php | 4 ++-- lib/public/Share/IManager.php | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 8c5962e22fc..a8c1174e289 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -1098,7 +1098,7 @@ class ShareByMailProvider implements IShareProvider { } $qb = $this->dbConnection->getQueryBuilder(); - $qb->select('share_with', 'file_source') + $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))) @@ -1114,7 +1114,8 @@ class ShareByMailProvider implements IShareProvider { $mail[] = $row['share_with']; } else { $mail[$row['share_with']] = [ - 'node_id' => $row['file_source'] + 'node_id' => $row['file_source'], + 'token' => $row['token'] ]; } } diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 279750afaa6..bafea10b125 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1690,8 +1690,8 @@ class Manager implements IManager { * ], * public => bool * mail => [ - * 'email1@maildomain1' => ['node_id' => 42], - * 'email2@maildomain2' => ['node_id' => 23], + * 'email1@maildomain1' => ['node_id' => 42, 'token' => 'aBcDeFg'], + * 'email2@maildomain2' => ['node_id' => 23, 'token' => 'hIjKlMn'], * ] * ] * diff --git a/lib/public/Share/IManager.php b/lib/public/Share/IManager.php index 18c429e1cec..1c75b306fe2 100644 --- a/lib/public/Share/IManager.php +++ b/lib/public/Share/IManager.php @@ -256,7 +256,7 @@ interface IManager { * |-folder2 (32) * |-fileA (42) * - * fileA is shared with user1 and user1@server1 email1@maildomain1 + * fileA is shared with user1 and user1@server1 and email1@maildomain1 * folder2 is shared with group2 (user4 is a member of group2) * folder1 is shared with user2 (renamed to "folder (1)") and user2@server2 * and email2@maildomain2 @@ -274,9 +274,9 @@ interface IManager { * ], * public => bool * mail => [ - * 'email1@maildomain1' => ['node_id' => 42], - * 'email2@maildomain2' => ['node_id' => 23], - * ] + * 'email1@maildomain1' => ['node_id' => 42, 'token' => 'aBcDeFg'], + * 'email2@maildomain2' => ['node_id' => 23, 'token' => 'hIjKlMn'], + * ] * * The access list to '/folder1/folder2/fileA' **without** $currentAccess is: * [ -- 2.39.5