|
|
|
@ -124,6 +124,7 @@ $form->applyFilter('official_code', 'trim'); |
|
|
|
|
$form->addElement('text', 'email', get_lang('Email'), array('size' => '40')); |
|
|
|
|
$form->addRule('email', get_lang('EmailWrong'), 'email'); |
|
|
|
|
$form->addRule('email', get_lang('EmailWrong'), 'required'); |
|
|
|
|
|
|
|
|
|
if (api_get_setting('login_is_email') == 'true') { |
|
|
|
|
$form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH); |
|
|
|
|
$form->addRule('email', get_lang('UserTaken'), 'username_available', $user_data['username']); |
|
|
|
@ -156,8 +157,7 @@ if (api_get_setting('login_is_email') == 'true') { |
|
|
|
|
|
|
|
|
|
// Password |
|
|
|
|
$form->addElement('radio', 'reset_password', get_lang('Password'), get_lang('DontResetPassword'), 0); |
|
|
|
|
if (count($extAuthSource) > 0) |
|
|
|
|
{ |
|
|
|
|
if (count($extAuthSource) > 0) { |
|
|
|
|
$group[] =& HTML_QuickForm::createElement('radio', 'reset_password', null, get_lang('ExternalAuthentication').' ', 3); |
|
|
|
|
$auth_sources = array(); |
|
|
|
|
foreach($extAuthSource as $key => $info) { |
|
|
|
@ -315,6 +315,7 @@ $form->addElement('style_submit_button', 'submit', get_lang('ModifyInformation') |
|
|
|
|
// Set default values |
|
|
|
|
$user_data['reset_password'] = 0; |
|
|
|
|
$expiration_date = $user_data['expiration_date']; |
|
|
|
|
|
|
|
|
|
if ($expiration_date == '0000-00-00 00:00:00') { |
|
|
|
|
$user_data['radio_expiration_date'] = 0; |
|
|
|
|
$user_data['expiration_date'] = array(); |
|
|
|
@ -346,8 +347,7 @@ if ( $form->validate()) { |
|
|
|
|
$picture_uri = $user_data['picture_uri']; |
|
|
|
|
if ($user['delete_picture']) { |
|
|
|
|
$picture_uri = UserManager::delete_user_picture($user_id); |
|
|
|
|
} |
|
|
|
|
elseif (!empty($picture['name'])) { |
|
|
|
|
} elseif (!empty($picture['name'])) { |
|
|
|
|
$picture_uri = UserManager::update_user_picture($user_id, $_FILES['picture']['name'], $_FILES['picture']['tmp_name']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -373,16 +373,13 @@ if ( $form->validate()) { |
|
|
|
|
if ($reset_password == 0) { |
|
|
|
|
$password = null; |
|
|
|
|
$auth_source = $user_data['auth_source']; |
|
|
|
|
} |
|
|
|
|
elseif($reset_password == 1) { |
|
|
|
|
} elseif($reset_password == 1) { |
|
|
|
|
$password = api_generate_password(); |
|
|
|
|
$auth_source = PLATFORM_AUTH_SOURCE; |
|
|
|
|
} |
|
|
|
|
elseif($reset_password == 2) { |
|
|
|
|
} elseif($reset_password == 2) { |
|
|
|
|
$password = $user['password']; |
|
|
|
|
$auth_source = PLATFORM_AUTH_SOURCE; |
|
|
|
|
} |
|
|
|
|
elseif($reset_password == 3) { |
|
|
|
|
} elseif($reset_password == 3) { |
|
|
|
|
$password = $user['password']; |
|
|
|
|
$auth_source = $user['auth_source']; |
|
|
|
|
} |
|
|
|
|