2017-03-30 09:23:44 -04:00
|
|
|
<?php
|
2020-07-05 07:23:30 -04:00
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2020-08-24 08:54:25 -04:00
|
|
|
|
2017-03-30 09:23:44 -04:00
|
|
|
/**
|
2024-06-02 09:26:54 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-03-30 09:23:44 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\ShareByMail\Settings;
|
|
|
|
|
|
|
|
|
|
use OCP\IConfig;
|
|
|
|
|
|
|
|
|
|
class SettingsManager {
|
|
|
|
|
|
2017-04-10 12:36:23 -04:00
|
|
|
private $sendPasswordByMailDefault = 'yes';
|
|
|
|
|
|
2021-01-27 11:47:35 -05:00
|
|
|
private $replyToInitiatorDefault = 'yes';
|
2021-01-05 18:25:38 -05:00
|
|
|
|
2024-10-18 06:04:22 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private IConfig $config,
|
|
|
|
|
) {
|
2017-03-30 09:23:44 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* should the password for a mail share be send to the recipient
|
|
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
2020-07-05 07:23:30 -04:00
|
|
|
public function sendPasswordByMail(): bool {
|
2017-04-10 12:36:23 -04:00
|
|
|
$sendPasswordByMail = $this->config->getAppValue('sharebymail', 'sendpasswordmail', $this->sendPasswordByMailDefault);
|
2017-03-30 09:23:44 -04:00
|
|
|
return $sendPasswordByMail === 'yes';
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-05 18:25:38 -05:00
|
|
|
/**
|
|
|
|
|
* should add reply to with initiator mail
|
|
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function replyToInitiator(): bool {
|
2021-02-24 05:24:17 -05:00
|
|
|
$replyToInitiator = $this->config->getAppValue('sharebymail', 'replyToInitiator', $this->replyToInitiatorDefault);
|
2021-01-27 16:33:02 -05:00
|
|
|
return $replyToInitiator === 'yes';
|
2021-01-05 18:25:38 -05:00
|
|
|
}
|
2017-03-30 09:23:44 -04:00
|
|
|
}
|