Merge branch 'develop' into ent-10435-cambios-intaladores-online

This commit is contained in:
Rafael 2023-02-21 15:30:20 +01:00
commit f98b8baec1
38 changed files with 163 additions and 85 deletions

View File

@ -1,6 +1,7 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 4.0 %define version 4.0
%define release 1 %define release 1

View File

@ -1,6 +1,7 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 4.0.1 %define version 4.0.1
%define release 1 %define release 1

View File

@ -1,6 +1,7 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent %define name pandorafms_agent
%define version 3.2 %define version 3.2
Summary: Pandora FMS Linux agent Summary: Pandora FMS Linux agent

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.769-230217 Version: 7.0NG.769-230221
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.769-230217" pandora_version="7.0NG.769-230221"
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

@ -1023,7 +1023,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.769'; use constant AGENT_VERSION => '7.0NG.769';
use constant AGENT_BUILD => '230217'; use constant AGENT_BUILD => '230221';
# 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

@ -1,9 +1,10 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.769 %define version 7.0NG.769
%define release 230217 %define release 230221
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -1,9 +1,10 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.769 %define version 7.0NG.769
%define release 230217 %define release 230221
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.769" PI_VERSION="7.0NG.769"
PI_BUILD="230217" PI_BUILD="230221"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{230217} {230221}
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.769 Build 230217") #define PANDORA_VERSION ("7.0NG.769 Build 230221")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.769(Build 230217))" VALUE "ProductVersion", "(7.0NG.769(Build 230221))"
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.769-230217 Version: 7.0NG.769-230221
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.769-230217" pandora_version="7.0NG.769-230221"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -359,6 +359,10 @@ if ($config['enterprise_installed']) {
} }
// CSRF validation. // CSRF validation.
if (isset($_SESSION['csrf_code']) === true) {
unset($_SESSION['csrf_code']);
}
html_print_csrf_hidden(); html_print_csrf_hidden();
echo '</form></div>'; echo '</form></div>';

View File

@ -402,6 +402,11 @@ if ($delete_user === true) {
__('There was a problem deleting the profile') __('There was a problem deleting the profile')
); );
} else if ($disable_user !== false) { } else if ($disable_user !== false) {
// CSRF Validator.
if (html_print_csrf_error()) {
return;
}
// Disable_user. // Disable_user.
$id_user = get_parameter('id', 0); $id_user = get_parameter('id', 0);
@ -646,6 +651,8 @@ $limit = (int) $config['block_size'];
$rowPair = true; $rowPair = true;
$iterator = 0; $iterator = 0;
$cont = 0; $cont = 0;
// Creates csrf.
$csrf = html_print_csrf_hidden(true);
foreach ($info as $user_id => $user_info) { foreach ($info as $user_id => $user_info) {
if (empty($user_id) === true) { if (empty($user_id) === true) {
continue; continue;
@ -815,6 +822,8 @@ foreach ($info as $user_id => $user_info) {
$user_info['id_user'], $user_info['id_user'],
true true
); );
// Same csrf for every disable button for submit.
$data[6] .= $csrf;
$data[6] .= html_print_input_hidden( $data[6] .= html_print_input_hidden(
'disable_user', 'disable_user',
$toDoAction, $toDoAction,

View File

@ -104,6 +104,7 @@ class Diagnostics extends Wizard
'getChartAjax', 'getChartAjax',
'formFeedback', 'formFeedback',
'createdScheduleFeedbackTask', 'createdScheduleFeedbackTask',
'getSystemDate',
]; ];
@ -209,6 +210,7 @@ class Diagnostics extends Wizard
'getAttachmentFolder', 'getAttachmentFolder',
'getInfoTagenteDatos', 'getInfoTagenteDatos',
'getServerThreads', 'getServerThreads',
'getSystemDate',
]; ];
if ($this->pdf === true) { if ($this->pdf === true) {
@ -278,6 +280,10 @@ class Diagnostics extends Wizard
$title = __('SQL show engine innodb status'); $title = __('SQL show engine innodb status');
break; break;
case 'getSystemDate':
$title = __('Date system');
break;
default: default:
// Not possible. // Not possible.
$title = ''; $title = '';
@ -516,6 +522,27 @@ class Diagnostics extends Wizard
} }
/**
* Date system
*
* @return string
*/
public function getSystemDate(): string
{
$result = [
'error' => false,
'data' => [
'date' => [
'name' => __('System Date (Console)'),
'value' => date('H:i:s Y-m-d'),
],
],
];
return json_encode($result);
}
/** /**
* Database size stats. * Database size stats.
* *

View File

@ -413,73 +413,74 @@ class SnmpConsole extends HTML
'class' => 'flex-row', 'class' => 'flex-row',
'inputs' => [ 'inputs' => [
[ [
'label' => __('Alert'), 'label' => __('Alert'),
'type' => 'select', 'type' => 'select',
'id' => 'filter_alert', 'id' => 'filter_alert',
'name' => 'filter_alert', 'input_class' => 'filter_input_datatable',
'class' => 'w200px', 'name' => 'filter_alert',
'fields' => $show_alerts, 'fields' => $show_alerts,
'return' => true, 'return' => true,
'selected' => $this->filter_alert, 'selected' => $this->filter_alert,
], ],
[ [
'label' => __('Severity'), 'label' => __('Severity'),
'type' => 'select', 'type' => 'select',
'id' => 'filter_severity', 'id' => 'filter_severity',
'name' => 'filter_severity', 'input_class' => 'filter_input_datatable',
'class' => 'w200px', 'name' => 'filter_severity',
'fields' => $severities, 'fields' => $severities,
'return' => true, 'return' => true,
'selected' => $this->filter_severity, 'selected' => $this->filter_severity,
], ],
[ [
'label' => __('Free search'), 'label' => __('Free search'),
'type' => 'text', 'type' => 'text',
'class' => 'w400px', 'id' => 'filter_free_search',
'id' => 'filter_free_search', 'input_class' => 'filter_input_datatable',
'name' => 'filter_free_search', 'name' => 'filter_free_search',
'value' => $this->filter_free_search, 'value' => $this->filter_free_search,
], ],
[ [
'label' => __('Status'), 'label' => __('Status'),
'type' => 'select', 'type' => 'select',
'id' => 'filter_status', 'id' => 'filter_status',
'name' => 'filter_status', 'input_class' => 'filter_input_datatable',
'class' => 'w200px', 'name' => 'filter_status',
'fields' => $status_array, 'fields' => $status_array,
'return' => true, 'return' => true,
'selected' => $this->filter_status, 'selected' => $this->filter_status,
], ],
[ [
'label' => __('Group by Enterprise String/IP'), 'label' => __('Group by Enterprise String/IP'),
'type' => 'select', 'type' => 'select',
'name' => 'filter_group_by', 'name' => 'filter_group_by',
'selected' => $this->filter_group_by, 'selected' => $this->filter_group_by,
'disabled' => false, 'disabled' => false,
'return' => true, 'return' => true,
'id' => 'filter_group_by', 'id' => 'filter_group_by',
'fields' => [ 'input_class' => 'filter_input_datatable',
'fields' => [
0 => __('No'), 0 => __('No'),
1 => __('Yes'), 1 => __('Yes'),
], ],
], ],
[ [
'label' => __('Max. hours old'), 'label' => __('Max. hours old'),
'type' => 'text', 'type' => 'text',
'class' => 'w200px', 'id' => 'filter_hours_ago',
'id' => 'filter_hours_ago', 'input_class' => 'filter_input_datatable',
'name' => 'filter_hours_ago', 'name' => 'filter_hours_ago',
'value' => $this->filter_hours_ago, 'value' => $this->filter_hours_ago,
], ],
[ [
'label' => __('Trap type'), 'label' => __('Trap type'),
'type' => 'select', 'type' => 'select',
'id' => 'filter_trap_type', 'id' => 'filter_trap_type',
'name' => 'filter_trap_type', 'input_class' => 'filter_input_datatable',
'class' => 'w200px', 'name' => 'filter_trap_type',
'fields' => $trap_types, 'fields' => $trap_types,
'return' => true, 'return' => true,
'selected' => $this->filter_trap_type, 'selected' => $this->filter_trap_type,
], ],
], ],
], ],

View File

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

View File

@ -797,6 +797,7 @@ if (is_ajax()) {
$db_fragmentation = json_decode($d->getTablesFragmentation()); $db_fragmentation = json_decode($d->getTablesFragmentation());
$sys_info = json_decode($d->getSystemInfo()); $sys_info = json_decode($d->getSystemInfo());
$php_sys = json_decode($d->getPHPSetup()); $php_sys = json_decode($d->getPHPSetup());
$system_date = json_decode($d->getSystemDate());
$fragmentation_status = ''; $fragmentation_status = '';
if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) { if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) {
@ -1030,6 +1031,14 @@ if (is_ajax()) {
<p>'.$sys_info->data->ipInfo->value.'</p> <p>'.$sys_info->data->ipInfo->value.'</p>
</th> </th>
</tr> </tr>
<tr>
<th style="width: 15%;">
<p><span>'.$system_date->data->date->name.'</span></p>
</th>
<th style="width: 85%;">
<p>'.$system_date->data->date->value.'</p>
</th>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -323,6 +323,27 @@ a.pandora_pagination.current:hover {
cursor: default; cursor: default;
} }
.filter_input_datatable {
width: 45% !important;
display: flex;
flex-wrap: nowrap;
flex-direction: row;
max-width: 450px;
min-width: 400px;
}
.filter_input_datatable input {
flex: 1;
}
.filter_input_datatable label {
width: 93px;
max-width: 100%;
}
.filter_input_datatable .select2.select2-container {
flex: 1;
}
.datatable_filter.content li.filter_input_datatable {
margin: 1em 0;
}
/* Default datatable filter style */ /* Default datatable filter style */
.datatable_filter.content { .datatable_filter.content {
display: flex; display: flex;
@ -337,6 +358,7 @@ a.pandora_pagination.current:hover {
.datatable_filter.content li { .datatable_filter.content li {
flex: 1 1 auto; flex: 1 1 auto;
margin: 1em auto; margin: 1em auto;
padding: 0px 10px;
} }
.sorting_desc { .sorting_desc {
background: url(../../images/sort_down_green.png) no-repeat; background: url(../../images/sort_down_green.png) no-repeat;

View File

@ -1049,6 +1049,7 @@ if (isset($_GET['bye'])) {
header_remove('Set-Cookie'); header_remove('Set-Cookie');
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
generate_csrf_code();
// Process logout. // Process logout.
include 'general/logoff.php'; include 'general/logoff.php';

View File

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

View File

@ -2413,8 +2413,6 @@ try {
100, 100,
200, 200,
500, 500,
1000,
-1,
], ],
[ [
$config['block_size'], $config['block_size'],
@ -2423,8 +2421,6 @@ try {
100, 100,
200, 200,
500, 500,
1000,
'All',
], ],
], ],
'order' => [ 'order' => [

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.769 %define version 7.0NG.769
%define release 230217 %define release 230221
# 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.769 %define version 7.0NG.769
%define release 230217 %define release 230221
# 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.769 %define version 7.0NG.769
%define release 230217 %define release 230221
%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

@ -97,7 +97,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('first_login', 0), ('first_login', 0),
('mins_fail_pass', 5), ('mins_fail_pass', 5),
('number_attempts', 5), ('number_attempts', 5),
('enable_pass_policy_admin', 0), ('enable_pass_policy_admin', 1),
('enable_pass_history', 0), ('enable_pass_history', 0),
('compare_pass', 3), ('compare_pass', 3),
('meta_style', 'meta_pandora'), ('meta_style', 'meta_pandora'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.769-230217 Version: 7.0NG.769-230221
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.769-230217" pandora_version="7.0NG.769-230221"
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.769"; my $pandora_version = "7.0NG.769";
my $pandora_build = "230217"; my $pandora_build = "230221";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

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.769"; my $pandora_version = "7.0NG.769";
my $pandora_build = "230217"; my $pandora_build = "230221";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -1,9 +1,10 @@
# #
# Pandora FMS Server # Pandora FMS Server
# #
%global __os_install_post %{nil}
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.769 %define version 7.0NG.769
%define release 230217 %define release 230221
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -1,9 +1,10 @@
# #
# Pandora FMS Server # Pandora FMS Server
# #
%global __os_install_post %{nil}
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.769 %define version 7.0NG.769
%define release 230217 %define release 230221
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.769" PI_VERSION="7.0NG.769"
PI_BUILD="230217" PI_BUILD="230221"
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.769 Build 230217"; my $version = "7.0NG.769 Build 230221";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;
@ -53,6 +53,9 @@ my $SMALL_OPERATION_STEP = 1000; # 1000 is default
# Timeout for lock acquisition. # Timeout for lock acquisition.
my $LOCK_TIMEOUT = 60; my $LOCK_TIMEOUT = 60;
# Cron cookies file.
my $COOKIES_FILE = '/tmp/cron-session-cookies';
# FLUSH in each IO # FLUSH in each IO
$| = 1; $| = 1;
@ -1075,9 +1078,8 @@ sub pandora_delete_old_session_data {
db_do ($dbh, "DELETE FROM tsessions_php WHERE data IS NULL OR id_session REGEXP '^cron-'"); db_do ($dbh, "DELETE FROM tsessions_php WHERE data IS NULL OR id_session REGEXP '^cron-'");
# Delete cron cookies file # Delete cron cookies file
my $cookie_file = '/tmp/cron-session-cookies';
log_message ('PURGE', "Deleting cron session file"); log_message ('PURGE', "Deleting cron session file");
unlink($cookie_file) or die log_message ('PURGE', "Could not delete session file"); unlink($COOKIES_FILE);
} }

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.769 Build 230217"; my $version = "7.0NG.769 Build 230221";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);

View File

@ -571,7 +571,7 @@ foreach my $iface (keys %{$analysis_tree}) {
$inUsage += $analysis_tree->{$iface}{'inUsage'}; $inUsage += $analysis_tree->{$iface}{'inUsage'};
$j++; $j++;
} }
if (is_enabled($analysis_tree->{$iface}{'outUsage'}) || $analysis_tree->{$iface}{'inUsage'} == 0) { if (is_enabled($analysis_tree->{$iface}{'outUsage'}) || $analysis_tree->{$iface}{'outUsage'} == 0) {
$outUsage += $analysis_tree->{$iface}{'outUsage'}; $outUsage += $analysis_tree->{$iface}{'outUsage'};
$k++; $k++;
} }