Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-03-12 16:43:27 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2020-03-13 11:20:32 +0300
commit84a148aac19f4e5f3d1dd48f6b9c7622a4364a74 (patch)
tree976d24caed0bd6cbdb463a864e6a5857cd5960e8 /apps/sharebymail/lib
parentdbead0c0fa3011721755105490dc82de7e7e3463 (diff)
Properly respect hide download on sharebymail
fixes #19484 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/sharebymail/lib')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index 48c60b168e8..a7b8f541217 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -354,7 +354,8 @@ class ShareByMailProvider implements IShareProvider {
$share->getPermissions(),
$share->getToken(),
$share->getPassword(),
- $share->getSendPasswordByTalk()
+ $share->getSendPasswordByTalk(),
+ $share->getHideDownload()
);
try {
@@ -686,9 +687,10 @@ class ShareByMailProvider implements IShareProvider {
* @param string $token
* @param string $password
* @param bool $sendPasswordByTalk
+ * @param bool $hideDownload
* @return int
*/
- protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk) {
+ protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk, $hideDownload) {
$qb = $this->dbConnection->getQueryBuilder();
$qb->insert('share')
->setValue('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_EMAIL))
@@ -702,7 +704,8 @@ class ShareByMailProvider implements IShareProvider {
->setValue('token', $qb->createNamedParameter($token))
->setValue('password', $qb->createNamedParameter($password))
->setValue('password_by_talk', $qb->createNamedParameter($sendPasswordByTalk, IQueryBuilder::PARAM_BOOL))
- ->setValue('stime', $qb->createNamedParameter(time()));
+ ->setValue('stime', $qb->createNamedParameter(time()))
+ ->setValue('hide_download', $qb->createNamedParameter($hideDownload, IQueryBuilder::PARAM_BOOL));
/*
* Added to fix https://github.com/owncloud/core/issues/22215
@@ -747,6 +750,7 @@ class ShareByMailProvider implements IShareProvider {
->set('password_by_talk', $qb->createNamedParameter($share->getSendPasswordByTalk(), IQueryBuilder::PARAM_BOOL))
->set('expiration', $qb->createNamedParameter($share->getExpirationDate(), IQueryBuilder::PARAM_DATE))
->set('note', $qb->createNamedParameter($share->getNote()))
+ ->set('hide_download', $qb->createNamedParameter($share->getHideDownload(), IQueryBuilder::PARAM_BOOL))
->execute();
if ($originalShare->getNote() !== $share->getNote() && $share->getNote() !== '') {
@@ -1007,6 +1011,7 @@ class ShareByMailProvider implements IShareProvider {
$share->setSharedWith($data['share_with']);
$share->setPassword($data['password']);
$share->setSendPasswordByTalk((bool)$data['password_by_talk']);
+ $share->setHideDownload((bool)$data['hide_download']);
if ($data['uid_initiator'] !== null) {
$share->setShareOwner($data['uid_owner']);