Fixed bug #12803: Creating or deleting ENABLE_INSTALL_TOOL file saves settings in...
authorSteffen Kamper <info@sk-typo3.de>
Thu, 13 May 2010 12:41:33 +0000 (12:41 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 13 May 2010 12:41:33 +0000 (12:41 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7591 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 7dde20f..a7ff22c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-05-13  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #12803: Creating or deleting ENABLE_INSTALL_TOOL file saves settings in "User Settings"
        * Fixed bug #14341: c&p error in t3lib_div::logDeprecatedFunction
        * Fixed bug #14365: Bug: Install Tool skin is sometimes wrong (thanks to Lars Houmark)
        * Fixed bug #14336: Merge modules "Cleanup and typo3temp/" of the Install Tool (thanks to Steffen Gebert)
index 7aa3a2a..d5f31bd 100755 (executable)
@@ -112,6 +112,7 @@ class SC_mod_user_setup_index {
 
        protected $tsFieldConf;
 
+       protected $saveData = FALSE;
        protected $passwordIsUpdated = FALSE;
        protected $passwordIsSubmitted = FALSE;
        protected $setupIsUpdated = FALSE;
@@ -131,6 +132,7 @@ class SC_mod_user_setup_index {
         * @return      void
         */
        function storeIncomingData()    {
+               /* @var $BE_USER t3lib_beUserAuth */
                global $BE_USER;
 
                        // First check if something is submittet in the data-array from POST vars
@@ -162,9 +164,9 @@ class SC_mod_user_setup_index {
                                        }
                                }
                                $this->tempDataIsCleared = TRUE;
-                       } else {
+                       } elseif ($d['save']) {
                                        // 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;
@@ -183,7 +185,31 @@ class SC_mod_user_setup_index {
                                                $BE_USER->uc[$field] = htmlspecialchars($d[$field]);
                                        }
                                }
+
+                                       // Personal data for the users be_user-record (email, name, password...)
+                                       // If email and name is changed, set it in the users record:
+                               $be_user_data = $d['be_users'];
+
+                               $this->passwordIsSubmitted = (strlen($be_user_data['password']) > 0);
+                               $passwordIsConfirmed = ($this->passwordIsSubmitted && $be_user_data['password'] === $be_user_data['password2']);
+
+                                       // Update the real name:
+                               if ($be_user_data['realName'] !== $BE_USER->user['realName']) {
+                                       $BE_USER->user['realName'] = $storeRec['be_users'][$beUserId]['realName'] = substr($be_user_data['realName'], 0, 80);
+                               }
+                                       // Update the email address:
+                               if ($be_user_data['email'] !== $BE_USER->user['email']) {
+                                       $BE_USER->user['email'] = $storeRec['be_users'][$beUserId]['email'] = substr($be_user_data['email'], 0, 80);
+                               }
+                                       // Update the password:
+                               if ($passwordIsConfirmed) {
+                                       $storeRec['be_users'][$beUserId]['password'] = $be_user_data['password2'];
+                                       $this->passwordIsUpdated = TRUE;
+                               }
+
+                               $this->saveData = TRUE;
                        }
+
                        $BE_USER->overrideUC(); // Inserts the overriding values.
 
                        $save_after = md5(serialize($BE_USER->uc));
@@ -197,30 +223,8 @@ class SC_mod_user_setup_index {
                                $BE_USER->writelog(254, 1, 0, 1, $GLOBALS['LANG']->getLL('tempDataClearedLog'), array());
                        }
 
-
-                               // Personal data for the users be_user-record (email, name, password...)
-                               // If email and name is changed, set it in the users record:
-                       $be_user_data = $d['be_users'];
-
-                       $this->passwordIsSubmitted = (strlen($be_user_data['password']) > 0);
-                       $passwordIsConfirmed = ($this->passwordIsSubmitted && $be_user_data['password'] === $be_user_data['password2']);
-
-                               // Update the real name:
-                       if ($be_user_data['realName'] !== $BE_USER->user['realName']) {
-                               $BE_USER->user['realName'] = $storeRec['be_users'][$beUserId]['realName'] = substr($be_user_data['realName'], 0, 80);
-                       }
-                               // Update the email address:
-                       if ($be_user_data['email'] !== $BE_USER->user['email']) {
-                               $BE_USER->user['email'] = $storeRec['be_users'][$beUserId]['email'] = substr($be_user_data['email'], 0, 80);
-                       }
-                               // Update the password:
-                       if ($passwordIsConfirmed) {
-                               $storeRec['be_users'][$beUserId]['password'] = $be_user_data['password2'];
-                               $this->passwordIsUpdated = TRUE;
-                       }
-
                                // Persist data if something has changed:
-                       if (count($storeRec)) {
+                       if (count($storeRec) && $this->saveData) {
                                        // Make instance of TCE for storing the changes.
                                $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                                $tce->stripslashes_values=0;
@@ -385,7 +389,7 @@ class SC_mod_user_setup_index {
                $this->content .= $this->doc->section('',
                        t3lib_BEfunc::cshItem('_MOD_user_setup', 'reset', $BACK_PATH) . '
                        <input type="hidden" name="simUser" value="'.$this->simUser.'" />
-                       <input type="submit" name="submit" value="'.$LANG->getLL('save').'" />
+                       <input type="submit" name="data[save]" value="'.$LANG->getLL('save').'" />
                        <input type="submit" name="data[setValuesToDefault]" value="'.$LANG->getLL('resetConfiguration').'" onclick="return confirm(\''.$LANG->getLL('setToStandardQuestion').'\');" />
                        <input type="submit" name="data[clearSessionVars]" value="' . $LANG->getLL('clearSessionVars') . '"  onclick="return confirm(\'' . $LANG->getLL('clearSessionVarsQuestion') . '\');" />'
                );