From 909728253c2e4febd7de00997ecb42a88afad357 Mon Sep 17 00:00:00 2001 From: Torben Hansen Date: Sun, 10 Sep 2023 19:40:49 +0200 Subject: [PATCH] [TASK] Use ConfigurationManagerInterface in ext:felogin Currently, extbase `ConfigurationManager` is directly used in ext:felogin for the password recovery functionality. With this change, `ConfigurationManagerInterface` is used instead of `ConfigurationManager`, so DI can decide which implementation of `ConfigurationManager` should be used. Resolves: #101894 Releases: main, 12.4 Signed-off-by: Torben Hansen Change-Id: I0a09e88b3d778f3da850fbd753d5ef43cdbb9f25 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80941 Tested-by: Benjamin Franzke Reviewed-by: Benjamin Franzke Reviewed-by: Oliver Klee Reviewed-by: Georg Ringer Tested-by: core-ci Tested-by: Georg Ringer --- .../felogin/Classes/Configuration/RecoveryConfiguration.php | 6 +++--- typo3/sysext/felogin/Classes/Service/RecoveryService.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/typo3/sysext/felogin/Classes/Configuration/RecoveryConfiguration.php b/typo3/sysext/felogin/Classes/Configuration/RecoveryConfiguration.php index da67a16b5d1e..511fb7ee6447 100644 --- a/typo3/sysext/felogin/Classes/Configuration/RecoveryConfiguration.php +++ b/typo3/sysext/felogin/Classes/Configuration/RecoveryConfiguration.php @@ -22,7 +22,7 @@ use Symfony\Component\Mime\Address; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Crypto\Random; -use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; +use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Security\Cryptography\HashService; use TYPO3\CMS\Fluid\View\TemplatePaths; @@ -42,11 +42,11 @@ class RecoveryConfiguration implements LoggerAwareInterface public function __construct( protected Context $context, - ConfigurationManager $configurationManager, + ConfigurationManagerInterface $configurationManager, Random $random, HashService $hashService ) { - $this->settings = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS); + $this->settings = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS); $this->forgotHash = $this->getLifeTimeTimestamp() . '|' . $this->generateHash($random, $hashService); $this->resolveFromTypoScript(); } diff --git a/typo3/sysext/felogin/Classes/Service/RecoveryService.php b/typo3/sysext/felogin/Classes/Service/RecoveryService.php index cc84dcaddb43..2932f8073d4c 100644 --- a/typo3/sysext/felogin/Classes/Service/RecoveryService.php +++ b/typo3/sysext/felogin/Classes/Service/RecoveryService.php @@ -23,7 +23,7 @@ use TYPO3\CMS\Core\Mail\FluidEmail; use TYPO3\CMS\Core\Mail\MailerInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; +use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Mvc\RequestInterface; use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; @@ -40,11 +40,11 @@ class RecoveryService public function __construct( protected readonly MailerInterface $mailer, protected EventDispatcherInterface $eventDispatcher, - ConfigurationManager $configurationManager, + ConfigurationManagerInterface $configurationManager, protected RecoveryConfiguration $recoveryConfiguration, protected UriBuilder $uriBuilder ) { - $this->settings = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS); + $this->settings = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS); } /**