Project

General

Profile

Feature #20774 » 11564_saltedpwhook_v3.diff

Administrator Admin, 2009-09-17 21:19

View differences:

typo3/sysext/setup/mod/index.php (working copy)
$this->PASSWORD_UPDATED = strlen($be_user_data['password'].$be_user_data['password2'])>0 ? -1 : 0;
if ($be_user_data['email']!=$BE_USER->user['email']
|| $be_user_data['realName']!=$BE_USER->user['realName']
|| (strlen($be_user_data['password'])==32
|| ( (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']))
) {
$storeRec = array();
$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 (strlen($be_user_data['password'])==32 && !strcmp($be_user_data['password'],$be_user_data['password2'])) {
$BE_USER->user['password'] = $storeRec['be_users'][$BE_USER->user['uid']]['password'] = $be_user_data['password2'];
$this->PASSWORD_UPDATED = 1;
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->PASSWORD_UPDATED = 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->PASSWORD_UPDATED = 1;
}
}
// Make instance of TCE for storing the changes.
(4-4/4)