diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index cce401a38e..2ac59fc8d8 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.746-200619 +Version: 7.0NG.746-200623 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 6000a4649c..50bca46312 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.746-200619" +pandora_version="7.0NG.746-200623" 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 8235ef30a7..7488696c43 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.746'; -use constant AGENT_BUILD => '200619'; +use constant AGENT_BUILD => '200623'; # 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 c0ffaffb19..b08bc3d1fb 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_unix %define version 7.0NG.746 -%define release 200619 +%define release 200623 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 541b3cd798..1659722628 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.746 -%define release 200619 +%define release 200623 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 dab87f1b01..41c8150c9b 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.746" -PI_BUILD="200619" +PI_BUILD="200623" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index be816e92f3..b7ba3ced8d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{200619} +{200623} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 08ec60e1ca..99bda65375 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.746(Build 200619)") +#define PANDORA_VERSION ("7.0NG.746(Build 200623)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1f1d27db3d..2e2b2cfbf8 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.746(Build 200619))" + VALUE "ProductVersion", "(7.0NG.746(Build 200623))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b26e961b95..9653ced84e 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.746-200619 +Version: 7.0NG.746-200623 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 3a3f26957c..2f571587ef 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.746-200619" +pandora_version="7.0NG.746-200623" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/39.sql b/pandora_console/extras/mr/39.sql new file mode 100644 index 0000000000..d37235e2ff --- /dev/null +++ b/pandora_console/extras/mr/39.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +ALTER TABLE `tmensajes` ADD COLUMN `hidden_sent` TINYINT(1) UNSIGNED DEFAULT 0; + +COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index b148f0f58d..d05785f4ed 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -2314,6 +2314,7 @@ ALTER TABLE `tmensajes` ADD COLUMN `response_mode` VARCHAR(200) DEFAULT NULL; ALTER TABLE `tmensajes` ADD COLUMN `citicity` INT(10) UNSIGNED DEFAULT '0'; ALTER TABLE `tmensajes` ADD COLUMN `id_source` BIGINT(20) UNSIGNED NOT NULL; ALTER TABLE `tmensajes` ADD COLUMN `subtype` VARCHAR(255) DEFAULT ''; +ALTER TABLE `tmensajes` ADD COLUMN `hidden_sent` TINYINT(1) UNSIGNED DEFAULT 0; ALTER TABLE `tmensajes` ADD CONSTRAINT `tsource_fk` FOREIGN KEY (`id_source`) REFERENCES `tnotification_source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `tmensajes` DROP COLUMN `id_usuario_destino`, ADD UNIQUE INDEX `id_mensaje` (`id_mensaje`); diff --git a/pandora_console/godmode/alerts/alert_special_days.php b/pandora_console/godmode/alerts/alert_special_days.php index e6f532c1e8..d1a91eb645 100644 --- a/pandora_console/godmode/alerts/alert_special_days.php +++ b/pandora_console/godmode/alerts/alert_special_days.php @@ -119,7 +119,7 @@ if ($create_special_day) { $values['description'] = (string) get_parameter('description'); $aviable_description = true; - if (preg_match('"; $returnString = ob_get_clean(); diff --git a/pandora_console/include/functions_messages.php b/pandora_console/include/functions_messages.php index e0212a9478..08b0b10d48 100644 --- a/pandora_console/include/functions_messages.php +++ b/pandora_console/include/functions_messages.php @@ -311,7 +311,7 @@ function messages_get_message_sent(int $message_id) $sql = sprintf( "SELECT id_usuario_origen, subject, mensaje, timestamp FROM tmensajes - WHERE id_usuario_origen='%s' AND id_mensaje=%d", + WHERE id_usuario_origen='%s' AND id_mensaje=%d AND hidden_sent = 0", $config['id_user'], $message_id ); @@ -431,7 +431,7 @@ function messages_get_count_sent(string $user='') $sql = sprintf( "SELECT COUNT(*) - FROM tmensajes WHERE id_usuario_origen='%s'", + FROM tmensajes WHERE id_usuario_origen='%s' AND hidden_sent = 0", $user ); @@ -579,6 +579,17 @@ function messages_get_overview_sent( $order .= ' DESC'; } + $filter = [ + 'id_usuario_origen' => $config['id_user'], + 'hidden_sent' => 0, + 'order' => $order, + ]; + + return db_get_all_rows_filter( + 'tmensajes', + $filter + ); + return db_get_all_rows_field_filter( 'tmensajes', 'id_usuario_origen', @@ -661,3 +672,27 @@ function messages_get_url($message_id) // Return the message direction. return ui_get_full_url('index.php?sec=message_list&sec2=operation/messages/message_edit&read_message=1&id_message='.$message_id); } + + +/** + * Deletes sent message + * + * @param integer $message_id Message id to get URL. + * + * @return boolean true when deleted, false in case of error + */ +function messages_delete_message_sent($id_message) +{ + global $config; + + $ret = db_process_sql_update( + 'tmensajes', + ['hidden_sent' => 1], + [ + 'id_mensaje' => $id_message, + 'id_usuario_origen' => $config['id_user'], + ] + ); + + return $ret; +} diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 9a4ed439fa..99b9faecc1 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2142,10 +2142,24 @@ function reporting_html_historical_data($table, $item, $pdf=0) $table1->data = []; foreach ($item['data'] as $data) { if (!is_numeric($data[__('Data')])) { - $row = [ - $data[__('Date')], - $data[__('Data')], - ]; + if (is_snapshot_data($data[__('Data')])) { + if ($config['command_snapshot']) { + $row = [ + $data[__('Date')], + '', + ]; + } else { + $row = [ + $data[__('Date')], + wordwrap(io_safe_input($data[__('Data')]), 60, "
\n", true), + ]; + } + } else { + $row = [ + $data[__('Date')], + $data[__('Data')], + ]; + } } else { $row = [ $data[__('Date')], @@ -2191,6 +2205,8 @@ function reporting_html_historical_data($table, $item, $pdf=0) */ function reporting_html_database_serialized($table, $item, $pdf=0) { + global $config; + $table1 = new stdClass(); $table1->width = '100%'; $table1->head = [ @@ -2205,9 +2221,19 @@ function reporting_html_database_serialized($table, $item, $pdf=0) $table1->data = []; foreach ($item['data'] as $data) { - foreach ($data['data'] as $data_unserialied) { + foreach ($data['data'] as $data_unserialized) { $row = [$data['date']]; - $row = array_merge($row, $data_unserialied); + foreach ($data_unserialized as $key => $data_value) { + if (is_snapshot_data($data_unserialized[$key])) { + if ($config['command_snapshot']) { + $data_unserialized[$key] = ''; + } else { + $data_unserialized[$key] = wordwrap(io_safe_input($data_value), 60, "
\n", true); + } + } + } + + $row = array_merge($row, $data_unserialized); $table1->data[] = $row; } } diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 9666196a6c..1899cd416c 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -226,14 +226,13 @@ function flot_area_graph( $config['custom_graph_width'], true ); - /* - $return .= "
"; - */ + $return .= "
"; $return .= "