Skip to content

Commit

Permalink
[TASK] Moves TCA override to seperate file
Browse files Browse the repository at this point in the history
* Removes obsolete parameter in addTCAcolumns()
* Removes trim evaluation for password field
* Removes saltedpasswords dependency due to
  having the extension built-in and not
  uninstallable

Resolves: #64208
Change-Id: I665e0920c60de2dec6860a684edb753d157d7545
Reviewed-on: http://review.typo3.org/40375
Reviewed-by: Thomas Löffler <[email protected]>
Tested-by: Thomas Löffler <[email protected]>
  • Loading branch information
spoonerWeb committed Jun 17, 2015
1 parent 4ce6f3f commit 8aecdc0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
30 changes: 30 additions & 0 deletions Configuration/TCA/Overrides/be_users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

$tempColumns = array(
'tx_besecurepw_lastpwchange' => array(
'exclude' => 0,
'label' => 'LLL:EXT:be_secure_pw/Resources/Private/Language/locallang.xml:be_users.tx_besecurepw_lastpwchange',
'config' => array(
'type' => 'input',
'size' => 12,
'eval' => 'datetime',
)
),
);

ExtensionManagementUtility::addTCAcolumns('be_users', $tempColumns);
ExtensionManagementUtility::addToAllTCAtypes('be_users', 'tx_besecurepw_lastpwchange;;;;1-1-1');
24 changes: 2 additions & 22 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,8 @@
die ('Access denied.');
}

$tempColumns = array(
'tx_besecurepw_lastpwchange' => array(
'exclude' => 0,
'label' => 'LLL:EXT:be_secure_pw/Resources/Private/Language/locallang.xml:be_users.tx_besecurepw_lastpwchange',
'config' => array(
'type' => 'input',
'size' => 12,
'eval' => 'datetime',
)
),
);

\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,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,SpoonerWeb\\BeSecurePw\\Evaluation\\PasswordEvaluator,tx_saltedpasswords_eval_be,password';
}
}
/* set password evaluation for password field in be_users */
$TCA['be_users']['columns']['password']['config']['eval'] = 'required,SpoonerWeb\\BeSecurePw\\Evaluation\\PasswordEvaluator,tx_saltedpasswords_eval_be,password';

/* override language file */
$TCA_DESCR['_MOD_user_setup']['refs'][] = 'EXT:be_secure_pw/Resources/Private/Language/ux_locallang_csh_mod.xml';
Expand Down

0 comments on commit 8aecdc0

Please sign in to comment.