Merge branch 'develop' into ent-10639-unificacion-de-controles-de-fecha

This commit is contained in:
Jonathan 2023-08-29 12:29:41 +02:00
commit 4ca9b6d8d2
32 changed files with 81 additions and 85 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.773.2-230824 Version: 7.0NG.773.2-230829
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.773.2-230824" pandora_version="7.0NG.773.2-230829"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1031,7 +1031,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.773.2'; use constant AGENT_VERSION => '7.0NG.773.2';
use constant AGENT_BUILD => '230824'; use constant AGENT_BUILD => '230829';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.773.2 %define version 7.0NG.773.2
%define release 230824 %define release 230829
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin %define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux %define source_name pandorafms_agent_linux
%define version 7.0NG.773 %define version 7.0NG.773.2
%define release 230725 %define release 230725
Summary: Pandora FMS Linux agent, binary version Summary: Pandora FMS Linux agent, binary version

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.773.2 %define version 7.0NG.773.2
%define release 230824 %define release 230829
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.773.2" PI_VERSION="7.0NG.773.2"
PI_BUILD="230824" PI_BUILD="230829"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{230824} {230829}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.773.2 Build 230824") #define PANDORA_VERSION ("7.0NG.773.2 Build 230829")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Pandora FMS" VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.773.2(Build 230824))" VALUE "ProductVersion", "(7.0NG.773.2(Build 230829))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.773.2-230824 Version: 7.0NG.773.2-230829
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.773.2-230824" pandora_version="7.0NG.773.2-230829"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -1558,7 +1558,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
$all_modules = true; $all_modules = true;
} }
if ($all_common_modules === true) { if ($all_common_modules === true || $all_modules === true) {
$module_names = explode(',', get_parameter('all_common_modules')); $module_names = explode(',', get_parameter('all_common_modules'));
} }
@ -1602,7 +1602,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
foreach ($agents as $agent_id) { foreach ($agents as $agent_id) {
$agent_id = (int) $agent_id; $agent_id = (int) $agent_id;
// Check module belongs to the agent. // Check module belongs to the agent.
if ($modules_selection_mode == 'all' && $all_modules === false) { if ($modules_selection_mode == 'all' && ($all_modules === false || $all_modules === true)) {
$check = false; $check = false;
foreach ($module_names as $module_name) { foreach ($module_names as $module_name) {
$check_module = modules_get_agentmodule_id( $check_module = modules_get_agentmodule_id(
@ -1666,7 +1666,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
); );
} }
if ($result !== false && (bool) $all_modules === false) { if ($result !== false && ((bool) $all_modules === false || (bool) $all_modules === true)) {
foreach ($module_names as $module_name) { foreach ($module_names as $module_name) {
$module = modules_get_agentmodule_id( $module = modules_get_agentmodule_id(
$module_name, $module_name,

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC230824'; $build_version = 'PC230829';
$pandora_version = 'v7.0NG.773.2'; $pandora_version = 'v7.0NG.773.2';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -2760,6 +2760,17 @@ function agents_delete_agent($id_agents, $disableACL=false)
enterprise_include_once('include/functions_agents.php'); enterprise_include_once('include/functions_agents.php');
enterprise_hook('agent_delete_from_cache', [$id_agent]); enterprise_hook('agent_delete_from_cache', [$id_agent]);
// Delete agent from fav menu.
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_agent,
'section' => 'Agents',
'id_user' => $config['id_user'],
]
);
// Break the loop on error. // Break the loop on error.
if ((bool) $error === true) { if ((bool) $error === true) {
break; break;

View File

@ -620,45 +620,33 @@ function planned_downtimes_stop($downtime)
$count = 0; $count = 0;
foreach ($agents as $agent) { foreach ($agents as $agent) {
if ($agent['all_modules']) { $modules = db_get_all_rows_filter(
'tplanned_downtime_modules',
[
'id_agent' => $agent['id_agent'],
'id_downtime' => $id_downtime,
]
);
if (empty($modules)) {
$modules = [];
}
foreach ($modules as $module) {
$result = db_process_sql_update( $result = db_process_sql_update(
'tagente', 'tagente_modulo',
['quiet' => 0], [
['id_agente' => $agent['id_agent']] 'quiet' => 0,
'quiet_by_downtime' => 0,
],
[
'quiet_by_downtime' => 1,
'id_agente_modulo' => $module['id_agent_module'],
]
); );
if ($result) { if ($result) {
$count++; $count++;
} }
} else {
$modules = db_get_all_rows_filter(
'tplanned_downtime_modules',
[
'id_agent' => $agent['id_agent'],
'id_downtime' => $id_downtime,
]
);
if (empty($modules)) {
$modules = [];
}
foreach ($modules as $module) {
$result = db_process_sql_update(
'tagente_modulo',
[
'quiet' => 0,
'quiet_by_downtime' => 0,
],
[
'quiet_by_downtime' => 1,
'id_agente_modulo' => $module['id_agent_module'],
]
);
if ($result) {
$count++;
}
}
} }
} }
break; break;

View File

@ -4170,9 +4170,9 @@ function ui_print_datatable(array $parameters)
// * START JAVASCRIPT. // * START JAVASCRIPT.
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
$file_path = ui_get_full_url('include/javascript/datatablesFunction.js'); $file_path = 'include/javascript/datatablesFunction.js';
} else { } else {
$file_path = ui_get_full_url('../../include/javascript/datatablesFunction.js'); $file_path = '../../include/javascript/datatablesFunction.js';
} }
$file_content = file_get_contents($file_path); $file_content = file_get_contents($file_path);

View File

@ -217,8 +217,12 @@ function initialiceLayout(data) {
success: function(widgetData) { success: function(widgetData) {
// Remove spinner. // Remove spinner.
removeSpinner(element); removeSpinner(element);
widgetData = widgetData.replace("<script", "&lt;script");
widgetData = widgetData.replace("</script", "&lt;/script"); if (widgetData.includes('class="post-widget"')) {
widgetData = widgetData.replace("<script", "&lt;script");
widgetData = widgetData.replace("</script", "&lt;/script");
}
$("#widget-" + id + " .content-widget").append(widgetData); $("#widget-" + id + " .content-widget").append(widgetData);
$("#button-add-widget-" + id).click(function() { $("#button-add-widget-" + id).click(function() {

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'> <div style='padding-bottom: 50px'>
<?php <?php
$version = '7.0NG.773.2'; $version = '7.0NG.773.2';
$build = '230824'; $build = '230829';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.773.2 %define version 7.0NG.773.2
%define release 230824 %define release 230829
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.773.2 %define version 7.0NG.773.2
%define release 230824 %define release 230829
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.773.2 %define version 7.0NG.773.2
%define release 230824 %define release 230829
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.773.2-230824 Version: 7.0NG.773.2-230829
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.773.2-230824" pandora_version="7.0NG.773.2-230829"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.773.2"; my $pandora_version = "7.0NG.773.2";
my $pandora_build = "230824"; my $pandora_build = "230829";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -2660,30 +2660,23 @@ sub pandora_planned_downtime_set_quiet_elements($$$) {
WHERE id_downtime = ' . $downtime_id); WHERE id_downtime = ' . $downtime_id);
foreach my $downtime_agent (@downtime_agents) { foreach my $downtime_agent (@downtime_agents) {
if ($downtime_agent->{'all_modules'}) { my @downtime_modules = get_db_rows($dbh, 'SELECT *
db_do ($dbh, 'UPDATE tagente
SET quiet = 1
WHERE id_agente = ?', $downtime_agent->{'id_agent'});
}
else {
my @downtime_modules = get_db_rows($dbh, 'SELECT *
FROM tplanned_downtime_modules FROM tplanned_downtime_modules
WHERE id_agent = ' . $downtime_agent->{'id_agent'} . ' WHERE id_agent = ' . $downtime_agent->{'id_agent'} . '
AND id_downtime = ' . $downtime_id); AND id_downtime = ' . $downtime_id);
foreach my $downtime_module (@downtime_modules) { foreach my $downtime_module (@downtime_modules) {
# If traversed module was already quiet, do not set quiet_by_downtime flag. # If traversed module was already quiet, do not set quiet_by_downtime flag.
# quiet_by_downtime is used to avoid setting the module back to quiet=0 when downtime is over for those modules that were quiet before the downtime. # quiet_by_downtime is used to avoid setting the module back to quiet=0 when downtime is over for those modules that were quiet before the downtime.
db_do ($dbh, 'UPDATE tagente_modulo db_do ($dbh, 'UPDATE tagente_modulo
SET quiet_by_downtime = 1 SET quiet_by_downtime = 1
WHERE quiet = 0 && id_agente_modulo = ?', WHERE quiet = 0 && id_agente_modulo = ?',
$downtime_module->{'id_agent_module'}); $downtime_module->{'id_agent_module'});
db_do ($dbh, 'UPDATE tagente_modulo db_do ($dbh, 'UPDATE tagente_modulo
SET quiet = 1 SET quiet = 1
WHERE id_agente_modulo = ?', WHERE id_agente_modulo = ?',
$downtime_module->{'id_agent_module'}); $downtime_module->{'id_agent_module'});
}
} }
} }
} }

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.773.2"; my $pandora_version = "7.0NG.773.2";
my $pandora_build = "230824"; my $pandora_build = "230829";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
# #
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.773 %define version 7.0NG.773.2
%define release 230814 %define release 230814
Summary: Pandora FMS Server Summary: Pandora FMS Server

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.773.2 %define version 7.0NG.773.2
%define release 230824 %define release 230829
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.773.2" PI_VERSION="7.0NG.773.2"
PI_BUILD="230824" PI_BUILD="230829"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.773.2 Build 230824"; my $version = "7.0NG.773.2 Build 230829";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.773.2 Build 230824"; my $version = "7.0NG.773.2 Build 230829";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);