]> source.dussan.org Git - nextcloud-server.git/commitdiff
ShareByMailProvider: getAccessList: add token to returned array
authorAdam Serbinski <adam@serbinski.com>
Fri, 27 May 2022 15:29:15 +0000 (11:29 -0400)
committerAdam Serbinski <37986043+ASerbinski@users.noreply.github.com>
Thu, 21 Mar 2024 22:25:31 +0000 (18:25 -0400)
This allows the share URI to be regenerated.

Signed-off-by: Adam Serbinski <adam@serbinski.com>
apps/sharebymail/lib/ShareByMailProvider.php
lib/private/Share20/Manager.php
lib/public/Share/IManager.php

index 8c5962e22fc02d10f05f311fff4fcd367b94acbd..a8c1174e289d3de515651a1e1cd6be8a4bd25690 100644 (file)
@@ -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']
                                ];
                        }
                }
index 279750afaa6d6af65fb786f8b7ff3cd6050eb9c5..bafea10b12571afb3c652a8158fb2511e984b509 100644 (file)
@@ -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'],
          *  ]
         * ]
         *
index 18c429e1cec1e6ecfefb40a690d3d7896b1f072a..1c75b306fe2843716c502b72ea78d7e760817f02 100644 (file)
@@ -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:
         * [