Bug #31110 » bug_31110.diff
tx_sysaction_task.new 2011-10-19 14:04:06.000000000 +0200 | ||
---|---|---|
if (empty($vars['username'])) {
|
||
$errors[] = $GLOBALS['LANG']->getLL('error-username-empty');
|
||
}
|
||
if (empty($vars['password'])) {
|
||
if ($vars['key'] == 'NEW' && empty($vars['password'])) {
|
||
$errors[] = $GLOBALS['LANG']->getLL('error-password-empty');
|
||
}
|
||
if ($vars['key'] !== 'NEW' && !$this->isCreatedByUser($vars['key'], $record)) {
|
||
... | ... | |
// check if the usergroup is allowed
|
||
$vars['usergroup'] = $this->fixUserGroup($vars['usergroup'], $record);
|
||
// check if md5 is used as password encryption
|
||
if (strpos($GLOBALS['TCA']['be_users']['columns']['password']['config']['eval'], 'md5') !== FALSE) {
|
||
if (strlen(trim($vars['password'])) > 0 AND strpos($GLOBALS['TCA']['be_users']['columns']['password']['config']['eval'], 'md5') !== FALSE) {
|
||
$vars['password'] = md5($vars['password']);
|
||
}
|
||
... | ... | |
if (is_array($beRec) && $beRec['cruser_id'] == $GLOBALS['BE_USER']->user['uid']) {
|
||
$data=array();
|
||
$data['be_users'][$key]['username'] = $this->fixUsername($vars['username'], $record['t1_userprefix']);
|
||
if (trim($vars['password'])) {
|
||
if (strlen(trim($vars['password'])) > 0) {
|
||
$data['be_users'][$key]['password'] = (trim($vars['password']));
|
||
}
|
||
... | ... | |
* @return string Combined username
|
||
*/
|
||
protected function fixUsername($username, $prefix) {
|
||
return trim($prefix) . trim($username);
|
||
if (!is_numeric(strpos($username, trim($prefix)))){
|
||
return trim($prefix) . trim($username);
|
||
}else{
|
||
return $username;
|
||
}
|
||
}
|
||
/**
|
||
... | ... | |
foreach($grList as $group) {
|
||
$checkGroup = t3lib_BEfunc::getRecord('be_groups', $group);
|
||
if (is_array($checkGroup)) {
|
||
$selected = (is_array($vars['usergroup']) && t3lib_div::inList(implode(',', $vars['usergroup']), $checkGroup['uid'])) ? ' selected="selected" ' : '';
|
||
$selected = (t3lib_div::inList($vars['usergroup'], $checkGroup['uid'])) ? ' selected="selected" ' : '';
|
||
$content .= '<option ' . $selected . 'value="' . $checkGroup['uid'] . '">' . htmlspecialchars($checkGroup['title']) . '</option>';
|
||
}
|
||
}
|
||
... | ... | |
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/sys_action/task/class.tx_sysaction_task.php']);
|
||
}
|
||
?>
|
||
?>
|