TYPO3
7.6
Users
bogdan
Projects
Kapeli
Resources
Dash
Docsets
TYPO3
src
typo3
sysext
rsaauth
Classes
Hook
UserSetupHook.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Rsaauth\Hook;
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
17
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
18
use
TYPO3\CMS\Rsaauth\RsaEncryptionDecoder
;
19
use
TYPO3\CMS\Rsaauth\RsaEncryptionEncoder
;
20
use
TYPO3\CMS\Setup\Controller\SetupModuleController
;
21
26
class
UserSetupHook
27
{
31
protected
$rsaEncryptionDecoder
= null;
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
79
return
$this->rsaEncryptionDecoder
;
80
}
81
}
Generated on Wed Nov 11 2015 01:52:07 for TYPO3 by
1.8.3