2020-08-12 09:16:33 -04:00
< ? php
declare ( strict_types = 1 );
/**
2024-06-03 04:23:34 -04:00
* SPDX - FileCopyrightText : 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX - License - Identifier : AGPL - 3.0 - or - later
2020-08-12 09:16:33 -04:00
*/
namespace OCA\Settings\SetupChecks ;
use OCP\IConfig ;
use OCP\IL10N ;
use OCP\IURLGenerator ;
2022-05-30 03:59:52 -04:00
use OCP\SetupCheck\ISetupCheck ;
use OCP\SetupCheck\SetupResult ;
2020-08-12 09:16:33 -04:00
2022-05-30 03:59:52 -04:00
class LegacySSEKeyFormat implements ISetupCheck {
2023-09-28 10:15:00 -04:00
public function __construct (
private IL10N $l10n ,
private IConfig $config ,
private IURLGenerator $urlGenerator ,
) {
2020-08-12 09:16:33 -04:00
}
2022-05-30 03:59:52 -04:00
public function getCategory () : string {
return 'security' ;
2020-08-12 09:16:33 -04:00
}
2022-05-30 03:59:52 -04:00
public function getName () : string {
2023-10-24 05:40:03 -04:00
return $this -> l10n -> t ( 'Old server-side-encryption' );
2020-08-12 09:16:33 -04:00
}
2022-05-30 03:59:52 -04:00
public function run () : SetupResult {
if ( $this -> config -> getSystemValueBool ( 'encryption.legacy_format_support' , false ) === false ) {
2023-10-24 05:40:03 -04:00
return SetupResult :: success ( $this -> l10n -> t ( 'Disabled' ));
2022-05-30 03:59:52 -04:00
}
2023-10-16 11:23:47 -04:00
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' ));
2020-08-12 09:16:33 -04:00
}
}