[BUGFIX] Move TCA modification of saltedpasswords to TCA/Overrides 43/30943/3
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 20 Jun 2014 14:57:30 +0000 (16:57 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 5 Jul 2014 14:08:27 +0000 (16:08 +0200)
TCA manipulation code must no longer reside in ext_tables.php, but
moved to Configuration/TCA/Overrides/<tablename>.php. Leftovers
in ext_tables might disturb loading order of TCA changes and spoil
proper caching.

Change-Id: I328cbcb718ee33beec19379ea6047a18cdc370b0
Resolves: #59704
Related: #59414
Releases: 6.3, 6.2
Reviewed-on: https://review.typo3.org/30943
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Markus Klein
Reviewed-by: Marcin SÄ…gol
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/saltedpasswords/Configuration/TCA/Overrides/be_users.php [new file with mode: 0644]
typo3/sysext/saltedpasswords/Configuration/TCA/Overrides/fe_users.php [new file with mode: 0644]
typo3/sysext/saltedpasswords/ext_tables.php

diff --git a/typo3/sysext/saltedpasswords/Configuration/TCA/Overrides/be_users.php b/typo3/sysext/saltedpasswords/Configuration/TCA/Overrides/be_users.php
new file mode 100644 (file)
index 0000000..3b56d10
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+$GLOBALS['TCA']['be_users']['columns']['password']['config']['max'] = 100;
+
+// Backend configuration for saltedpasswords
+// Get eval field operations methods as array keys
+$operations = array_flip(\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TCA']['be_users']['columns']['password']['config']['eval'], TRUE));
+// Remove md5 and temporary password from the list of evaluated methods
+unset($operations['md5'], $operations['password']);
+// Append new methods to have "password" as last operation.
+$operations['tx_saltedpasswords_eval_be'] = 1;
+$operations['password'] = 1;
+$GLOBALS['TCA']['be_users']['columns']['password']['config']['eval'] = implode(',', array_keys($operations));
+unset($operations);
diff --git a/typo3/sysext/saltedpasswords/Configuration/TCA/Overrides/fe_users.php b/typo3/sysext/saltedpasswords/Configuration/TCA/Overrides/fe_users.php
new file mode 100644 (file)
index 0000000..53bfc48
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+$GLOBALS['TCA']['fe_users']['columns']['password']['config']['max'] = 100;
+if (\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::isUsageEnabled('FE')) {
+       // Get eval field operations methods as array keys
+       $operations = array_flip(\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TCA']['fe_users']['columns']['password']['config']['eval'], TRUE));
+       // Remove md5 and temporary password from the list of evaluated methods
+       unset($operations['md5'], $operations['password']);
+       // Append new methods to have "password" as last operation.
+       $operations['tx_saltedpasswords_eval_fe'] = 1;
+       $operations['password'] = 1;
+       $GLOBALS['TCA']['fe_users']['columns']['password']['config']['eval'] = implode(',', array_keys($operations));
+       unset($operations);
+}
index ac523ab..0e00b6e 100644 (file)
@@ -2,29 +2,6 @@
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
-$GLOBALS['TCA']['fe_users']['columns']['password']['config']['max'] = 100;
-if (\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::isUsageEnabled('FE')) {
-       // Get eval field operations methods as array keys
-       $operations = array_flip(\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TCA']['fe_users']['columns']['password']['config']['eval'], TRUE));
-       // Remove md5 and temporary password from the list of evaluated methods
-       unset($operations['md5'], $operations['password']);
-       // Append new methods to have "password" as last operation.
-       $operations['tx_saltedpasswords_eval_fe'] = 1;
-       $operations['password'] = 1;
-       $GLOBALS['TCA']['fe_users']['columns']['password']['config']['eval'] = implode(',', array_keys($operations));
-       unset($operations);
-}
-$GLOBALS['TCA']['be_users']['columns']['password']['config']['max'] = 100;
 
-// Backend configuration for saltedpasswords
-// Get eval field operations methods as array keys
-$operations = array_flip(\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TCA']['be_users']['columns']['password']['config']['eval'], TRUE));
-// Remove md5 and temporary password from the list of evaluated methods
-unset($operations['md5'], $operations['password']);
-// Append new methods to have "password" as last operation.
-$operations['tx_saltedpasswords_eval_be'] = 1;
-$operations['password'] = 1;
-$GLOBALS['TCA']['be_users']['columns']['password']['config']['eval'] = implode(',', array_keys($operations));
-unset($operations);
 // Add context sensitive help (csh) for scheduler task
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_txsaltedpasswords', 'EXT:' . $_EXTKEY . '/locallang_csh_saltedpasswords.xlf');