|
|
|
@ -60,6 +60,9 @@ class UserManager |
|
|
|
|
* @param int The department of HR in which the user is registered (optional, defaults to 0) |
|
|
|
|
* @param array Extra fields |
|
|
|
|
* @param string Encrypt method used if password is given encrypted. Set to an empty string by default |
|
|
|
|
* @param bool $send_mail |
|
|
|
|
* @param bool $isAdmin |
|
|
|
|
* |
|
|
|
|
* @return mixed new user id - if the new user creation succeeds, false otherwise |
|
|
|
|
* @desc The function tries to retrieve user id from the session. |
|
|
|
|
* If it exists, the current user id is the creator id. If a problem arises, |
|
|
|
@ -84,7 +87,8 @@ class UserManager |
|
|
|
|
$hr_dept_id = 0, |
|
|
|
|
$extra = null, |
|
|
|
|
$encrypt_method = '', |
|
|
|
|
$send_mail = false |
|
|
|
|
$send_mail = false, |
|
|
|
|
$isAdmin = false |
|
|
|
|
) { |
|
|
|
|
$currentUserId = api_get_user_id(); |
|
|
|
|
$hook = HookCreateUser::create(); |
|
|
|
@ -206,6 +210,10 @@ class UserManager |
|
|
|
|
$sql = "UPDATE $table_user SET user_id = $return WHERE id = $return"; |
|
|
|
|
Database::query($sql); |
|
|
|
|
|
|
|
|
|
if ($isAdmin) { |
|
|
|
|
UserManager::add_user_as_admin($userId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (api_get_multiple_access_url()) { |
|
|
|
|
UrlManager::add_user_to_url($return, api_get_current_access_url_id()); |
|
|
|
|
} else { |
|
|
|
|