Skip to content

Commit

Permalink
Fixup: password shall be sent to owner when password is to be given d…
Browse files Browse the repository at this point in the history
…uring a Talk session.

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
  • Loading branch information
StCyr committed Apr 9, 2022
1 parent 4b8f9ce commit f4abed9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions apps/sharebymail/lib/ShareByMailProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ public function create(IShare $share) {

$shareId = $this->createMailShare($share);

// Sends share password when it's a permanent one (otherwise guest will have to request it via the showShare UI)
if ($this->config->getSystemValue('allow_mail_share_permanent_password')) {
// Sends share password to receiver when it's a permanent one (otherwise she will have to request it via the showShare UI)
// or to owner when the password shall be given during a Talk session
if ($this->config->getSystemValue('allow_mail_share_permanent_password') || $share->getSendPasswordByTalk()) {
$send = $this->sendPassword($share, $password);
if ($passwordEnforced && $send === false) {
$this->sendPasswordToOwner($share, $password);
Expand Down
2 changes: 1 addition & 1 deletion apps/sharebymail/tests/ShareByMailProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public function testCreateSendPasswordByTalkWithEnforcedPasswordProtection() {

// The autogenerated password should be mailed to the owner of the share.
$this->shareManager->expects($this->any())->method('shareApiLinkEnforcePassword')->willReturn(true);
$this->config->expects($this->once())->method('getSystemValue')->with('allow_mail_share_permanent_password')->willReturn(true);
$this->config->expects($this->once())->method('getSystemValue')->with('allow_mail_share_permanent_password')->willReturn(false);
$this->settingsManager->expects($this->any())->method('sendPasswordByMail')->willReturn(true);
$instance->expects($this->once())->method('autoGeneratePassword')->with($share)->willReturn('autogeneratedPassword');

Expand Down

0 comments on commit f4abed9

Please sign in to comment.