'Gray', 'blue-marble' => 'Blue marble', 'night-electric' => 'Night Electric', 'living' => 'Living Earth', ]; $local_file = 'include/javascript/timezonepicker/images/gray-400.png'; // Dimensions must always be exact since the imagemap does not scale. $array_size = getimagesize($local_file); $map_width = $array_size[0]; $map_height = $array_size[1]; $timezones = timezone_picker_parse_files( $map_width, $map_height, 'include/javascript/timezonepicker/tz_world.txt', 'include/javascript/timezonepicker/tz_islands.txt' ); foreach ($timezones as $timezone_name => $tz) { if ($timezone_name == 'America/Montreal') { $timezone_name = 'America/Toronto'; } else if ($timezone_name == 'Asia/Chongqing') { $timezone_name = 'Asia/Shanghai'; } $area_data_timezone_polys .= ''; foreach ($tz['polys'] as $coords) { $area_data_timezone_polys .= ''; } $area_data_timezone_rects .= ''; foreach ($tz['rects'] as $coords) { $area_data_timezone_rects .= ''; } } } // This defines the working user. Beware with this, old code get confusses // and operates with current logged user (dangerous). $id = get_parameter('id', get_parameter('id_user', '')); // ID given as parameter $pure = get_parameter('pure', 0); $user_info = get_user_info($id); $is_err = false; if (! check_acl($config['id_user'], 0, 'UM')) { db_pandora_audit( 'ACL Violation', 'Trying to access User Management' ); include 'general/noaccess.php'; return; } if (is_ajax()) { $delete_profile = (bool) get_parameter('delete_profile'); if ($delete_profile) { $id2 = (string) get_parameter('id_user'); $id_up = (int) get_parameter('id_user_profile'); $perfilUser = db_get_row('tusuario_perfil', 'id_up', $id_up); $id_perfil = $perfilUser['id_perfil']; $perfil = db_get_row('tperfil', 'id_perfil', $id_perfil); db_pandora_audit( 'User management', 'Deleted profile for user '.io_safe_output($id2), false, false, 'The profile with id '.$id_perfil.' in the group '.$perfilUser['id_grupo'] ); $return = profile_delete_user_profile($id2, $id_up); ui_print_result_message( $return, __('Successfully deleted'), __('Could not be deleted') ); $has_profile = db_get_row('tusuario_perfil', 'id_usuario', $id2); if ($has_profile == false) { $result = delete_user($id2); if ($result) { db_pandora_audit( 'User management', __('Deleted user %s', io_safe_output($id_user)) ); } ui_print_result_message( $result, __('Successfully deleted'), __('There was a problem deleting the user') ); // Delete the user in all the consoles if (defined('METACONSOLE')) { $servers = metaconsole_get_servers(); foreach ($servers as $server) { // Connect to the remote console metaconsole_connect($server); // Delete the user $result = delete_user($id_user); if ($result) { db_pandora_audit( 'User management', __('Deleted user %s from metaconsole', io_safe_output($id_user)) ); } // Restore the db connection metaconsole_restore_db(); // Log to the metaconsole too if ($result) { db_pandora_audit( 'User management', __('Deleted user %s from %s', io_safe_input($id_user), io_safe_input($server['server_name'])) ); } ui_print_result_message( $result, __('Successfully deleted from %s', io_safe_input($server['server_name'])), __('There was a problem deleting the user from %s', io_safe_input($server['server_name'])) ); } } } return; } } $tab = get_parameter('tab', 'user'); if ($id) { $header_title = ' » '.__('Update user'); } else { $header_title = ' » '.__('Create user'); } // Header if ($meta) { user_meta_print_header(); $sec = 'advanced'; } else { $buttons = [ 'user' => [ 'active' => false, 'text' => ''.html_print_image( 'images/user.png', true, [ 'title' => __('User management'), 'class' => 'invert_filter', ] ).'', ], 'profile' => [ 'active' => false, 'text' => ''.html_print_image( 'images/profiles.png', true, [ 'title' => __('Profile management'), 'class' => 'invert_filter', ] ).'', ], ]; $buttons[$tab]['active'] = true; ui_print_page_header( __('User detail editor').$header_title, 'images/gm_users.png', false, '', true, $buttons ); $sec = 'gusuarios'; } if ($config['user_can_update_info']) { $view_mode = false; } else { $view_mode = true; } $new_user = (bool) get_parameter('new_user'); $create_user = (bool) get_parameter('create_user'); $add_profile = (bool) get_parameter('add_profile'); $update_user = (bool) get_parameter('update_user'); $status = get_parameter('status', -1); $json_profile = get_parameter('json_profile', ''); // Reset status var if current action is not update_user if ($new_user || $create_user || $add_profile || $delete_profile || $update_user ) { $status = -1; } if ($new_user && $config['admin_can_add_user']) { $user_info = []; $id = ''; $user_info['fullname'] = ''; $user_info['firstname'] = ''; $user_info['lastname'] = ''; $user_info['email'] = ''; $user_info['phone'] = ''; $user_info['comments'] = ''; $user_info['is_admin'] = 0; $user_info['language'] = 'default'; $user_info['timezone'] = ''; $user_info['not_login'] = false; $user_info['strict_acl'] = false; $user_info['session_time'] = 0; $user_info['middlename'] = 0; if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { $user_info['id_skin'] = ''; } $user_info['section'] = ''; $user_info['data_section'] = ''; // This attributes are inherited from global configuration $user_info['block_size'] = $config['block_size']; if (enterprise_installed() && defined('METACONSOLE')) { $user_info['metaconsole_agents_manager'] = 0; $user_info['metaconsole_assigned_server'] = ''; $user_info['metaconsole_access_node'] = 0; } if ($config['ehorus_user_level_conf']) { $user_info['ehorus_user_level_user'] = ''; $user_info['ehorus_user_level_pass'] = ''; $user_info['ehorus_user_level_enabled'] = true; } } if ($create_user) { if (! $config['admin_can_add_user']) { ui_print_error_message(__('The current authentication scheme doesn\'t support creating users on %s', get_product_name())); return; } if (html_print_csrf_error()) { return; } $user_is_admin = (int) get_parameter('is_admin', 0); $values = []; $values['id_user'] = (string) get_parameter('id_user'); $values['fullname'] = (string) get_parameter('fullname'); $values['firstname'] = (string) get_parameter('firstname'); $values['lastname'] = (string) get_parameter('lastname'); $password_new = (string) get_parameter('password_new', ''); $password_confirm = (string) get_parameter('password_confirm', ''); $values['email'] = (string) get_parameter('email'); $values['phone'] = (string) get_parameter('phone'); $values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments')))); $values['is_admin'] = $user_is_admin; $values['language'] = get_parameter('language', 'default'); $values['timezone'] = (string) get_parameter('timezone'); $values['default_event_filter'] = (int) get_parameter('default_event_filter'); $values['default_custom_view'] = (int) get_parameter('default_custom_view'); $dashboard = get_parameter('dashboard', ''); $visual_console = get_parameter('visual_console', ''); if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { $values['id_skin'] = (int) get_parameter('skin', 0); } $values['block_size'] = (int) get_parameter('block_size', $config['block_size']); $values['section'] = get_parameter('section'); if (($values['section'] == 'Event list') || ($values['section'] == 'Group view') || ($values['section'] == 'Alert detail') || ($values['section'] == 'Tactical view') || ($values['section'] == 'Default')) { $values['data_section'] = ''; } else if ($values['section'] == 'Dashboard') { $values['data_section'] = $dashboard; } else if (io_safe_output($values['section']) == 'Visual console') { $values['data_section'] = $visual_console; } else if ($values['section'] == 'Other' || io_safe_output($values['section']) == 'External link') { $values['data_section'] = get_parameter('data_section'); } if (enterprise_installed()) { $values['force_change_pass'] = 1; $values['last_pass_change'] = date('Y/m/d H:i:s', get_system_time()); if (defined('METACONSOLE')) { $values['metaconsole_access'] = get_parameter('metaconsole_access', 'basic'); $values['metaconsole_agents_manager'] = ($user_is_admin == 1 ? 1 : get_parameter('metaconsole_agents_manager', '0')); $values['metaconsole_assigned_server'] = get_parameter('metaconsole_assigned_server', ''); $values['metaconsole_access_node'] = ($user_is_admin == 1 ? 1 : get_parameter('metaconsole_access_node', '0')); } } $values['not_login'] = (bool) get_parameter('not_login', false); $values['middlename'] = get_parameter('middlename', 0); $values['strict_acl'] = (bool) get_parameter('strict_acl', false); $values['session_time'] = (int) get_parameter('session_time', 0); // eHorus user level conf if ($config['ehorus_user_level_conf']) { $values['ehorus_user_level_enabled'] = (bool) get_parameter('ehorus_user_level_enabled', false); if ($values['ehorus_user_level_enabled'] === true) { $values['ehorus_user_level_user'] = (string) get_parameter('ehorus_user_level_user'); $values['ehorus_user_level_pass'] = (string) get_parameter('ehorus_user_level_pass'); } else { $values['ehorus_user_level_user'] = null; $values['ehorus_user_level_pass'] = null; } } if ($id == '') { ui_print_error_message(__('User ID cannot be empty')); $is_err = true; $user_info = $values; $password_new = ''; $password_confirm = ''; $new_user = true; } else if (preg_match('/^\s+|\s+$/', io_safe_output($id))) { ui_print_error_message(__('Invalid user ID: leading or trailing blank spaces not allowed')); $is_err = true; $user_info = $values; $password_new = ''; $password_confirm = ''; $new_user = true; } else if ($password_new == '') { $is_err = true; ui_print_error_message(__('Passwords cannot be empty')); $user_info = $values; $password_new = ''; $password_confirm = ''; $new_user = true; } else if ($password_new != $password_confirm) { $is_err = true; ui_print_error_message(__('Passwords didn\'t match')); $user_info = $values; $password_new = ''; $password_confirm = ''; $new_user = true; } else { if ((!is_user_admin($config['id_user']) || $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 { $result = create_user($id, $password_new, $values); } } else { $result = create_user($id, $password_new, $values); } $info = '{"Id_user":"'.$values['id_user'].'","FullName":"'.$values['fullname'].'","Firstname":"'.$values['firstname'].'","Lastname":"'.$values['lastname'].'","Email":"'.$values['email'].'","Phone":"'.$values['phone'].'","Comments":"'.$values['comments'].'","Is_admin":"'.$values['is_admin'].'","Language":"'.$values['language'].'","Timezone":"'.$values['timezone'].'","Block size":"'.$values['block_size'].'"'; if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { $info .= ',"Skin":"'.$values['id_skin'].'"}'; } else { $info .= '}'; } $can_create = false; if ($result) { $res = save_pass_history($id, $password_new); } db_pandora_audit( 'User management', 'Created user '.io_safe_output($id), false, false, $info ); ui_print_result_message( $result, __('Successfully created'), __('Could not be created') ); $password_new = ''; $password_confirm = ''; if ($result) { if ($values['strict_acl']) { if ($values['is_admin']) { ui_print_info_message(__('Strict ACL is not recommended for admin users because performance could be affected.')); } } $user_info = get_user_info($id); $new_user = false; if (!empty($json_profile)) { $json_profile = json_decode(io_safe_output($json_profile), true); foreach ($json_profile as $key => $profile) { if (!empty($profile)) { $group2 = $profile['group']; $profile2 = $profile['profile']; $tags = $profile['tags']; foreach ($tags as $k => $tag) { if (empty($tag)) { unset($tags[$k]); } } $tags = implode(',', $tags); $no_hierarchy = $profile['hierarchy']; db_pandora_audit( 'User management', 'Added profile for user '.io_safe_output($id2), false, false, 'Profile: '.$profile2.' Group: '.$group2.' Tags: '.$tags ); $result_profile = profile_create_user_profile($id, $profile2, $group2, false, $tags, $no_hierarchy); ui_print_result_message( $result_profile, __('Profile added successfully'), __('Profile cannot be added') ); } } } } else { $user_info = $values; $new_user = true; } } } if ($update_user) { if (html_print_csrf_error()) { return; } $values = []; $values['id_user'] = (string) get_parameter('id_user'); $values['fullname'] = (string) get_parameter('fullname'); $values['firstname'] = (string) get_parameter('firstname'); $values['lastname'] = (string) get_parameter('lastname'); $values['email'] = (string) get_parameter('email'); $values['phone'] = (string) get_parameter('phone'); $values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments')))); $values['is_admin'] = get_parameter('is_admin', 0); $values['language'] = (string) get_parameter('language'); $values['timezone'] = (string) get_parameter('timezone'); $values['default_event_filter'] = (int) get_parameter('default_event_filter'); $values['default_custom_view'] = (int) get_parameter('default_custom_view'); // eHorus user level conf. $values['ehorus_user_level_enabled'] = (bool) get_parameter('ehorus_user_level_enabled', false); $values['ehorus_user_level_user'] = (string) get_parameter('ehorus_user_level_user'); $values['ehorus_user_level_pass'] = (string) get_parameter('ehorus_user_level_pass'); $values['middlename'] = get_parameter('middlename', 0); $dashboard = get_parameter('dashboard', ''); $visual_console = get_parameter('visual_console', ''); if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { $values['id_skin'] = get_parameter('skin', 0); } $values['block_size'] = get_parameter('block_size', $config['block_size']); $values['section'] = get_parameter('section'); if (($values['section'] == 'Event list') || ($values['section'] == 'Group view') || ($values['section'] == 'Alert detail') || ($values['section'] == 'Tactical view') || ($values['section'] == 'Default')) { $values['data_section'] = ''; } else if ($values['section'] == 'Dashboard') { $values['data_section'] = $dashboard; } else if (io_safe_output($values['section']) == 'Visual console') { $values['data_section'] = $visual_console; } else if ($values['section'] == 'Other' || io_safe_output($values['section']) == 'External link') { $values['data_section'] = get_parameter('data_section'); } if (enterprise_installed() && defined('METACONSOLE')) { $values['metaconsole_access'] = get_parameter('metaconsole_access'); $values['metaconsole_agents_manager'] = get_parameter('metaconsole_agents_manager', '0'); $values['metaconsole_assigned_server'] = get_parameter('metaconsole_assigned_server', ''); $values['metaconsole_access_node'] = get_parameter('metaconsole_access_node', '0'); } $values['not_login'] = (bool) get_parameter('not_login', false); $values['strict_acl'] = (bool) get_parameter('strict_acl', false); $values['session_time'] = (int) get_parameter('session_time', 0); $res1 = update_user($id, $values); if ($config['user_can_update_password']) { $password_new = (string) get_parameter('password_new', ''); $password_confirm = (string) get_parameter('password_confirm', ''); $own_password_confirm = (string) get_parameter('own_password_confirm', ''); if ($password_new != '') { $correct_password = false; $user_credentials_check = process_user_login($config['id_user'], $own_password_confirm, true); if ($user_credentials_check !== false) { $correct_password = true; } if ($password_confirm == $password_new) { if ($correct_password === true || is_user_admin($config['id_user'])) { if ((!is_user_admin($config['id_user']) || $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 { $res2 = update_user_password($id, $password_new); if ($res2) { db_process_sql_insert( 'tsesion', [ 'id_sesion' => '', 'id_usuario' => $id, 'ip_origen' => $_SERVER['REMOTE_ADDR'], 'accion' => 'Password change', 'descripcion' => 'Access password updated', 'fecha' => date('Y-m-d H:i:s'), 'utimestamp' => time(), ] ); $res3 = save_pass_history($id, $password_new); } ui_print_result_message( $res1 || $res2, __('User info successfully updated'), __('Error updating user info (no change?)') ); } } else { $res2 = update_user_password($id, $password_new); if ($res2) { $res3 = save_pass_history($id, $password_new); db_process_sql_insert( 'tsesion', [ 'id_sesion' => '', 'id_usuario' => $id, 'ip_origen' => $_SERVER['REMOTE_ADDR'], 'accion' => 'Password change', 'descripcion' => 'Access password updated', 'fecha' => date('Y-m-d H:i:s'), 'utimestamp' => time(), ] ); } ui_print_result_message( $res1 || $res2, __('User info successfully updated'), __('Error updating user info (no change?)') ); } } else { if ($own_password_confirm === '') { ui_print_error_message(__('Password of the active user is required to perform password change')); } else { ui_print_error_message(__('Password of active user is not correct')); } } } else { db_process_sql_insert( 'tsesion', [ 'id_sesion' => '', 'id_usuario' => $id, 'ip_origen' => $_SERVER['REMOTE_ADDR'], 'accion' => 'Password change', 'descripcion' => 'Access password update failed', 'fecha' => date('Y-m-d H:i:s'), 'utimestamp' => time(), ] ); ui_print_error_message(__('Passwords does not match')); } } else { $has_skin = false; $has_wizard = false; $info = '{"id_user":"'.$values['id_user'].'", "FullName":"'.$values['fullname'].'", "Firstname":"'.$values['firstname'].'", "Lastname":"'.$values['lastname'].'", "Email":"'.$values['email'].'", "Phone":"'.$values['phone'].'", "Comments":"'.$values['comments'].'", "Is_admin":"'.$values['is_admin'].'", "Language":"'.$values['language'].'", "Timezone":"'.$values['timezone'].'", "Block size":"'.$values['block_size'].'", "Section":"'.$values['section'].'"'; if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { $info .= ',"Skin":"'.$values['id_skin'].'"'; $has_skin = true; } if (enterprise_installed() && defined('METACONSOLE')) { $info .= ',"Wizard access":"'.$values['metaconsole_access'].'"}'; $has_wizard = true; } else if ($has_skin) { $info .= '}'; } if (!$has_skin && !$has_wizard) { $info .= '}'; } db_pandora_audit( 'User management', 'Updated user '.io_safe_output($id), false, false, $info ); ui_print_result_message( $res1, __('User info successfully updated'), __('Error updating user info (no change?)') ); } } else { ui_print_result_message( $res1, __('User info successfully updated'), __('Error updating user info (no change?)') ); } if ($values['strict_acl']) { $count_groups = 0; $count_tags = 0; $profiles = db_get_all_rows_field_filter('tusuario_perfil', 'id_usuario', $id); if ($profiles === false) { $profiles = []; } foreach ($profiles as $profile) { $count_groups = ($count_groups + 1); $arr_tags = explode(',', $profile['tags']); $count_tags = ($count_tags + count($arr_tags)); } if (($count_groups > 3) && ($count_tags > 10)) { ui_print_info_message(__('Strict ACL is not recommended for this user. Performance could be affected.')); } } $user_info = $values; } if ($status != -1) { ui_print_result_message( $status, __('User info successfully updated'), __('Error updating user info (no change?)') ); } if ($add_profile && empty($json_profile)) { $id2 = (string) get_parameter('id'); $group2 = (int) get_parameter('assign_group'); $profile2 = (int) get_parameter('assign_profile'); $tags = (array) get_parameter('assign_tags'); $no_hierarchy = (int) get_parameter('no_hierarchy', 0); foreach ($tags as $k => $tag) { if (empty($tag)) { unset($tags[$k]); } } $tags = implode(',', $tags); db_pandora_audit( 'User management', 'Added profile for user '.io_safe_output($id2), false, false, 'Profile: '.$profile2.' Group: '.$group2.' Tags: '.$tags ); $return = profile_create_user_profile($id2, $profile2, $group2, false, $tags, $no_hierarchy); ui_print_result_message( $return, __('Profile added successfully'), __('Profile cannot be added') ); } if ($values) { $user_info = $values; } if (!users_is_admin() && $config['id_user'] != $id && !$new_user) { $group_um = users_get_groups_UM($config['id_user']); if (isset($group_um[0])) { $group_um_string = implode(',', array_keys(users_get_groups($config['id_user'], 'um', true))); } else { $group_um_string = implode(',', array_keys($group_um)); } $sql = sprintf( "SELECT tusuario_perfil.* FROM tusuario_perfil INNER JOIN tperfil ON tperfil.id_perfil = tusuario_perfil.id_perfil WHERE id_usuario like '%s' AND id_grupo IN (%s) AND user_management = 1", $config['id_user'], $group_um_string ); $result = db_get_all_rows_sql($sql); if ($result == false && $user_info['is_admin'] == false) { db_pandora_audit( 'ACL Violation', 'Trying to access User Management' ); include 'general/noaccess.php'; return; } } if (defined('METACONSOLE')) { if ($id) { echo '
'.__('User ID').':
'; $user_id .= ''.$id.''; $user_id .= html_print_input_hidden('id_user', $id, true); $user_id .= ''.__('Language').'
'; $language .= html_print_select_from_sql( 'SELECT id_language, name FROM tlanguage', 'language', $user_info['language'], '', __('Default'), 'default', true ).''.__('Timezone').ui_print_help_tip( __('The timezone must be that of the associated server.'), true ).'
'; $timezone .= html_print_timezone_select('timezone', $user_info['timezone']).''.__('Comments').'
'; $comments .= html_print_textarea( 'comments', 2, 65, $user_info['comments'], ($view_mode ? 'readonly="readonly"' : ''), true ); // If we want to create a new user, skins displayed are the skins of the creator's group. If we want to update, skins displayed are the skins of the modified user. $own_info = get_user_info($config['id_user']); if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { $display_all_group = true; } else { $display_all_group = false; } if ($new_user) { $usr_groups = (users_get_groups($config['id_user'], 'AR', $display_all_group)); $id_usr = $config['id_user']; } else { $usr_groups = (users_get_groups($id, 'AR', $display_all_group)); $id_usr = $id; } if (!$meta) { // User only can change skins if has more than one group if (count($usr_groups) > 1) { if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { $skin = ''.__('Skin').'
'; $skin .= skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true).''.__('Search custom field view').' '.ui_print_help_tip(__('Load by default the selected view in custom field view'), true).'
'; $search_custom_fields_view .= html_print_select( $array_filters, 'default_custom_view', $user_info['default_custom_view'], '', __('None'), 0, true, false, true, '', false ).''.__('Home screen').ui_print_help_tip( __('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'), true ).'
'; ; $values = [ 'Default' => __('Default'), 'Visual console' => __('Visual console'), 'Event list' => __('Event list'), 'Group view' => __('Group view'), 'Tactical view' => __('Tactical view'), 'Alert detail' => __('Alert detail'), 'External link' => __('External link'), 'Other' => __('Other'), ]; if (!is_metaconsole()) { $values['Dashboard'] = __('Dashboard'); } $home_screen .= html_print_select( $values, 'section', io_safe_output($user_info['section']), 'show_data_section();', '', -1, true, false, false ).''.__('Block size for pagination').'
'; $size_pagination .= html_print_input_text( 'block_size', $user_info['block_size'], '', 5, 5, true ).''.__('Metaconsole access').' './* ui_print_help_icon('meta_access', true). */'
'; $metaconsole_accesses = [ 'basic' => __('Basic'), 'advanced' => __('Advanced'), ]; $meta_access .= html_print_select( $metaconsole_accesses, 'metaconsole_access', $user_info_metaconsole_access, '', '', -1, true, false, false ).''.__('Not Login').'
'; $not_login .= ui_print_help_tip( __('The user with not login set only can access to API.'), true ); $not_login .= html_print_checkbox_switch( 'not_login', 1, $user_info['not_login'], true ).''.__('Session Time'); $session_time .= ui_print_help_tip( __('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'), true ).'
'; $session_time .= html_print_input_text( 'session_time', $user_info['session_time'], '', 5, 5, true.false, false, '', 'class="input_line_small"' ).''.__('Default event filter').'
'; $default_event_filter .= html_print_select( $event_filter, 'default_event_filter', $user_info['default_event_filter'], '', '', __('None'), true, false, false ).''.__('Disabled newsletter').'
'; if ($user_info['middlename'] >= 0) { $middlename = false; } else { $middlename = true; } $newsletter .= html_print_checkbox_switch( 'middlename', -1, $middlename, true ).''.__('eHorus user access enabled').'
'; $ehorus .= html_print_checkbox_switch( 'ehorus_user_level_enabled', 1, $user_info['ehorus_user_level_enabled'], true ).''.__('eHorus user').'
'; $ehorus .= html_print_input_text( 'ehorus_user_level_user', $user_info['ehorus_user_level_user'], '', 15, 45, true ).''.__('eHorus password').'
'; $ehorus .= html_print_input_password( 'ehorus_user_level_pass', io_output_password($user_info['ehorus_user_level_pass']), '', 15, 45, true ).''.__('Double authentication').'
'; if (($config['2FA_all_users'] == '' && !$double_auth_enabled) || ($config['double_auth_enabled'] == '' && $double_auth_enabled) || check_acl($config['id_user'], 0, 'PM') ) { if ($new_user === false) { $double_authentication .= html_print_checkbox_switch('double_auth', 1, $double_auth_enabled, true); } else { $double_authentication .= ui_print_help_tip(__('User must be created before activating double authentication.'), true); } } // Dialog. $double_authentication .= ''.__('Enable agents managment').'
'; $metaconsole_agents_manager .= html_print_checkbox_switch( 'metaconsole_agents_manager', 1, $user_info['metaconsole_agents_manager'], true ).''.__('Assigned node').ui_print_help_tip(__('Server where the agents created of this user will be placed'), true).'
'; $servers = metaconsole_get_servers(); $servers_for_select = []; foreach ($servers as $server) { $servers_for_select[$server['id']] = $server['server_name']; } $metaconsole_assigned_server .= html_print_select($servers_for_select, 'metaconsole_assigned_server', $user_info['metaconsole_assigned_server'], '', '', -1, true, false, false).''.__('Enable node access').ui_print_help_tip(__('With this option enabled, the user will can access to nodes console'), true).'
'; $metaconsole_access_node .= html_print_checkbox( 'metaconsole_access_node', 1, $user_info['metaconsole_access_node'], true ).'