From aff91aa1b2e6df9e572965ecd5e7ed6a4ae009cb Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 12 Jan 2023 12:42:48 +0100 Subject: [PATCH 01/25] #10126 added button save in visual console --- .../godmode/reporting/visual_console_builder.elements.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora_console/godmode/reporting/visual_console_builder.elements.php b/pandora_console/godmode/reporting/visual_console_builder.elements.php index b331f5bdac..870316af29 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.elements.php +++ b/pandora_console/godmode/reporting/visual_console_builder.elements.php @@ -862,9 +862,15 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/'); height: 300, autoOpen: false, beforeClose: function() { + console.log("Entra"); var id_layout_data = $("#active_id_layout_data").val(); var label = tinyMCE.activeEditor.getContent(); $("#hidden-label_" + id_layout_data).val(label); + }, + buttons: { + Save: function() { + $(this).dialog("close"); + } } }); From eec87fb2deec816330bd53e86747ea6cad879a13 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 16 Jan 2023 14:51:27 +0100 Subject: [PATCH 02/25] #10032 Fixed config_update_value --- pandora_console/include/functions_config.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 01a7e78ffc..b0d15d5cef 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -67,7 +67,7 @@ function config_create_value($token, $value) * * @return boolean True if success. False on failure. */ -function config_update_value($token, $value, $noticed=false) +function config_update_value($token, $value, $noticed=false, $password=false) { global $config; // Include functions_io to can call __() function. @@ -91,7 +91,11 @@ function config_update_value($token, $value, $noticed=false) if (isset($config[$token]) === false) { $config[$token] = $value; - return (bool) config_create_value($token, io_safe_input($value)); + if (($password === false)) { + return (bool) config_create_value($token, io_safe_input($value)); + } else { + return (bool) config_create_value($token, io_input_password($value)); + } } // If it has not changed. @@ -104,7 +108,7 @@ function config_update_value($token, $value, $noticed=false) $result = db_process_sql_update( 'tconfig', - ['value' => io_safe_input($value)], + ['value' => ($password === false) ? io_safe_input($value) : io_input_password($value)], ['token' => $token] ); From 904b50580319b68cc431f3039549a34527c28c69 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 16 Jan 2023 16:31:13 +0100 Subject: [PATCH 03/25] #9473 total_modules all and id --- pandora_console/include/functions_api.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index d141160f9b..e0961cb238 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -12471,9 +12471,26 @@ function api_get_total_modules($id_group, $trash1, $trash2, $returnType) return; } - $partial = tactical_status_modules_agents($config['id_user'], false, 'AR'); + if ($id_group) { + $groups_clause = '1 = 1'; + if (!users_is_admin($config['id_user'])) { + $user_groups = implode(',', array_keys(users_get_groups())); + $groups_clause = "(ta.id_grupo IN ($user_groups) OR tasg.id_group IN ($user_groups))"; + } - $total = (int) $partial['_monitor_total_']; + $sql = "SELECT COUNT(DISTINCT(id_agente_modulo)) + FROM tagente_modulo tam, tagente ta + LEFT JOIN tagent_secondary_group tasg + ON ta.id_agente = tasg.id_agent + WHERE tam.id_agente = ta.id_agente AND id_module_group = $id_group + AND delete_pending = 0 AND $groups_clause"; + + $total = db_get_value_sql($sql); + } else { + $partial = tactical_status_modules_agents($config['id_user'], false, 'AR'); + + $total = (int) $partial['_monitor_total_']; + } $data = [ 'type' => 'string', From a2076ffd0c3c4f6231c9945bf306ec1a549b9671 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Fri, 20 Jan 2023 13:11:49 +0100 Subject: [PATCH 04/25] fix server status when distinct timezones --- pandora_console/extras/mr/61.sql | 5 ++++ .../godmode/servers/servers.build_table.php | 8 ++++++- pandora_console/pandoradb.sql | 1 + pandora_server/lib/PandoraFMS/Core.pm | 24 +++++++++++-------- 4 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 pandora_console/extras/mr/61.sql diff --git a/pandora_console/extras/mr/61.sql b/pandora_console/extras/mr/61.sql new file mode 100644 index 0000000000..8cff0d2944 --- /dev/null +++ b/pandora_console/extras/mr/61.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +ALTER TABLE `tserver` ADD COLUMN `server_keepalive_utimestamp` BIGINT NOT NULL DEFAULT 0; + +COMMIT; diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index 9629dccb22..a82933f640 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -110,6 +110,12 @@ foreach ($servers as $server) { ]; $data[0] = ''.strip_tags($server['name']).''; + $server_keepalive = time_w_fixed_tz($server['keepalive']); + + if ($server['server_keepalive_utimestamp'] > 0) { + $server_keepalive = $server['server_keepalive_utimestamp']; + } + // Status. $data[1] = ui_print_status_image(STATUS_SERVER_OK, '', true); if ($server['status'] == -1) { @@ -119,7 +125,7 @@ foreach ($servers as $server) { true ); } else if ((int) ($server['status'] === 0) - || (($date - time_w_fixed_tz($server['keepalive'])) > ($server['server_keepalive']) * 2) + || (($date - $server_keepalive) > ($server['server_keepalive']) * 2) ) { $data[1] = ui_print_status_image( STATUS_SERVER_DOWN, diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 3f90f157f8..c45758affe 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1157,6 +1157,7 @@ CREATE TABLE IF NOT EXISTS `tserver` ( `stat_utimestamp` BIGINT NOT NULL DEFAULT 0, `exec_proxy` TINYINT UNSIGNED NOT NULL DEFAULT 0, `port` INT UNSIGNED NOT NULL DEFAULT 0, + `server_keepalive_utimestamp` BIGINT NOT NULL DEFAULT 0, PRIMARY KEY (`id_server`), KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 899254d02c..d33445a2fa 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -118,7 +118,7 @@ use Tie::File; use Time::Local; use Time::HiRes qw(time); eval "use POSIX::strftime::GNU;1" if ($^O =~ /win/i); -use POSIX qw(strftime); +use POSIX qw(strftime mktime); use threads; use threads::shared; use JSON qw(decode_json encode_json); @@ -3173,16 +3173,20 @@ sub pandora_update_server ($$$$$$;$$$$) { $version = $pa_config->{'version'} . ' (P) ' . $pa_config->{'build'} unless defined($version); my $master = ($server_type == SATELLITESERVER) ? 0 : $pa_config->{'pandora_master'}; - + + my ($year, $month, $day, $hour, $minute, $second) = split /[- :]/, $timestamp; + + my $keepalive_utimestamp = mktime($second, $minute, $hour, $day, $month-1, $year-1900); + # First run if ($server_id == 0) { # Create an entry in tserver if needed my $server = get_db_single_row ($dbh, 'SELECT id_server FROM tserver WHERE BINARY name = ? AND server_type = ?', $server_name, $server_type); if (! defined ($server)) { - $server_id = db_insert ($dbh, 'id_server', 'INSERT INTO tserver (name, server_type, description, version, threads, queued_modules, server_keepalive) - VALUES (?, ?, ?, ?, ?, ?, ?)', $server_name, $server_type, - 'Autocreated at startup', $version, $num_threads, $queue_size, $keepalive); + $server_id = db_insert ($dbh, 'id_server', 'INSERT INTO tserver (name, server_type, description, version, threads, queued_modules, server_keepalive, server_keepalive_utimestamp) + VALUES (?, ?, ?, ?, ?, ?, ?, ?)', $server_name, $server_type, + 'Autocreated at startup', $version, $num_threads, $queue_size, $keepalive, $keepalive_utimestamp); $server = get_db_single_row ($dbh, 'SELECT status FROM tserver WHERE id_server = ?', $server_id); if (! defined ($server)) { @@ -3193,14 +3197,14 @@ sub pandora_update_server ($$$$$$;$$$$) { $server_id = $server->{'id_server'}; } - db_do ($dbh, 'UPDATE tserver SET status = ?, keepalive = ?, master = ?, laststart = ?, version = ?, threads = ?, queued_modules = ?, server_keepalive = ? + db_do ($dbh, 'UPDATE tserver SET status = ?, keepalive = ?, master = ?, laststart = ?, version = ?, threads = ?, queued_modules = ?, server_keepalive = ?, server_keepalive_utimestamp = ? WHERE id_server = ?', - 1, $timestamp, $master, $timestamp, $version, $num_threads, $queue_size, $keepalive, $server_id); + 1, $timestamp, $master, $timestamp, $version, $num_threads, $queue_size, $keepalive, $keepalive_utimestamp, $server_id); return; } - - db_do ($dbh, 'UPDATE tserver SET status = ?, keepalive = ?, master = ?, version = ?, threads = ?, queued_modules = ?, server_keepalive = ? - WHERE id_server = ?', $status, $timestamp, $master, $version, $num_threads, $queue_size, $keepalive, $server_id); + + db_do ($dbh, 'UPDATE tserver SET status = ?, keepalive = ?, master = ?, version = ?, threads = ?, queued_modules = ?, server_keepalive = ?, server_keepalive_utimestamp = ? + WHERE id_server = ?', $status, $timestamp, $master, $version, $num_threads, $queue_size, $keepalive, $keepalive_utimestamp, $server_id); } ########################################################################## From c380a588ea86cd89fbcff81fa007c9cb7588c662 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 23 Jan 2023 11:07:34 +0100 Subject: [PATCH 05/25] #10076 attachments-plugins access --- pandora_console/godmode/servers/plugin.php | 116 +++++++++++++++++++-- 1 file changed, 108 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 5a0d8a063a..47851469c3 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -225,14 +225,69 @@ if ($filemanager) { $directory = (string) get_parameter('directory'); if (empty($directory) === true) { $directory = $fallback_directory; + $base_url = 'index.php?sec=gservers&sec2=godmode/servers/plugin'; + $setup_url = $base_url.'&filemanager=1&tab=Attachments'; + $tab = get_parameter('tab', null); + $tabs = [ + 'list' => [ + 'text' => ''.html_print_image( + 'images/eye_show.png', + true, + [ + 'title' => __('Plugins'), + 'class' => 'invert_filter', + ] + ).'', + 'active' => (bool) ($tab != 'Attachments'), + ], + 'options' => [ + 'text' => ''.html_print_image( + 'images/setup.png', + true, + [ + 'title' => __('Attachments'), + 'class' => 'invert_filter', + ] + ).'', + 'active' => (bool) ($tab == 'Attachments'), + ], + ]; + + if ($tab === 'Attachments') { + $helpHeader = ''; + $titleHeader = __('Index of attachment/plugin'); + } else { + $helpHeader = 'servers_ha_clusters_tab'; + $titleHeader = __('Plug-ins registered on %s', get_product_name()); + } + + // Header. + ui_print_standard_header( + $titleHeader, + 'images/gm_servers.png', + false, + $helpHeader, + false, + $tabs, + [ + [ + 'link' => '', + 'label' => __('Servers'), + ], + [ + 'link' => '&filemanager=1', + 'label' => __('Plugins'), + ], + ] + ); } else { $directory = str_replace('\\', '/', $directory); $directory = filemanager_safe_directory($directory, $fallback_directory); + echo '

'.__('Index of %s', $directory).'

'; } $real_directory = realpath($config['homedir'].'/'.$directory); - echo '

'.__('Index of %s', $directory).'

'; $chunck_url = '&view='.$id_plugin; if ($id_plugin == 0) { @@ -597,15 +652,60 @@ if (($create != '') || ($view != '')) { ); } } else { - ui_print_page_header( - __( - 'Plug-ins registered on %s', - get_product_name() - ), + $base_url = 'index.php?sec=gservers&sec2=godmode/servers/plugin'; + $setup_url = $base_url.'&filemanager=1&tab=Attachments'; + $tab = get_parameter('tab', null); + $tabs = [ + 'list' => [ + 'text' => ''.html_print_image( + 'images/eye_show.png', + true, + [ + 'title' => __('Plugins'), + 'class' => 'invert_filter', + ] + ).'', + 'active' => (bool) ($tab != 'Attachments'), + ], + 'options' => [ + 'text' => ''.html_print_image( + 'images/setup.png', + true, + [ + 'title' => __('Attachments'), + 'class' => 'invert_filter', + ] + ).'', + 'active' => (bool) ($tab == 'Attachments'), + ], + ]; + + if ($tab === 'Attachments') { + $helpHeader = ''; + $titleHeader = __('Index of attachment/plugin'); + } else { + $helpHeader = 'servers_ha_clusters_tab'; + $titleHeader = __('Plug-ins registered on %s', get_product_name()); + } + + // Header. + ui_print_standard_header( + $titleHeader, 'images/gm_servers.png', false, - '', - true + $helpHeader, + false, + $tabs, + [ + [ + 'link' => '', + 'label' => __('Servers'), + ], + [ + 'link' => '&filemanager=1', + 'label' => __('Plugins'), + ], + ] ); $management_allowed = is_management_allowed(); From aacf069acf711b383d4809581cd12b159d7edf90 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 23 Jan 2023 11:19:59 +0100 Subject: [PATCH 06/25] #10076 attachments-plugins access --- pandora_console/godmode/servers/plugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 47851469c3..7a15eb4e8c 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -275,7 +275,7 @@ if ($filemanager) { 'label' => __('Servers'), ], [ - 'link' => '&filemanager=1', + 'link' => '', 'label' => __('Plugins'), ], ] @@ -456,7 +456,7 @@ if (($create != '') || ($view != '')) { $data[0] = __('Plugin command').ui_print_help_tip(__('Specify interpreter and plugin path. The server needs permissions to run it.'), true); $data[1] = ''; - $data[1] .= ' '; + $data[1] .= ' '; $data[1] .= html_print_image('images/file.png', true, ['class' => 'invert_filter'], false, true); $data[1] .= ''; $table->data['plugin_command'] = $data; @@ -702,7 +702,7 @@ if (($create != '') || ($view != '')) { 'label' => __('Servers'), ], [ - 'link' => '&filemanager=1', + 'link' => '', 'label' => __('Plugins'), ], ] From 60756ebb1880160a7f4e5d0d89a55c2643066d48 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 23 Jan 2023 13:01:31 +0100 Subject: [PATCH 07/25] #10076 attachments-plugins icon tab --- pandora_console/godmode/servers/plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 7a15eb4e8c..82049defca 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -242,7 +242,7 @@ if ($filemanager) { ], 'options' => [ 'text' => ''.html_print_image( - 'images/setup.png', + 'images/collection.png', true, [ 'title' => __('Attachments'), @@ -669,7 +669,7 @@ if (($create != '') || ($view != '')) { ], 'options' => [ 'text' => ''.html_print_image( - 'images/setup.png', + 'images/collection.png', true, [ 'title' => __('Attachments'), From 293d067a4dbec7753878b6bc5ea432fe057d20f7 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 23 Jan 2023 14:44:10 +0100 Subject: [PATCH 08/25] #10162 safe input description in special days --- pandora_console/include/class/CalendarManager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/CalendarManager.class.php b/pandora_console/include/class/CalendarManager.class.php index af7e51848f..989d921e88 100644 --- a/pandora_console/include/class/CalendarManager.class.php +++ b/pandora_console/include/class/CalendarManager.class.php @@ -900,7 +900,7 @@ class CalendarManager $id_group = get_parameter('id_group', null); $day_code = get_parameter('day_code', null); $id_calendar = get_parameter('id_calendar', null); - $description = get_parameter('description', null); + $description = io_safe_input(get_parameter('description', null)); $change = true; if ($new === false && ($date === $specialDay->date() From 9282aa2319969b30c349bb746fae1b33a92c62a7 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 26 Jan 2023 16:20:25 +0100 Subject: [PATCH 09/25] #10219 fixed xss injection in syslog --- pandora_console/godmode/agentes/configurar_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index d0c796cc59..81277763c5 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1994,7 +1994,7 @@ if ($create_module) { $agent = db_get_row('tagente', 'id_agente', $id_agente); db_pandora_audit( AUDIT_LOG_AGENT_MANAGEMENT, - "Added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']), + "Added module '".$name."' for agent ".io_safe_output($agent['alias']), false, true, io_json_mb_encode($values) From c2a16eb31183810bf66ed9a2191c982b08d9c9d3 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 26 Jan 2023 16:34:35 +0100 Subject: [PATCH 10/25] #10219 added db_escape_string_sql for control quotes --- pandora_console/godmode/agentes/configurar_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 81277763c5..e35f15ead9 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1994,7 +1994,7 @@ if ($create_module) { $agent = db_get_row('tagente', 'id_agente', $id_agente); db_pandora_audit( AUDIT_LOG_AGENT_MANAGEMENT, - "Added module '".$name."' for agent ".io_safe_output($agent['alias']), + "Added module '".db_escape_string_sql($name)."' for agent ".io_safe_output($agent['alias']), false, true, io_json_mb_encode($values) From 95575b4e905b1fe06a2275dc920c47528e1488e3 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 27 Jan 2023 12:37:25 +0100 Subject: [PATCH 11/25] remove old format events sounds pandora_enterprise#10208 --- pandora_console/operation/events/events.php | 40 ++++++++++----------- pandora_console/operation/menu.php | 20 ----------- 2 files changed, 18 insertions(+), 42 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 648581a3a6..18c928727a 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1475,7 +1475,24 @@ if ($pure) { // Sound events. $sound_event['active'] = false; - $sound_event['text'] = ''.html_print_image( + + // Sound Events. + $data_sound = base64_encode( + json_encode( + [ + 'title' => __('Sound Console'), + 'start' => __('Start'), + 'stop' => __('Stop'), + 'noAlert' => __('No alert'), + 'silenceAlarm' => __('Silence alarm'), + 'url' => ui_get_full_url('ajax.php'), + 'page' => 'include/ajax/events', + 'urlSound' => 'include/sounds/', + ] + ) + ); + + $sound_event['text'] = ''.html_print_image( 'images/sound.png', true, [ @@ -1565,27 +1582,6 @@ if ($pure) { unset($onheader['fullscreen']); ui_meta_print_header(__('Events'), $section_string, $onheader); } - - ?> - - - - Date: Fri, 27 Jan 2023 13:18:57 +0100 Subject: [PATCH 12/25] #10236 fixed dynamic_interval in bulk operations --- pandora_console/godmode/massive/massive_edit_modules.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index c3734ca90f..3bfed79752 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -550,7 +550,7 @@ $table->data['form_agents_3'][3] = html_print_select( $table->data['edit0'][0] = __('Dynamic Interval'); -$table->data['edit0'][1] = html_print_extended_select_for_time('dynamic_interval', '', '', 'None', '0', 10, true, 'width:150px', false); +$table->data['edit0'][1] = html_print_extended_select_for_time('dynamic_interval', -2, '', 'None', '0', 10, true, 'width:150px', false, '', false, false, '', true); $table->data['edit0'][2] = ''; $table->data['edit0'][2] .= ''; $table->data['edit0'][2] .= ''; @@ -2128,6 +2128,12 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' } break; + case 'dynamic_interval': + if ($value !== -2) { + $values[$field] = $value; + } + break; + case 'plugin_pass': if ($value != '') { $values['plugin_pass'] = io_input_password($value); From 27b42d313702174374b4e7b94592f49a2478285f Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 27 Jan 2023 13:23:48 +0100 Subject: [PATCH 13/25] #10076 add easy acces on directorys --- pandora_console/godmode/servers/plugin.php | 114 ++++++++++----------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 82049defca..94ab20aebf 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -225,67 +225,67 @@ if ($filemanager) { $directory = (string) get_parameter('directory'); if (empty($directory) === true) { $directory = $fallback_directory; - $base_url = 'index.php?sec=gservers&sec2=godmode/servers/plugin'; - $setup_url = $base_url.'&filemanager=1&tab=Attachments'; - $tab = get_parameter('tab', null); - $tabs = [ - 'list' => [ - 'text' => ''.html_print_image( - 'images/eye_show.png', - true, - [ - 'title' => __('Plugins'), - 'class' => 'invert_filter', - ] - ).'', - 'active' => (bool) ($tab != 'Attachments'), - ], - 'options' => [ - 'text' => ''.html_print_image( - 'images/collection.png', - true, - [ - 'title' => __('Attachments'), - 'class' => 'invert_filter', - ] - ).'', - 'active' => (bool) ($tab == 'Attachments'), - ], - ]; - - if ($tab === 'Attachments') { - $helpHeader = ''; - $titleHeader = __('Index of attachment/plugin'); - } else { - $helpHeader = 'servers_ha_clusters_tab'; - $titleHeader = __('Plug-ins registered on %s', get_product_name()); - } - - // Header. - ui_print_standard_header( - $titleHeader, - 'images/gm_servers.png', - false, - $helpHeader, - false, - $tabs, - [ - [ - 'link' => '', - 'label' => __('Servers'), - ], - [ - 'link' => '', - 'label' => __('Plugins'), - ], - ] - ); } else { $directory = str_replace('\\', '/', $directory); $directory = filemanager_safe_directory($directory, $fallback_directory); - echo '

'.__('Index of %s', $directory).'

'; } + $base_url = 'index.php?sec=gservers&sec2=godmode/servers/plugin'; + $setup_url = $base_url.'&filemanager=1&tab=Attachments'; + $tab = get_parameter('tab', null); + $tabs = [ + 'list' => [ + 'text' => ''.html_print_image( + 'images/eye_show.png', + true, + [ + 'title' => __('Plugins'), + 'class' => 'invert_filter', + ] + ).'', + 'active' => (bool) ($tab != 'Attachments'), + ], + 'options' => [ + 'text' => ''.html_print_image( + 'images/collection.png', + true, + [ + 'title' => __('Attachments'), + 'class' => 'invert_filter', + ] + ).'', + 'active' => (bool) ($tab == 'Attachments'), + ], + ]; + + if ($tab === 'Attachments') { + $helpHeader = ''; + $titleHeader = __('Index of attachment/plugin'); + } else { + $helpHeader = 'servers_ha_clusters_tab'; + $titleHeader = __('Plug-ins registered on %s', get_product_name()); + } + + // Header. + ui_print_standard_header( + $titleHeader, + 'images/gm_servers.png', + false, + $helpHeader, + false, + $tabs, + [ + [ + 'link' => '', + 'label' => __('Servers'), + ], + [ + 'link' => '', + 'label' => __('Plugins'), + ], + ] + ); + $real_directory = realpath($config['homedir'].'/'.$directory); @@ -310,7 +310,7 @@ if ($filemanager) { filemanager_file_explorer( $real_directory, $directory, - 'index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1&id_plugin='.$id_plugin, + 'index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1&id_plugin='.$id_plugin.'&tab=Attachments', $fallback_directory, true, false, From 0bf97acf509ea45e88afe8951f78072117ef5f7f Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 27 Jan 2023 13:39:41 +0100 Subject: [PATCH 14/25] #10236 fixed typed control --- pandora_console/godmode/massive/massive_edit_modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 3bfed79752..c69cba35ad 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -2129,7 +2129,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' break; case 'dynamic_interval': - if ($value !== -2) { + if ($value !== '-2') { $values[$field] = $value; } break; From 8475e5fbf68255bfc7810692b36f7e51fb2e34fb Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 30 Jan 2023 17:21:20 +0100 Subject: [PATCH 15/25] #10162 fixed entities in special days --- pandora_console/views/calendar/special_days_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/views/calendar/special_days_edit.php b/pandora_console/views/calendar/special_days_edit.php index 23f72dc38f..74197e57bd 100644 --- a/pandora_console/views/calendar/special_days_edit.php +++ b/pandora_console/views/calendar/special_days_edit.php @@ -140,7 +140,7 @@ $inputs[] = [ 'type' => 'textarea', 'name' => 'description', 'required' => false, - 'value' => $specialDay->description(), + 'value' => io_safe_output($specialDay->description()), 'rows' => 50, 'columns' => 30, ], From a0c311c1105590db35161cd7a9c055749e9a8df3 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 30 Jan 2023 19:47:02 +0100 Subject: [PATCH 16/25] fixed vulnerability --- .../godmode/setup/file_manager.php | 16 ++++++++++++++++ .../include/functions_filemanager.php | 19 ++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/setup/file_manager.php b/pandora_console/godmode/setup/file_manager.php index 6f54f2f0a8..272eab74f0 100644 --- a/pandora_console/godmode/setup/file_manager.php +++ b/pandora_console/godmode/setup/file_manager.php @@ -87,6 +87,22 @@ $create_text_file = (bool) get_parameter('create_text_file'); $default_real_directory = realpath($config['homedir'].'/'); +$_FILES['file']['name'] = '../test3.jpeg'; + +// Remove double dot in filename path. +$file_name = $_FILES['file']['name']; +$path_parts = explode('/', $file_name); + +$stripped_parts = array_filter( + $path_parts, + function ($value) { + return $value !== '..'; + } +); + +$stripped_path = implode('/', $stripped_parts); +$_FILES['file']['name'] = $stripped_path; + if ($upload_file === true) { upload_file( $upload_file, diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 94e16e822b..3242fadcb0 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -139,8 +139,25 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_ $nombre_archivo = sprintf('%s/%s', $real_directory, $filename); try { $mimeContentType = mime_content_type($_FILES['file']['tmp_name']); + $fileExtension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION); - if (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true) { + $validFileExtension = true; + + if (empty($fileExtension) === false) { + $filtered_types = array_filter( + $filterFilesType, + function ($value) use ($fileExtension) { + $mimeTypeExtensionName = explode('/', $value)[1]; + return $mimeTypeExtensionName === $fileExtension; + } + ); + + if (empty($filtered_types) === true) { + $validFileExtension = false; + } + } + + if ($validFileExtension === true && (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true)) { $result = copy($_FILES['file']['tmp_name'], $nombre_archivo); } else { $error_message = 'The uploaded file is not allowed. Only gif, png or jpg files can be uploaded.'; From 7d7ee65c7b10f9ef85f797b9d8255a2ee5f12e45 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Tue, 31 Jan 2023 11:51:00 +0100 Subject: [PATCH 17/25] fixed filter --- pandora_console/operation/agentes/alerts_status.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index e07849f181..d547412a29 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -53,7 +53,7 @@ $isFunctionPolicies = enterprise_include_once('include/functions_policies.php'); $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); -$filter = get_parameter('filter', 'all_enabled'); +$disabled = get_parameter('disabled', 'all_enabled'); $filter_standby = get_parameter('standby', 'all'); $id_group = (int) get_parameter('ag_group', 0); // 0 is the All group (selects all groups) @@ -113,7 +113,7 @@ $tab = get_parameter_get('tab', null); $refr = (int) get_parameter('refr', 0); $pure = get_parameter('pure', 0); -$url = 'index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.$refr.'&filter='.$filter.'&filter_standby='.$filter_standby.'&ag_group='.$id_group.'&tag_filter='.$tag_filter.'&action_filter='.$action_filter; +$url = 'index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.$refr.'&disabled='.$disabled.'&filter_standby='.$filter_standby.'&ag_group='.$id_group.'&tag_filter='.$tag_filter.'&action_filter='.$action_filter; if ($flag_alert == 1 && check_acl($config['id_user'], $id_group, 'AW')) { forceExecution($id_group); @@ -418,7 +418,7 @@ if ($agent_view_page === true) { 'form' => [ 'html' => printFormFilterAlert( $id_group, - $filter, + $disabled, $free_search, $url, $filter_standby, From bbb249d031f3d293085d5ae0130bea06f4cb1312 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 31 Jan 2023 12:13:57 +0100 Subject: [PATCH 18/25] #10126 clear log --- .../godmode/reporting/visual_console_builder.elements.php | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.elements.php b/pandora_console/godmode/reporting/visual_console_builder.elements.php index 870316af29..b6e6eb8b24 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.elements.php +++ b/pandora_console/godmode/reporting/visual_console_builder.elements.php @@ -862,7 +862,6 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/'); height: 300, autoOpen: false, beforeClose: function() { - console.log("Entra"); var id_layout_data = $("#active_id_layout_data").val(); var label = tinyMCE.activeEditor.getContent(); $("#hidden-label_" + id_layout_data).val(label); From 3579cc22c1b610f5478cd08b2e743a173ac577cb Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 1 Feb 2023 01:02:36 +0100 Subject: [PATCH 19/25] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4b4a52511b..afc54471c1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.768-230131 +Version: 7.0NG.768-230201 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 9254a5d6f4..9df0081520 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.768-230131" +pandora_version="7.0NG.768-230201" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index c4b3442ef7..1e5d84a983 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.768'; -use constant AGENT_BUILD => '230131'; +use constant AGENT_BUILD => '230201'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index d88a17eb4d..96828c37ca 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_linux %define version 7.0NG.768 -%define release 230131 +%define release 230201 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 926e1bfa3c..9962d1576f 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_linux %define version 7.0NG.768 -%define release 230131 +%define release 230201 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index d389d4d49b..452c313796 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.768" -PI_BUILD="230131" +PI_BUILD="230201" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index e0ff248658..cc492132d2 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230131} +{230201} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 640c3a635f..c1e3246ddd 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.768 Build 230131") +#define PANDORA_VERSION ("7.0NG.768 Build 230201") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d772c549d2..1992da4f68 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.768(Build 230131))" + VALUE "ProductVersion", "(7.0NG.768(Build 230201))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c92ec8113f..37ab3243c8 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.768-230131 +Version: 7.0NG.768-230201 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 05b4621fef..5045deaedf 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.768-230131" +pandora_version="7.0NG.768-230201" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a75e0581c3..e2813badfe 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC230131'; +$build_version = 'PC230201'; $pandora_version = 'v7.0NG.768'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 8d1cfbd00e..3d2b1aba3d 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 37f345c035..ae87851c3b 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.768 -%define release 230131 +%define release 230201 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index b14f0745ce..c699e6db1c 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.768 -%define release 230131 +%define release 230201 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7e84b1df9d..b7b7a9b348 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.768" -PI_BUILD="230131" +PI_BUILD="230201" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index f9f1e4d6fe..8719a2cf50 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.768 Build 230131"; +my $version = "7.0NG.768 Build 230201"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 39ebbb915d..687ff7dff9 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.768 Build 230131"; +my $version = "7.0NG.768 Build 230201"; # save program name for logging my $progname = basename($0); From a69f3eb0dcc1160ed3a55622d1aeeaf527fddf18 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 1 Feb 2023 10:24:35 +0100 Subject: [PATCH 20/25] minor change --- pandora_console/godmode/setup/file_manager.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_console/godmode/setup/file_manager.php b/pandora_console/godmode/setup/file_manager.php index 272eab74f0..f54cf7f7f6 100644 --- a/pandora_console/godmode/setup/file_manager.php +++ b/pandora_console/godmode/setup/file_manager.php @@ -87,8 +87,6 @@ $create_text_file = (bool) get_parameter('create_text_file'); $default_real_directory = realpath($config['homedir'].'/'); -$_FILES['file']['name'] = '../test3.jpeg'; - // Remove double dot in filename path. $file_name = $_FILES['file']['name']; $path_parts = explode('/', $file_name); From 022ca1c6a4dd2df06238038dd3886170dfbcf227 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 1 Feb 2023 13:12:12 +0100 Subject: [PATCH 21/25] fixed ssrf vulnerability --- pandora_console/extensions/api_checker.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandora_console/extensions/api_checker.php b/pandora_console/extensions/api_checker.php index 895d621178..6b4dcf4d72 100755 --- a/pandora_console/extensions/api_checker.php +++ b/pandora_console/extensions/api_checker.php @@ -103,6 +103,15 @@ function api_execute( } } + $url_protocol = parse_url($url)['scheme']; + + if ($url_protocol !== 'http' && $url_protocol !== 'https') { + return [ + 'url' => $url, + 'result' => '', + ]; + } + $curlObj = curl_init($url); if (empty($data) === false) { $url .= http_build_query($data); From 4d24f281fe7d5281495f819b29a50ce009ed0356 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 1 Feb 2023 14:56:30 +0100 Subject: [PATCH 22/25] fixed minor bug --- pandora_console/operation/events/events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 18c928727a..6777ced4c3 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -524,7 +524,7 @@ if (is_ajax() === true) { $tmp->ack_utimestamp_raw = strtotime($tmp->ack_utimestamp); $tmp->ack_utimestamp = ui_print_timestamp( - (int) $tmp->ack_utimestamp, + (empty($tmp->ack_utimestamp) === true) ? 0 : $tmp->ack_utimestamp, true ); $tmp->timestamp = ui_print_timestamp( From 427ab4d058724b83d1ff7e832cc2bea507740773 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 1 Feb 2023 17:51:31 +0100 Subject: [PATCH 23/25] #10277 remove db size in about popup --- pandora_console/include/class/Diagnostics.class.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index a60cb7cf77..b0f698252b 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -659,15 +659,6 @@ class Diagnostics extends Wizard { global $config; - // Size BBDD. - $dbSizeSql = db_get_value_sql( - 'SELECT ROUND(SUM(data_length+index_length)/1024/1024,3) - FROM information_schema.TABLES' - ); - - // Add unit size. - $dbSize = $dbSizeSql.' M'; - $result = [ 'error' => false, 'data' => [ @@ -683,10 +674,6 @@ class Diagnostics extends Wizard 'name' => __('DB Schema Build'), 'value' => $config['db_scheme_build'], ], - 'dbSize' => [ - 'name' => __('DB Size'), - 'value' => $dbSize, - ], ], ]; From b6745696132082d511f8d45175d30f9b6204828c Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 2 Feb 2023 01:01:52 +0100 Subject: [PATCH 24/25] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index afc54471c1..0c48cf6cc3 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.768-230201 +Version: 7.0NG.768-230202 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 9df0081520..6c8a798ef3 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.768-230201" +pandora_version="7.0NG.768-230202" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 1e5d84a983..f6c587dc22 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.768'; -use constant AGENT_BUILD => '230201'; +use constant AGENT_BUILD => '230202'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 96828c37ca..380839216f 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_linux %define version 7.0NG.768 -%define release 230201 +%define release 230202 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 9962d1576f..2fddf75161 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_linux %define version 7.0NG.768 -%define release 230201 +%define release 230202 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 452c313796..ad6e29d2a2 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.768" -PI_BUILD="230201" +PI_BUILD="230202" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cc492132d2..af3fa12867 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230201} +{230202} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index c1e3246ddd..ea47f47d52 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.768 Build 230201") +#define PANDORA_VERSION ("7.0NG.768 Build 230202") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1992da4f68..3e8e853947 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.768(Build 230201))" + VALUE "ProductVersion", "(7.0NG.768(Build 230202))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 37ab3243c8..a433d8e8ae 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.768-230201 +Version: 7.0NG.768-230202 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 5045deaedf..7a0c09cd88 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.768-230201" +pandora_version="7.0NG.768-230202" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e2813badfe..b327c883ee 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC230201'; +$build_version = 'PC230202'; $pandora_version = 'v7.0NG.768'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 3d2b1aba3d..2bd2ffef03 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index ae87851c3b..dde1cc0de3 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.768 -%define release 230201 +%define release 230202 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index c699e6db1c..0a434f2607 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.768 -%define release 230201 +%define release 230202 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index b7b7a9b348..ba1f58d122 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.768" -PI_BUILD="230201" +PI_BUILD="230202" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 8719a2cf50..f0437a5bfb 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.768 Build 230201"; +my $version = "7.0NG.768 Build 230202"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 687ff7dff9..6af8cbfe5e 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.768 Build 230201"; +my $version = "7.0NG.768 Build 230202"; # save program name for logging my $progname = basename($0); From 36b0fc90284781c02d8d4dc459d9dded892c0563 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 3 Feb 2023 01:01:54 +0100 Subject: [PATCH 25/25] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 0c48cf6cc3..52844ccf4e 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.768-230202 +Version: 7.0NG.768-230203 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 6c8a798ef3..56b49f892b 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.768-230202" +pandora_version="7.0NG.768-230203" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f6c587dc22..4ea39cebf9 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.768'; -use constant AGENT_BUILD => '230202'; +use constant AGENT_BUILD => '230203'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 380839216f..893d2e2114 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_linux %define version 7.0NG.768 -%define release 230202 +%define release 230203 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 2fddf75161..b28241dfc0 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_linux %define version 7.0NG.768 -%define release 230202 +%define release 230203 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index ad6e29d2a2..e1d4835d97 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.768" -PI_BUILD="230202" +PI_BUILD="230203" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index af3fa12867..4c8755872a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230202} +{230203} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ea47f47d52..85564a8d4e 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.768 Build 230202") +#define PANDORA_VERSION ("7.0NG.768 Build 230203") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3e8e853947..0c740c8dd5 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.768(Build 230202))" + VALUE "ProductVersion", "(7.0NG.768(Build 230203))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a433d8e8ae..dddc5bfaf0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.768-230202 +Version: 7.0NG.768-230203 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 7a0c09cd88..046ef8206f 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.768-230202" +pandora_version="7.0NG.768-230203" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index b327c883ee..7a1df87826 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC230202'; +$build_version = 'PC230203'; $pandora_version = 'v7.0NG.768'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 2bd2ffef03..9542fd4a64 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index dde1cc0de3..85a0c0f370 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.768 -%define release 230202 +%define release 230203 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 0a434f2607..a863c10426 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.768 -%define release 230202 +%define release 230203 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index ba1f58d122..ead614a9fe 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.768" -PI_BUILD="230202" +PI_BUILD="230203" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index f0437a5bfb..4c9faa6194 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.768 Build 230202"; +my $version = "7.0NG.768 Build 230203"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 6af8cbfe5e..1c72cae187 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.768 Build 230202"; +my $version = "7.0NG.768 Build 230203"; # save program name for logging my $progname = basename($0);
'.__('Dynamic Min.').''.html_print_input_text('dynamic_min', '', '', 10, 255, true).'
'.__('Dynamic Max.').'