Merge remote-tracking branch 'origin/develop' into ent-8130-ncm-fase-2

Conflicts:
	pandora_console/extras/mr/51.sql
This commit is contained in:
fbsanchez 2021-12-02 10:43:30 +01:00
commit cad0c6cea6
43 changed files with 347 additions and 50 deletions

View File

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

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.758.1'; use constant AGENT_VERSION => '7.0NG.758.1';
use constant AGENT_BUILD => '211129'; use constant AGENT_BUILD => '211202';
# 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

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.758.1 %define version 7.0NG.758.1
%define release 211129 %define release 211202
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.758.1" PI_VERSION="7.0NG.758.1"
PI_BUILD="211129" PI_BUILD="211202"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{211129} {211202}
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.758.1 Build 211129") #define PANDORA_VERSION ("7.0NG.758.1 Build 211202")
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.758.1(Build 211129))" VALUE "ProductVersion", "(7.0NG.758.1(Build 211202))"
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.758.1-211129 Version: 7.0NG.758.1-211202
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.758.1-211129" pandora_version="7.0NG.758.1-211202"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -1,5 +1,7 @@
START TRANSACTION; START TRANSACTION;
ALTER TABLE tagente_modulo MODIFY debug_content TEXT;
CREATE TABLE IF NOT EXISTS `tncm_queue` ( CREATE TABLE IF NOT EXISTS `tncm_queue` (
`id` SERIAL, `id` SERIAL,
`id_agent` INT(10) UNSIGNED NOT NULL, `id_agent` INT(10) UNSIGNED NOT NULL,
@ -36,17 +38,24 @@ CREATE TABLE IF NOT EXISTS `talert_calendar` (
UNIQUE (`name`) UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_network_location` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tncm_agent` ADD COLUMN `cron_interval` varchar(100) default '' AFTER `execute`; ALTER TABLE `tncm_agent` ADD COLUMN `cron_interval` varchar(100) default '' AFTER `execute`;
ALTER TABLE `tncm_agent` ADD COLUMN `event_on_change` int unsigned default null AFTER `cron_interval`; ALTER TABLE `tncm_agent` ADD COLUMN `event_on_change` int unsigned default null AFTER `cron_interval`;
ALTER TABLE `tipam_network` MODIFY `location` int(10) unsigned NULL;
ALTER TABLE `tipam_network` ADD FOREIGN KEY (`location`) REFERENCES `tipam_network_location`(`id`) ON DELETE CASCADE;
ALTER TABLE `tagent_repository` ADD COLUMN `deployment_timeout` INT UNSIGNED DEFAULT 600 AFTER `path`;
ALTER TABLE `talert_special_days` ADD COLUMN `id_calendar` int(10) unsigned NOT NULL DEFAULT 1; ALTER TABLE `talert_special_days` ADD COLUMN `id_calendar` int(10) unsigned NOT NULL DEFAULT 1;
ALTER TABLE `talert_special_days` ADD COLUMN `day_code` tinyint(2) unsigned NOT NULL DEFAULT 0; ALTER TABLE `talert_special_days` ADD COLUMN `day_code` tinyint(2) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `talert_special_days` DROP COLUMN `same_day`; ALTER TABLE `talert_special_days` DROP COLUMN `same_day`;
ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `talert_calendar`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `talert_calendar`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `tagent_repository` ADD COLUMN `deployment_timeout` INT UNSIGNED DEFAULT 600 AFTER `path`;
ALTER TABLE `tncm_vendor` ADD COLUMN `icon` VARCHAR(255) DEFAULT ''; ALTER TABLE `tncm_vendor` ADD COLUMN `icon` VARCHAR(255) DEFAULT '';
ALTER TABLE `tevento` MODIFY COLUMN `event_type` ENUM('going_unknown','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal', 'configuration_change', 'ncm') DEFAULT 'unknown'; ALTER TABLE `tevento` MODIFY COLUMN `event_type` ENUM('going_unknown','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal', 'configuration_change', 'ncm') DEFAULT 'unknown';
ALTER TABLE `tagent_repository` ADD COLUMN `deployment_timeout` INT UNSIGNED DEFAULT 600 AFTER `path`;
INSERT IGNORE INTO `talert_calendar` VALUES (1, 'Default', 0, 'Default calendar'); INSERT IGNORE INTO `talert_calendar` VALUES (1, 'Default', 0, 'Default calendar');
UPDATE `talert_special_days` set `day_code` = 1 WHERE `same_day` = 'monday'; UPDATE `talert_special_days` set `day_code` = 1 WHERE `same_day` = 'monday';
@ -57,4 +66,8 @@ UPDATE `talert_special_days` set `day_code` = 5 WHERE `same_day` = 'friday';
UPDATE `talert_special_days` set `day_code` = 6 WHERE `same_day` = 'saturday'; UPDATE `talert_special_days` set `day_code` = 6 WHERE `same_day` = 'saturday';
UPDATE `talert_special_days` set `day_code` = 7 WHERE `same_day` = 'sunday'; UPDATE `talert_special_days` set `day_code` = 7 WHERE `same_day` = 'sunday';
INSERT IGNORE INTO `tipam_network_location` (`name`) SELECT `location` FROM `tipam_network` WHERE `location` <> '';
UPDATE `tipam_network` INNER JOIN `tipam_network_location` ON tipam_network_location.name=tipam_network.location SET tipam_network.location=tipam_network_location.id;
UPDATE `tconfig` c1 JOIN (select count(*) as n FROM `tconfig` c2 WHERE (c2.`token` = "node_metaconsole" AND c2.`value` = 1) OR (c2.`token` = "centralized_management" AND c2.`value` = 1) ) v SET c1. `value` = 0 WHERE c1.token = "autocreate_remote_users" AND v.n = 2;
COMMIT; COMMIT;

View File

@ -4045,6 +4045,18 @@ CREATE TABLE IF NOT EXISTS `tipam_supernet_network` (
FOREIGN KEY (`id_network`) REFERENCES tipam_network(`id`) ON UPDATE CASCADE ON DELETE CASCADE FOREIGN KEY (`id_network`) REFERENCES tipam_network(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_network_location` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT IGNORE INTO `tipam_network_location` (`name`) SELECT `location` FROM `tipam_network` WHERE `location` <> '';
UPDATE `tipam_network` INNER JOIN `tipam_network_location` ON tipam_network_location.name=tipam_network.location SET tipam_network.location=tipam_network_location.id;
ALTER TABLE `tipam_network` MODIFY `location` int(10) unsigned NULL;
ALTER TABLE `tipam_network` ADD FOREIGN KEY (`location`) REFERENCES `tipam_network_location`(`id`) ON DELETE CASCADE;
SET @insert_type = 3; SET @insert_type = 3;
SET @insert_name = 'IPAM Recon'; SET @insert_name = 'IPAM Recon';
SET @insert_description = 'This script is used to automatically detect network hosts availability and name, used as Recon Custom Script in the recon task. Parameters used are:\n\n* custom_field1 = network. i.e.: 192.168.100.0/24\n* custom_field2 = associated IPAM network id. i.e.: 4. Please do not change this value, it is assigned automatically in IPAM management.\n\nSee documentation for more information.'; SET @insert_description = 'This script is used to automatically detect network hosts availability and name, used as Recon Custom Script in the recon task. Parameters used are:\n\n* custom_field1 = network. i.e.: 192.168.100.0/24\n* custom_field2 = associated IPAM network id. i.e.: 4. Please do not change this value, it is assigned automatically in IPAM management.\n\nSee documentation for more information.';
@ -4290,3 +4302,5 @@ UPDATE `talert_special_days` set `day_code` = 7 WHERE `same_day` = 'sunday';
ALTER TABLE `talert_special_days` DROP COLUMN `same_day`; ALTER TABLE `talert_special_days` DROP COLUMN `same_day`;
ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `talert_calendar`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `talert_calendar`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
UPDATE `tconfig` c1 JOIN (select count(*) as n FROM `tconfig` c2 WHERE (c2.`token` = "node_metaconsole" AND c2.`value` = 1) OR (c2.`token` = "centralized_management" AND c2.`value` = 1) ) v SET c1. `value` = 0 WHERE c1.token = "autocreate_remote_users" AND v.n = 2;

View File

@ -60,6 +60,7 @@ if (is_ajax()) {
$table->data['fallback_local_auth'] = $row; $table->data['fallback_local_auth'] = $row;
if (enterprise_installed()) { if (enterprise_installed()) {
$is_management_allowed = is_management_allowed();
// Autocreate remote users. // Autocreate remote users.
$row = []; $row = [];
$row['name'] = __('Autocreate remote users'); $row['name'] = __('Autocreate remote users');
@ -67,7 +68,7 @@ if (is_ajax()) {
'autocreate_remote_users', 'autocreate_remote_users',
1, 1,
$config['autocreate_remote_users'], $config['autocreate_remote_users'],
false, (is_metaconsole() === false) ? !$is_management_allowed : false,
'', '',
'', '',
true true

View File

@ -835,7 +835,7 @@ class Client
function ($carry, $item) { function ($carry, $item) {
$matches = []; $matches = [];
if (is_array($item) !== true if (is_array($item) !== true
&& preg_match('/(\d+)\.tar/', $item, $matches) > 0 && preg_match('/([\d\.\d]+?)\.tar/', $item, $matches) > 0
) { ) {
$carry[] = [ $carry[] = [
'version' => $matches[1], 'version' => $matches[1],

View File

@ -75,8 +75,8 @@ class RepoDisk extends Repo
$this->files = []; $this->files = [];
while ($file_name = readdir($dh)) { while ($file_name = readdir($dh)) {
// Files must contain a version number. // Files must contain a version number.
if (preg_match('/(\d+)\_x86_64.'.$this->extension.'$/', $file_name, $utimestamp) === 1 if (preg_match('/([\d\.]+?)\_x86_64.'.$this->extension.'$/', $file_name, $utimestamp) === 1
|| preg_match('/(\d+)\.'.$this->extension.'$/', $file_name, $utimestamp) === 1 || preg_match('/([\d\.]+?)\.'.$this->extension.'$/', $file_name, $utimestamp) === 1
) { ) {
// Add the file to the repository. // Add the file to the repository.
$this->files[$utimestamp[1]] = $file_name; $this->files[$utimestamp[1]] = $file_name;

View File

@ -1309,6 +1309,14 @@ if ($get_extended_event) {
&& isset($config['event_replication']) && isset($config['event_replication'])
&& $config['event_replication'] == 1 && $config['event_replication'] == 1
&& $config['show_events_in_local'] == 1 && $config['show_events_in_local'] == 1
|| enterprise_hook(
'enterprise_acl',
[
$config['id_user'],
'eventos',
'execute_event_responses',
]
) === false
) { ) {
$readonly = true; $readonly = true;
} }

View File

@ -3409,6 +3409,15 @@ class NetworkMap
$output .= '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url( $output .= '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url(
'include/styles/tooltipster.bundle.min.css' 'include/styles/tooltipster.bundle.min.css'
).'" />'."\n"; ).'" />'."\n";
ui_require_css_file('jquery.contextMenu', 'include/styles/js/');
$output .= '<script type="text/javascript" src="';
$output .= ui_get_full_url(
'include/javascript/jquery.contextMenu.js',
false,
false,
false
);
$output .= '" charset="utf-8"></script>';
$output .= '<div id="simple_map" data-id="'.$this->idMap.'" '; $output .= '<div id="simple_map" data-id="'.$this->idMap.'" ';
$output .= 'class="border_1px_dd" style="'; $output .= 'class="border_1px_dd" style="';

View File

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

View File

@ -760,7 +760,11 @@ function mysql_db_format_array_where_clause_sql($values, $join='AND', $prefix=fa
if ($field[0] != '`') { if ($field[0] != '`') {
// If the field is as <table>.<field>, don't scape. // If the field is as <table>.<field>, don't scape.
if (strstr($field, '.') === false) { if (strstr($field, '.') === false) {
$field = '`'.$field.'`'; if (preg_match('/(UPPER|LOWER)(.+)/mi', $field)) {
$field = preg_replace('/(UPPER|LOWER])\((.+)\)/mi', '$1(`$2`)', $field);
} else {
$field = '`'.$field.'`';
}
} }
} }

View File

@ -194,11 +194,11 @@ function custom_graphs_get_user($id_user=0, $only_names=false, $returnAllGroup=t
function custom_graphs_search($id_group, $search) function custom_graphs_search($id_group, $search)
{ {
if ($id_group != '' && $search != '') { if ($id_group != '' && $search != '') {
$all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.' AND name LIKE "%'.$search.'%"'); $all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.' AND (name LIKE "%'.$search.'%" OR description LIKE "'.$search.'")');
} else if ($id_group != '') { } else if ($id_group != '') {
$all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.''); $all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.'');
} else { } else {
$all_graphs = db_get_all_rows_sql('select * from tgraph where name LIKE "%'.$search.'%"'); $all_graphs = db_get_all_rows_sql('select * from tgraph where name LIKE "%'.$search.'%" OR description LIKE "'.$search.'"');
} }
if ($all_graphs === false) { if ($all_graphs === false) {

View File

@ -503,14 +503,14 @@ function menu_add_extras(&$menu)
$menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_editor']['text'] = __('Manage graph templates'); $menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_editor']['text'] = __('Manage graph templates');
$menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_item_editor']['text'] = __('Graph template items'); $menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_item_editor']['text'] = __('Graph template items');
$menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_wizard']['text'] = __('Graph template wizard'); $menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_wizard']['text'] = __('Graph template wizard');
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=wizard&action=wizard']['text'] = __('Templates wizard');
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=template&action=list_template']['text'] = __('Templates');
if ($config['activate_gis']) { if ($config['activate_gis']) {
$menu_extra['godgismaps']['sub']['godmode/gis_maps/configure_gis_map']['text'] = __('Manage GIS Maps'); $menu_extra['godgismaps']['sub']['godmode/gis_maps/configure_gis_map']['text'] = __('Manage GIS Maps');
} }
$menu_extra['workspace']['sub']['operation/messages/message_edit']['text'] = __('Manage messages'); $menu_extra['workspace']['sub']['operation/messages/message_edit']['text'] = __('Manage messages');
$menu_extra['gagente']['sub']['godmode/groups/configure_group']['text'] = __('Manage groups');
$menu_extra['gagente']['sub']['godmode/groups/configure_modu_group']['text'] = __('Manage module groups'); $menu_extra['gagente']['sub']['godmode/groups/configure_modu_group']['text'] = __('Manage module groups');
$menu_extra['gagente']['sub']['godmode/agentes/configure_field']['text'] = __('Manage custom field'); $menu_extra['gagente']['sub']['godmode/agentes/configure_field']['text'] = __('Manage custom field');
@ -524,6 +524,9 @@ function menu_add_extras(&$menu)
$menu_extra['workspace']['sub']['operation/incidents/incident_detail']['text'] = __('Manage incident'); $menu_extra['workspace']['sub']['operation/incidents/incident_detail']['text'] = __('Manage incident');
$menu_extra['gusuarios']['sub']['godmode/groups/configure_group']['text'] = __('Manage groups');
$menu_extra['gusuarios']['sub']['godmode/tag/edit_tag']['text'] = __('Tags management');
// Duplicate extensions as sec=extension to check it from url. // Duplicate extensions as sec=extension to check it from url.
foreach ($menu as $k => $m) { foreach ($menu as $k => $m) {
if (!isset($m['sub'])) { if (!isset($m['sub'])) {
@ -532,7 +535,9 @@ function menu_add_extras(&$menu)
foreach ($m['sub'] as $kk => $mm) { foreach ($m['sub'] as $kk => $mm) {
if (isset($mm['sec'])) { if (isset($mm['sec'])) {
$menu_extra[$mm['sec']]['sub'][$kk]['text'] = $mm['text']; if (empty($menu[$mm['sec']]['sub'][$kk]['text']) === true) {
$menu_extra[$mm['sec']]['sub'][$kk]['text'] = $mm['text'];
}
} }
} }
} }

View File

@ -381,6 +381,52 @@ SimpleMapController.prototype.paint_nodes = function() {
}); });
} }
}); });
if (
typeof node["type_net"] !== "undefined" &&
node["type_net"] === "supernet"
) {
var items_list = {};
items_list["details"] = {
name: "Show/hide subnets",
icon: "show",
disabled: false,
callback: function(key, options) {
self.nodes.forEach(function(subnode) {
if (
subnode.id != node["id"] &&
subnode.id_parent != null &&
subnode.id_parent == node["id"]
) {
if ($("#node_" + subnode.id).css("display") == "none") {
$("#node_" + subnode.id).show();
} else {
$("#node_" + subnode.id).hide();
}
}
});
self.arrows.forEach(function(arrow) {
if (arrow.source == node["id"] || arrow.target == node["id"]) {
if (
$("#arrow_" + arrow.source + "_" + arrow.target).css(
"display"
) == "none"
) {
$("#arrow_" + arrow.source + "_" + arrow.target).show();
} else {
$("#arrow_" + arrow.source + "_" + arrow.target).hide();
}
}
});
}
};
$.contextMenu({
selector: "#node_" + node["id"],
items: items_list
});
}
} }
}); });
}; };
@ -416,6 +462,9 @@ SimpleMapController.prototype.paint_arrows = function() {
}) })
.attr("y2", function(d) { .attr("y2", function(d) {
return self.center_y + self.getSecondPoint(d["dest"], "y"); return self.center_y + self.getSecondPoint(d["dest"], "y");
})
.attr("id", function(d) {
return "arrow_" + d["source"] + "_" + d["target"];
}); });
} }
}; };

View File

@ -1,5 +1,19 @@
/* global $, jQuery*/ /* global $, jQuery*/
/**
* Custom selector for case instensitive contains.
*/
jQuery.expr[":"].iContains = jQuery.expr.createPseudo(function(arg) {
return function(elem) {
return (
jQuery(elem)
.text()
.toUpperCase()
.indexOf(arg.toUpperCase()) >= 0
);
};
});
/** /**
* Add modules from available to selected. * Add modules from available to selected.
*/ */
@ -58,14 +72,14 @@ function filterItems(id, str) {
$("#" + id + " option[value=0]").remove(); $("#" + id + " option[value=0]").remove();
// Move not matching elements filtered to tmp-id. // Move not matching elements filtered to tmp-id.
var tmp = $("#" + id + " option:not(:contains(" + str + "))").toArray(); var tmp = $("#" + id + " option:not(:iContains(" + str + "))").toArray();
tmp.forEach(function(item) { tmp.forEach(function(item) {
$("#tmp-" + id).append(item); $("#tmp-" + id).append(item);
$(this).remove(); $(this).remove();
}); });
// Move matching filter back to id. // Move matching filter back to id.
tmp = $("#tmp-" + id + " option:contains(" + str + ")").toArray(); tmp = $("#tmp-" + id + " option:iContains(" + str + ")").toArray();
tmp.forEach(function(item) { tmp.forEach(function(item) {
$("#" + id).append(item); $("#" + id).append(item);
$(this).remove(); $(this).remove();

View File

@ -104,7 +104,7 @@
.context-menu-item.icon { .context-menu-item.icon {
min-height: 18px; min-height: 18px;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 4px 2px; background-position: 4px center;
} }
.context-menu-item.icon-edit { .context-menu-item.icon-edit {
background-image: url(../../../images/page_white_edit.png); background-image: url(../../../images/page_white_edit.png);
@ -163,6 +163,9 @@
.context-menu-item.icon-interface_link_cancel { .context-menu-item.icon-interface_link_cancel {
background-image: url(../../../images/link_abortar.png); background-image: url(../../../images/link_abortar.png);
} }
.context-menu-item.icon-show {
background-image: url(../../../images/eye_show.png);
}
/* vertically align inside labels */ /* vertically align inside labels */
.context-menu-input > label > * { .context-menu-input > label > * {

View File

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

View File

@ -239,7 +239,8 @@ if ($free_search != '') {
WHERE id_agente IN ( WHERE id_agente IN (
SELECT id_agente SELECT id_agente
FROM tagente FROM tagente
WHERE nombre LIKE "%'.$free_search.'%") OR alias LIKE "%'.$free_search.'%")'.')'; WHERE nombre COLLATE utf8_general_ci LIKE "%'.$free_search.'%")
OR alias COLLATE utf8_general_ci LIKE "%'.$free_search.'%")'.')';
} else { } else {
$whereAlertSimple = ''; $whereAlertSimple = '';
} }

View File

@ -1009,6 +1009,18 @@ if (is_metaconsole() !== true) {
} }
} }
if (enterprise_hook(
'enterprise_acl',
[
$config['id_user'],
'eventos',
'execute_event_responses',
]
) === false
) {
$readonly = true;
}
/* /*
* Load filter form. * Load filter form.
*/ */

View File

@ -139,32 +139,32 @@ if ($searchAlerts) {
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
$whereAlerts = 'AND ( $whereAlerts = 'AND (
id_alert_template IN (SELECT id FROM talert_templates WHERE name LIKE "%'.$stringSearchSQL.'%") OR id_alert_template IN (SELECT id FROM talert_templates WHERE name COLLATE utf8_general_ci LIKE "%'.$stringSearchSQL.'%") OR
id_alert_template IN ( id_alert_template IN (
SELECT id SELECT id
FROM talert_templates FROM talert_templates
WHERE id_alert_action IN ( WHERE id_alert_action IN (
SELECT id SELECT id
FROM talert_actions FROM talert_actions
WHERE name LIKE "%'.$stringSearchSQL.'%")) OR WHERE name COLLATE utf8_general_ci LIKE "%'.$stringSearchSQL.'%")) OR
talert_template_modules.id IN ( talert_template_modules.id IN (
SELECT id_alert_template_module SELECT id_alert_template_module
FROM talert_template_module_actions FROM talert_template_module_actions
WHERE id_alert_action IN ( WHERE id_alert_action IN (
SELECT id SELECT id
FROM talert_actions FROM talert_actions
WHERE name LIKE "%'.$stringSearchSQL.'%")) OR WHERE name COLLATE utf8_general_ci LIKE "%'.$stringSearchSQL.'%")) OR
id_agent_module IN ( id_agent_module IN (
SELECT id_agente_modulo SELECT id_agente_modulo
FROM tagente_modulo FROM tagente_modulo
WHERE nombre LIKE "%'.$stringSearchSQL.'%") OR WHERE nombre COLLATE utf8_general_ci LIKE "%'.$stringSearchSQL.'%") OR
id_agent_module IN ( id_agent_module IN (
SELECT id_agente_modulo SELECT id_agente_modulo
FROM tagente_modulo FROM tagente_modulo
WHERE id_agente IN ( WHERE id_agente IN (
SELECT id_agente SELECT id_agente
FROM tagente FROM tagente
WHERE nombre LIKE "%'.$stringSearchSQL.'%" '.$extra_sql.')) WHERE nombre COLLATE utf8_general_ci LIKE "%'.$stringSearchSQL.'%" '.$extra_sql.'))
)'; )';
break; break;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.758.1 %define version 7.0NG.758.1
%define release 211129 %define release 211202
# 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.758.1 %define version 7.0NG.758.1
%define release 211129 %define release 211202
# 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.758.1 %define version 7.0NG.758.1
%define release 211129 %define release 211202
%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

@ -3941,6 +3941,16 @@ CREATE TABLE `tnode_relations` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tipam_network_location`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tipam_network_location` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
-- Table `tipam_network` -- Table `tipam_network`
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
@ -3949,7 +3959,7 @@ CREATE TABLE IF NOT EXISTS `tipam_network` (
`network` varchar(100) NOT NULL default '', `network` varchar(100) NOT NULL default '',
`name_network` varchar(255) default '', `name_network` varchar(255) default '',
`description` text NOT NULL, `description` text NOT NULL,
`location` tinytext NOT NULL, `location` int(10) unsigned NULL,
`id_recon_task` int(10) unsigned NOT NULL, `id_recon_task` int(10) unsigned NOT NULL,
`scan_interval` tinyint(2) default 1, `scan_interval` tinyint(2) default 1,
`monitoring` tinyint(2) default 0, `monitoring` tinyint(2) default 0,
@ -3957,7 +3967,8 @@ CREATE TABLE IF NOT EXISTS `tipam_network` (
`lightweight_mode` tinyint(2) default 0, `lightweight_mode` tinyint(2) default 0,
`users_operator` text, `users_operator` text,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
FOREIGN KEY (`id_recon_task`) REFERENCES trecon_task(`id_rt`) ON DELETE CASCADE FOREIGN KEY (`id_recon_task`) REFERENCES trecon_task(`id_rt`) ON DELETE CASCADE,
FOREIGN KEY (`location`) REFERENCES `tipam_network_location`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.758.1-211129 Version: 7.0NG.758.1-211202
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.758.1-211129" pandora_version="7.0NG.758.1-211202"
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.758.1"; my $pandora_version = "7.0NG.758.1";
my $pandora_build = "211129"; my $pandora_build = "211202";
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.758.1"; my $pandora_version = "7.0NG.758.1";
my $pandora_build = "211129"; my $pandora_build = "211202";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -376,6 +376,159 @@ my %ENT2CHR = (
'ouml' => chr(246), 'ouml' => chr(246),
'uacute' => chr(250), 'uacute' => chr(250),
'uuml' => chr(252), 'uuml' => chr(252),
# multibyte characters
'OElig' => chr(338),
'oelig' => chr(339),
'Scaron' => chr(352),
'scaron' => chr(353),
'Yuml' => chr(376),
'fnof' => chr(402),
'circ' => chr(710),
'tilde' => chr(732),
'Alpha' => chr(913),
'Beta' => chr(914),
'Gamma' => chr(915),
'Delta' => chr(916),
'Epsilon' => chr(917),
'Zeta' => chr(918),
'Eta' => chr(919),
'Theta' => chr(920),
'Iota' => chr(921),
'Kappa' => chr(922),
'Lambda' => chr(923),
'Mu' => chr(924),
'Nu' => chr(925),
'Xi' => chr(926),
'Omicron' => chr(927),
'Pi' => chr(928),
'Rho' => chr(929),
'Sigma' => chr(931),
'Tau' => chr(932),
'Upsilon' => chr(933),
'Phi' => chr(934),
'Chi' => chr(935),
'Psi' => chr(936),
'Omega' => chr(937),
'alpha' => chr(945),
'beta' => chr(946),
'gamma' => chr(947),
'delta' => chr(948),
'epsilon' => chr(949),
'zeta' => chr(950),
'eta' => chr(951),
'theta' => chr(952),
'iota' => chr(953),
'kappa' => chr(954),
'lambda' => chr(955),
'mu' => chr(956),
'nu' => chr(957),
'xi' => chr(958),
'omicron' => chr(959),
'pi' => chr(960),
'rho' => chr(961),
'sigmaf' => chr(962),
'sigma' => chr(963),
'tau' => chr(964),
'upsilon' => chr(965),
'phi' => chr(966),
'chi' => chr(967),
'psi' => chr(968),
'omega' => chr(969),
'thetasym' => chr(977),
'upsih' => chr(978),
'piv' => chr(982),
'ensp' => chr(8194),
'emsp' => chr(8195),
'thinsp' => chr(8201),
'zwnj' => chr(8204),
'zwj' => chr(8205),
'lrm' => chr(8206),
'rlm' => chr(8207),
'ndash' => chr(8211),
'mdash' => chr(8212),
'lsquo' => chr(8216),
'rsquo' => chr(8217),
'sbquo' => chr(8218),
'ldquo' => chr(8220),
'rdquo' => chr(8221),
'bdquo' => chr(8222),
'dagger' => chr(8224),
'Dagger' => chr(8225),
'bull' => chr(8226),
'hellip' => chr(8230),
'permil' => chr(8240),
'prime' => chr(8242),
'Prime' => chr(8243),
'lsaquo' => chr(8249),
'rsaquo' => chr(8250),
'oline' => chr(8254),
'frasl' => chr(8260),
'euro' => chr(8364),
'image' => chr(8465),
'weierp' => chr(8472),
'real' => chr(8476),
'trade' => chr(8482),
'alefsym' => chr(8501),
'larr' => chr(8592),
'uarr' => chr(8593),
'rarr' => chr(8594),
'darr' => chr(8595),
'harr' => chr(8596),
'crarr' => chr(8629),
'lArr' => chr(8656),
'uArr' => chr(8657),
'rArr' => chr(8658),
'dArr' => chr(8659),
'hArr' => chr(8660),
'forall' => chr(8704),
'part' => chr(8706),
'exist' => chr(8707),
'empty' => chr(8709),
'nabla' => chr(8711),
'isin' => chr(8712),
'notin' => chr(8713),
'ni' => chr(8715),
'prod' => chr(8719),
'sum' => chr(8721),
'minus' => chr(8722),
'lowast' => chr(8727),
'radic' => chr(8730),
'prop' => chr(8733),
'infin' => chr(8734),
'ang' => chr(8736),
'and' => chr(8743),
'or' => chr(8744),
'cap' => chr(8745),
'cup' => chr(8746),
'int' => chr(8747),
'there4' => chr(8756),
'sim' => chr(8764),
'cong' => chr(8773),
'asymp' => chr(8776),
'ne' => chr(8800),
'equiv' => chr(8801),
'le' => chr(8804),
'ge' => chr(8805),
'sub' => chr(8834),
'sup' => chr(8835),
'nsub' => chr(8836),
'sube' => chr(8838),
'supe' => chr(8839),
'oplus' => chr(8853),
'otimes' => chr(8855),
'perp' => chr(8869),
'sdot' => chr(8901),
'lceil' => chr(8968),
'rceil' => chr(8969),
'lfloor' => chr(8970),
'rfloor' => chr(8971),
'lang' => chr(9001),
'rang' => chr(9002),
'loz' => chr(9674),
'spades' => chr(9824),
'clubs' => chr(9827),
'hearts' => chr(9829),
'diams' => chr(9830),
); );
# Construct the character to entity mapping. # Construct the character to entity mapping.
@ -475,7 +628,7 @@ sub safe_input($) {
return "" unless defined($value); return "" unless defined($value);
$value =~ s/([\x00-\xFF])/$CHR2ENT{$1}||$1/ge; $value =~ s/(.)/$CHR2ENT{$1}||$1/ge;
return $value; return $value;
} }

View File

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

View File

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

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.758.1" PI_VERSION="7.0NG.758.1"
PI_BUILD="211129" PI_BUILD="211202"
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.758.1 Build 211129"; my $version = "7.0NG.758.1 Build 211202";
# 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.758.1 Build 211129"; my $version = "7.0NG.758.1 Build 211202";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);