1
0

LegacySSEKeyFormat.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Settings\SetupChecks;
  8. use OCP\IConfig;
  9. use OCP\IL10N;
  10. use OCP\IURLGenerator;
  11. use OCP\SetupCheck\ISetupCheck;
  12. use OCP\SetupCheck\SetupResult;
  13. class LegacySSEKeyFormat implements ISetupCheck {
  14. public function __construct(
  15. private IL10N $l10n,
  16. private IConfig $config,
  17. private IURLGenerator $urlGenerator,
  18. ) {
  19. }
  20. public function getCategory(): string {
  21. return 'security';
  22. }
  23. public function getName(): string {
  24. return $this->l10n->t('Old server-side-encryption');
  25. }
  26. public function run(): SetupResult {
  27. if ($this->config->getSystemValueBool('encryption.legacy_format_support', false) === false) {
  28. return SetupResult::success($this->l10n->t('Disabled'));
  29. }
  30. return SetupResult::warning($this->l10n->t('The old server-side-encryption format is enabled. We recommend disabling this.'), $this->urlGenerator->linkToDocs('admin-sse-legacy-format'));
  31. }
  32. }