|
|
|
@ -372,6 +372,17 @@ if( $form->validate()) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$user_id = UserManager::create_user($firstname, $lastname, $status, $email, $username, $password, $official_code, $language, $phone, $picture_uri, $auth_source, $expiration_date, $active, $hr_dept_id); |
|
|
|
|
Security::clear_token(); |
|
|
|
|
$tok = Security::get_token(); |
|
|
|
|
if ($user_id === false) { |
|
|
|
|
//If any error ocurred during user creation, print it (api_failureList |
|
|
|
|
// stores values as separate words, so rework it |
|
|
|
|
$message = ''; |
|
|
|
|
$message_bits = explode(' ',array_pop($api_failureList)); |
|
|
|
|
foreach ($message_bits as $bit) { |
|
|
|
|
$message .= ucfirst($bit); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
if (!empty($picture['name'])) { |
|
|
|
|
$picture_uri = UserManager::update_user_picture($user_id, $_FILES['picture']['name'], $_FILES['picture']['tmp_name']); |
|
|
|
@ -408,15 +419,15 @@ if( $form->validate()) { |
|
|
|
|
} |
|
|
|
|
@api_mail($recipient_name, $email, $emailsubject, $emailbody, $sender_name, $email_admin); |
|
|
|
|
} |
|
|
|
|
Security::clear_token(); |
|
|
|
|
$message = get_lang('UserAdded'); |
|
|
|
|
} |
|
|
|
|
if (isset($user['submit_plus'])) { |
|
|
|
|
//we want to add more. Prepare report message and redirect to the same page (to clean the form) |
|
|
|
|
$tok = Security::get_token(); |
|
|
|
|
header('Location: user_add.php?message='.urlencode(get_lang('UserAdded')).'&sec_token='.$tok); |
|
|
|
|
header('Location: user_add.php?message='.urlencode($message).'&sec_token='.$tok); |
|
|
|
|
exit (); |
|
|
|
|
} else { |
|
|
|
|
$tok = Security::get_token(); |
|
|
|
|
header('Location: user_list.php?action=show_message&message='.urlencode(get_lang('UserAdded')).'&sec_token='.$tok); |
|
|
|
|
header('Location: user_list.php?action=show_message&message='.urlencode($message).'&sec_token='.$tok); |
|
|
|
|
exit (); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|