Fixed bug #12517: Password change in User tools -> User setup impossible if rsaauth...
authorOliver Hader <oliver.hader@typo3.org>
Tue, 17 Nov 2009 16:37:23 +0000 (16:37 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 17 Nov 2009 16:37:23 +0000 (16:37 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6452 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 731a248..eef8f4f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
 
        * Fixed bug #12612: Backend Login-Popup not working
        * Follow-up to bugfix #12612: Removed reference operators for objects and code cleanup
+       * Fixed bug #12517: Password change in User tools -> User setup impossible if rsaauth and saltedpassword are installed
 
 2009-11-17  Benjamin Mack  <benni@typo3.org>
 
index 998ae85..7e483a2 100755 (executable)
@@ -189,35 +189,20 @@ class SC_mod_user_setup_index {
                                // If email and name is changed, set it in the users record:
                        $be_user_data = $d['be_users'];
                        $this->passwordIsUpdated = strlen($be_user_data['password'].$be_user_data['password2'])>0 ? -1 : 0;
+
+                       $passwordIsConfirmed = ($this->passwordIsUpdated && $be_user_data['password'] === $be_user_data['password2']);
+
                        if ($be_user_data['email']!=$BE_USER->user['email']
                                        || $be_user_data['realName']!=$BE_USER->user['realName']
-                                       || ( (strlen($be_user_data['password'])==32 || (isset($columns['password']['eval']) && substr($columns['password']['eval'], 0, 3) == 'tx_'))
-                                                       && !strcmp($be_user_data['password'],$be_user_data['password2']))
+                                       || $passwordIsConfirmed
                                        )       {
 
                                $BE_USER->user['realName'] = $storeRec['be_users'][$BE_USER->user['uid']]['realName'] = substr($be_user_data['realName'],0,80);
                                $BE_USER->user['email'] = $storeRec['be_users'][$BE_USER->user['uid']]['email'] = substr($be_user_data['email'],0,80);
 
-                               if (isset($columns['password']['eval']) && substr($columns['password']['eval'], 0, 3) == 'tx_') {
-                                               // password encryption by external script (e.g. EXT:saltedpasswords)
-                                       $func = $columns['password']['eval'];
-                                       $evalObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func].':&'.$func);
-                                       if (is_object($evalObj) && method_exists($evalObj, 'evaluateFieldValue'))       {
-                                                       // initialize vars. If method fails, $set will be set to false
-                                               $is_in = '';
-                                               $set = TRUE;
-                                               $newPassword = $evalObj->evaluateFieldValue($be_user_data['password2'], $is_in, $set);
-                                               if ($set === TRUE) {
-                                                               // password was changed
-                                                       $storeRec['be_users'][$BE_USER->user['uid']]['password'] = $newPassword;
-                                                       $this->passwordIsUpdated = 1;
-                                               }
-                                       }
-                               } else {
-                                       if (strlen($be_user_data['password'])==32 && !strcmp($be_user_data['password'],$be_user_data['password2']))     {
-                                               $storeRec['be_users'][$BE_USER->user['uid']]['password'] = $be_user_data['password2'];
-                                               $this->passwordIsUpdated = 1;
-                                       }
+                               if ($passwordIsConfirmed) {
+                                       $storeRec['be_users'][$BE_USER->user['uid']]['password'] = $be_user_data['password2'];
+                                       $this->passwordIsUpdated = 1;
                                }
                        }
                        if (count($storeRec)) {