From f2f6e6be42426c5d86ca459d6b321a21362c6ad2 Mon Sep 17 00:00:00 2001 From: Steffen Kamper Date: Sat, 10 Apr 2010 21:20:26 +0000 Subject: [PATCH] Fixed bug #12838: Deactivated fields of $TYPO3_USER_SETTINGS are changed by the module "User Settings" git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7279 709f56b5-9817-0410-a4d7-c38de5d9e867 --- ChangeLog | 1 + typo3/sysext/setup/mod/index.php | 39 +++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index b68ad63a406..cf4201740b3 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2010-04-10 Steffen Kamper + * 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) diff --git a/typo3/sysext/setup/mod/index.php b/typo3/sysext/setup/mod/index.php index 09036130bb3..6fa95e7eb7e 100755 --- a/typo3/sysext/setup/mod/index.php +++ b/typo3/sysext/setup/mod/index.php @@ -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; + } } -- 2.20.1