aboutsummaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib/ShareByMailProvider.php
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-07-10 12:36:28 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-07-24 13:56:29 +0200
commitd582a66bea10e3a7ab41c1e475c5eec3eb218ba0 (patch)
tree3c158f04625e7661728623b95a94ae6b221ca7c9 /apps/sharebymail/lib/ShareByMailProvider.php
parentdd0c5e297e3190b1f4324fb2e88e08760d8d71b8 (diff)
downloadnextcloud-server-d582a66bea10e3a7ab41c1e475c5eec3eb218ba0.tar.gz
nextcloud-server-d582a66bea10e3a7ab41c1e475c5eec3eb218ba0.zip
Honour "sendPasswordByTalk" property in mail shares
When a password was set for a mail share an e-mail was sent to the recipient with the password. Now the e-mail is no longer sent if the password is meant to be sent by Talk. However, before the e-mail was not sent when the share was updated but the password was not changed. Now an e-mail is sent in that case too if switching from a password sent by Talk to a password sent by mail. On the other hand, when switching from a password sent by mail to a password sent by Talk it is mandatory to change the password; otherwise the recipient would already have access to the share without having to call the sharer to verify her identity. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/sharebymail/lib/ShareByMailProvider.php')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index d26938a3242..6cc27957bbe 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -454,7 +454,7 @@ class ShareByMailProvider implements IShareProvider {
$initiator = $share->getSharedBy();
$shareWith = $share->getSharedWith();
- if ($password === '' || $this->settingsManager->sendPasswordByMail() === false) {
+ if ($password === '' || $this->settingsManager->sendPasswordByMail() === false || $share->getSendPasswordByTalk()) {
return false;
}
@@ -707,7 +707,8 @@ class ShareByMailProvider implements IShareProvider {
// a real password was given
$validPassword = $plainTextPassword !== null && $plainTextPassword !== '';
- if($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
+ if($validPassword && ($originalShare->getPassword() !== $share->getPassword() ||
+ ($originalShare->getSendPasswordByTalk() && !$share->getSendPasswordByTalk()))) {
$this->sendPassword($share, $plainTextPassword);
}
/*