Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ShareByMailProvider: getAccessList: add token to returned array
This allows the share URI to be regenerated.

Signed-off-by: Adam Serbinski <[email protected]>
  • Loading branch information
ASerbinski committed Mar 21, 2024
commit 9c528d412c677b686d0776a43ec9567d6639a083
5 changes: 3 additions & 2 deletions apps/sharebymail/lib/ShareByMailProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ public function getAccessList($nodes, $currentAccess): array {
}

$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)))
Expand All @@ -1114,7 +1114,8 @@ public function getAccessList($nodes, $currentAccess): array {
$mail[] = $row['share_with'];
} else {
$mail[$row['share_with']] = [
'node_id' => $row['file_source']
'node_id' => $row['file_source'],
'token' => $row['token']
];
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1690,8 +1690,8 @@ public function userDeletedFromGroup($uid, $gid) {
* ],
* 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'],
* ]
* ]
*
Expand Down
8 changes: 4 additions & 4 deletions lib/public/Share/IManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function userDeletedFromGroup($uid, $gid);
* |-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
Expand All @@ -274,9 +274,9 @@ public function userDeletedFromGroup($uid, $gid);
* ],
* 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:
* [
Expand Down