SettingsManager.php 984 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\ShareByMail\Settings;
  8. use OCP\IConfig;
  9. class SettingsManager {
  10. private $sendPasswordByMailDefault = 'yes';
  11. private $replyToInitiatorDefault = 'yes';
  12. public function __construct(
  13. private IConfig $config,
  14. ) {
  15. }
  16. /**
  17. * should the password for a mail share be send to the recipient
  18. *
  19. * @return bool
  20. */
  21. public function sendPasswordByMail(): bool {
  22. $sendPasswordByMail = $this->config->getAppValue('sharebymail', 'sendpasswordmail', $this->sendPasswordByMailDefault);
  23. return $sendPasswordByMail === 'yes';
  24. }
  25. /**
  26. * should add reply to with initiator mail
  27. *
  28. * @return bool
  29. */
  30. public function replyToInitiator(): bool {
  31. $replyToInitiator = $this->config->getAppValue('sharebymail', 'replyToInitiator', $this->replyToInitiatorDefault);
  32. return $replyToInitiator === 'yes';
  33. }
  34. }