‪TYPO3CMS  9.5
UserSetupHook.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 
27 {
31  protected ‪$rsaEncryptionDecoder;
32 
38  public function ‪decryptPassword(array $parameters)
39  {
40  if ($this->‪isRsaAvailable()) {
41  // Note: although $parameters is not passed by reference, the 'be_user_data' is a reference
42  $parameters['be_user_data'] = $this->‪getRsaEncryptionDecoder()->‪decrypt($parameters['be_user_data']);
43  }
44  }
45 
53  public function ‪getLoginScripts(array $parameters, ‪SetupModuleController $userSetupObject)
54  {
55  $rsaEncryptionEncoder = GeneralUtility::makeInstance(RsaEncryptionEncoder::class);
56  $rsaEncryptionEncoder->enableRsaEncryption(true);
57  return '';
58  }
59 
65  protected function ‪isRsaAvailable()
66  {
67  return trim(‪$GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel']) === 'rsa' && $this->‪getRsaEncryptionDecoder()->‪isAvailable();
68  }
69 
73  protected function ‪getRsaEncryptionDecoder()
74  {
75  if ($this->rsaEncryptionDecoder === null) {
76  $this->rsaEncryptionDecoder = GeneralUtility::makeInstance(RsaEncryptionDecoder::class);
77  }
78 
80  }
81 }
‪TYPO3\CMS\Rsaauth\Hook
Definition: DecryptionHook.php:2
‪TYPO3\CMS\Setup\Controller\SetupModuleController
Definition: SetupModuleController.php:49
‪TYPO3\CMS\Rsaauth\RsaEncryptionDecoder\decrypt
‪string array decrypt($data)
Definition: RsaEncryptionDecoder.php:38
‪TYPO3\CMS\Rsaauth\Hook\UserSetupHook\getLoginScripts
‪string getLoginScripts(array $parameters, SetupModuleController $userSetupObject)
Definition: UserSetupHook.php:52
‪TYPO3\CMS\Rsaauth\Hook\UserSetupHook\decryptPassword
‪decryptPassword(array $parameters)
Definition: UserSetupHook.php:37
‪TYPO3\CMS\Rsaauth\Hook\UserSetupHook\$rsaEncryptionDecoder
‪RsaEncryptionDecoder $rsaEncryptionDecoder
Definition: UserSetupHook.php:30
‪TYPO3\CMS\Rsaauth\RsaEncryptionDecoder
Definition: RsaEncryptionDecoder.php:21
‪TYPO3\CMS\Rsaauth\RsaEncryptionDecoder\isAvailable
‪bool isAvailable()
Definition: RsaEncryptionDecoder.php:54
‪TYPO3\CMS\Rsaauth\RsaEncryptionEncoder
Definition: RsaEncryptionEncoder.php:29
‪TYPO3\CMS\Rsaauth\Hook\UserSetupHook\isRsaAvailable
‪bool isRsaAvailable()
Definition: UserSetupHook.php:64
‪TYPO3\CMS\Rsaauth\Hook\UserSetupHook\getRsaEncryptionDecoder
‪RsaEncryptionDecoder getRsaEncryptionDecoder()
Definition: UserSetupHook.php:72
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Rsaauth\Hook\UserSetupHook
Definition: UserSetupHook.php:27