1414use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \Service \TwoFAServiceInterface ;
1515use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \Service \TwoFAUserServiceInterface ;
1616use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \Service \TwoFAUserSettingsServiceInterface ;
17+ use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \Settings \TwoFAShopSettingsInterface ;
1718use OxidEsales \SecurityModule \Captcha \Captcha \Image \Service \ImageCaptchaService ;
1819use OxidEsales \SecurityModule \Captcha \Service \CaptchaServiceInterface ;
1920use OxidEsales \SecurityModule \PasswordPolicy \Service \ModuleSettingsServiceInterface as PasswordSettingsServiceInterface ;
@@ -56,13 +57,7 @@ public function getImage(): string
5657 return 'data:image/jpeg;base64, ' . base64_encode ($ images [ImageCaptchaService::CAPTCHA_NAME ]);
5758 }
5859
59- public function getActiveProviders (): iterable
60- {
61- $ providers = $ this ->getService (ProviderCollectorInterface::class)->getProviders ();
62-
63- return array_filter ($ providers , fn ($ provider ) => $ provider ->isActive ());
64- }
65-
60+ // todo-critical: move to controller
6661 public function getRemainingAttempts (): int
6762 {
6863 $ twoFAService = $ this ->getService (TwoFAServiceInterface::class);
@@ -74,6 +69,7 @@ public function getRemainingAttempts(): int
7469 return $ twoFAService ->getRemainingAttempts ($ userId );
7570 }
7671
72+ // todo-critical: move to controller
7773 public function getResendCooldownRemaining (): int
7874 {
7975 $ twoFAService = $ this ->getService (TwoFAServiceInterface::class);
@@ -85,14 +81,10 @@ public function getResendCooldownRemaining(): int
8581 return $ twoFAService ->getCooldownRemaining ($ userId );
8682 }
8783
88- public function isTwoFAEnabled (): bool
84+ // todo-high: questionable if we want this method here at all, its just for one template - controller instead?
85+ public function isTwoFAEnabledForShop (): bool
8986 {
90- $ user = $ this ->getUser ();
91- if (!$ user ) {
92- return false ;
93- }
94-
95- return $ this ->getService (TwoFAUserSettingsServiceInterface::class)->isEnabledForUser ($ user ->getId ());
87+ return $ this ->getService (TwoFAShopSettingsInterface::class)->isTwoFactorAuthEnabled ();
9688 }
9789
9890 public function isExternalAuthUser (): bool
0 commit comments