} } unset($configToolError); } if ($configError) { $display = DISP_RUN_INSTALL_NOT_COMPLETE; } /** * Add administrator in user and admin table */ include_once $newIncludePath . 'lib/user.lib.php'; $user_data['lastname'] = $adminNameForm; $user_data['firstname'] = $adminSurnameForm; $user_data['username'] = $loginForm; $user_data['password'] = $passForm; $user_data['email'] = $adminEmailForm; $user_data['language'] = ''; $user_data['isCourseCreator'] = 1; $user_data['officialCode'] = ''; $user_data['officialEmail'] = ''; $user_data['phone'] = ''; $id_admin = user_create($user_data); if ($id_admin) { user_set_platform_admin(true, $id_admin); } else { echo 'error in admin account creation'; } } } catch (Exception $e) { die("AN EXCEPTION OCCURED : " . $e->getMessage()); }
if (empty($user_data['password'])) { unset($user_data['password']); } user_set_properties($userId, $user_data); // if no error update use setting if ($userId == claro_get_current_user_id()) { $uidReset = true; include get_path('incRepositorySys') . '/claro_init_local.inc.php'; } //$classMsg = 'success'; $dialogBox->success(get_lang('Changes have been applied to the user settings')); // set user admin parameter if ($user_data['is_admin']) { user_set_platform_admin(true, $userId); } else { user_set_platform_admin(false, $userId); } //$messageList[] = get_lang('Changes have been applied to the user settings'); } else { // $error = true; $dialogBox->error(get_lang('Changes have not been applied to the user settings')); foreach ($messageList as $message) { $dialogBox->error($message); } } } // if apply changes /** * PREPARE DISPLAY */ // Prepend in reverse order !!!