From 1fc0a43ca82ab0d97f0779332dfc88f99ed8a4d3 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 10 May 2023 12:53:03 +0200 Subject: [PATCH 1/2] #11158 Fixed entities in agent name and icon size --- pandora_console/godmode/agentes/modificar_agente.php | 4 +++- pandora_console/godmode/netflow/nf_edit_form.php | 8 ++++++-- pandora_console/include/functions_html.php | 8 ++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 6d2ec44f25..7b72c1a989 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -765,7 +765,9 @@ if ($agents !== false) { } if (empty($agent['alias']) === true) { - $agent['alias'] = $agent['nombre']; + $agent['alias'] = io_safe_output($agent['nombre']); + } else { + $agent['alias'] = io_safe_output($agent['alias']); } $additionalDataAgentName = []; diff --git a/pandora_console/godmode/netflow/nf_edit_form.php b/pandora_console/godmode/netflow/nf_edit_form.php index 5ad8923ce1..f802c31dd8 100644 --- a/pandora_console/godmode/netflow/nf_edit_form.php +++ b/pandora_console/godmode/netflow/nf_edit_form.php @@ -74,8 +74,8 @@ if ($id) { // Header Buttons. $buttons = []; -$buttons[] = ['text' => ''.html_print_image('images/logs@svg.svg', true, ['title' => __('Filter list')]).'']; -$buttons[] = ['text' => ''.html_print_image('images/plus@svg.svg', true, ['title' => __('Add filter')]).'']; +$buttons[] = ['text' => ''.html_print_image('images/logs@svg.svg', true, ['title' => __('Filter list'), 'main_menu_icon' => true]).'']; +$buttons[] = ['text' => ''.html_print_image('images/plus@svg.svg', true, ['title' => __('Add filter'), 'main_menu_icon' => true]).'']; // Header Caption. $headerTitle = ($id) ? __('Update filter') : __('Create filter'); @@ -96,6 +96,7 @@ ui_print_standard_header( ); if ($id) { + hd('id', true); $filter = netflow_filter_get_filter($id); $assign_group = $filter['id_group']; $name = $filter['id_name']; @@ -111,6 +112,7 @@ if ($id) { $traffic_warning = $filter['traffic_warning']; $netflow_monitoring_interval = $filter['netflow_monitoring_interval']; } else { + hd('no id', true); $name = ''; $assign_group = ''; $ip_dst = ''; @@ -127,6 +129,7 @@ if ($id) { } if ($update) { + hd('update', true); $name = (string) get_parameter('name'); $assign_group = (int) get_parameter('assign_group'); $aggregate = get_parameter('aggregate', ''); @@ -176,6 +179,7 @@ if ($update) { } if ($create) { + hd('create', true); $name = (string) get_parameter('name'); $assign_group = (int) get_parameter('assign_group'); $aggregate = get_parameter('aggregate', 'dstip'); diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index b2f5091d4c..b4536bcf5f 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -4622,6 +4622,14 @@ function html_print_image( $output .= 'data-use_title_for_force_title="1" '; } + if (isset($options['main_menu_icon']) && $options['main_menu_icon'] != '') { + if (isset($options['class'])) { + $options['class'] .= ' main_menu_icon'; + } else { + $options['class'] = 'main_menu_icon'; + } + } + // Valid attributes (invalid attributes get skipped). $attrs = [ 'height', From f3b7a4aa09e11828eeff58d3b8b4222ccc3dd093 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 10 May 2023 12:57:09 +0200 Subject: [PATCH 2/2] Delete hd --- pandora_console/godmode/netflow/nf_edit_form.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pandora_console/godmode/netflow/nf_edit_form.php b/pandora_console/godmode/netflow/nf_edit_form.php index f802c31dd8..135739c446 100644 --- a/pandora_console/godmode/netflow/nf_edit_form.php +++ b/pandora_console/godmode/netflow/nf_edit_form.php @@ -96,7 +96,6 @@ ui_print_standard_header( ); if ($id) { - hd('id', true); $filter = netflow_filter_get_filter($id); $assign_group = $filter['id_group']; $name = $filter['id_name']; @@ -112,7 +111,6 @@ if ($id) { $traffic_warning = $filter['traffic_warning']; $netflow_monitoring_interval = $filter['netflow_monitoring_interval']; } else { - hd('no id', true); $name = ''; $assign_group = ''; $ip_dst = ''; @@ -129,7 +127,6 @@ if ($id) { } if ($update) { - hd('update', true); $name = (string) get_parameter('name'); $assign_group = (int) get_parameter('assign_group'); $aggregate = get_parameter('aggregate', ''); @@ -179,7 +176,6 @@ if ($update) { } if ($create) { - hd('create', true); $name = (string) get_parameter('name'); $assign_group = (int) get_parameter('assign_group'); $aggregate = get_parameter('aggregate', 'dstip');