Fixed bug #12838: Deactivated fields of $TYPO3_USER_SETTINGS are changed by the modul...
authorSteffen Kamper <info@sk-typo3.de>
Sat, 10 Apr 2010 21:20:26 +0000 (21:20 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sat, 10 Apr 2010 21:20:26 +0000 (21:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7279 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/setup/mod/index.php

index b68ad63..cf42017 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-04-10  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #12838: Deactivated fields of $TYPO3_USER_SETTINGS are changed by the module "User Settings"
        * Added feature #13953: Hookrequest - t3lib_page::getRecordOverlay (thanks to Tolleiv Nietsch)
        * Added feature #14041: impexp: Add Hooks
        * Added feature #13949: Hookrequest - alt_doc::makeEditForm() to enable further access-restrictions (thanks to Tolleiv Nietsch)
index 0903613..6fa95e7 100755 (executable)
@@ -138,6 +138,7 @@ class SC_mod_user_setup_index {
                $columns = $GLOBALS['TYPO3_USER_SETTINGS']['columns'];
                $beUserId = $BE_USER->user['uid'];
                $storeRec = array();
+               $fieldList = $this->getFieldsFromShowItem();
 
                if (is_array($d))       {
 
@@ -163,7 +164,11 @@ class SC_mod_user_setup_index {
                                $this->tempDataIsCleared = TRUE;
                        } else {
                                        // save all submitted values if they are no array (arrays are with table=be_users) and exists in $GLOBALS['TYPO3_USER_SETTINGS'][columns]
+                       
                                foreach($columns as $field => $config) {
+                                       if (!in_array($field, $fieldList)) {
+                                               continue;
+                                       }
                                        if ($config['table']) {
                                                if ($config['table'] == 'be_users' && !in_array($field, array('password', 'password2', 'email', 'realName', 'admin'))) {
                                                        if (!isset($config['access']) || $this->checkAccess($config) && $BE_USER->user[$field] !== $d['be_users'][$field]) {
@@ -464,18 +469,8 @@ class SC_mod_user_setup_index {
                $code = array();
                $i = 0;
 
-               $fieldList = $GLOBALS['TYPO3_USER_SETTINGS']['showitem'];
-
-                       // disable fields depended on settings
-               if (!$GLOBALS['TYPO3_CONF_VARS']['BE']['RTEenabled']) {
-                       $fieldList = t3lib_div::rmFromList('edit_RTE', $fieldList);
-               }
+               $fieldArray = $this->getFieldsFromShowItem();
 
-               if ($GLOBALS['BE_USER']->uc['interfaceSetup'] != 'backend_old') {
-                       $fieldList = t3lib_div::rmFromList('noMenuMode', $fieldList);
-               }
-
-               $fieldArray = t3lib_div::trimExplode(',', $fieldList, true);
                $this->dividers2tabs = isset($GLOBALS['TYPO3_USER_SETTINGS']['ctrl']['dividers2tabs']) ? intval($GLOBALS['TYPO3_USER_SETTINGS']['ctrl']['dividers2tabs']) : 0;
 
 
@@ -865,6 +860,28 @@ class SC_mod_user_setup_index {
                }
                return t3lib_BEfunc::cshItem('_MOD_user_setup', $str, $this->doc->backPath, '|', false, 'margin-bottom:0px;');
        }
+       
+       /**
+        * Returns array with fields defined in $GLOBALS['TYPO3_USER_SETTINGS']['showitem']
+        * 
+        * @param       void
+        * @return      array   array with fieldnames visible in form
+        */
+       protected function getFieldsFromShowItem() {
+               $fieldList = $GLOBALS['TYPO3_USER_SETTINGS']['showitem'];
+
+                       // disable fields depended on settings
+               if (!$GLOBALS['TYPO3_CONF_VARS']['BE']['RTEenabled']) {
+                       $fieldList = t3lib_div::rmFromList('edit_RTE', $fieldList);
+}
+
+               if ($GLOBALS['BE_USER']->uc['interfaceSetup'] != 'backend_old') {
+                       $fieldList = t3lib_div::rmFromList('noMenuMode', $fieldList);
+               }
+
+               $fieldArray = t3lib_div::trimExplode(',', $fieldList, TRUE);
+               return $fieldArray;
+       }
 }