Project

General

Profile

Bug #21010 ยป 11896.diff

Administrator Admin, 2009-09-08 00:03

View differences:

typo3/sysext/setup/mod/index.php (working copy)
// First check if something is submittet in the data-array from POST vars
$d = t3lib_div::_POST('data');
$columns = $GLOBALS['TYPO3_USER_SETTINGS']['columns'];
$storeRec = array();
if (is_array($d)) {
// UC hashed before applying changes
......
// 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 ($config['table']) {
if ($config['table'] == 'be_users' && !in_array($field, array('password', 'password2', 'email', 'realName'))) {
$storeRec['be_users'][$BE_USER->user['uid']][$field] = $d['be_users'][$field];
$BE_USER->user[$field] = $d['be_users'][$field];
}
continue;
}
if ($config['type'] == 'check') {
......
|| (strlen($be_user_data['password'])==32
&& !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 (count($storeRec)) {
// Make instance of TCE for storing the changes.
$tce = t3lib_div::makeInstance('t3lib_TCEmain');
$tce->stripslashes_values=0;
......
$more .= ' style="' . $style . '"';
}
$value = $config['table'] == 'be_users' ? $GLOBALS['BE_USER']->user[$fieldName] : $GLOBALS['BE_USER']->uc[$fieldName];
if (!$value && isset($config['default'])) {
$value = $config['default'];
}
switch ($type) {
case 'text':
case 'password':
$dataAdd = '';
if ($config['table'] == 'be_users') {
$dataAdd = '[be_users]';
$value = $GLOBALS['BE_USER']->user[$fieldName];
} else {
$value = $GLOBALS['BE_USER']->uc[$fieldName];
}
if ($eval == 'md5') {
$more .= ' onchange="this.value=this.value?MD5(this.value):\'\';"';
}
......
value="' . htmlspecialchars($value) . '" ' . $GLOBALS['TBE_TEMPLATE']->formWidth(20) . $more . ' />';
break;
case 'check':
if (!$class) {
if (!$class) {
$more .= ' class="check"';
}
$html = '<input id="field_' . $fieldName . '"
type="checkbox"
name="data[' . $fieldName . ']"' .
($GLOBALS['BE_USER']->uc[$fieldName] ? ' checked="checked"' : '') . $more . ' />';
($value ? ' checked="checked"' : '') . $more . ' />';
break;
case 'select':
if (!$class) {
......
$html = '<select id="field_' . $fieldName . '" name="data[' . $fieldName . ']"' . $more . '>' . chr(10);
foreach ($config['items'] as $key => $value) {
$html .= '<option value="' . $key . '"' .
($GLOBALS['BE_USER']->uc[$fieldName] == $key ? ' selected="selected"' : '') .
($value == $key ? ' selected="selected"' : '') .
'>' . $this->getLabel($value,'',false) . '</option>' . chr(10);
}
$html .= '</select>';
    (1-1/1)