From 574e537ff17d643445f43ff1d0a8c6ba47e0e347 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 14 Nov 2018 12:16:59 +0100 Subject: [PATCH 1/6] Decode entities in the eHorus password. Ref pandora_enterprise#3073. --- pandora_console/operation/agentes/ehorus.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/agentes/ehorus.php b/pandora_console/operation/agentes/ehorus.php index ddb1ca7db2..66a6a778cd 100644 --- a/pandora_console/operation/agentes/ehorus.php +++ b/pandora_console/operation/agentes/ehorus.php @@ -53,7 +53,7 @@ if (empty($ehorus_agent_id)) { $hostname = $config['ehorus_hostname']; $port = $config['ehorus_port']; $user = $config['ehorus_user']; -$password = io_output_password($config['ehorus_pass']); +$password = io_safe_output(io_output_password($config['ehorus_pass'])); $curl_timeout = $config['ehorus_req_timeout']; $base_url = 'https://' . $hostname . ':' . $port; @@ -315,4 +315,4 @@ $client_url = $config['homeurl'] . 'operation/agentes/ehorus_client.php?' . $que $('input#run-ehorus-client').click(handleButtonClick); }); - \ No newline at end of file + From a20d541fb49c6c7d031a1c0852a584b7cf3adab7 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 14 Nov 2018 12:31:35 +0100 Subject: [PATCH 2/6] removed default charset, set to auto --- pandora_console/include/db/mysql.php | 10 +++++++--- pandora_console/include/functions_db.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index 45f0a22db6..9982ec24fb 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -14,7 +14,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null, $charset = "utf8") { +function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null, $charset = null) { global $config; if ($host === null) @@ -42,7 +42,9 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, } db_change_cache_id ($db, $host); - mysqli_set_charset($connect_id, $charset); + if (isset($charset)) { + mysqli_set_charset($connect_id, $charset); + } mysqli_select_db($connect_id, $db); } @@ -54,7 +56,9 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, db_change_cache_id ($db, $host); - @mysql_set_charset($connect_id, $charset); + if (isset($charset)) { + @mysql_set_charset($connect_id, $charset); + } mysql_select_db($db, $connect_id); } diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index eca1a67eeb..386673dc53 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -43,7 +43,7 @@ function db_select_engine() { } } -function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true, $charset = "utf8") { +function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true, $charset = null) { global $config; static $error = 0; From 6174e622c8a6c490be7e57dc63e87c1a528bf945 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 14 Nov 2018 18:15:48 +0100 Subject: [PATCH 3/6] create alert php7 --- pandora_console/general/php7_message.php | 67 +++++++++++++++++++ .../godmode/update_manager/update_manager.php | 6 ++ pandora_console/include/functions_config.php | 23 +++++++ pandora_console/index.php | 7 +- 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 pandora_console/general/php7_message.php diff --git a/pandora_console/general/php7_message.php b/pandora_console/general/php7_message.php new file mode 100644 index 0000000000..5832842d60 --- /dev/null +++ b/pandora_console/general/php7_message.php @@ -0,0 +1,67 @@ +'; + echo '
'; + echo "

" . __('For a correct operation of PandoraFMS you will have to update php to version 7.0 or later.') . "

"; + echo "

" . __(' If you don\'t update, you will lose functionalities:') . "

"; + echo "
    "; + echo "
  • " . __('Report download in PDF format') . "
  • "; + echo "
  • " . __('Sending emails') . "
  • "; + echo "
  • " . __('Metaconsole Collections') . "
  • "; + echo "
  • " . '...' . "
  • "; + echo "
"; + echo '

'.__('Acess Help').'

'; + echo '
'; + echo "
"; + echo html_print_image('images/icono_warning_mr.png', true, array("alt" => __('Warning php version'), "border" => 0)); + echo "
"; +echo ''; +?> + + diff --git a/pandora_console/godmode/update_manager/update_manager.php b/pandora_console/godmode/update_manager/update_manager.php index c54aedc3bb..97dbaad48f 100644 --- a/pandora_console/godmode/update_manager/update_manager.php +++ b/pandora_console/godmode/update_manager/update_manager.php @@ -26,6 +26,12 @@ if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_us return; } +$php_version = phpversion(); +$php_version_array = explode('.', $php_version); +if($php_version_array[0] < 7){ + include_once("general/php7_message.php"); +} + $tab = get_parameter('tab', 'online'); $buttons = array( diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index aeab684350..9087a18376 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2231,6 +2231,29 @@ function config_check () { __("phantomjs is not installed")); } } + + + $php_version = phpversion(); + $php_version_array = explode('.', $php_version); + if($php_version_array[0] < 7){ + if ($config['language'] == 'es') { + $url_help = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Instalaci%C3%B3n_y_actualizaci%C3%B3n_PHP_7'; + } + else{ + $url_help = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:_PHP_7'; + } + + set_pandora_error_for_header( + __('For a correct operation of PandoraFMS you will have to update php to version 7.0 or later.') . "
" . + __(' If you don\'t update, you will lose functionalities:') . "
" . + "
  1. " . __('Report download in PDF format') . "
  2. " . + "
  3. " . __('Sending emails') . "
  4. " . + "
  5. " . __('Metaconsole Collections') . "
  6. " . + "
  7. " . '...' . "
  8. " . + "
" . + ''.__('Acess Help').'', + __("REQUIRED PHP UPDATE")); + } } function config_return_in_bytes($val) { diff --git a/pandora_console/index.php b/pandora_console/index.php index 9111aec168..69bcc7c683 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -940,7 +940,12 @@ if (get_parameter ('login', 0) !== 0) { include_once("general/login_help_dialog.php"); } - + + $php_version = phpversion(); + $php_version_array = explode('.', $php_version); + if($php_version_array[0] < 7){ + include_once("general/php7_message.php"); + } } // Header From e9e132589ce144242e96f1b18d1049955f179a58 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 15 Nov 2018 00:01:29 +0100 Subject: [PATCH 4/6] 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.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 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 444617c108..1edc74b63f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.729-181114 +Version: 7.0NG.729-181115 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 6f69a1b2f6..fdba2aa12a 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.729-181114" +pandora_version="7.0NG.729-181115" 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 b41ef8ab21..d878ae93cb 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.729'; -use constant AGENT_BUILD => '181114'; +use constant AGENT_BUILD => '181115'; # 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 5055aa9f22..cd06bf14f7 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.729 -%define release 181114 +%define release 181115 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 983a2c6857..6b7ae9d5f2 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.729 -%define release 181114 +%define release 181115 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 17a1cd8211..aa84a1f2a1 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.729" -PI_BUILD="181114" +PI_BUILD="181115" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 720743837a..8fe36853ac 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{181114} +{181115} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 69e4209b74..c8518dc9ee 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.729(Build 181114)") +#define PANDORA_VERSION ("7.0NG.729(Build 181115)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index ebc8ccf35d..98cb7fec71 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.729(Build 181114))" + VALUE "ProductVersion", "(7.0NG.729(Build 181115))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 354e8f7821..80c9cb71a3 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.729-181114 +Version: 7.0NG.729-181115 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 a228c80217..f1f3a1183f 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.729-181114" +pandora_version="7.0NG.729-181115" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6b31b39b6e..bdc0562fcf 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC181114'; +$build_version = 'PC181115'; $pandora_version = 'v7.0NG.729'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 7d1636f1bf..c595a07b88 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 101dd25255..719b6ce3ab 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.729 -%define release 181114 +%define release 181115 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 78ebe3251e..79d87ed536 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.729 -%define release 181114 +%define release 181115 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index ea825407fa..f6821b22c1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.729" -PI_BUILD="181114" +PI_BUILD="181115" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 330cd820c7..5291bf9afc 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.729 PS181114"; +my $version = "7.0NG.729 PS181115"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 32d694cc3a..ebbd72300f 100644 --- 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.729 PS181114"; +my $version = "7.0NG.729 PS181115"; # save program name for logging my $progname = basename($0); From b786c6c3ab05360fcdde070d0b4cde07763d049a Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 15 Nov 2018 13:04:35 +0100 Subject: [PATCH 5/6] Fixed snmptrap binary in windows trap generator --- pandora_console/include/functions_snmp.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_snmp.php b/pandora_console/include/functions_snmp.php index fe5333f162..769524744c 100644 --- a/pandora_console/include/functions_snmp.php +++ b/pandora_console/include/functions_snmp.php @@ -25,6 +25,7 @@ * @param string Snmp especific OID. */ function snmp_generate_trap($snmp_host_address, $snmp_community, $snmp_oid, $snmp_agent, $snmp_data, $snmp_type) { + global $config; // Call snmptrap if (empty($config['snmptrap'])) { switch (PHP_OS) { @@ -35,7 +36,9 @@ function snmp_generate_trap($snmp_host_address, $snmp_community, $snmp_oid, $snm $snmptrap_bin = '/usr/pkg/bin/snmptrap'; break; default: - $snmptrap_bin = 'snmptrap'; + $snmptrap_bin = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' + ? 'C:\Windows\snmptrap.exe' + : 'snmptrap'; break; } } From b78c52caa45b88474535caad7d74ffc818ed3681 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 15 Nov 2018 13:22:54 +0100 Subject: [PATCH 6/6] fixed error Acess for Access --- pandora_console/general/php7_message.php | 2 +- pandora_console/include/functions_config.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/general/php7_message.php b/pandora_console/general/php7_message.php index 5832842d60..6df5706598 100644 --- a/pandora_console/general/php7_message.php +++ b/pandora_console/general/php7_message.php @@ -38,7 +38,7 @@ echo '
" . __('Metaconsole Collections') . ""; echo "
  • " . '...' . "
  • "; echo ""; - echo '

    '.__('Acess Help').'

    '; + echo '

    '.__('Access Help').'

    '; echo '
    '; echo "
    "; echo html_print_image('images/icono_warning_mr.png', true, array("alt" => __('Warning php version'), "border" => 0)); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 9087a18376..8e0cf5898d 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2251,7 +2251,7 @@ function config_check () { "
  • " . __('Metaconsole Collections') . "
  • " . "
  • " . '...' . "
  • " . "" . - ''.__('Acess Help').'', + ''.__('Access Help').'', __("REQUIRED PHP UPDATE")); } }