|
|
|
|
@ -1,8 +1,10 @@ |
|
|
|
|
<?php |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @package chamilo.admin |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
$cidReset = true; |
|
|
|
|
// Including necessary libraries. |
|
|
|
|
require_once __DIR__.'/../inc/global.inc.php'; |
|
|
|
|
@ -291,7 +293,6 @@ $form->addElement('radio', 'active', '', get_lang('Inactive'), 0); |
|
|
|
|
|
|
|
|
|
$extraField = new ExtraField('user'); |
|
|
|
|
$returnParams = $extraField->addElements($form); |
|
|
|
|
|
|
|
|
|
$jquery_ready_content = $returnParams['jquery_ready_content']; |
|
|
|
|
|
|
|
|
|
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function |
|
|
|
|
@ -328,6 +329,7 @@ if ($form->validate()) { |
|
|
|
|
$check = Security::check_token('post'); |
|
|
|
|
if ($check) { |
|
|
|
|
$user = $form->exportValues(); |
|
|
|
|
|
|
|
|
|
$lastname = $user['lastname']; |
|
|
|
|
$firstname = $user['firstname']; |
|
|
|
|
$official_code = $user['official_code']; |
|
|
|
|
@ -358,7 +360,6 @@ if ($form->validate()) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$active = intval($user['active']); |
|
|
|
|
|
|
|
|
|
if (api_get_setting('login_is_email') == 'true') { |
|
|
|
|
$username = $email; |
|
|
|
|
} |
|
|
|
|
@ -425,17 +426,21 @@ if ($form->validate()) { |
|
|
|
|
$extraFieldValues = new ExtraFieldValue('user'); |
|
|
|
|
$user['item_id'] = $user_id; |
|
|
|
|
$extraFieldValues->saveFieldValues($user); |
|
|
|
|
$message = get_lang('UserAdded'); |
|
|
|
|
$message = get_lang('UserAdded').': '. |
|
|
|
|
Display::url( |
|
|
|
|
api_get_person_name($firstname, $lastname), |
|
|
|
|
api_get_path(WEB_CODE_PATH).'admin/user_edit.php?user_id='.$user_id |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isset($user['submit_plus'])) { |
|
|
|
|
Display::addFlash(Display::return_message($message, 'normal', false)); |
|
|
|
|
|
|
|
|
|
if (isset($_POST['submit_plus'])) { |
|
|
|
|
//we want to add more. Prepare report message and redirect to the same page (to clean the form) |
|
|
|
|
Display::addFlash(Display::return_message($message)); |
|
|
|
|
header('Location: user_add.php?sec_token='.$tok); |
|
|
|
|
exit; |
|
|
|
|
} else { |
|
|
|
|
$tok = Security::get_token(); |
|
|
|
|
Display::addFlash(Display::return_message($message)); |
|
|
|
|
header('Location: user_list.php?sec_token='.$tok); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
|