Commit 2c1e687b authored by Thomas Löffler's avatar Thomas Löffler
Browse files

[TASK] Adds parameter in Evaluator and fixes instance creation

* Ready for 6.2LTS but patch http://forge.typo3.org/issues/52904
is need to be done before release.

Resolves: #51567
Change-Id: Ifc753926b4bf7624f5d746c517a64154b2f71a3f
parent 8719024e
......@@ -57,7 +57,6 @@ class PasswordEvaluator {
* @return string The new value of the field
*/
public function evaluateFieldValue($value, $is_in, &$set, $onlyCheck = FALSE) {
Utility\DebugUtility::debug($value);
$confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_secure_pw']);
$exit = FALSE;
$noMD5 = FALSE;
......@@ -83,11 +82,13 @@ class PasswordEvaluator {
}
// create tce object for logging
$tce = Utility\GeneralUtility::makeInstance('t3lib_tcemain');
/** @var \TYPO3\CMS\Core\DataHandling\DataHandler $tce */
$tce = Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
$tce->BE_USER = $GLOBALS['BE_USER'];
// get the languages from ext
$LANG = Utility\GeneralUtility::makeInstance('language');
/** @var \TYPO3\CMS\Lang\LanguageService $LANG */
$LANG = Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Lang\\LanguageService');
$LANG->init($tce->BE_USER->uc['lang']);
$LANG->includeLLFile('EXT:be_secure_pw/Resources/Private/Language/locallang.xml');
......@@ -147,6 +148,7 @@ class PasswordEvaluator {
$ignoredPatterns = $confArr['patterns'] - $counter;
$additional = '';
$set = FALSE;
if (is_array($notUsed) && sizeof($notUsed) > 0) {
if (sizeof($notUsed) > 1) {
......@@ -175,7 +177,6 @@ class PasswordEvaluator {
);
}
}
$set = FALSE;
} else {
/* no problems */
if ($onlyCheck || $noMD5) {
......
......@@ -18,11 +18,11 @@ $tempColumns = array(
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('be_users', $tempColumns, 1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('be_users', 'tx_besecurepw_lastpwchange;;;;1-1-1');
$TCA['be_users']['columns']['password']['config']['eval'] = 'trim,required,PasswordEvaluator,password';
$TCA['be_users']['columns']['password']['config']['eval'] = 'trim,required,SpoonerWeb\\BeSecurePw\\Evaluation\\PasswordEvaluator,password';
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('saltedpasswords')) {
if (\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::isUsageEnabled('BE')) {
$TCA['be_users']['columns']['password']['config']['eval'] =
'trim,required,PasswordEvaluator,tx_saltedpasswords_eval_be,password';
'trim,required,SpoonerWeb\\BeSecurePw\\Evaluation\\PasswordEvaluator,tx_saltedpasswords_eval_be,password';
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment