From 8764413597018b25be321f5f940aa09a205868c7 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 6 Oct 2021 15:07:46 +0200 Subject: [PATCH 1/7] Some ui_get_full_url improvements --- pandora_console/include/functions_ui.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 322496228d..22f98a57bf 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4315,18 +4315,15 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me } } - if ($url === '') { - if ($proxy) { - $url = ''; - } else { + $skip_meta_tag = false; + if (empty($url) === true) { + if ($proxy === false) { $url = $_SERVER['REQUEST_URI']; - } - } else if ($url === false) { - if ($proxy) { - $url = ''; + // Already inserted in request_uri. + $skip_meta_tag = true; } else { - // Only add the home url. - $url = $config['homeurl_static'].'/'; + // Redirect to main. + $url = '?'.$_SERVER['QUERY_STRING']; } } else if (!strstr($url, '.php')) { if ($proxy) { @@ -4354,7 +4351,10 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me $url = substr($url, 1); } - if (is_metaconsole() && $metaconsole_root) { + if ($skip_meta_tag === false + && $metaconsole_root + && is_metaconsole() + ) { $fullurl .= 'enterprise/meta/'; } From 35eb1d07901547d71af6eb09c93a291f96a1c4f3 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 6 Oct 2021 15:13:21 +0200 Subject: [PATCH 2/7] Some ui_get_full_url improvements --- pandora_console/include/functions_ui.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 22f98a57bf..45f2cb708d 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4316,7 +4316,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me } $skip_meta_tag = false; - if (empty($url) === true) { + if ($url === '') { if ($proxy === false) { $url = $_SERVER['REQUEST_URI']; // Already inserted in request_uri. @@ -4325,6 +4325,17 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me // Redirect to main. $url = '?'.$_SERVER['QUERY_STRING']; } + } else if (empty($url) === true) { + if ($proxy === false) { + $url = $config['homeurl_static'].'/'; + if ($metaconsole_root === true) { + $url = $config['homeurl_static'].'/'.ENTERPRISE_DIR.'/meta/'; + } + + $skip_meta_tag = true; + } else { + $url = ''; + } } else if (!strstr($url, '.php')) { if ($proxy) { $fullurl .= '/'; @@ -4355,7 +4366,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me && $metaconsole_root && is_metaconsole() ) { - $fullurl .= 'enterprise/meta/'; + $fullurl .= ENTERPRISE_DIR.'/meta/'; } return $fullurl.$url; From 795d5c055ac776fdb1a7c2c533a53931630c32fc Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 7 Oct 2021 09:56:17 +0200 Subject: [PATCH 3/7] merge conflict --- pandora_console/godmode/agentes/modificar_agente.php | 2 +- pandora_console/godmode/agentes/module_manager.php | 2 +- pandora_console/godmode/alerts/alert_list.list.php | 6 +++--- pandora_console/godmode/extensions.php | 2 +- pandora_console/godmode/wizards/DiscoveryTaskList.class.php | 5 ++++- pandora_console/include/styles/pandora_black.css | 3 +++ pandora_console/operation/search_alerts.php | 2 +- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 34c9481f58..e2aca5017f 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -910,7 +910,7 @@ if ($agents !== false) { echo ' onClick="if (!confirm(\' '.__('You are going to enable a cluster agent. Are you sure?').'\')) return false;">'; } - echo html_print_image('images/lightbulb_off.png', true, ['alt' => __('Enable agent'), 'title' => __('Enable agent')]).''; + echo html_print_image('images/lightbulb_off.png', true, ['alt' => __('Enable agent'), 'title' => __('Enable agent'), 'class' => 'filter_none']).''; } else { echo " __('Enable module'), 'title' => __('Enable module'), + 'class' => 'filter_none', ] ).''; } else { @@ -1139,7 +1140,6 @@ foreach ($modules as $module) { [ 'alt' => __('Disable module'), 'title' => __('Disable module'), - 'class' => 'invert_filter', ] ).''; } diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 8e2e01aa2d..2b1c07ae6a 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -811,7 +811,7 @@ foreach ($simple_alerts as $alert) { 1, 'padding:0px', true, - ['class' => 'invert_filter'] + ['class' => 'filter_none'] ); $data[4] .= html_print_input_hidden('enable_alert', 1, true); } else { @@ -998,7 +998,7 @@ if (! $id_agente) { echo '"'.html_print_image( 'images/lightbulb_off.png', true, - false, + ['class' => 'filter_none'], true ).'"'; ?> @@ -1037,7 +1037,7 @@ if (! $id_agente) { echo '"'.html_print_image( 'images/lightbulb_off.png', true, - false, + ['class' => 'filter_none'], true ).'"'; ?> diff --git a/pandora_console/godmode/extensions.php b/pandora_console/godmode/extensions.php index 6a46795322..6e036827aa 100644 --- a/pandora_console/godmode/extensions.php +++ b/pandora_console/godmode/extensions.php @@ -254,7 +254,7 @@ foreach ($extensions as $file => $extension) { if ($file != 'update_manager.php') { $table->cellclass[][10] = 'action_buttons'; if (!$extension['enabled']) { - $data[] = ''.html_print_image('images/cross.disabled.png', true).''.' '.html_print_image('images/lightbulb_off.png', true).''; + $data[] = ''.html_print_image('images/cross.disabled.png', true, ['class' => 'filter_none']).''.' '.html_print_image('images/lightbulb_off.png', true, ['class' => 'filter_none']).''; } else { $data[] = ''.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).''.' '.html_print_image('images/lightbulb.png', true).''; } diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 245c2ae876..3235e2dd6a 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -961,7 +961,10 @@ class DiscoveryTaskList extends HTML ).'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image( 'images/lightbulb_off.png', true, - ['title' => __('enable task')] + [ + 'title' => __('enable task'), + 'class' => 'filter_none', + ] ).''; } else if ($task['disabled'] == 0) { $data[9] .= ' Date: Thu, 7 Oct 2021 12:25:41 +0200 Subject: [PATCH 5/7] errata fix --- pandora_console/include/functions_ui.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 45f2cb708d..a9759730ea 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4328,7 +4328,9 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me } else if (empty($url) === true) { if ($proxy === false) { $url = $config['homeurl_static'].'/'; - if ($metaconsole_root === true) { + if ($metaconsole_root === true + && is_metaconsole() + ) { $url = $config['homeurl_static'].'/'.ENTERPRISE_DIR.'/meta/'; } From afb9cea67fbac5f2513b673039d162bfe4d189e0 Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 7 Oct 2021 12:42:58 +0200 Subject: [PATCH 6/7] add new filter fot litghbulb_off --- pandora_console/godmode/users/user_list.php | 4 +++- pandora_console/include/styles/pandora_black.css | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index aca2686e59..e146bf9646 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -716,10 +716,12 @@ foreach ($info as $user_id => $user_info) { $toDoString = __('Disable'); $toDoAction = '1'; $toDoImage = 'images/lightbulb.png'; + $toDoClass = ''; } else { $toDoString = __('Enable'); $toDoAction = '0'; $toDoImage = 'images/lightbulb_off.png'; + $toDoClass = 'filter_none'; } $data[6] = '
'; @@ -742,7 +744,7 @@ foreach ($info as $user_id => $user_info) { [ 'data-title' => $toDoString, 'data-use_title_for_force_title' => '1', - 'class' => 'forced_title no-padding', + 'class' => 'forced_title no-padding '.$toDoClass, ] ); $data[6] .= '
'; diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index 7985245116..77b762d1b0 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -1203,6 +1203,10 @@ a.pandora_pagination, background-color: #50505050 !important; } +.filter_none { + filter: brightness(0) contrast(50%) !important; +} + input[type="image"] { background-color: transparent !important; } From 030b45af8e7a53e4f1b7bb3720cbf5e658010c44 Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 7 Oct 2021 12:50:10 +0200 Subject: [PATCH 7/7] add new filter fot litghbulb_off --- pandora_console/godmode/users/user_list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index aca2686e59..e146bf9646 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -716,10 +716,12 @@ foreach ($info as $user_id => $user_info) { $toDoString = __('Disable'); $toDoAction = '1'; $toDoImage = 'images/lightbulb.png'; + $toDoClass = ''; } else { $toDoString = __('Enable'); $toDoAction = '0'; $toDoImage = 'images/lightbulb_off.png'; + $toDoClass = 'filter_none'; } $data[6] = '
'; @@ -742,7 +744,7 @@ foreach ($info as $user_id => $user_info) { [ 'data-title' => $toDoString, 'data-use_title_for_force_title' => '1', - 'class' => 'forced_title no-padding', + 'class' => 'forced_title no-padding '.$toDoClass, ] ); $data[6] .= '
';