From 181b172ba8dc1e82cf8071534b95eba4da515bbd Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 1 Feb 2023 16:57:48 +0100 Subject: [PATCH 1/8] #9529 timezone visual for new users --- .../godmode/setup/setup_general.php | 2 +- pandora_console/include/auth/mysql.php | 4 ++ pandora_console/include/functions_config.php | 4 ++ pandora_console/include/functions_events.php | 52 ++++++++++++++++++- pandora_console/operation/events/events.php | 29 +++++++++-- 5 files changed, 84 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index fa889f3071..4060fe8847 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -276,7 +276,7 @@ foreach ($timezones as $timezone) { } } -$table->data[$i][0] = __('Timezone setup'); +$table->data[$i][0] = __('Server Timezone setup'); $table->data[$i][1] = html_print_input_text_extended( 'timezone_text', $config['timezone'], diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index be845f3fc0..1df8fae13c 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -393,6 +393,10 @@ function process_user_login_remote($login, $pass, $api=false) $user_info['metaconsole_access_node'] = $config['ldap_adv_user_node']; } + if (isset($config['timezonevisual']) === true) { + $user_info['timezone'] = $config['timezonevisual']; + } + $permissions = fill_permissions_ldap($sr); if (empty($permissions) === true) { $config['auth_error'] = __('User not found in database or incorrect password'); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index b0d15d5cef..382e4354a4 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -561,6 +561,10 @@ function config_update_config() $error_update[] = __('Automatically assigned no hierarchy'); } + if (config_update_value('timezonevisual', (string) get_parameter('timezonevisual'), true) === false) { + $error_update[] = __('Automatically timezone visual'); + } + if (config_update_value('autocreate_blacklist', get_parameter('autocreate_blacklist'), true) === false) { $error_update[] = __('Autocreate blacklist'); } diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 3740257717..2e6e836286 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -4235,12 +4235,53 @@ function events_page_details($event, $server_id=0) $data = []; $data[0] = '
'.__('Last contact').'
'; - $data[1] = ($agent['ultimo_contacto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : ui_print_timestamp($agent['ultimo_contacto'], true); + + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + if (!$user_timezone) { + $timezone = timezone_open(date_default_timezone_get()); + $datetime_eur = date_create('now', timezone_open($config['timezone'])); + $dif = timezone_offset_get($timezone, $datetime_eur); + date($config['date_format'], $dif); + if (!date('I')) { + // For summer -3600sec. + $dif -= 3600; + } + + $total_sec = strtotime($agent['ultimo_contacto']); + $total_sec += $dif; + $last_contact = date($config['date_format'], $total_sec); + $last_contact_value = ui_print_timestamp($last_contact, true); + } else { + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + date_default_timezone_set($user_timezone); + + $last_contact_value = human_time_comparation(strtotime($agent['ultimo_contacto']), 'large'); + } + + $data[1] = ($agent['ultimo_contacto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : $last_contact_value; $table_details->data[] = $data; + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + if (!$user_timezone) { + $timezone = timezone_open(date_default_timezone_get()); + $datetime_eur = date_create('now', timezone_open($config['timezone'])); + $dif = timezone_offset_get($timezone, $datetime_eur); + date($config['date_format'], $dif); + if (!date('I')) { + // For summer -3600sec. + $dif -= 3600; + } + + $total_sec = strtotime($agent['ultimo_contacto_remoto']); + $total_sec += $dif; + $lr_contact = date($config['date_format'], $total_sec); + } else { + $lr_contact = date($config['date_format'], strtotime($agent['ultimo_contacto_remoto'])); + } + $data = []; $data[0] = '
'.__('Last remote contact').'
'; - $data[1] = ($agent['ultimo_contacto_remoto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : date_w_fixed_tz($agent['ultimo_contacto_remoto']); + $data[1] = ($agent['ultimo_contacto_remoto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : $lr_contact; $table_details->data[] = $data; $data = []; @@ -4729,6 +4770,13 @@ function events_page_general($event) $data[1] .= __('Last event').': '; $data[1] .= date($config['date_format'], $event['timestamp_last']); } else { + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + if ($user_timezone) { + date_default_timezone_set($user_timezone); + } else { + date_default_timezone_set($config['timezone']); + } + $data[1] = date($config['date_format'], $event['utimestamp']); } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 6777ced4c3..23b8794b5c 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -527,10 +527,31 @@ if (is_ajax() === true) { (empty($tmp->ack_utimestamp) === true) ? 0 : $tmp->ack_utimestamp, true ); - $tmp->timestamp = ui_print_timestamp( - $tmp->timestamp, - true - ); + + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + if (!$user_timezone) { + $timezone = timezone_open(date_default_timezone_get()); + $datetime_eur = date_create('now', timezone_open($config['timezone'])); + $dif = timezone_offset_get($timezone, $datetime_eur); + date($config['date_format'], $dif); + if (!date('I')) { + // For summer -3600sec. + $dif -= 3600; + } + + $total_sec = strtotime($tmp->timestamp); + $total_sec += $dif; + $last_contact = date($config['date_format'], $total_sec); + $last_contact_value = ui_print_timestamp($last_contact, true); + } else { + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + date_default_timezone_set($user_timezone); + $title = date($config['date_format'], strtotime($tmp->timestamp)); + $value = human_time_comparation(strtotime($tmp->timestamp), 'large'); + $last_contact_value = ''.$value.''; + } + + $tmp->timestamp = $last_contact_value; if (is_numeric($tmp->data) === true) { $tmp->data = format_numeric( From 6c64ccd6d6772ecdfc81c3eab376ae8013d15774 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Tue, 21 Feb 2023 15:32:45 +0100 Subject: [PATCH 2/8] implemented consoles management --- pandora_console/extras/mr/62.sql | 17 ++ pandora_console/godmode/consoles/consoles.php | 69 ++++++ pandora_console/godmode/menu.php | 7 + .../include/ajax/consoles.ajax.php | 96 ++++++++ pandora_console/include/lib/Console.php | 138 +++++++++++ pandora_console/pandoradb.sql | 16 ++ pandora_console/views/consoles/list.php | 219 ++++++++++++++++++ 7 files changed, 562 insertions(+) create mode 100644 pandora_console/extras/mr/62.sql create mode 100644 pandora_console/godmode/consoles/consoles.php create mode 100644 pandora_console/include/ajax/consoles.ajax.php create mode 100644 pandora_console/include/lib/Console.php create mode 100644 pandora_console/views/consoles/list.php diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql new file mode 100644 index 0000000000..14baa793af --- /dev/null +++ b/pandora_console/extras/mr/62.sql @@ -0,0 +1,17 @@ +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `tconsole` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_console` BIGINT NOT NULL DEFAULT 0, + `description` TEXT, + `version` TINYTEXT, + `last_execution` INT UNSIGNED NOT NULL DEFAULT 0, + `console_type` TINYINT NOT NULL DEFAULT 0, + `timezone` TINYTEXT, + `public_url` TEXT, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +ALTER TABLE `tuser_task_scheduled` ADD COLUMN `id_console` BIGINT NOT NULL DEFAULT 0; + +COMMIT; diff --git a/pandora_console/godmode/consoles/consoles.php b/pandora_console/godmode/consoles/consoles.php new file mode 100644 index 0000000000..02bbe981aa --- /dev/null +++ b/pandora_console/godmode/consoles/consoles.php @@ -0,0 +1,69 @@ + $ajax_url, + 'message' => $message, + ] +); diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index d98eb9d3c6..9a9d11c02e 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -305,6 +305,13 @@ if ($access_console_node === true) { $sub['godmode/servers/modificar_server']['id'] = 'Manage servers'; } + if ((bool) check_acl($config['id_user'], 0, 'PM') === true + || is_user_admin($config['id_user']) === true + ) { + $sub['godmode/consoles/consoles']['text'] = __('Manage consoles'); + $sub['godmode/consoles/consoles']['id'] = 'Manage consoles'; + } + // This subtabs are only for Pandora Admin. if ((bool) check_acl($config['id_user'], 0, 'PM') === true) { enterprise_hook('ha_cluster'); diff --git a/pandora_console/include/ajax/consoles.ajax.php b/pandora_console/include/ajax/consoles.ajax.php new file mode 100644 index 0000000000..bb20320c75 --- /dev/null +++ b/pandora_console/include/ajax/consoles.ajax.php @@ -0,0 +1,96 @@ + $data, + 'recordsTotal' => $count, + 'recordsFiltered' => $count, + ] + ); + + return; +} + +if ($delete === true) { + $id = get_parameter('id'); + + try { + $console = new Console($id); + $console->delete(); + $console->save(); + echo json_encode(['result' => __('Console successfully deleted')]); + } catch (Exception $e) { + echo json_encode(['result' => $e->getMessage()]); + } + + return; +} diff --git a/pandora_console/include/lib/Console.php b/pandora_console/include/lib/Console.php new file mode 100644 index 0000000000..e6e8d25d57 --- /dev/null +++ b/pandora_console/include/lib/Console.php @@ -0,0 +1,138 @@ + $id]; + + $this->existsInDB = false; + + if (is_numeric($id) === true + && $id > 0 + ) { + parent::__construct( + $table, + $filter, + null, + false + ); + $this->existsInDB = true; + } else { + // Create empty skel. + parent::__construct($table, null); + } + } + + + /** + * Saves current definition of a Console to database. + * + * @return mixed Affected rows of false in case of error. + * @throws \Exception On error. + */ + public function save() + { + if ($this->fields['id'] > 0) { + // Update. + $updates = $this->fields; + + $rs = \db_process_sql_update( + $this->table, + $updates, + ['id' => $this->fields['id']] + ); + + if ($rs === false) { + global $config; + throw new \Exception( + __METHOD__.' error: '.$config['dbconnection']->error + ); + } + } else { + // Creation. + $inserts = $this->fields; + + // Clean null fields. + foreach ($inserts as $k => $v) { + if ($v === null) { + unset($inserts[$k]); + } + } + + $rs = \db_process_sql_insert( + $this->table, + $inserts + ); + + if ($rs === false) { + global $config; + throw new \Exception( + __METHOD__.' error: '.$config['dbconnection']->error + ); + } + + $this->fields['id'] = $rs; + } + + return true; + } + + + /** + * Remove this Console. + * + * @return void + */ + public function delete() + { + if ($this->existsInDB === true) { + \db_process_delete_temp( + $this->table, + 'id', + $this->fields['id'] + ); + } + } +} diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index e43aaa7646..f9eda8cf97 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3758,6 +3758,7 @@ CREATE TABLE IF NOT EXISTS `tuser_task_scheduled` ( `flag_delete` TINYINT UNSIGNED NOT NULL DEFAULT 0, `id_grupo` INT UNSIGNED NOT NULL DEFAULT 0, `enabled` TINYINT UNSIGNED NOT NULL DEFAULT 1, + `id_console` BIGINT NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; @@ -4177,3 +4178,18 @@ CREATE TABLE IF NOT EXISTS `tmonitor_filter` ( `ag_custom_fields` TEXT, PRIMARY KEY (`id_filter`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +-- --------------------------------------------------------------------- +-- Table `tconsole` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tconsole` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_console` BIGINT NOT NULL DEFAULT 0, + `description` TEXT, + `version` TINYTEXT, + `last_execution` INT UNSIGNED NOT NULL DEFAULT 0, + `console_type` TINYINT NOT NULL DEFAULT 0, + `timezone` TINYTEXT, + `public_url` TEXT, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; diff --git a/pandora_console/views/consoles/list.php b/pandora_console/views/consoles/list.php new file mode 100644 index 0000000000..f7a4d6bcc1 --- /dev/null +++ b/pandora_console/views/consoles/list.php @@ -0,0 +1,219 @@ +'; +echo ''; + + +// Consoles list. +try { + $columns = [ + 'id_console', + 'description', + 'version', + 'last_execution', + 'console_type', + 'timezone', + 'public_url', + 'options', + ]; + + $column_names = [ + __('Console ID'), + __('Description'), + __('Version'), + __('Last Execution'), + __('Console type'), + __('Timezone'), + __('Public URL'), + [ + 'text' => __('Options'), + 'class' => 'action_buttons', + ], + ]; + + + $tableId = 'consoles_list'; + // Load datatables user interface. + ui_print_datatable( + [ + 'id' => $tableId, + 'class' => 'info_table', + 'style' => 'width: 100%', + 'columns' => $columns, + 'column_names' => $column_names, + 'ajax_url' => 'include/ajax/consoles.ajax', + 'ajax_data' => ['get_all_datatables_formatted' => 1], + 'ajax_postprocess' => 'process_datatables_item(item)', + 'no_sortable_columns' => [-1], + 'order' => [ + 'field' => 'id', + 'direction' => 'asc', + ], + ] + ); +} catch (Exception $e) { + echo $e->getMessage(); +} + +?> + \ No newline at end of file From 2a118736385511773d3f9eab30ff270bed38b03c Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 6 Mar 2023 12:12:36 +0100 Subject: [PATCH 3/8] #9529 fix events last contact value --- pandora_console/operation/events/events.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index f6cbbf3288..ed8094cda8 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -558,10 +558,7 @@ if (is_ajax() === true) { $last_contact_value = ''.$value.''; } - $tmp->timestamp = ui_print_timestamp( - $tmp->utimestamp, - true - ); + $tmp->timestamp = $last_contact_value; if (is_numeric($tmp->data) === true) { $tmp->data = format_numeric( From cd85c6062002dd9c21560f8890fa9e651fa8f8ed Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Fri, 10 Mar 2023 15:17:21 +0100 Subject: [PATCH 4/8] visual fix after pandora style refactorization --- pandora_console/views/consoles/list.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandora_console/views/consoles/list.php b/pandora_console/views/consoles/list.php index f7a4d6bcc1..dd4a9a8995 100644 --- a/pandora_console/views/consoles/list.php +++ b/pandora_console/views/consoles/list.php @@ -85,7 +85,7 @@ try { [ 'id' => $tableId, 'class' => 'info_table', - 'style' => 'width: 100%', + 'style' => 'width: 99%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'include/ajax/consoles.ajax', @@ -145,8 +145,6 @@ try { }, datatype: "json", success: function (data) { - console.log("dataaaa"); - console.log(data); showMsg(data); }, error: function(e) { From 5113117a392d0a19d843182a63ba887d2342b520 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 29 Mar 2023 01:00:25 +0200 Subject: [PATCH 5/8] 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 d165592662..74e0af2009 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.770-230328 +Version: 7.0NG.770-230329 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 ca1b28074c..b811cd3723 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.770-230328" +pandora_version="7.0NG.770-230329" 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 198ce93a98..dab99b4711 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.770'; -use constant AGENT_BUILD => '230328'; +use constant AGENT_BUILD => '230329'; # 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 f7a6557826..df2f094194 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.770 -%define release 230328 +%define release 230329 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 8463d27509..06fe72b342 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.770 -%define release 230328 +%define release 230329 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 17bd442365..fbcef5e8ad 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.770" -PI_BUILD="230328" +PI_BUILD="230329" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 91d152f1ca..30df9148e5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230328} +{230329} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index dc40c0314b..3b69dd0af1 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.770 Build 230328") +#define PANDORA_VERSION ("7.0NG.770 Build 230329") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 934cd7e37e..9786f5bb3a 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.770(Build 230328))" + VALUE "ProductVersion", "(7.0NG.770(Build 230329))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d30c602a99..2035eda646 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.770-230328 +Version: 7.0NG.770-230329 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 dcda7cf218..884edecb5b 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.770-230328" +pandora_version="7.0NG.770-230329" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 191fb8e151..bd150fc852 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 = 'PC230328'; +$build_version = 'PC230329'; $pandora_version = 'v7.0NG.770'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index cba1fee177..1ae3824e7a 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 baf3fc3826..d2b00dd849 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.770 -%define release 230328 +%define release 230329 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index b77bb73372..95323c1fe4 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.770 -%define release 230328 +%define release 230329 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index a67a88b89a..70be237d28 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.770" -PI_BUILD="230328" +PI_BUILD="230329" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 1aa1f9dcdc..8995679d6f 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.770 Build 230328"; +my $version = "7.0NG.770 Build 230329"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ac6e97e34a..8266fd883d 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.770 Build 230328"; +my $version = "7.0NG.770 Build 230329"; # save program name for logging my $progname = basename($0); From a760bbfbc28e14d4176847fd54235af56656e9c9 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 29 Mar 2023 08:22:35 +0200 Subject: [PATCH 6/8] MIB Uploader fix delete icon --- pandora_console/include/functions_filemanager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 66f60967c7..1e5297dbff 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -751,7 +751,7 @@ function filemanager_file_explorer( && ($readOnly === false) ) { $data[4] .= '
'; - $data[4] .= ''; + $data[4] .= ''; $data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true); $data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['server_unique_identifier']), true); $data[4] .= html_print_input_hidden('delete_file', 1, true); From 32bc7335ac846f96c93f62ba9161fb461211c183 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 29 Mar 2023 09:11:26 +0200 Subject: [PATCH 7/8] fixed styles --- pandora_console/include/styles/pandora.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 7d4ebc1e6c..1df4aaf488 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -5879,7 +5879,12 @@ div.switch_radio_button label:last-of-type { cursor: pointer; } -.switch_radio_button input:checked + label, +.switch_radio_button input:checked + label { + background-color: var(--primary-color); + box-shadow: none; + color: var(--secondary-color) !important; +} + .switch_radio_button input:checked:has(.custom_checkbox) { background-color: var(--primary-color); box-shadow: none; From 9a0dffbee36801cf0f721e2f97f055ad9a832e74 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 29 Mar 2023 11:02:57 +0200 Subject: [PATCH 8/8] Agents modules view fix filters --- pandora_console/extensions/agents_modules.php | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index d3467b846c..5bf3d18ab5 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -729,16 +729,31 @@ function mainAgentsModules() if (isset($modules_selected[0]) === true && $modules_selected[0]) { $all_modules = []; foreach ($modules_selected as $key => $value) { - $name = modules_get_agentmodule_name($value); - $sql = "SELECT id_agente_modulo - FROM tagente_modulo - WHERE nombre = '".$name."';"; + if (is_int($value)) { + $name = modules_get_agentmodule_name($value); + $sql = "SELECT id_agente_modulo + FROM tagente_modulo + WHERE nombre = '".$name."';"; - $result_sql = db_get_all_rows_sql($sql); + $result_sql = db_get_all_rows_sql($sql); - if (is_array($result_sql)) { - foreach ($result_sql as $key => $value) { - $all_modules[$value['id_agente_modulo']] = io_safe_output($name); + if (is_array($result_sql)) { + foreach ($result_sql as $key => $value) { + $all_modules[$value['id_agente_modulo']] = io_safe_output($name); + } + } + } else { + $name = $value; + $sql = "SELECT id_agente_modulo + FROM tagente_modulo + WHERE nombre = '".$name."';"; + + $result_sql = db_get_all_rows_sql($sql); + + if (is_array($result_sql)) { + foreach ($result_sql as $key => $value) { + $all_modules[$value['id_agente_modulo']] = io_safe_output($name); + } } } } @@ -838,7 +853,7 @@ function mainAgentsModules() echo ''; - echo "".__('Agents').' / '.__('Modules').''; + echo "".__('Agents').' / '.__('Modules').''; if ($hor_offset > 0) { $new_hor_offset = ($hor_offset - $block); @@ -958,7 +973,7 @@ function mainAgentsModules() foreach ($module['id'] as $module_id) { if (!$match && array_key_exists($module_id, $agent_modules)) { - echo ""; + echo ""; $win_handle = dechex(crc32($module_id.$module['name'])); $graph_type = return_graphtype(modules_get_agentmodule_type($module_id)); $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."', 800, 480)";