diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 534ff5be19..76acd4b169 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210510 +Version: 7.0NG.754-210511 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 81ffd301d3..ba8ff1c9f9 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.754-210510" +pandora_version="7.0NG.754-210511" 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 2702989549..b904a3bc42 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.754'; -use constant AGENT_BUILD => '210510'; +use constant AGENT_BUILD => '210511'; # 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 57f18f62f0..8984992513 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.754 -%define release 210510 +%define release 210511 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 e1895fe5d9..2124636e4f 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.754 -%define release 210510 +%define release 210511 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 1c40d15a32..e2fe704edb 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210510" +PI_BUILD="210511" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cb2afa514a..39f0e0ea99 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210510} +{210511} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 467d3d6a04..5df547c181 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.754(Build 210510)") +#define PANDORA_VERSION ("7.0NG.754(Build 210511)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 15756ba8f0..84320d0433 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.754(Build 210510))" + VALUE "ProductVersion", "(7.0NG.754(Build 210511))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index dc9a610360..ca82b95067 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210510 +Version: 7.0NG.754-210511 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 9c76d31b44..6d9f92c008 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.754-210510" +pandora_version="7.0NG.754-210511" package_pear=0 package_pandora=1 diff --git a/pandora_console/godmode/setup/setup_integria.php b/pandora_console/godmode/setup/setup_integria.php index 9e63fb3639..58a3d054ae 100644 --- a/pandora_console/godmode/setup/setup_integria.php +++ b/pandora_console/godmode/setup/setup_integria.php @@ -282,7 +282,7 @@ $table_remote->data['integria_pass'] = $row; // Integria hostname. $row = []; -$row['name'] = __('API Hostname'); +$row['name'] = __('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true); $row['control'] = html_print_input_text('integria_hostname', $config['integria_hostname'], '', 30, 100, true); $table_remote->data['integria_hostname'] = $row; @@ -329,22 +329,20 @@ $row['control'] = html_print_input_text( true, false, false -).ui_print_help_icon('alert_macros', true); +); $table_alert_settings->data['custom_response_incident_title'] = $row; // Alert incident description. $row = []; -$row['name'] = __('Description'); -$row['control'] = html_print_input_text( +$row['name'] = __('Ticket body'); +$row['control'] = html_print_textarea( 'incident_content', + 7, + 25, $config['incident_content'], '', - 50, - 100, - true, - false, - false -).ui_print_help_icon('alert_macros', true); + true +); $table_alert_settings->data['custom_response_incident_content'] = $row; // Alert default group. @@ -452,22 +450,21 @@ $row['control'] = html_print_input_text( true, false, false -).ui_print_help_icon('response_macros', true); +); $table_cr_settings->data['custom_response_incident_title'] = $row; // Custom response incident description. $row = []; -$row['name'] = __('Description'); -$row['control'] = html_print_input_text( +$row['name'] = __('Ticket body'); +$row['control'] = html_print_textarea( 'cr_incident_content', + 7, + 25, $config['cr_incident_content'], '', - 50, - 100, - true, - false, - false -).ui_print_help_icon('response_macros', true); + true +); + $table_cr_settings->data['custom_response_incident_content'] = $row; // Custom response default group. @@ -599,7 +596,7 @@ if ($has_connection != false) { // Form alert default settings. echo '
'; echo '
'; - echo ''.__('Alert default values').''; + echo ''.__('Alert default values').' '.ui_print_help_icon('alert_macros', true).''; html_print_table($table_alert_settings); @@ -609,7 +606,7 @@ if ($has_connection != false) { // Form custom response default settings. echo '
'; echo '
'; - echo ''.__('Event custom response default values').''; + echo ''.__('Event custom response default values').' '.ui_print_help_icon('alert_macros', true).''; html_print_table($table_cr_settings); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 23fcfe8a3c..1cd5f34cd9 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 = 'PC210510'; +$build_version = 'PC210511'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_integriaims.php b/pandora_console/include/functions_integriaims.php index 436e189a9d..c117b679e5 100644 --- a/pandora_console/include/functions_integriaims.php +++ b/pandora_console/include/functions_integriaims.php @@ -188,7 +188,7 @@ function integria_api_call($api_hostname, $user, $user_pass, $api_pass, $operati } // Build URL for API request. - $url = $api_hostname.'/integria/include/api.php'; + $url = $api_hostname.'/include/api.php'; // ob_start(); // $out = fopen('php://output', 'w'); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 947218a7a9..e82bac98ce 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -42,6 +42,7 @@ require_once $config['homedir'].'/include/functions_users.php'; enterprise_include_once('include/functions_reporting.php'); enterprise_include_once('include/functions_metaconsole.php'); enterprise_include_once('include/functions_inventory.php'); +enterprise_include_once('include/functions_cron.php'); require_once $config['homedir'].'/include/functions_forecast.php'; require_once $config['homedir'].'/include/functions_ui.php'; require_once $config['homedir'].'/include/functions_netflow.php'; @@ -13948,3 +13949,69 @@ function reporting_module_histogram_graph($report, $content, $pdf=0) return reporting_check_structure_content($return); } + + +/** + * Email template for sending reports. + * + * @param string $subjectEmail Subject of email. + * @param string $bodyEmail Body of email. + * @param string $scheduled Id of schedule report. + * @param string $reportName Report name. + * @param string $email Serialized list of destination emails. + * @param array $attachments Attachments. + * + * @return void + */ +function reporting_email_template( + string $subjectEmail='', + string $bodyEmail='', + string $scheduled='', + string $reportName='', + string $email='', + array $attachments=null +) { + // Subject. + $subject = (empty($subjectEmail) === true) ? '[Pandora] '.__('Reports') : $subjectEmail; + // Body. + if (empty($bodyEmail) === true) { + $body = __('Greetings').','; + $body .= '

'; + $body .= __('Attached to this email there\'s a PDF file of the').' '; + $body .= $scheduled.' '.__('report'); + $body .= ' "'.$reportName.'"'; + $body .= '

'; + $body .= __('Generated at').' '.date('Y/m/d H:i:s'); + $body .= '

'; + $body .= __('Thanks for your time.'); + $body .= '

'; + $body .= __('Best regards, Pandora FMS'); + $body .= '

'; + $body .= ''.__('This is an automatically generated email from Pandora FMS, please do not reply.').''; + } else { + $bodyEmail = str_replace( + [ + "\r\n", + "\r", + ' ', + ], + "\n", + $bodyEmail + ); + + $body = '

'.implode("

\n

", explode("\n", $bodyEmail)).'

'; + } + + // Extract list of emails. + $destinationEmails = explode(',', io_safe_output($email)); + foreach ($destinationEmails as $destination) { + $destination = trim($destination); + + // Skip the empty 'to'. + if (empty($destination) === false) { + send_email_attachment($destination, $body, $subject, $attachments); + } else { + db_pandora_audit('ERROR:', 'Cron jobs mail, empty destination email.'); + } + } +} diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 740e5c6053..850842cb1e 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -8500,3 +8500,8 @@ div.stat-win-spinner img { .font_11pt { font-size: 11pt; } + +.checkbox-random-name { + width: 100px !important; + margin-left: 20px; +} diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index b3342794cf..d654d1219f 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -387,7 +387,6 @@ table#diagnostic_info tbody td div { color: #fff; } -.ui-widget-content.ui-autocomplete, .ui-widget-content.ui-autocomplete a { color: #333; } diff --git a/pandora_console/index.php b/pandora_console/index.php index 9d079624d4..462d08d2f9 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -220,7 +220,8 @@ echo ''."\n"; // This starts the page head. In the callback function, // $page['head'] array content will be processed into the head. ob_start('ui_process_page_head'); - +// Avoid clickjacking. +header('X-Frame-Options: SAMEORIGIN'); // Enterprise main. enterprise_include_once('index.php'); diff --git a/pandora_console/install.php b/pandora_console/install.php index 877216b9a1..cbd529980a 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
\ No newline at end of file + diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 7eaa5fcad5..e23b3dfe89 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210510 +%define release 210511 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index 82b2605bef..32c150fd95 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210510 +%define release 210511 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 3494b8e145..9a64b22aca 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210510 +%define release 210511 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 4a7242bcf9..570248af2c 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.754-210510 +Version: 7.0NG.754-210511 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 2586050247..66c1fe0559 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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.754-210510" +pandora_version="7.0NG.754-210511" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 30e7c59d5c..d6205b006e 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -45,7 +45,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210510"; +my $pandora_build = "210511"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index ef00a01b55..b3f8db192a 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1339,6 +1339,9 @@ sub pandora_execute_action ($$$$$$$$$;$) { my $cid_data = "CID_IMAGE"; my $dataname = "CID_IMAGE.png"; + # Decode ampersand. Used for macros with encoded names. + $field3 =~ s/&/&/g; + if (defined($data) && $data =~ /^data:image\/png;base64, /) { # macro _data_ substitution in case is image. $attach_data_as_image = 1; diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index f3e7153a37..b9caadbd8f 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210510"; +my $pandora_build = "210511"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index f8c3e4efb5..35726363dd 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.754 -%define release 210510 +%define release 210511 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 9b74a4cce8..8fc4aece9f 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.754 -%define release 210510 +%define release 210511 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7202d3c8d2..be07ace396 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210510" +PI_BUILD="210511" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index a1e0360b4f..a601c8a258 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.754 PS210510"; +my $version = "7.0NG.754 PS210511"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index a8d5e47d7e..78815064ac 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.754 PS210510"; +my $version = "7.0NG.754 PS210511"; # save program name for logging my $progname = basename($0);