Merge remote-tracking branch 'origin/develop' into ent-3357-7329-comision-europea-ordenar-consolas-por-nombre-en-metaconsola-y-anadir-buscador

This commit is contained in:
fbsanchez 2020-09-17 11:51:29 +02:00
commit 79bedb4982
36 changed files with 98 additions and 53 deletions

View File

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

@ -55,7 +55,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.749';
use constant AGENT_BUILD => '200916';
use constant AGENT_BUILD => '200917';
# 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.749
%define release 200916
%define release 200917
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.749"
PI_BUILD="200916"
PI_BUILD="200917"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{200916}
{200917}
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.749(Build 200916)")
#define PANDORA_VERSION ("7.0NG.749(Build 200917)")
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.749(Build 200916))"
VALUE "ProductVersion", "(7.0NG.749(Build 200917))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.749-200916
Version: 7.0NG.749-200917
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.749-200916"
pandora_version="7.0NG.749-200917"
package_pear=0
package_pandora=1

View File

@ -116,7 +116,7 @@ if ($create_special_day) {
$same_day = (string) get_parameter('same_day');
$values = [];
$values['id_group'] = (string) get_parameter('id_group');
$values['description'] = (string) get_parameter('description');
$values['description'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$aviable_description = true;
if (preg_match('/script/i', $values['description'])) {
@ -180,7 +180,7 @@ if ($update_special_day) {
$date = (string) get_parameter('date');
$date_orig = (string) get_parameter('date_orig');
$same_day = (string) get_parameter('same_day');
$description = (string) get_parameter('description');
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$id_group = (string) get_parameter('id_group');
$id_group_orig = (string) get_parameter('id_group_orig');
@ -515,7 +515,11 @@ for ($month = 1; $month <= 12; $month++) {
break;
}
$cal_table->data[$cal_line][$week] .= ui_print_help_tip($special_day['description'], true);
// Only show description if is filled.
if (empty($special_day['description']) === false) {
$cal_table->data[$cal_line][$week] .= ui_print_help_tip($special_day['description'], true);
}
if ($special_day['id_group'] || ($can_manage_group_all && $special_day['id_group'] == 0)) {
$cal_table->data[$cal_line][$week] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_special_days&id='.$special_day['id'].'" title=';
$cal_table->data[$cal_line][$week] .= __('Edit');

View File

@ -81,8 +81,8 @@ if (defined('METACONSOLE')) {
}
$type = (int) get_parameter('type');
$name = (string) get_parameter('name');
$description = (string) get_parameter('description');
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$max = (int) get_parameter('max');
$min = (int) get_parameter('min');
$tcp_send = (string) get_parameter('tcp_send');

View File

@ -37,8 +37,8 @@ if ($idOS) {
$description = $os['description'];
$icon = $os['icon_name'];
} else {
$name = get_parameter('name', '');
$description = get_parameter('description', '');
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$icon = get_parameter('icon', 0);
}
@ -91,8 +91,8 @@ switch ($action) {
break;
case 'update':
$name = get_parameter('name', '');
$description = get_parameter('description', '');
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$icon = get_parameter('icon', 0);
$values = [];

View File

@ -313,7 +313,7 @@ if ($create_user) {
$password_confirm = (string) get_parameter('password_confirm', '');
$values['email'] = (string) get_parameter('email');
$values['phone'] = (string) get_parameter('phone');
$values['comments'] = (string) get_parameter('comments');
$values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments'))));
$values['is_admin'] = $user_is_admin;
$values['language'] = get_parameter('language', 'default');
$values['timezone'] = (string) get_parameter('timezone');
@ -500,7 +500,7 @@ if ($update_user) {
$values['lastname'] = (string) get_parameter('lastname');
$values['email'] = (string) get_parameter('email');
$values['phone'] = (string) get_parameter('phone');
$values['comments'] = (string) get_parameter('comments');
$values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments'))));
$values['is_admin'] = get_parameter('is_admin', 0);
$values['language'] = (string) get_parameter('language');
$values['timezone'] = (string) get_parameter('timezone');

View File

@ -495,8 +495,8 @@ class ConfigPEN extends HTML
public function add()
{
$pen = get_parameter('pen', 0);
$manufacturer = get_parameter('manufacturer', '');
$description = get_parameter('description', '');
$manufacturer = io_safe_input(strip_tags(io_safe_output((string) get_parameter('manufacturer'))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$is_new = (bool) get_parameter('is_new', false);
if (empty($pen)) {

View File

@ -180,7 +180,7 @@ class ManageNetScanScripts extends Wizard
$result = [];
$reconscript_name = get_parameter('form_name', '');
$reconscript_description = get_parameter('form_description', '');
$reconscript_description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('form_description'))));
$reconscript_script = get_parameter('form_script', '');
// Get macros.
@ -260,7 +260,7 @@ class ManageNetScanScripts extends Wizard
// If modified any parameter.
$reconscript_name = get_parameter('form_name', '');
$reconscript_description = get_parameter('form_description', '');
$reconscript_description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('form_description'))));
$reconscript_script = get_parameter('form_script', '');
// Get macros.

View File

@ -303,8 +303,8 @@ class ModuleTemplates extends HTML
if (!empty($this->action)) {
// Success variable.
$success = false;
$this->name = get_parameter('name', '');
$this->description = get_parameter('description', '');
$this->name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
$this->description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$this->pen = get_parameter('pen', '');
switch ($this->action) {

View File

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

View File

@ -372,6 +372,9 @@ define('MODULE_PREDICTION_CLUSTER_AP', 7);
// Forced agent OS ID for cluster agents.
define('CLUSTER_OS_ID', 100);
// Forced agent OS ID for satellite agents.
define('SATELLITE_OS_ID', 19);
// Type of Webserver Modules.
define('MODULE_WEBSERVER_CHECK_LATENCY', 30);
define('MODULE_WEBSERVER_CHECK_SERVER_RESPONSE', 31);

View File

@ -4360,7 +4360,8 @@ function html_print_input($data, $wrapper='div', $input_only=false)
((isset($data['value']) === true) ? $data['value'] : ''),
((isset($data['attributes']) === true) ? $data['attributes'] : ''),
((isset($data['return']) === true) ? $data['return'] : false),
((isset($data['class']) === true) ? $data['class'] : '')
((isset($data['class']) === true) ? $data['class'] : ''),
((isset($data['disabled']) === true) ? $data['disabled'] : false)
);
break;

View File

@ -63,11 +63,16 @@ class Agent extends Entity
) {
$table = 'tagente';
$filter = ['id_agente' => $id_agent];
$enterprise_class = '\PandoraFMS\Enterprise\Agent';
if (is_numeric($id_agent) === true
&& $id_agent > 0
) {
parent::__construct($table, $filter);
parent::__construct(
$table,
$filter,
$enterprise_class
);
if ($load_modules === true) {
$rows = \db_get_all_rows_filter(
'tagente_modulo',
@ -84,7 +89,7 @@ class Agent extends Entity
}
} else {
// Create empty skel.
parent::__construct($table);
parent::__construct($table, null, $enterprise_class);
// New agent has no modules.
$this->modulesLoaded = true;
@ -408,11 +413,12 @@ class Agent extends Entity
/**
* Search for modules into this agent.
*
* @param array $filter Filters.
* @param array $filter Filters.
* @param integer $limit Limit search results.
*
* @return PandoraFMS\Module Module found.
*/
public function searchModules(array $filter)
public function searchModules(array $filter, int $limit=0)
{
$filter['id_agente'] = $this->id_agente();
@ -423,7 +429,7 @@ class Agent extends Entity
foreach ($this->modules as $module) {
$found = true;
foreach ($filter as $field => $value) {
if ($module->{$field}() !== $value) {
if ($module->{$field}() != $value) {
$found = false;
break;
}
@ -437,7 +443,7 @@ class Agent extends Entity
return $results;
} else {
// Search in db.
return Module::search($filter);
return Module::search($filter, $limit);
}
}

View File

@ -50,6 +50,13 @@ abstract class Entity
*/
protected $table = '';
/**
* Enterprise capabilities object.
*
* @var object
*/
private $enterprise;
/**
* Instances a new object using array definition.
@ -74,13 +81,17 @@ abstract class Entity
/**
* Defines a generic constructor to extract information of the object.
*
* @param string $table Table.
* @param array $filters Filters, for instance ['id' => $id].
* @param string $table Table.
* @param array|null $filters Filters, for instance ['id' => $id].
* @param string|null $enterprise_class Enterprise class name.
*
* @throws \Exception On error.
*/
public function __construct(string $table, ?array $filters=null)
{
public function __construct(
string $table,
?array $filters=null,
?string $enterprise_class=null
) {
if (empty($table) === true) {
throw new \Exception(
get_class($this).' error, table name is not defined'
@ -116,6 +127,12 @@ abstract class Entity
$this->fields[$row['Field']] = null;
}
}
if (\enterprise_installed() === true
&& $enterprise_class !== null
) {
$this->enterprise = new $enterprise_class($this);
}
}
@ -135,6 +152,20 @@ abstract class Entity
return $this->{$methodName}($params);
}
// Enterprise capabilities.
if (\enterprise_installed() === true
&& $this->enterprise !== null
&& method_exists($this->enterprise, $methodName) === true
) {
return call_user_func_array(
[
$this->enterprise,
$methodName,
],
$params
);
}
if (array_key_exists($methodName, $this->fields) === true) {
if (empty($params) === true) {
return $this->fields[$methodName];

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.749
%define release 200916
%define release 200917
# 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.749
%define release 200916
%define release 200917
# 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.749
%define release 200916
%define release 200917
%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.749-200916
Version: 7.0NG.749-200917
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.749-200916"
pandora_version="7.0NG.749-200917"
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.749";
my $pandora_build = "200916";
my $pandora_build = "200917";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -33,7 +33,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.749";
my $pandora_build = "200916";
my $pandora_build = "200917";
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.749
%define release 200916
%define release 200917
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.749 PS200916";
my $version = "7.0NG.749 PS200917";
# 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.749 PS200916";
my $version = "7.0NG.749 PS200917";
# save program name for logging
my $progname = basename($0);