From e54bc01178de813ace96f3eafa2e9451fee09290 Mon Sep 17 00:00:00 2001 From: Mohsin Khan Date: Thu, 26 Nov 2020 17:49:57 +0500 Subject: [PATCH 01/13] Add support for TYPO3 v10 Resolves: #183 --- .../Controller/Frontend/SetupController.php | 4 +-- Classes/Hook/FeLogin.php | 2 +- Classes/Hook/TCEMain.php | 11 ++++-- Classes/Hook/UserSettings.php | 36 ++++++++++--------- Configuration/Extbase/Persistence/Classes.php | 10 ++++++ Configuration/TCA/Overrides/be_users.php | 2 +- Configuration/TCA/Overrides/fe_users.php | 2 +- composer.json | 6 ++-- ext_emconf.php | 32 ++++++----------- ext_localconf.php | 17 ++++----- ext_typoscript_setup.typoscript | 18 ---------- 11 files changed, 65 insertions(+), 75 deletions(-) create mode 100644 Configuration/Extbase/Persistence/Classes.php delete mode 100644 ext_typoscript_setup.typoscript diff --git a/Classes/Controller/Frontend/SetupController.php b/Classes/Controller/Frontend/SetupController.php index 7cbc2a4..d96d2dc 100644 --- a/Classes/Controller/Frontend/SetupController.php +++ b/Classes/Controller/Frontend/SetupController.php @@ -33,7 +33,7 @@ use TYPO3\CMS\Extbase\Object\Exception as ObjectException; use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException; use TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException; -use TYPO3\CMS\Lang\LanguageService; +use TYPO3\CMS\Core\Localization\LanguageService; use function get_class; use function vsprintf; @@ -93,8 +93,6 @@ public function __construct( Context $context ) { - parent::__construct(); - $this->frontendUserRepository = $frontendUserRepository; $this->qrCodeGenerator = $qrCodeGenerator; $this->setupFormValidator = $setupFormValidator; diff --git a/Classes/Hook/FeLogin.php b/Classes/Hook/FeLogin.php index 85c6b6d..404df00 100644 --- a/Classes/Hook/FeLogin.php +++ b/Classes/Hook/FeLogin.php @@ -18,7 +18,7 @@ use CodeFareith\CfGoogleAuthenticator\Utility\ExtensionBasicDataUtility; use CodeFareith\CfGoogleAuthenticator\Utility\PathUtility; use TYPO3\CMS\Core\Service\MarkerBasedTemplateService; -use TYPO3\CMS\Lang\LanguageService; +use TYPO3\CMS\Core\Localization\LanguageService; /** * Hook for the TYPO3 CMS extension 'felogin' diff --git a/Classes/Hook/TCEMain.php b/Classes/Hook/TCEMain.php index 455c89e..87888ce 100644 --- a/Classes/Hook/TCEMain.php +++ b/Classes/Hook/TCEMain.php @@ -54,7 +54,7 @@ class TCEMain /** * @noinspection MoreThanThreeArgumentsInspection * - * @param mixed $fieldArray + * @param mixed $fieldArray * @param string|int $id * * @throws MissingRequiredField @@ -75,7 +75,14 @@ public function processDatamap_preProcessFieldArray( $otpInFieldArray = $otpInPostData; } - $preProcessFieldArrayDTO = $this->getPreProcessFieldArrayDTO($fieldArray, $table, (int) $id, $dataHandler); + $otpInFieldArray2 = &$fieldArray['tx_cfgoogleauthenticator_secret']; + $otpInPostData2 = $_POST['data']['be_users']['tx_cfgoogleauthenticator_secret']; + + if ($otpInFieldArray2 === null && $otpInPostData2 !== null) { + $otpInFieldArray2 = $otpInPostData2; + } + + $preProcessFieldArrayDTO = $this->getPreProcessFieldArrayDTO($fieldArray, $table, (int)$id, $dataHandler); $result = $this->getGoogleAuthenticatorSetupHandler()->process($preProcessFieldArrayDTO); $fieldArray = array_merge($fieldArray, $result); diff --git a/Classes/Hook/UserSettings.php b/Classes/Hook/UserSettings.php index 7729060..96bd5e7 100644 --- a/Classes/Hook/UserSettings.php +++ b/Classes/Hook/UserSettings.php @@ -26,6 +26,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView; use function sprintf; use function vsprintf; +use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; /** * Hook for the user settings @@ -37,7 +38,7 @@ * @package CodeFareith\CfGoogleAuthenticator\Hook * @since 1.0.0 */ -class UserSettings +class UserSettings extends AbstractFormElement { /*─────────────────────────────────────────────────────────────────────────────*\ Traits @@ -71,21 +72,20 @@ class UserSettings * @return string * @throws Exception */ - public function createSecretField(array $data): string + public function render(): array { - $this->data = $data; - + $result = $this->initializeResultArray(); $authenticationSecret = $this->getAuthenticationSecret(); $templateView = $this->initializeTemplateView(); $isEnabled = $this->isGoogleAuthenticatorEnabled(); $qrCodeUri = $this->getQrCodeGenerator()->generateUri($authenticationSecret); $prefix = ''; - if ($data['table'] !== null) { - $prefix .= sprintf('[%s]', $data['table']); + if ($this->data['tableName'] !== null) { + $prefix .= sprintf('[%s]', $this->data['tableName']); } - if ($data['row']['uid'] !== null) { - $prefix .= sprintf('[%s]', (string)$data['row']['uid']); + if ($data['databaseRow']['uid'] !== null) { + $prefix .= sprintf('[%s]', (string)$this->data['databaseRow']['uid']); } $templateView->assignMultiple( @@ -97,7 +97,9 @@ public function createSecretField(array $data): string ] ); - return $templateView->render(); + $result['html'] = $templateView->render(); + + return $result; } private function initializeTemplateView(): StandaloneView @@ -146,15 +148,15 @@ private function getLayer(): string { $layer = ''; - if ($this->data['table'] === 'fe_users') { + if ($this->data['tableName'] === 'fe_users') { $layer = 'Frontend'; - } elseif ($this->data['table'] === 'be_users') { + } elseif ($this->data['tableName'] === 'be_users') { $layer = 'Backend'; } $dispatcher = GeneralUtility::makeInstance(Dispatcher::class); $signalArguments = [ - 'table' => $this->data['table'], + 'table' => $this->data['tableName'], 'layer' => $layer, 'caller' => $this, ]; @@ -169,7 +171,7 @@ private function getLayer(): string private function getUsername(): string { - return $this->data['row']['username'] ?? ''; + return $this->data['databaseRow']['username'] ?? ''; } /** @@ -195,7 +197,7 @@ private function getAuthenticationSecret(): AuthenticationSecret private function getSecretKey(): string { if ($this->isGoogleAuthenticatorEnabled()) { - $secretKey = (string) $this->data['row']['tx_cfgoogleauthenticator_secret']; + $secretKey = (string) $this->data['databaseRow']['tx_cfgoogleauthenticator_secret']; } else { $secretKey = Base32Utility::generateRandomString(16); } @@ -205,10 +207,10 @@ private function getSecretKey(): string private function isGoogleAuthenticatorEnabled(): bool { - if ($this->data['type'] === 'user' && !is_array($this->data['row'])) { - $this->data['row'] = $GLOBALS['BE_USER']->user; + if ($this->data['parameterArray']['fieldConf']['config']['type'] === 'user' && !is_array($this->data['databaseRow'])) { + $this->data['databaseRow'] = $GLOBALS['BE_USER']->user; } - return (bool) $this->data['row']['tx_cfgoogleauthenticator_enabled']; + return (bool) $this->data['databaseRow']['tx_cfgoogleauthenticator_enabled']; } private function getQrCodeGenerator(): QrCodeGeneratorInterface diff --git a/Configuration/Extbase/Persistence/Classes.php b/Configuration/Extbase/Persistence/Classes.php new file mode 100644 index 0000000..8adc467 --- /dev/null +++ b/Configuration/Extbase/Persistence/Classes.php @@ -0,0 +1,10 @@ + [ + 'tableName' => 'fe_users', + ], + \CodeFareith\CfGoogleAuthenticator\Domain\Model\BackendUser::class => [ + 'tableName' => 'be_users', + ], +]; diff --git a/Configuration/TCA/Overrides/be_users.php b/Configuration/TCA/Overrides/be_users.php index faeb79e..c1705ed 100644 --- a/Configuration/TCA/Overrides/be_users.php +++ b/Configuration/TCA/Overrides/be_users.php @@ -41,7 +41,7 @@ static function () { ), 'config' => [ 'type' => 'user', - 'userFunc' => \CodeFareith\CfGoogleAuthenticator\Hook\UserSettings::class . '->createSecretField', + 'renderType' => 'TwoFactorAuth', ], ], ] diff --git a/Configuration/TCA/Overrides/fe_users.php b/Configuration/TCA/Overrides/fe_users.php index 4e203c2..478bc7e 100644 --- a/Configuration/TCA/Overrides/fe_users.php +++ b/Configuration/TCA/Overrides/fe_users.php @@ -41,7 +41,7 @@ static function () { ), 'config' => [ 'type' => 'user', - 'userFunc' => \CodeFareith\CfGoogleAuthenticator\Hook\UserSettings::class . '->createSecretField', + 'renderType' => 'TwoFactorAuth', ], ], ] diff --git a/composer.json b/composer.json index 58f81af..3268d2d 100644 --- a/composer.json +++ b/composer.json @@ -46,9 +46,9 @@ "rss": "https://github.com/codeFareith/cf_google_authenticator/commits/master.atom" }, "require": { - "typo3/cms-core": "^8.7 || ^9.5", - "typo3/cms-reports": "^8.7 || ^9.5", - "typo3/cms-setup": "^8.7 || ^9.5", + "typo3/cms-core": "^9.5 || ^10.4", + "typo3/cms-reports": "^9.5 || ^10.4", + "typo3/cms-setup": "^9.5 || ^10.4", "ext-json": "*" }, "require-dev": { diff --git a/ext_emconf.php b/ext_emconf.php index 95da051..f1e2986 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -1,47 +1,36 @@ - * @copyright (c) 2018-2019 by Robin von den Bergen - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version 1.0.0 + * Auto generated 23-11-2020 17:42 * - * @link https://github.com/codeFareith/cf_google_authenticator - * @see https://www.fareith.de - * @see https://typo3.org - */ - -/** @var string $_EXTKEY */ + * Manual updates: + * Only the data in the array - everything else is removed by next + * writing. "version" and "dependencies" must not be touched! + ***************************************************************/ $EM_CONF[$_EXTKEY] = [ 'title' => '[codeFareith] Google Authenticator', 'description' => 'Enable Google 2FA (two factor authentication) for both, frontend- and backend accounts.', 'category' => 'misc', - 'author' => 'Robin "codeFareith" von den Bergen', 'author_email' => 'robin@vondenbergen.de', 'author_company' => '', - 'state' => 'stable', 'version' => '1.2.4', - 'uploadFolders' => false, 'createDirs' => '', 'clearCacheOnLoad' => true, - 'constraints' => [ 'depends' => [ 'php' => '7.1-', - 'typo3' => '8.7.0-9.5.99', + 'typo3' => '9.5.0-10.4.99', ], 'conflicts' => [ ], 'suggests' => [ - 'felogin' => '8.7.0-9.5.99', + 'felogin' => '9.5.0-10.4.99', ], ], @@ -56,3 +45,4 @@ ], ], ]; + diff --git a/ext_localconf.php b/ext_localconf.php index 91a0b32..021d36f 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -26,12 +26,6 @@ static function ($_EXTKEY) { $extConf = \CodeFareith\CfGoogleAuthenticator\Utility\ExtensionBasicDataUtility::getExtensionConfiguration(); - $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( - \TYPO3\CMS\Extbase\Object\ObjectManager::class - ); - $adapterFactory = $objectManager->get(\CodeFareith\CfGoogleAuthenticator\Service\GoogleAuthenticationServiceAdapterFactory::class); - $adapter = $adapterFactory->create(); - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService( $_EXTKEY, 'auth', @@ -45,7 +39,7 @@ static function ($_EXTKEY) { 'quality' => 80, 'os' => '', 'exec' => '', - 'className' => get_class($adapter), + 'className' => \CodeFareith\CfGoogleAuthenticator\Service\CoreAuthenticationServiceAdapter::class, ] ); @@ -95,7 +89,14 @@ static function ($_EXTKEY) { ['felogin'] ['postProcContent'] [$_EXTKEY] = \CodeFareith\CfGoogleAuthenticator\Hook\FeLogin::class . '->createOneTimePasswordField'; + + // Register a node in ext_localconf.php + $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1606376982] = [ + 'nodeName' => 'TwoFactorAuth', + 'priority' => 40, + 'class' => \CodeFareith\CfGoogleAuthenticator\Hook\UserSettings::class, + ]; }, /** @var string $_EXTKEY */ - $_EXTKEY + 'cf_google_authenticator' ); diff --git a/ext_typoscript_setup.typoscript b/ext_typoscript_setup.typoscript deleted file mode 100644 index cec0503..0000000 --- a/ext_typoscript_setup.typoscript +++ /dev/null @@ -1,18 +0,0 @@ -config { - tx_extbase { - persistence { - classes { - CodeFareith\CfGoogleAuthenticator\Domain\Model\FrontendUser { - mapping { - tableName = fe_users - } - } - CodeFareith\CfGoogleAuthenticator\Domain\Model\BackendUser { - mapping { - tableName = be_users - } - } - } - } - } -} From dfb34096d8e1c1d41078232dc03ff29426874894 Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Mon, 28 Feb 2022 11:04:09 +0100 Subject: [PATCH 02/13] [TASK] Ensure compatibility with helhum/typo3-secure-web --- .../Public/Icons/Extension.png | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename ext_icon.png => Resources/Public/Icons/Extension.png (100%) diff --git a/ext_icon.png b/Resources/Public/Icons/Extension.png similarity index 100% rename from ext_icon.png rename to Resources/Public/Icons/Extension.png From d06f4ee2fb6d75b3d1ef64ba1eb747d797b9e37c Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Mon, 28 Feb 2022 11:13:18 +0100 Subject: [PATCH 03/13] [TASK] Drop files related to TYPO3 v8 --- .travis.yml | 6 +- ...gleAuthenticationServiceAdapterFactory.php | 65 ------------------- .../LegacyAuthenticationServiceAdapter.php | 54 --------------- Tests/Build/UnitTests.xml | 1 - ext_localconf.php | 1 - ext_tables.php | 51 +++++++-------- 6 files changed, 27 insertions(+), 151 deletions(-) delete mode 100644 Classes/Service/GoogleAuthenticationServiceAdapterFactory.php delete mode 100644 Classes/Service/LegacyAuthenticationServiceAdapter.php diff --git a/.travis.yml b/.travis.yml index d6faff4..5210cdf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,12 @@ language: php matrix: fast_finish: true include: - - name: 'PHP 7.1 | TYPO3 CMS v8' - php: '7.1' - env: TYPO3_VERSION=^8 - name: 'PHP 7.2 | TYPO3 CMS v9' php: '7.2' env: TYPO3_VERSION=^9 + - name: 'PHP 7.2 | TYPO3 CMS v10' + php: '7.2' + env: TYPO3_VERSION=^10 sudo: false diff --git a/Classes/Service/GoogleAuthenticationServiceAdapterFactory.php b/Classes/Service/GoogleAuthenticationServiceAdapterFactory.php deleted file mode 100644 index 8fc9df2..0000000 --- a/Classes/Service/GoogleAuthenticationServiceAdapterFactory.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright (c) 2018-2019 by Robin von den Bergen - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version 1.0.0 - * - * @link https://github.com/codeFareith/cf_google_authenticator - * @see https://www.fareith.de - * @see https://typo3.org - */ - -namespace CodeFareith\CfGoogleAuthenticator\Service; - -use TYPO3\CMS\Core\Utility\VersionNumberUtility; -use TYPO3\CMS\Extbase\Object\ObjectManager; -use function version_compare; - -/** - * @package CodeFareith\CfGoogleAuthenticator\Service - * @since 1.1.5 - */ -class GoogleAuthenticationServiceAdapterFactory - implements AuthenticationServiceAdapterFactory -{ - protected $objectManager; - - public function __construct(ObjectManager $objectManager) - { - $this->objectManager = $objectManager; - } - - public function create(): AuthenticationService - { - return $this->objectManager->get( - $this->suggestServiceAdapter(), - $this->suggestAuthenticatorService() - ); - } - - private function suggestServiceAdapter(): string - { - if ($this->isLegacyInstallation()) { - $serviceAdapter = LegacyAuthenticationServiceAdapter::class; - } else { - $serviceAdapter = CoreAuthenticationServiceAdapter::class; - } - - return $serviceAdapter; - } - - private function isLegacyInstallation(): bool - { - $version = VersionNumberUtility::getNumericTypo3Version(); - - return version_compare($version, '9.0.0', '<'); - } - - private function suggestAuthenticatorService(): AuthenticationService - { - return $this->objectManager->get(GoogleAuthenticatorService::class); - } -} diff --git a/Classes/Service/LegacyAuthenticationServiceAdapter.php b/Classes/Service/LegacyAuthenticationServiceAdapter.php deleted file mode 100644 index db0ec03..0000000 --- a/Classes/Service/LegacyAuthenticationServiceAdapter.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @copyright (c) 2018-2019 by Robin von den Bergen - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version 1.0.0 - * - * @link https://github.com/codeFareith/cf_google_authenticator - * @see https://www.fareith.de - * @see https://typo3.org - */ - -namespace CodeFareith\CfGoogleAuthenticator\Service; - -use TYPO3\CMS\Sv\AuthenticationService as SvAuthenticationService; - -/** @noinspection LongInheritanceChainInspection */ - -/** - * @package CodeFareith\CfGoogleAuthenticator\Service - * @since 1.1.5 - */ -class LegacyAuthenticationServiceAdapter - extends SvAuthenticationService - implements AuthenticationService -{ - /** - * @var AuthenticationService - */ - protected $service; - - public function __construct(AuthenticationService $authenticationService = null) - { - $authenticationService = $authenticationService ?? new GoogleAuthenticatorService(); - - $this->service = $authenticationService; - } - - public function init(): bool - { - return ( - parent::init() - && $this->service->init() - ); - } - - public function authUser(array $user): int - { - parent::authUser($user); - return $this->service->authUser($user); - } -} diff --git a/Tests/Build/UnitTests.xml b/Tests/Build/UnitTests.xml index e63d396..02a8f4e 100644 --- a/Tests/Build/UnitTests.xml +++ b/Tests/Build/UnitTests.xml @@ -17,7 +17,6 @@ ../../Classes ../../Classes/Service/CoreAuthenticationServiceAdapter.php - ../../Classes/Service/LegacyAuthenticationServiceAdapter.php diff --git a/ext_localconf.php b/ext_localconf.php index 021d36f..fd58ef7 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -97,6 +97,5 @@ static function ($_EXTKEY) { 'class' => \CodeFareith\CfGoogleAuthenticator\Hook\UserSettings::class, ]; }, - /** @var string $_EXTKEY */ 'cf_google_authenticator' ); diff --git a/ext_tables.php b/ext_tables.php index 984f214..7bddce7 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -24,37 +24,35 @@ or die('Access denied.'); call_user_func( - static function (/*$_EXTKEY*/) { + static function ($_EXTKEY) { $globalsReference = &$GLOBALS; $globalsReference['TBE_STYLES'] ['stylesheet2'] = \CodeFareith\CfGoogleAuthenticator\Utility\PathUtility::makeExtensionPath('Resources/Public/Css/cf_google_authenticator.css'); - if (TYPO3_version >= '9.0.0') { - $globalsReference['TYPO3_USER_SETTINGS']['columns'] = array_merge( - $globalsReference['TYPO3_USER_SETTINGS']['columns'], - [ - 'tx_cfgoogleauthenticator_enabled' => [ - 'label' => \CodeFareith\CfGoogleAuthenticator\Utility\PathUtility::makeLocalLangLinkPath( - 'be_users.tx_cfgoogleauthenticator_enabled', - 'locallang_db.xlf' - ), - 'type' => 'check', - 'table' => 'be_users', - ], + $globalsReference['TYPO3_USER_SETTINGS']['columns'] = array_merge( + $globalsReference['TYPO3_USER_SETTINGS']['columns'], + [ + 'tx_cfgoogleauthenticator_enabled' => [ + 'label' => \CodeFareith\CfGoogleAuthenticator\Utility\PathUtility::makeLocalLangLinkPath( + 'be_users.tx_cfgoogleauthenticator_enabled', + 'locallang_db.xlf' + ), + 'type' => 'check', + 'table' => 'be_users', + ], - 'tx_cfgoogleauthenticator_secret' => [ - 'label' => \CodeFareith\CfGoogleAuthenticator\Utility\PathUtility::makeLocalLangLinkPath( - 'be_users.tx_cfgoogleauthenticator_secret', - 'locallang_db.xlf' - ), - 'type' => 'user', - 'userFunc' => \CodeFareith\CfGoogleAuthenticator\Hook\UserSettings::class . '->createSecretField', - 'table' => 'be_users', - ], - ] - ); - } + 'tx_cfgoogleauthenticator_secret' => [ + 'label' => \CodeFareith\CfGoogleAuthenticator\Utility\PathUtility::makeLocalLangLinkPath( + 'be_users.tx_cfgoogleauthenticator_secret', + 'locallang_db.xlf' + ), + 'type' => 'user', + 'userFunc' => \CodeFareith\CfGoogleAuthenticator\Hook\UserSettings::class . '->createSecretField', + 'table' => 'be_users', + ], + ] + ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToUserSettings( '--div--;' . \CodeFareith\CfGoogleAuthenticator\Utility\PathUtility::makeLocalLangLinkPath( @@ -65,6 +63,5 @@ static function (/*$_EXTKEY*/) { tx_cfgoogleauthenticator_secret' ); }, - /** @var string $_EXTKEY */ - $_EXTKEY + 'cf_google_authenticator' ); From 0656db4c2a79fd4e9119bf069ab20be542150c47 Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Mon, 28 Feb 2022 11:22:20 +0100 Subject: [PATCH 04/13] [TASK] Use better namespace for the custom TCA field for 2FA --- .../Form/Element/TwoFactorAuth.php} | 13 +++++++------ ext_localconf.php | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) rename Classes/{Hook/UserSettings.php => Backend/Form/Element/TwoFactorAuth.php} (97%) diff --git a/Classes/Hook/UserSettings.php b/Classes/Backend/Form/Element/TwoFactorAuth.php similarity index 97% rename from Classes/Hook/UserSettings.php rename to Classes/Backend/Form/Element/TwoFactorAuth.php index 96bd5e7..d3be576 100644 --- a/Classes/Hook/UserSettings.php +++ b/Classes/Backend/Form/Element/TwoFactorAuth.php @@ -1,4 +1,7 @@ - 'TwoFactorAuth', 'priority' => 40, - 'class' => \CodeFareith\CfGoogleAuthenticator\Hook\UserSettings::class, + 'class' => \CodeFareith\CfGoogleAuthenticator\Backend\Form\Element\TwoFactorAuth::class, ]; }, 'cf_google_authenticator' From c3719694afe52c8f36eac48045aa57ecfc267a1b Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Mon, 28 Feb 2022 11:42:06 +0100 Subject: [PATCH 05/13] [BUGFIX] Prevent exception when accessing Install Tool from Backend BEWARE: The dialog "Confirm with user password" to access the various modules of the Install Tool does not support 2FA so trying to confirm with the password of someone having 2FA enabled will always fail at this point. It will just not crash anymore. The corollary is that for such cases, only the Install Tool password may be used. --- Classes/Service/GoogleAuthenticatorService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/Service/GoogleAuthenticatorService.php b/Classes/Service/GoogleAuthenticatorService.php index 53848c8..cac90d5 100644 --- a/Classes/Service/GoogleAuthenticatorService.php +++ b/Classes/Service/GoogleAuthenticatorService.php @@ -73,7 +73,8 @@ public function authUser(array $user): int $logArgs ); - $otp = GeneralUtility::_GP('google-authenticator-otp'); + // TODO: Bypass OTP check in case we try to access the Install Tool? Or add support for OTP in prompt? + $otp = GeneralUtility::_GP('google-authenticator-otp') ?? ''; $secret = $user['tx_cfgoogleauthenticator_secret']; if (GoogleAuthenticatorUtility::verifyOneTimePassword($secret, $otp) === true) { From 923cf9e13d60c46873fb65b6d1fc50e57e18faa5 Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Mon, 28 Feb 2022 12:06:08 +0100 Subject: [PATCH 06/13] [TASK] Make User Settings hook functional --- .../Backend/Form/Element/TwoFactorAuth.php | 2 +- Classes/Hook/UserSettings.php | 27 +++++++++++++++++++ ext_emconf.php | 2 +- ext_tables.php | 2 -- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 Classes/Hook/UserSettings.php diff --git a/Classes/Backend/Form/Element/TwoFactorAuth.php b/Classes/Backend/Form/Element/TwoFactorAuth.php index d3be576..6dcfc25 100644 --- a/Classes/Backend/Form/Element/TwoFactorAuth.php +++ b/Classes/Backend/Form/Element/TwoFactorAuth.php @@ -32,7 +32,7 @@ use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; /** - * Hook for the user settings + * Custom field for the OTP setup in TCA * * This class hooks into the backend user settings, * to extend the view by creating a secret key and an image of diff --git a/Classes/Hook/UserSettings.php b/Classes/Hook/UserSettings.php new file mode 100644 index 0000000..217f479 --- /dev/null +++ b/Classes/Hook/UserSettings.php @@ -0,0 +1,27 @@ + 'be_users', + 'databaseRow' => $GLOBALS['BE_USER']->user, + ]; + + $twoFactorAuthElement = GeneralUtility::makeInstance(TwoFactorAuth::class, $nodeFactory, $data); + + $result = $twoFactorAuthElement->render(); + return $result['html']; + } +} diff --git a/ext_emconf.php b/ext_emconf.php index f1e2986..15a33eb 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -24,7 +24,7 @@ 'clearCacheOnLoad' => true, 'constraints' => [ 'depends' => [ - 'php' => '7.1-', + 'php' => '7.2-', 'typo3' => '9.5.0-10.4.99', ], 'conflicts' => [ diff --git a/ext_tables.php b/ext_tables.php index 7bddce7..3f3cc9e 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -39,7 +39,6 @@ static function ($_EXTKEY) { 'locallang_db.xlf' ), 'type' => 'check', - 'table' => 'be_users', ], 'tx_cfgoogleauthenticator_secret' => [ @@ -49,7 +48,6 @@ static function ($_EXTKEY) { ), 'type' => 'user', 'userFunc' => \CodeFareith\CfGoogleAuthenticator\Hook\UserSettings::class . '->createSecretField', - 'table' => 'be_users', ], ] ); From 493c4e1e3d09477043c1d170e3aa17c85033ea3a Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Mon, 28 Feb 2022 13:00:02 +0100 Subject: [PATCH 07/13] [BUGFIX] Ensure OTP can be set up for fe_users Resolves: #515 --- Classes/Hook/TCEMain.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Hook/TCEMain.php b/Classes/Hook/TCEMain.php index 87888ce..8c29e11 100644 --- a/Classes/Hook/TCEMain.php +++ b/Classes/Hook/TCEMain.php @@ -69,14 +69,14 @@ public function processDatamap_preProcessFieldArray( ): void { $otpInFieldArray = &$fieldArray['tx_cfgoogleauthenticator_otp']; - $otpInPostData = $_POST['data']['be_users']['tx_cfgoogleauthenticator_otp']; + $otpInPostData = $_POST['data'][$table]['tx_cfgoogleauthenticator_otp']; if ($otpInFieldArray === null && $otpInPostData !== null) { $otpInFieldArray = $otpInPostData; } $otpInFieldArray2 = &$fieldArray['tx_cfgoogleauthenticator_secret']; - $otpInPostData2 = $_POST['data']['be_users']['tx_cfgoogleauthenticator_secret']; + $otpInPostData2 = $_POST['data'][$table]['tx_cfgoogleauthenticator_secret']; if ($otpInFieldArray2 === null && $otpInPostData2 !== null) { $otpInFieldArray2 = $otpInPostData2; From f0ab70f72da84510588b598ca0c92a0666e7b72b Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Mon, 28 Feb 2022 13:09:34 +0100 Subject: [PATCH 08/13] [TASK] Clean-up variable naming in hook for TCEMain --- Classes/Hook/TCEMain.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/Hook/TCEMain.php b/Classes/Hook/TCEMain.php index 8c29e11..989fd2e 100644 --- a/Classes/Hook/TCEMain.php +++ b/Classes/Hook/TCEMain.php @@ -75,11 +75,11 @@ public function processDatamap_preProcessFieldArray( $otpInFieldArray = $otpInPostData; } - $otpInFieldArray2 = &$fieldArray['tx_cfgoogleauthenticator_secret']; - $otpInPostData2 = $_POST['data'][$table]['tx_cfgoogleauthenticator_secret']; + $secretInFieldArray = &$fieldArray['tx_cfgoogleauthenticator_secret']; + $secretInPostData = $_POST['data'][$table]['tx_cfgoogleauthenticator_secret']; - if ($otpInFieldArray2 === null && $otpInPostData2 !== null) { - $otpInFieldArray2 = $otpInPostData2; + if ($secretInFieldArray === null && $secretInPostData !== null) { + $secretInFieldArray = $secretInPostData; } $preProcessFieldArrayDTO = $this->getPreProcessFieldArrayDTO($fieldArray, $table, (int)$id, $dataHandler); From ec5a49bb63791892aa7540719deb5d7cb568e067 Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Mon, 28 Feb 2022 13:13:24 +0100 Subject: [PATCH 09/13] [TASK] Use a checkbox "toggle" renderer for enabling OTP Instead of using an old checkbox for enabling OTP for be_users and fe_users, this uses the toggle renderer available since TYPO3 v9. --- Configuration/TCA/Overrides/be_users.php | 7 +++++++ Configuration/TCA/Overrides/fe_users.php | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Configuration/TCA/Overrides/be_users.php b/Configuration/TCA/Overrides/be_users.php index c1705ed..862e560 100644 --- a/Configuration/TCA/Overrides/be_users.php +++ b/Configuration/TCA/Overrides/be_users.php @@ -31,6 +31,13 @@ static function () { ), 'config' => [ 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + ] + ], ], ], 'tx_cfgoogleauthenticator_secret' => [ diff --git a/Configuration/TCA/Overrides/fe_users.php b/Configuration/TCA/Overrides/fe_users.php index 478bc7e..4613935 100644 --- a/Configuration/TCA/Overrides/fe_users.php +++ b/Configuration/TCA/Overrides/fe_users.php @@ -31,6 +31,13 @@ static function () { ), 'config' => [ 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + ] + ], ], ], 'tx_cfgoogleauthenticator_secret' => [ From 4a9a88adeab6913c6add3e019a8512b203715961 Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Mon, 28 Feb 2022 13:56:20 +0100 Subject: [PATCH 10/13] [BUGFIX] Fix OTP status in User Settings Resolves: #517 --- ext_tables.php | 1 + 1 file changed, 1 insertion(+) diff --git a/ext_tables.php b/ext_tables.php index 3f3cc9e..da8daae 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -39,6 +39,7 @@ static function ($_EXTKEY) { 'locallang_db.xlf' ), 'type' => 'check', + 'table' => 'be_users', ], 'tx_cfgoogleauthenticator_secret' => [ From 2a202af673b932d199b6faa20970bf84c6c2c083 Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Tue, 1 Mar 2022 15:41:57 +0100 Subject: [PATCH 11/13] [TASK] Update copyright year --- Classes/Backend/Form/Element/TwoFactorAuth.php | 2 +- Classes/Controller/Frontend/SetupController.php | 2 +- .../DataTransferObject/GoogleAuthenticatorSettingsDTO.php | 2 +- Classes/Domain/DataTransferObject/PreProcessFieldArrayDTO.php | 2 +- Classes/Domain/Form/FormInterface.php | 2 +- Classes/Domain/Form/SetupForm.php | 2 +- Classes/Domain/Immutable/AuthenticationSecret.php | 2 +- Classes/Domain/Immutable/ImmutableInterface.php | 2 +- Classes/Domain/Mapper/AbstractMapper.php | 2 +- Classes/Domain/Mapper/GoogleAuthenticatorSettingsMapper.php | 2 +- Classes/Domain/Mapper/MapperInterface.php | 2 +- Classes/Domain/Model/BackendUser.php | 2 +- Classes/Domain/Model/FrontendUser.php | 2 +- Classes/Domain/Repository/BackendUserRepository.php | 2 +- Classes/Domain/Repository/FrontendUserRepository.php | 2 +- Classes/Domain/Struct/AbstractStruct.php | 2 +- Classes/Domain/Struct/GoogleAuthenticatorSettings.php | 2 +- Classes/Domain/Struct/StructInterface.php | 2 +- Classes/Exception/MissingRequiredField.php | 2 +- Classes/Exception/PropertyNotFound.php | 2 +- Classes/Exception/PropertyNotInitialized.php | 2 +- Classes/Handler/GoogleAuthenticatorSetupHandler.php | 2 +- Classes/Hook/FeLogin.php | 2 +- Classes/Hook/TCEMain.php | 2 +- Classes/Provider/Login/GoogleAuthenticatorLoginProvider.php | 2 +- Classes/Service/AuthenticationService.php | 2 +- Classes/Service/AuthenticationServiceAdapterFactory.php | 2 +- Classes/Service/CoreAuthenticationServiceAdapter.php | 2 +- Classes/Service/GoogleAuthenticatorService.php | 2 +- Classes/Service/GoogleQrCodeGenerator.php | 2 +- Classes/Service/QrCodeGeneratorInterface.php | 2 +- Classes/Traits/GeneralUtilityObjectManager.php | 2 +- Classes/Utility/Base32Utility.php | 2 +- Classes/Utility/ExtensionBasicDataUtility.php | 2 +- Classes/Utility/GoogleAuthenticatorUtility.php | 2 +- Classes/Utility/PathUtility.php | 2 +- Classes/Utility/TypoScriptUtility.php | 2 +- Classes/Validation/Validator/SetupFormValidator.php | 2 +- Configuration/TCA/Overrides/be_users.php | 2 +- Configuration/TCA/Overrides/fe_users.php | 2 +- Configuration/TCA/Overrides/sys_template.php | 2 +- Configuration/TCA/Overrides/tt_content.php | 2 +- Documentation/API/files/Classes/Domain/Form/SetupForm.php.txt | 2 +- .../API/files/Classes/Exception/MissingRequiredField.php.txt | 2 +- .../API/files/Classes/Exception/PropertyNotFound.php.txt | 2 +- .../API/files/Classes/Exception/PropertyNotInitialized.php.txt | 2 +- .../Classes/Handler/GoogleAuthenticatorSetupHandler.php.txt | 2 +- Documentation/API/files/Classes/Hook/FeLogin.php.txt | 2 +- Documentation/API/files/Classes/Hook/TCEMain.php.txt | 2 +- Documentation/API/files/Classes/Hook/UserSettings.php.txt | 2 +- .../API/files/Classes/Service/GoogleQrCodeGenerator.php.txt | 2 +- .../API/files/Classes/Service/QrCodeGeneratorInterface.php.txt | 2 +- .../files/Classes/Traits/GeneralUtilityObjectManager.php.txt | 2 +- Documentation/API/files/Classes/Utility/Base32Utility.php.txt | 2 +- .../API/files/Classes/Utility/ExtensionBasicDataUtility.php.txt | 2 +- .../files/Classes/Utility/GoogleAuthenticatorUtility.php.txt | 2 +- Documentation/API/files/Classes/Utility/PathUtility.php.txt | 2 +- .../API/files/Classes/Utility/TypoScriptUtility.php.txt | 2 +- Tests/Unit/BaseTestCase.php | 2 +- 59 files changed, 59 insertions(+), 59 deletions(-) diff --git a/Classes/Backend/Form/Element/TwoFactorAuth.php b/Classes/Backend/Form/Element/TwoFactorAuth.php index 6dcfc25..27c7e78 100644 --- a/Classes/Backend/Form/Element/TwoFactorAuth.php +++ b/Classes/Backend/Form/Element/TwoFactorAuth.php @@ -6,7 +6,7 @@ * Class UserSettings * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Controller/Frontend/SetupController.php b/Classes/Controller/Frontend/SetupController.php index d96d2dc..7e3881a 100644 --- a/Classes/Controller/Frontend/SetupController.php +++ b/Classes/Controller/Frontend/SetupController.php @@ -3,7 +3,7 @@ * Class SetupController * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/DataTransferObject/GoogleAuthenticatorSettingsDTO.php b/Classes/Domain/DataTransferObject/GoogleAuthenticatorSettingsDTO.php index 8994bc3..45166fa 100644 --- a/Classes/Domain/DataTransferObject/GoogleAuthenticatorSettingsDTO.php +++ b/Classes/Domain/DataTransferObject/GoogleAuthenticatorSettingsDTO.php @@ -3,7 +3,7 @@ * Class GoogleAuthenticatorSettingsDTO * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/DataTransferObject/PreProcessFieldArrayDTO.php b/Classes/Domain/DataTransferObject/PreProcessFieldArrayDTO.php index d10a86b..caa2479 100644 --- a/Classes/Domain/DataTransferObject/PreProcessFieldArrayDTO.php +++ b/Classes/Domain/DataTransferObject/PreProcessFieldArrayDTO.php @@ -3,7 +3,7 @@ * Class PreProcessFieldArrayDTO * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Form/FormInterface.php b/Classes/Domain/Form/FormInterface.php index 1d5f2c1..3e628f5 100644 --- a/Classes/Domain/Form/FormInterface.php +++ b/Classes/Domain/Form/FormInterface.php @@ -3,7 +3,7 @@ * Interface FormInterface * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Form/SetupForm.php b/Classes/Domain/Form/SetupForm.php index 24c66e0..c01aed7 100644 --- a/Classes/Domain/Form/SetupForm.php +++ b/Classes/Domain/Form/SetupForm.php @@ -3,7 +3,7 @@ * Class SetupForm * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Immutable/AuthenticationSecret.php b/Classes/Domain/Immutable/AuthenticationSecret.php index 43829a5..6d9bebf 100644 --- a/Classes/Domain/Immutable/AuthenticationSecret.php +++ b/Classes/Domain/Immutable/AuthenticationSecret.php @@ -3,7 +3,7 @@ * Class AuthenticationSecret * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Immutable/ImmutableInterface.php b/Classes/Domain/Immutable/ImmutableInterface.php index 141f7de..68dd745 100644 --- a/Classes/Domain/Immutable/ImmutableInterface.php +++ b/Classes/Domain/Immutable/ImmutableInterface.php @@ -3,7 +3,7 @@ * Interface ImmutableInterface * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Mapper/AbstractMapper.php b/Classes/Domain/Mapper/AbstractMapper.php index 1f4d27c..c8964e9 100644 --- a/Classes/Domain/Mapper/AbstractMapper.php +++ b/Classes/Domain/Mapper/AbstractMapper.php @@ -3,7 +3,7 @@ * Class AbstractMapper * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Mapper/GoogleAuthenticatorSettingsMapper.php b/Classes/Domain/Mapper/GoogleAuthenticatorSettingsMapper.php index 90514f8..8ba4ac7 100644 --- a/Classes/Domain/Mapper/GoogleAuthenticatorSettingsMapper.php +++ b/Classes/Domain/Mapper/GoogleAuthenticatorSettingsMapper.php @@ -3,7 +3,7 @@ * Class GoogleAuthenticatorSettingsMapper * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Mapper/MapperInterface.php b/Classes/Domain/Mapper/MapperInterface.php index fc74c36..f298404 100644 --- a/Classes/Domain/Mapper/MapperInterface.php +++ b/Classes/Domain/Mapper/MapperInterface.php @@ -3,7 +3,7 @@ * Interface MapperInterface * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Model/BackendUser.php b/Classes/Domain/Model/BackendUser.php index 4825bb3..b18d992 100644 --- a/Classes/Domain/Model/BackendUser.php +++ b/Classes/Domain/Model/BackendUser.php @@ -3,7 +3,7 @@ * Class BackendUser * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Model/FrontendUser.php b/Classes/Domain/Model/FrontendUser.php index 551f63f..8182975 100644 --- a/Classes/Domain/Model/FrontendUser.php +++ b/Classes/Domain/Model/FrontendUser.php @@ -3,7 +3,7 @@ * Class FrontendUser * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Repository/BackendUserRepository.php b/Classes/Domain/Repository/BackendUserRepository.php index 6e73ea2..bfb9ae8 100644 --- a/Classes/Domain/Repository/BackendUserRepository.php +++ b/Classes/Domain/Repository/BackendUserRepository.php @@ -3,7 +3,7 @@ * Class BackendUserRepository * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Repository/FrontendUserRepository.php b/Classes/Domain/Repository/FrontendUserRepository.php index 5b702c5..567eb42 100644 --- a/Classes/Domain/Repository/FrontendUserRepository.php +++ b/Classes/Domain/Repository/FrontendUserRepository.php @@ -3,7 +3,7 @@ * Class FrontendUserRepository * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Struct/AbstractStruct.php b/Classes/Domain/Struct/AbstractStruct.php index 039c63e..6816dc7 100644 --- a/Classes/Domain/Struct/AbstractStruct.php +++ b/Classes/Domain/Struct/AbstractStruct.php @@ -3,7 +3,7 @@ * Class AbstractStruct * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Struct/GoogleAuthenticatorSettings.php b/Classes/Domain/Struct/GoogleAuthenticatorSettings.php index 55ad621..6cdf528 100644 --- a/Classes/Domain/Struct/GoogleAuthenticatorSettings.php +++ b/Classes/Domain/Struct/GoogleAuthenticatorSettings.php @@ -3,7 +3,7 @@ * Class GoogleAuthenticatorSettings * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Domain/Struct/StructInterface.php b/Classes/Domain/Struct/StructInterface.php index c58d9ab..9455cdd 100644 --- a/Classes/Domain/Struct/StructInterface.php +++ b/Classes/Domain/Struct/StructInterface.php @@ -3,7 +3,7 @@ * Interface StructInterface * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Exception/MissingRequiredField.php b/Classes/Exception/MissingRequiredField.php index 8f34588..3dfe9f1 100644 --- a/Classes/Exception/MissingRequiredField.php +++ b/Classes/Exception/MissingRequiredField.php @@ -3,7 +3,7 @@ * Class MissingRequiredField * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Exception/PropertyNotFound.php b/Classes/Exception/PropertyNotFound.php index 7cc81ad..542cbd3 100644 --- a/Classes/Exception/PropertyNotFound.php +++ b/Classes/Exception/PropertyNotFound.php @@ -3,7 +3,7 @@ * Class PropertyNotFound * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Exception/PropertyNotInitialized.php b/Classes/Exception/PropertyNotInitialized.php index 1b310cc..a564afe 100644 --- a/Classes/Exception/PropertyNotInitialized.php +++ b/Classes/Exception/PropertyNotInitialized.php @@ -3,7 +3,7 @@ * Class PropertyNotInitialized * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Handler/GoogleAuthenticatorSetupHandler.php b/Classes/Handler/GoogleAuthenticatorSetupHandler.php index f792d61..620700c 100644 --- a/Classes/Handler/GoogleAuthenticatorSetupHandler.php +++ b/Classes/Handler/GoogleAuthenticatorSetupHandler.php @@ -3,7 +3,7 @@ * Class GoogleAuthenticatorSetupHandler * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Hook/FeLogin.php b/Classes/Hook/FeLogin.php index 404df00..c94425c 100644 --- a/Classes/Hook/FeLogin.php +++ b/Classes/Hook/FeLogin.php @@ -3,7 +3,7 @@ * Class FeLogin * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Hook/TCEMain.php b/Classes/Hook/TCEMain.php index 989fd2e..60cd243 100644 --- a/Classes/Hook/TCEMain.php +++ b/Classes/Hook/TCEMain.php @@ -3,7 +3,7 @@ * Class TCEMain * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Provider/Login/GoogleAuthenticatorLoginProvider.php b/Classes/Provider/Login/GoogleAuthenticatorLoginProvider.php index 5a1e0bb..e647c5a 100644 --- a/Classes/Provider/Login/GoogleAuthenticatorLoginProvider.php +++ b/Classes/Provider/Login/GoogleAuthenticatorLoginProvider.php @@ -3,7 +3,7 @@ * Class GoogleAuthenticatorLoginProvider * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Service/AuthenticationService.php b/Classes/Service/AuthenticationService.php index ca01aeb..831edb2 100644 --- a/Classes/Service/AuthenticationService.php +++ b/Classes/Service/AuthenticationService.php @@ -3,7 +3,7 @@ * Interface AuthenticationService * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Service/AuthenticationServiceAdapterFactory.php b/Classes/Service/AuthenticationServiceAdapterFactory.php index 665613a..7212e9f 100644 --- a/Classes/Service/AuthenticationServiceAdapterFactory.php +++ b/Classes/Service/AuthenticationServiceAdapterFactory.php @@ -3,7 +3,7 @@ * Interface AuthenticationServiceAdapterFactory * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Service/CoreAuthenticationServiceAdapter.php b/Classes/Service/CoreAuthenticationServiceAdapter.php index 005972e..47211d9 100644 --- a/Classes/Service/CoreAuthenticationServiceAdapter.php +++ b/Classes/Service/CoreAuthenticationServiceAdapter.php @@ -3,7 +3,7 @@ * Class CoreAuthenticationServiceAdapter * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Service/GoogleAuthenticatorService.php b/Classes/Service/GoogleAuthenticatorService.php index cac90d5..da7cdf2 100644 --- a/Classes/Service/GoogleAuthenticatorService.php +++ b/Classes/Service/GoogleAuthenticatorService.php @@ -3,7 +3,7 @@ * Class GoogleAuthenticatorService * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Service/GoogleQrCodeGenerator.php b/Classes/Service/GoogleQrCodeGenerator.php index 5983ca1..79cac0b 100644 --- a/Classes/Service/GoogleQrCodeGenerator.php +++ b/Classes/Service/GoogleQrCodeGenerator.php @@ -3,7 +3,7 @@ * Class GoogleQrImageGenerator * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Service/QrCodeGeneratorInterface.php b/Classes/Service/QrCodeGeneratorInterface.php index 298d5c3..1759b45 100644 --- a/Classes/Service/QrCodeGeneratorInterface.php +++ b/Classes/Service/QrCodeGeneratorInterface.php @@ -3,7 +3,7 @@ * Interface QrImageGeneratorInterface * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Traits/GeneralUtilityObjectManager.php b/Classes/Traits/GeneralUtilityObjectManager.php index 976d172..acf32c5 100644 --- a/Classes/Traits/GeneralUtilityObjectManager.php +++ b/Classes/Traits/GeneralUtilityObjectManager.php @@ -3,7 +3,7 @@ * Trait GeneralUtilityObjectManager * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Utility/Base32Utility.php b/Classes/Utility/Base32Utility.php index 6a6c0c7..dd761e2 100644 --- a/Classes/Utility/Base32Utility.php +++ b/Classes/Utility/Base32Utility.php @@ -3,7 +3,7 @@ * Class Base32Utility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Utility/ExtensionBasicDataUtility.php b/Classes/Utility/ExtensionBasicDataUtility.php index 110c852..2a8e305 100644 --- a/Classes/Utility/ExtensionBasicDataUtility.php +++ b/Classes/Utility/ExtensionBasicDataUtility.php @@ -3,7 +3,7 @@ * Class ExtensionBasicDataUtility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Utility/GoogleAuthenticatorUtility.php b/Classes/Utility/GoogleAuthenticatorUtility.php index e5135f6..0931c6b 100644 --- a/Classes/Utility/GoogleAuthenticatorUtility.php +++ b/Classes/Utility/GoogleAuthenticatorUtility.php @@ -3,7 +3,7 @@ * Class GoogleAuthenticatorUtility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Utility/PathUtility.php b/Classes/Utility/PathUtility.php index 517f249..aa631b1 100644 --- a/Classes/Utility/PathUtility.php +++ b/Classes/Utility/PathUtility.php @@ -3,7 +3,7 @@ * Class PathUtility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Utility/TypoScriptUtility.php b/Classes/Utility/TypoScriptUtility.php index 8a2e8a0..98f6881 100644 --- a/Classes/Utility/TypoScriptUtility.php +++ b/Classes/Utility/TypoScriptUtility.php @@ -3,7 +3,7 @@ * Class TypoScriptUtility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Classes/Validation/Validator/SetupFormValidator.php b/Classes/Validation/Validator/SetupFormValidator.php index 5b8fd6f..59e0d4a 100644 --- a/Classes/Validation/Validator/SetupFormValidator.php +++ b/Classes/Validation/Validator/SetupFormValidator.php @@ -3,7 +3,7 @@ * Class SetupFormValidator * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Configuration/TCA/Overrides/be_users.php b/Configuration/TCA/Overrides/be_users.php index 862e560..27b129b 100644 --- a/Configuration/TCA/Overrides/be_users.php +++ b/Configuration/TCA/Overrides/be_users.php @@ -6,7 +6,7 @@ * are represented and handled in the TYPO3 backend. * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Configuration/TCA/Overrides/fe_users.php b/Configuration/TCA/Overrides/fe_users.php index 4613935..5f57a7c 100644 --- a/Configuration/TCA/Overrides/fe_users.php +++ b/Configuration/TCA/Overrides/fe_users.php @@ -6,7 +6,7 @@ * are represented and handled in the TYPO3 backend. * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index 07a6035..fa4901c 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -6,7 +6,7 @@ * are represented and handled in the TYPO3 backend. * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index af48d7b..310b17d 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -5,7 +5,7 @@ * This script extends the tt_content * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Domain/Form/SetupForm.php.txt b/Documentation/API/files/Classes/Domain/Form/SetupForm.php.txt index ba22f08..541f983 100644 --- a/Documentation/API/files/Classes/Domain/Form/SetupForm.php.txt +++ b/Documentation/API/files/Classes/Domain/Form/SetupForm.php.txt @@ -3,7 +3,7 @@ * Class SetupForm * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Exception/MissingRequiredField.php.txt b/Documentation/API/files/Classes/Exception/MissingRequiredField.php.txt index ba89837..b91f011 100644 --- a/Documentation/API/files/Classes/Exception/MissingRequiredField.php.txt +++ b/Documentation/API/files/Classes/Exception/MissingRequiredField.php.txt @@ -3,7 +3,7 @@ * Class MissingRequiredField * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Exception/PropertyNotFound.php.txt b/Documentation/API/files/Classes/Exception/PropertyNotFound.php.txt index 396fd09..4bca28f 100644 --- a/Documentation/API/files/Classes/Exception/PropertyNotFound.php.txt +++ b/Documentation/API/files/Classes/Exception/PropertyNotFound.php.txt @@ -3,7 +3,7 @@ * Class PropertyNotFound * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Exception/PropertyNotInitialized.php.txt b/Documentation/API/files/Classes/Exception/PropertyNotInitialized.php.txt index 71fb045..67b1fc6 100644 --- a/Documentation/API/files/Classes/Exception/PropertyNotInitialized.php.txt +++ b/Documentation/API/files/Classes/Exception/PropertyNotInitialized.php.txt @@ -3,7 +3,7 @@ * Class PropertyNotInitialized * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Handler/GoogleAuthenticatorSetupHandler.php.txt b/Documentation/API/files/Classes/Handler/GoogleAuthenticatorSetupHandler.php.txt index 6feaca5..4688288 100644 --- a/Documentation/API/files/Classes/Handler/GoogleAuthenticatorSetupHandler.php.txt +++ b/Documentation/API/files/Classes/Handler/GoogleAuthenticatorSetupHandler.php.txt @@ -3,7 +3,7 @@ * Class GoogleAuthenticatorSetupHandler * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Hook/FeLogin.php.txt b/Documentation/API/files/Classes/Hook/FeLogin.php.txt index da0ab31..3abc6da 100644 --- a/Documentation/API/files/Classes/Hook/FeLogin.php.txt +++ b/Documentation/API/files/Classes/Hook/FeLogin.php.txt @@ -3,7 +3,7 @@ * Class FeLogin * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Hook/TCEMain.php.txt b/Documentation/API/files/Classes/Hook/TCEMain.php.txt index a21ebd5..2bdc0f8 100644 --- a/Documentation/API/files/Classes/Hook/TCEMain.php.txt +++ b/Documentation/API/files/Classes/Hook/TCEMain.php.txt @@ -3,7 +3,7 @@ * Class TCEMain * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Hook/UserSettings.php.txt b/Documentation/API/files/Classes/Hook/UserSettings.php.txt index 4207eb3..9715c13 100644 --- a/Documentation/API/files/Classes/Hook/UserSettings.php.txt +++ b/Documentation/API/files/Classes/Hook/UserSettings.php.txt @@ -3,7 +3,7 @@ * Class UserSettings * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Service/GoogleQrCodeGenerator.php.txt b/Documentation/API/files/Classes/Service/GoogleQrCodeGenerator.php.txt index 09eceef..b6912a2 100644 --- a/Documentation/API/files/Classes/Service/GoogleQrCodeGenerator.php.txt +++ b/Documentation/API/files/Classes/Service/GoogleQrCodeGenerator.php.txt @@ -3,7 +3,7 @@ * Class GoogleQrImageGenerator * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Service/QrCodeGeneratorInterface.php.txt b/Documentation/API/files/Classes/Service/QrCodeGeneratorInterface.php.txt index 859e423..155140d 100644 --- a/Documentation/API/files/Classes/Service/QrCodeGeneratorInterface.php.txt +++ b/Documentation/API/files/Classes/Service/QrCodeGeneratorInterface.php.txt @@ -3,7 +3,7 @@ * Interface QrImageGeneratorInterface * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Traits/GeneralUtilityObjectManager.php.txt b/Documentation/API/files/Classes/Traits/GeneralUtilityObjectManager.php.txt index 033183c..562366e 100644 --- a/Documentation/API/files/Classes/Traits/GeneralUtilityObjectManager.php.txt +++ b/Documentation/API/files/Classes/Traits/GeneralUtilityObjectManager.php.txt @@ -3,7 +3,7 @@ * Trait GeneralUtilityObjectManager * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Utility/Base32Utility.php.txt b/Documentation/API/files/Classes/Utility/Base32Utility.php.txt index d90dfcb..c4f67db 100644 --- a/Documentation/API/files/Classes/Utility/Base32Utility.php.txt +++ b/Documentation/API/files/Classes/Utility/Base32Utility.php.txt @@ -3,7 +3,7 @@ * Class Base32Utility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Utility/ExtensionBasicDataUtility.php.txt b/Documentation/API/files/Classes/Utility/ExtensionBasicDataUtility.php.txt index 31f5747..ff7e634 100644 --- a/Documentation/API/files/Classes/Utility/ExtensionBasicDataUtility.php.txt +++ b/Documentation/API/files/Classes/Utility/ExtensionBasicDataUtility.php.txt @@ -3,7 +3,7 @@ * Class ExtensionBasicDataUtility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Utility/GoogleAuthenticatorUtility.php.txt b/Documentation/API/files/Classes/Utility/GoogleAuthenticatorUtility.php.txt index e97b7e5..9e744dc 100644 --- a/Documentation/API/files/Classes/Utility/GoogleAuthenticatorUtility.php.txt +++ b/Documentation/API/files/Classes/Utility/GoogleAuthenticatorUtility.php.txt @@ -3,7 +3,7 @@ * Class GoogleAuthenticatorUtility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Utility/PathUtility.php.txt b/Documentation/API/files/Classes/Utility/PathUtility.php.txt index 0b4efef..54cbf24 100644 --- a/Documentation/API/files/Classes/Utility/PathUtility.php.txt +++ b/Documentation/API/files/Classes/Utility/PathUtility.php.txt @@ -3,7 +3,7 @@ * Class PathUtility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Documentation/API/files/Classes/Utility/TypoScriptUtility.php.txt b/Documentation/API/files/Classes/Utility/TypoScriptUtility.php.txt index efc0e5a..f867cde 100644 --- a/Documentation/API/files/Classes/Utility/TypoScriptUtility.php.txt +++ b/Documentation/API/files/Classes/Utility/TypoScriptUtility.php.txt @@ -3,7 +3,7 @@ * Class TypoScriptUtility * * @author Robin 'codeFareith' von den Bergen - * @copyright (c) 2018-2019 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * diff --git a/Tests/Unit/BaseTestCase.php b/Tests/Unit/BaseTestCase.php index 1d62655..a73d37f 100644 --- a/Tests/Unit/BaseTestCase.php +++ b/Tests/Unit/BaseTestCase.php @@ -1,7 +1,7 @@ - * @copyright (c) 2018 by Robin von den Bergen + * @copyright (c) 2018-2022 by Robin von den Bergen * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version 1.0.0 * From 264c4002a417c89adf71dcb0465364d3e5423ddf Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Tue, 1 Mar 2022 16:28:31 +0100 Subject: [PATCH 12/13] [BUGFIX] Add missing table mapping for Extbase in TYPO3 v9 --- Configuration/TypoScript/setup.typoscript | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index 907281d..f5a0f8a 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -14,5 +14,17 @@ plugin { 1 = {$plugin.tx_cfgoogleauthenticator_setup.view.templateRootPath} } } + + # Persistence mapping is required for TYPO3 v9 + # (in TYPO3 v10, this has moved to EXT:cf_google_authenticator/Configuration/Extbase/Persistence/Classes.php) + persistence { + classes { + CodeFareith\CfGoogleAuthenticator\Domain\Model\FrontendUser { + mapping { + tableName = fe_users + } + } + } + } } } From 9013b0f7f7aa089d36d34c8417d90e7255ed6885 Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Tue, 1 Mar 2022 16:56:22 +0100 Subject: [PATCH 13/13] [FEATURE] Send signal when 2FA is enabled/disabled for a Frontend user Listening to this signal allows a third-party extension to synchronize the 2FA setup with a custom table of users. Related: #12 --- .../Controller/Frontend/SetupController.php | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Classes/Controller/Frontend/SetupController.php b/Classes/Controller/Frontend/SetupController.php index 7e3881a..9393fec 100644 --- a/Classes/Controller/Frontend/SetupController.php +++ b/Classes/Controller/Frontend/SetupController.php @@ -34,6 +34,7 @@ use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException; use TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException; use TYPO3\CMS\Core\Localization\LanguageService; +use TYPO3\CMS\Extbase\SignalSlot\Dispatcher; use function get_class; use function vsprintf; @@ -82,6 +83,11 @@ class SetupController */ private $authenticationSecret; + /** + * @var Dispatcher + */ + protected $dispatcher; + /*─────────────────────────────────────────────────────────────────────────────*\ Methods \*─────────────────────────────────────────────────────────────────────────────*/ @@ -90,7 +96,8 @@ public function __construct( GoogleQrCodeGenerator $qrCodeGenerator, SetupFormValidator $setupFormValidator, LanguageService $languageService, - Context $context + Context $context, + Dispatcher $dispatcher ) { $this->frontendUserRepository = $frontendUserRepository; @@ -98,6 +105,7 @@ public function __construct( $this->setupFormValidator = $setupFormValidator; $this->languageService = $languageService; $this->context = $context; + $this->dispatcher = $dispatcher; } /** @@ -151,16 +159,31 @@ public function updateAction(): void if ($user !== null) { $formData = (array)$this->request->getArgument(SetupForm::FORM_NAME); + $action = null; if ($this->request->hasArgument('enable')) { $user->enableGoogleAuthenticator($formData['secret']); + $action = 'enable'; } elseif ($this->request->hasArgument('disable')) { $user->disableGoogleAuthenticator(); + $action = 'disable'; } $this->frontendUserRepository->update($user); $this->addSuccessMessage(); + if ($action !== null) { + $this->dispatcher->dispatch( + __CLASS__, + 'toggleGoogleAuthenticator', + [ + 'action' => $action, + 'user' => $user, + 'caller' => $this, + ] + ); + } + $this->redirect('index'); } }