$id)); //Deactivate shorcut var if ($shortcut_value == 1){ db_process_sql_update('tusuario', array('shortcut' => 0), array('id_user' => $id)); } // Activate shortcut var else { db_process_sql_update('tusuario', array('shortcut' => 1), array('id_user' => $id)); } } return; } // Header ui_print_page_header (__('User detail editor'), "images/group.png", false, "", false, ""); // Update user info if (isset ($_GET["modified"]) && !$view_mode) { $upd_info = array (); $upd_info["fullname"] = get_parameter_post ("fullname", $user_info["fullname"]); $upd_info["firstname"] = get_parameter_post ("firstname", $user_info["firstname"]); $upd_info["lastname"] = get_parameter_post ("lastname", $user_info["lastname"]); $password_new = get_parameter_post ("password_new", ""); $password_confirm = get_parameter_post ("password_conf", ""); $upd_info["email"] = get_parameter_post ("email", $user_info["email"]); $upd_info["phone"] = get_parameter_post ("phone", $user_info["phone"]); $upd_info["comments"] = get_parameter_post ("comments", $user_info["comments"]); $upd_info["language"] = get_parameter_post ("language", $user_info["language"]); $upd_info["id_skin"] = get_parameter ("skin", $user_info["id_skin"]); $upd_info["block_size"] = get_parameter ("block_size", $config["block_size"]); $default_block_size = get_parameter ("default_block_size", 0); if($default_block_size) { $upd_info["block_size"] = 0; } $upd_info["flash_chart"] = get_parameter ("flash_charts", $config["flash_charts"]); $upd_info["shortcut"] = get_parameter ("shortcut_bar", 0); $upd_info["section"] = get_parameter ("section", $user_info["section"]); $upd_info["data_section"] = get_parameter ("data_section", ''); $dashboard = get_parameter('dashboard', ''); $visual_console = get_parameter('visual_console', ''); $is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $id); $section = io_safe_output($upd_info["section"]); if (($section == 'Event list') || ($section == 'Group view') || ($section == 'Alert detail') || ($section == 'Tactical view') || ($section == 'Default')) { $upd_info["data_section"] = ''; } else if ($section == 'Dashboard') { $upd_info["data_section"] = $dashboard; } else if ($section == 'Visual console') { $upd_info["data_section"] = $visual_console; } if ( !empty ($password_new)) { if ($config["user_can_update_password"] && $password_confirm == $password_new) { if ((!$is_admin || $config['enable_pass_policy_admin']) && $config['enable_pass_policy']) { $pass_ok = login_validate_pass($password_new, $id, true); if ($pass_ok != 1) { ui_print_error_message($pass_ok); } else { $return = update_user_password ($id, $password_new); if ($return) { $return2 = save_pass_history($id, $password_new); } ui_print_result_message ($return, __('Password successfully updated'), __('Error updating passwords: %s', $config['auth_error'])); } } else { $return = update_user_password ($id, $password_new); ui_print_result_message ($return, __('Password successfully updated'), __('Error updating passwords: %s', $config['auth_error'])); } } elseif ($password_new !== "NON-INIT") { ui_print_error_message (__('Passwords didn\'t match or other problem encountered while updating passwords')); } } // No need to display "error" here, because when no update is needed (no changes in data) // SQL function returns 0 (FALSE), but is not an error, just no change. Previous error // message could be confussing to the user. $return = update_user ($id, $upd_info); if ($return > 0) { ui_print_result_message ($return, __('User info successfully updated'), __('Error updating user info')); } $user_info = $upd_info; } // Prints action status for current message if ($status != -1) { ui_print_result_message ($status, __('User info successfully updated'), __('Error updating user info')); } echo '
'; echo '