'.__('metaconsole').''; } else { $url = __('any node'); } ui_print_warning_message( __( 'This node is configured with centralized mode. All profiles user information is read only. Go to %s to manage it.', $url ) ); return; } if (is_metaconsole() === true) { include_once $config['homedir'].'/include/functions_visual_map.php'; } $edit_users = (int) get_parameter('edit_users'); if ($edit_users === 1) { $users = get_parameter('id_users', false, false); if ($users !== false) { $update = []; $language = (string) get_parameter('language', '-1'); if ($language !== '-1') { $update['language'] = $language; } $block_size_change = (int) get_parameter('block_size_change'); if ($block_size_change === 0) { $block_size = (int) get_parameter('block_size', -1); if ($block_size !== -1) { $update['block_size'] = $block_size; } } $section = get_parameter('section', '-1'); if ($section !== '-1') { $update['section'] = $section; } $data_section = get_parameter('data_section', ''); $dashboard = get_parameter('dashboard', ''); $visual_console = get_parameter('visual_console', ''); $section = io_safe_output($section); if (($section === 'Event list') || ($section === 'Group view') || ($section === 'Alert detail') || ($section === 'Tactical view') || ($section === 'Default') ) { $update['data_section'] = ''; } else if ($section === 'Dashboard') { $update['data_section'] = $dashboard; } else if ($section === 'Visual console') { $update['data_section'] = $visual_console; } $event = (int) get_parameter('event_filter', -1); if ($event !== -1) { $update['default_event_filter'] = $event; } $autorefresh_list = get_parameter_post('autorefresh_list', [0 => '-1']); if ($autorefresh_list[0] !== '-1') { if (($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')) { $update['autorefresh_white_list'] = ''; } else { $update['autorefresh_white_list'] = json_encode($autorefresh_list); } } $time_autorefresh = (int) get_parameter('time_autorefresh', -1); if ($time_autorefresh !== -1) { $update['time_autorefresh'] = $time_autorefresh; } $timezone = (string) get_parameter('timezone', '-1'); if ($timezone !== '-1') { $update['timezone'] = $timezone; } $disabled = (int) get_parameter('disabled', -1); if ($disabled !== -1) { $update['disabled'] = $disabled; } $error = []; $success = []; foreach ($users as $key => $user) { if (empty($update) === false) { $result = update_user($user, $update); if ($result === false) { $error[] = $user; } else { $success[] = $user; } } else { $error[] = $user; } } if (empty($success) === false) { ui_print_success_message( __( 'Users updated successfully (%s)', implode( ',', $success ) ) ); } if (empty($error) === false) { ui_print_error_message( __( 'Users cannot be updated (%s)', implode(',', $error) ) ); } } } if (is_metaconsole() === false) { include 'include/javascript/timezonepicker/includes/parser.inc'; // Read in options for map builder. $bases = [ 'gray' => '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' ); } $get_users = get_users(); $users = []; if (empty($get_users) === false) { foreach ($get_users as $key => $value) { $users[$key] = $key; } } $users_div = '

'.__('Users').'

'; $users_div .= html_print_select( $users, 'id_users[]', 0, false, '', '', true, true, true, '', false, '', false, false, false, '', false, false, false, false, true, true, true ).'
'; echo '
'; echo '
'; echo '
'.$users_div.'
'; echo '
'; // Language. $language_db = db_get_all_rows_sql('SELECT id_language, name FROM tlanguage'); array_unshift($language_db, ['id_language' => 'default', 'name' => __('Default')]); $language_list = []; foreach ($language_db as $key => $value) { $language_list[$value['id_language']] = $value['name']; } $language = '

'.__('Language').'

'; $language .= html_print_select( $language_list, 'language', '', '', __('No change'), -1, true, false, false ).'
'; // Pagination. $block_size = $config['global_block_size']; $size_pagination = '

'.__('Block size for pagination').'

'; $size_pagination .= html_print_input_text('block_size', $block_size, '', 5, 5, true); $size_pagination .= html_print_checkbox_switch('block_size_change', 1, 1, true); $size_pagination .= ''.__('No change').''; $size_pagination .= '
'; // Home screen. $home_screen = '

'.__('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 = [ '-1' => __('No change'), 'Default' => __('Default'), 'Visual console' => __('Visual console'), 'Event list' => __('Event list'), 'Group view' => __('Group view'), 'Tactical view' => __('Tactical view'), 'Alert detail' => __('Alert detail'), 'Other' => __('Other'), 'Dashboard' => __('Dashboard'), ]; $home_screen .= html_print_select( $values, 'section', '', 'show_data_section();', '', -1, true, false, false, '', false, '', '', 10 ).'
'; $dashboards = get_user_dashboards($config['id_user']); $dashboards_aux = []; if ($dashboards === false) { $dashboards = ['None' => 'None']; } else { foreach ($dashboards as $key => $dashboard) { $dashboards_aux[$dashboard['id']] = $dashboard['name']; } } $home_screen .= ''; $layouts = visual_map_get_user_layouts($config['id_user'], true); $layouts_aux = []; if (empty($layouts) === true) { $layouts_aux = ['None' => 'None']; } else { foreach ($layouts as $layout) { $layouts_aux[$layout] = $layout; } } $home_screen .= ''; $home_screen .= html_print_input_text('data_section', '', '', 60, 255, true, false); // Event filter. $user_groups = implode(',', array_keys((users_get_groups($config['id_user'], 'AR', true)))); $event_list = db_get_all_rows_sql('SELECT id_filter, id_name AS name FROM tevent_filter WHERE id_group_filter IN ('.$user_groups.')'); if (empty($event_list) === true) { $event_list = []; } array_unshift($event_list, ['id_filter' => 'none', 'name' => __('None')]); $event_filter = '

'.__('Event filter').'

'; $event_filter .= html_print_select( $event_list, 'event_filter', '', '', __('No change'), -1, true, false, false ).'
'; // Autorefresh. $autorefresh_list_out = []; if (is_metaconsole() === false || is_centralized() === true) { $autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail'; $autorefresh_list_out['operation/agentes/alerts_status'] = 'Alert detail'; $autorefresh_list_out['enterprise/operation/cluster/cluster'] = 'Cluster view'; $autorefresh_list_out['operation/gis_maps/render_view'] = 'Gis Map'; $autorefresh_list_out['operation/reporting/graph_viewer'] = 'Graph Viewer'; $autorefresh_list_out['operation/snmpconsole/snmp_view'] = 'SNMP console'; if (enterprise_installed()) { $autorefresh_list_out['general/sap_view'] = 'SAP view'; } } $autorefresh_list_out['operation/agentes/tactical'] = 'Tactical view'; $autorefresh_list_out['operation/agentes/group_view'] = 'Group view'; $autorefresh_list_out['operation/agentes/status_monitor'] = 'Monitor detail'; $autorefresh_list_out['enterprise/operation/services/services'] = 'Services'; $autorefresh_list_out['operation/dashboard/dashboard'] = 'Dashboard'; $autorefresh_list_out['operation/agentes/pandora_networkmap'] = 'Network map'; $autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console'; $autorefresh_list_out['operation/events/events'] = 'Events'; $autorefresh_show = '

'._('Autorefresh').ui_print_help_tip( __('This will activate autorefresh in selected pages'), true ).'

'; $select_out = html_print_select( $autorefresh_list_out, 'autorefresh_list_out[]', '', '', '', '', true, true, true, '', false, 'width:100%;min-height: 150px;' ); $arrows = ' '; $autorefresh_list = []; $autorefresh_list['-1'] = __('No change'); $autorefresh_list[] = __('None'); $select_in = html_print_select( $autorefresh_list, 'autorefresh_list[]', '-1', '', '', '', true, true, true, '', false, 'width:100%;min-height: 150px;' ); $table_ichanges = '

'.__('Full list of pages').':

'.$select_out.'

'.__('List of pages with autorefresh').':

'.$select_in.'
'; $autorefresh_show .= $table_ichanges; // Time autorefresh. $times = get_refresh_time_array(); $time_autorefresh = '

'.__('Time autorefresh'); $time_autorefresh .= ui_print_help_tip( __('Interval of autorefresh of the elements, by default they are 30 seconds, needing to enable the autorefresh first'), true ).'

'; $time_autorefresh .= html_print_select( $times, 'time_autorefresh', '', '', __('No change'), '-1', true, false, false ).'
'; $timezone = '

'.__('Timezone').ui_print_help_tip(__('The timezone must be that of the associated server.'), true).'

'; $timezone .= html_print_timezone_select('timezone', '-1', __('No change'), '-1').'
'; $timezone_map = ''; if (is_metaconsole() === false) { 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 .= ''; } } $timezone_map = '
'.$area_data_timezone_polys.$area_data_timezone_rects.'
'; } // Status (Disable / Enable). $status = '
'; $status .= '

'.__('Status').'

'; $table = new StdClass(); $table->width = '100%'; $table->class = 'databox filters'; $table->data[0][0] = __('No change'); $table->data[0][0] .= html_print_radio_button_extended( 'disabled', -1, '', -1, false, '', 'class="mrgn_right_40px"', true ); $table->data[0][0] .= __('Disable'); $table->data[0][0] .= html_print_radio_button_extended( 'disabled', 1, '', '', false, '', 'class="mrgn_right_40px"', true ); $table->data[0][0] .= __('Enable'); $table->data[0][0] .= html_print_radio_button_extended( 'disabled', 0, '', '', false, '', 'class="mrgn_right_40px"', true ); $status .= html_print_table($table, true); echo ''; echo '
'; attachActionButton('edit_users', 'update', '100%', false, $SelectAction); echo '
'; if (is_metaconsole() === false) { // Include OpenLayers and timezone user map library. echo ''."\n\t"; echo ''."\n\t"; // Closes no meta condition. ?>