From d006c932978554f69f778dc88f2625d08b74e8b8 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 16 Mar 2023 15:38:08 +0100 Subject: [PATCH 1/3] Create update module msg error on open --- .../godmode/agentes/configurar_agente.php | 102 +++++++++--------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index f559b4e3eb..04b90c1bb1 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1907,62 +1907,64 @@ if ($create_module) { ); } - if (is_error($id_agent_module) === true) { - switch ($id_agent_module) { - case ERR_EXIST: - $msg = __('There was a problem adding module. Another module already exists with the same name.'); - break; + if ($update_module || $create_module) { + if (is_error($id_agent_module) === true) { + switch ($id_agent_module) { + case ERR_EXIST: + $msg = __('There was a problem adding module. Another module already exists with the same name.'); + break; - case ERR_INCOMPLETE: - $msg = __('There was a problem adding module. Some required fields are missed : (name)'); - break; + case ERR_INCOMPLETE: + $msg = __('There was a problem adding module. Some required fields are missed : (name)'); + break; - case ERR_DB: - case ERR_GENERIC: - default: - $msg = __('There was a problem adding module. Processing error'); - break; - } + case ERR_DB: + case ERR_GENERIC: + default: + $msg = __('There was a problem adding module. Processing error'); + break; + } - // I save the result of the action (insert or update). - $success_action = $id_agent_module; + // I save the result of the action (insert or update). + $success_action = $id_agent_module; - $id_agent_module = false; - ui_print_error_message($msg); - $edit_module = true; - $moduletype = $id_module; - db_pandora_audit( - AUDIT_LOG_AGENT_MANAGEMENT, - "Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']) - ); - } else { - if ($prediction_module === MODULE_PREDICTION_SYNTHETIC) { - enterprise_hook( - 'modules_create_synthetic_operations', - [ - $id_agent_module, - $serialize_ops, - ] + $id_agent_module = false; + ui_print_error_message($msg); + $edit_module = true; + $moduletype = $id_module; + db_pandora_audit( + AUDIT_LOG_AGENT_MANAGEMENT, + "Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']) + ); + } else { + if ($prediction_module === MODULE_PREDICTION_SYNTHETIC) { + enterprise_hook( + 'modules_create_synthetic_operations', + [ + $id_agent_module, + $serialize_ops, + ] + ); + } + + // Update the module interval. + cron_update_module_interval($id_agent_module, $cron_interval); + + ui_print_success_message(__('Module added successfully')); + $id_agent_module = false; + $edit_module = false; + + $info = ''; + + $agent = db_get_row('tagente', 'id_agente', $id_agente); + db_pandora_audit( + AUDIT_LOG_AGENT_MANAGEMENT, + "Added module '".db_escape_string_sql($name)."' for agent ".io_safe_output($agent['alias']), + false, + true, + io_json_mb_encode($values) ); } - - // Update the module interval. - cron_update_module_interval($id_agent_module, $cron_interval); - - ui_print_success_message(__('Module added successfully')); - $id_agent_module = false; - $edit_module = false; - - $info = ''; - - $agent = db_get_row('tagente', 'id_agente', $id_agente); - db_pandora_audit( - AUDIT_LOG_AGENT_MANAGEMENT, - "Added module '".db_escape_string_sql($name)."' for agent ".io_safe_output($agent['alias']), - false, - true, - io_json_mb_encode($values) - ); } } From 921e94994790dd3ac6202a71319524670f0516d3 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 16 Mar 2023 16:06:03 +0100 Subject: [PATCH 2/3] cluster visual fix link --- pandora_console/godmode/alerts/alert_list.builder.php | 4 ++-- pandora_console/include/styles/pandora.css | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index 74120d36c8..4844e5c443 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -123,7 +123,7 @@ $table->data[1][0] = html_print_label_input_block( 'w100p', false, 'width: 100%;' - ).''.$create_action + ).'
'.$create_action.'
' ); $own_info = get_user_info($config['id_user']); @@ -162,7 +162,7 @@ $table->data[1][1] = html_print_label_input_block( 'w100p', false, 'width: 100%;' - ).' '.$create_template + ).'
'.$create_template.'
' ); $table->data[2][0] = html_print_label_input_block( diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 01801cd5bc..c9711b2240 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -8255,6 +8255,11 @@ div.graph div.legend table { justify-content: center; } +.flex_justify_end { + display: flex; + justify-content: end; +} + .span_priority { width: 20px; height: 10px; From 5921e61ad861b57ebba5d69a4d5737827b56a6de Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 16 Mar 2023 16:32:18 +0100 Subject: [PATCH 3/3] fixed styles --- pandora_console/general/login_page.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 8517b1c46c..6816c99317 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -458,6 +458,7 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { 'enterprise/images/custom_splash_login/'.$config['custom_splash_login'], false, [ + 'class' => 'splash-logo', 'alt' => 'splash', 'border' => 0, ],