Merge remote-tracking branch 'origin/develop' into ent-3409-pandora-network-traffic-analyzer-ntop-fork-fase-1

Conflicts:
	pandora_console/include/class/ConsoleSupervisor.php

Former-commit-id: 7bdd1bfbcbc43410fb05465418979f4d085fa230
This commit is contained in:
fermin831 2019-03-27 11:59:25 +01:00
commit 9ee095406b
31 changed files with 94 additions and 49 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.732-190326
Version: 7.0NG.732-190327
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.732
%define release 190326
%define release 190327
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.732
%define release 190326
%define release 190327
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.732"
PI_BUILD="190326"
PI_BUILD="190327"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190326}
{190327}
ViewReadme
{Yes}

View File

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

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.732(Build 190326))"
VALUE "ProductVersion", "(7.0NG.732(Build 190327))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.732-190326
Version: 7.0NG.732-190327
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -19,10 +19,11 @@ require_once 'include/functions_notifications.php';
config_check();
if ($_SESSION['menu_type']=='classic')
if ($_SESSION['menu_type'] == 'classic') {
echo '<div id="header_table" class="header_table_classic">';
else
} else {
echo '<div id="header_table" class="header_table_collapsed">';
}
?>
<div id="header_table_inner">
<?php
@ -178,7 +179,8 @@ else
);
if ((isset($select[0]['time_autorefresh']) === true)
&& $select[0]['time_autorefresh'] !== 0 && !$config['refr']
&& $select[0]['time_autorefresh'] !== 0
&& $config['refr'] === null
) {
$config['refr'] = $select[0]['time_autorefresh'];
$autorefresh_txt .= ' (<span id="refrcounter">';

View File

@ -234,6 +234,7 @@ class ConsoleSupervisor
/*
* Check license.
* NOTIF.LICENSE.EXPIRATION
* NOTIF.LICENSE.LIMITED
*/
$this->checkLicense();
@ -537,6 +538,10 @@ class ConsoleSupervisor
}
switch ($data['type']) {
case 'NOTIF.LICENSE.LIMITED':
$max_age = 0;
break;
case 'NOTIF.LICENSE.EXPIRATION':
case 'NOTIF.FILES.ATTACHMENT':
case 'NOTIF.FILES.DATAIN':
@ -684,11 +689,27 @@ class ConsoleSupervisor
$days_to_expiry = ((strtotime($license['expiry_date']) - time()) / (60 * 60 * 24));
// Limited mode.
if (isset($config['limited_mode'])) {
// Warn user if license is going to expire in 15 days or less.
$this->notify(
[
'type' => 'NOTIF.LICENSE.LIMITED',
'title' => __('Limited mode.'),
'message' => io_safe_output($config['limited_mode']),
'url' => 'index.php?sec=gsetup&sec2=godmode/setup/license',
]
);
} else {
$this->cleanNotifications('NOTIF.LICENSE.LIMITED');
}
// Expiry.
if (($days_to_expiry <= 15) && ($days_to_expiry > 0)) {
// Warn user if license is going to expire in 15 days or less.
$this->notify(
[
'type' => 'NOTIF.LICENSE_EXPIRATION',
'type' => 'NOTIF.LICENSE.EXPIRATION',
'title' => __('License is about to expire'),
'message' => __(
'Your license will expire in %d days. Please, contact our sales department.',

View File

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

View File

@ -1444,7 +1444,13 @@ function enterprise_include($filename)
global $config;
// Load enterprise extensions
$filepath = realpath($config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename);
if (defined('DESTDIR')) {
$destdir = DESTDIR;
} else {
$destdir = '';
}
$filepath = realpath($destdir.$config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename);
if ($filepath === false) {
return ENTERPRISE_NOT_HOOK;

View File

@ -380,7 +380,18 @@ function extensions_load_extensions($process_login)
// ~ }
// ~ }
// ~ else {
try {
include_once $path_extension;
}
// PHP 7
catch (Throwable $e) {
}
// PHP 5
catch (Exception $e) {
}
// ~ }
}
}

View File

@ -539,10 +539,6 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
foreach ($item['data'] as $sla) {
if (isset($sla)) {
$the_first_men_time = get_agent_first_time(
io_safe_output($sla['agent'])
);
// First_table.
$row = [];
$row[] = $sla['agent'];
@ -2995,10 +2991,6 @@ function reporting_html_availability($table, $item, $pdf=0)
$table2->style[5] = 'text-align: right';
foreach ($item['data'] as $row) {
$the_first_men_time = get_agent_first_time(
io_safe_output($row['agent'])
);
$table_row = [];
$table_row[] = $row['agent'];
$table_row[] = $row['availability_item'];
@ -3307,9 +3299,8 @@ function get_agent_first_time($agent_name)
$id = agents_get_agent_id($agent_name, true);
$utimestamp = db_get_all_rows_sql(
'SELECT utimestamp FROM tagente_datos WHERE id_agente_modulo IN
(SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = '.$id.')
ORDER BY utimestamp ASC LIMIT 1'
'SELECT min(utimestamp) FROM tagente_datos WHERE id_agente_modulo IN
(SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = '.$id.')'
);
$utimestamp = $utimestamp[0]['utimestamp'];

View File

@ -163,12 +163,21 @@ $(document).ready (function () {
background: "black"
},
open: function() {
setTimeout(function(){
$("#spinner_ok").hide();
var remaining = 30;
// Timeout counter.
var count = function() {
if (remaining > 0) {
$("#license_error_remaining").text(remaining);
remaining -= 1;
} else {
$("#license_error_remaining").hide();
$("#ok_buttom").show();
},
30000
);
clearInterval(count);
}
}
setInterval(count, 1000);
}
});

View File

@ -173,8 +173,8 @@ if (!empty($config['https']) && empty($_SERVER['HTTPS'])) {
// Pure mode (without menu, header and footer).
$config['pure'] = (bool) get_parameter('pure');
// Auto Refresh page (can now be disabled anywhere in the script)
if (get_parameter('refr')) {
// Auto Refresh page (can now be disabled anywhere in the script).
if (get_parameter('refr') != null) {
$config['refr'] = (int) get_parameter('refr');
}
@ -244,6 +244,10 @@ if (strlen($search) > 0) {
// Login process
if (! isset($config['id_user'])) {
// Clear error messages.
unset($_COOKIE['errormsg']);
setcookie('errormsg', null, -1);
if (isset($_GET['login'])) {
include_once 'include/functions_db.php';
// Include it to use escape_string_sql function
@ -1026,10 +1030,11 @@ if ($config['pure'] == 0) {
echo '<div id="container"><div id="head">';
include 'general/header.php';
if ($_SESSION['menu_type']=='classic')
if ($_SESSION['menu_type'] == 'classic') {
echo '</div><div id="page" class="page_classic"><div id="menu">';
else
} else {
echo '</div><div id="page" class="page_collapsed"><div id="menu">';
}
include 'general/main_menu.php';
echo '</div>';

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.732';
$build = '190326';
$build = '190327';
$banner = "v$version Build $build";
error_reporting(0);

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.732-190326
Version: 7.0NG.732-190327
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.732
%define release 190326
%define release 190327
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.732
%define release 190326
%define release 190327
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.732 PS190326";
my $version = "7.0NG.732 PS190327";
# Pandora server configuration
my %conf;

View File

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