Merge remote-tracking branch 'origin/develop' into ent-7844-revision-acl-enterprise-parte-3-fallos-actuales

This commit is contained in:
Calvo 2021-09-01 11:06:20 +02:00
commit 3204fdb71f
114 changed files with 2019 additions and 1381 deletions

View File

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

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.756"
PI_BUILD="210811"
PI_BUILD="210901"
OS_NAME=`uname -s`
FORCE=0

View File

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

View File

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

View File

@ -1,5 +1,7 @@
START TRANSACTION;
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
ALTER TABLE `tmetaconsole_setup` ADD COLUMN `unified` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tlayout` ADD COLUMN `auto_adjust` INTEGER UNSIGNED NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `title` TEXT default '';

View File

@ -0,0 +1,7 @@
START TRANSACTION;
UPDATE `tconfig` set value = 'Lato-Regular.ttf' WHERE token LIKE 'custom_report_front_font';
UPDATE `tconfig` set value = 'Lato-Regular.ttf' WHERE token LIKE 'fontpath';
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';
COMMIT;

View File

@ -1028,6 +1028,7 @@ ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`);
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
-- ---------------------------------------------------------------------
-- Table `tmetaconsole_event_history`
@ -2350,6 +2351,8 @@ ALTER TABLE `tevento` ADD COLUMN `data` double(50,5) default NULL;
ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
-- ---------------------------------------------------------------------
-- Table `tevent_extended`
-- ---------------------------------------------------------------------
@ -4075,3 +4078,5 @@ CREATE TABLE IF NOT EXISTS `talert_execution_queue` (
`utimestamp` bigint(20) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';

View File

@ -23,13 +23,8 @@ ui_require_css_file('order_interpreter');
// Global errors/warnings checking.
config_check();
echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
if ($config['menu_type'] == 'classic') {
echo '<div id="header_table" class="header_table_classic">';
} else {
echo '<div id="header_table" class="header_table_collapsed">';
}
?>
<div id="header_table_inner">
<?php

View File

@ -1,17 +1,33 @@
<?php
/**
* Lateral Main Menu.
*
* @category Main Menu.
* @package Pandora FMS.
* @subpackage OpenSource.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
if (! isset($config['id_user'])) {
// Begin.
if (isset($config['id_user']) === false) {
include 'general/login_page.php';
exit();
}
@ -20,9 +36,9 @@ if (! isset($config['id_user'])) {
<script type="text/javascript" language="javascript">
$(document).ready(function(){
var menuType_value = "<?php echo $config['menu_type']; ?>";
var menuType_value = "<?php echo $_SESSION['menu_type']; ?>";
if (menuType_value == 'classic') {
if (menuType_value === '' || menuType_value === 'classic') {
$('ul.submenu').css('left', '214px');
}
else{
@ -34,26 +50,22 @@ $(document).ready(function(){
<?php
$autohidden_menu = 0;
if (isset($config['autohidden_menu']) && $config['autohidden_menu']) {
if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_menu'] === true) {
$autohidden_menu = 1;
}
// Menu container prepared to autohide menu
if ($config['menu_type'] == 'classic') {
echo '<div id="menu_full" class="menu_full_classic">';
} else {
echo '<div id="menu_full" class="menu_full_collapsed">';
}
// Start of full lateral menu.
echo sprintf('<div id="menu_full" class="menu_full_%s">', $menuTypeClass);
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
if (!defined('PANDORA_ENTERPRISE')) {
if (defined('PANDORA_ENTERPRISE') === false) {
$logo_title = get_product_name().' Opensource';
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
} else {
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) {
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo) === true) {
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
}
@ -61,54 +73,48 @@ if (!defined('PANDORA_ENTERPRISE')) {
}
echo '<div class="logo_green"><a href="index.php?sec=main">';
if (isset($config['custom_logo'])) {
if ($config['menu_type'] == 'classic') {
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:block']);
} else {
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:none']);
}
if (isset($config['custom_logo']) === true) {
echo html_print_image(
$custom_logo,
true,
[
'border' => '0',
'width' => '215',
'alt' => $logo_title,
'class' => 'logo_full',
'style' => ($menuCollapsed === true) ? 'display:none' : 'display:block',
]
);
}
if (isset($config['custom_logo_collapsed'])) {
if ($config['menu_type'] == 'classic') {
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:none']);
} else {
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:block']);
}
if (isset($config['custom_logo_collapsed']) === true) {
echo html_print_image(
$custom_logo_collapsed,
true,
[
'border' => '0',
'width' => '60',
'alt' => $logo_title,
'class' => 'logo_icon',
'style' => ($menuCollapsed === true) ? 'display:block' : 'display:none',
]
);
}
echo '</a></div>';
// echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
require 'operation/menu.php';
// Check all enterprise ACL used in godmenu items to print menu headers
if (check_acl($config['id_user'], 0, 'AW')
|| check_acl($config['id_user'], 0, 'PM')
|| check_acl($config['id_user'], 0, 'LM')
|| check_acl($config['id_user'], 0, 'UM')
|| check_acl($config['id_user'], 0, 'LW')
|| check_acl($config['id_user'], 0, 'EW')
|| check_acl($config['id_user'], 0, 'DW')
) {
// echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
}
require 'godmode/menu.php';
if ($config['menu_type'] == 'classic') {
echo '<div id="button_collapse" class="button_classic button_collapse"></div>';
} else {
echo '<div id="button_collapse" class="button_collapsed button_collapse"></div>';
}
echo sprintf('<div id="button_collapse" class="button_%s button_collapse"></div>', $menuTypeClass);
// require ("links_menu.php");
echo '</div>';
// menu_container
// Menu_container.
ui_require_jquery_file('cookie');
$config_fixed_header = false;
if (isset($config['fixed_header'])) {
if (isset($config['fixed_header']) === true) {
$config_fixed_header = $config['fixed_header'];
}
?>

View File

@ -577,12 +577,7 @@ $(document).ready (function () {
$('#text-ip_target').keyup(function() {
$('#text-target_ip').val($(this).val());
});
$('#text-target_ip').keyup(function() {
$('#text-ip_target').val($(this).val());
});
$('#text-community').keyup(function() {
$('#text-snmp_community').val($(this).val());
});
$('#text-snmp_community').keyup(function() {
$('#text-community').val($(this).val());
});
@ -591,61 +586,25 @@ $(document).ready (function () {
// Display or collapse the SNMP browser's v3 options
checkSNMPVersion ();
});
$('#snmp_browser_version').change(function() {
$('#snmp_version').val($(this).val());
// Display or collapse the SNMP v3 options in the main window
if ($(this).val() == "3") {
$("#simple-field_snmpv3_row1").attr("style", "");
$("#simple-field_snmpv3_row2").attr("style", "");
$("#simple-field_snmpv3_row3").attr("style", "");
$("input[name=active_snmp_v3]").val(1);
$("input[name=snmp_community]").attr("disabled", true);
}
else {
$("#simple-field_snmpv3_row1").css("display", "none");
$("#simple-field_snmpv3_row2").css("display", "none");
$("#simple-field_snmpv3_row3").css("display", "none");
$("input[name=active_snmp_v3]").val(0);
$("input[name=snmp_community]").removeAttr('disabled');
}
});
$('#snmp3_auth_user').keyup(function() {
$('#snmp3_browser_auth_user').val($(this).val());
});
$('#snmp3_browser_auth_user').keyup(function() {
$('#snmp3_auth_user').val($(this).val());
});
$('#snmp3_security_level').change(function() {
$('#snmp3_browser_security_level').val($(this).val());
});
$('#snmp3_browser_security_level').change(function() {
$('#snmp3_security_level').val($(this).val());
});
$('#snmp3_auth_method').change(function() {
$('#snmp3_browser_auth_method').val($(this).val());
});
$('#snmp3_browser_auth_method').change(function() {
$('#snmp3_auth_method').val($(this).val());
});
$('#snmp3_auth_pass').keyup(function() {
$('#snmp3_browser_auth_pass').val($(this).val());
});
$('#snmp3_browser_auth_pass').keyup(function() {
$('#snmp3_auth_pass').val($(this).val());
});
$('#snmp3_privacy_method').change(function() {
$('#snmp3_browser_privacy_method').val($(this).val());
});
$('#snmp3_browser_privacy_method').change(function() {
$('#snmp3_privacy_method').val($(this).val());
});
$('#snmp3_privacy_pass').keyup(function() {
$('#snmp3_browser_privacy_pass').val($(this).val());
});
$('#snmp3_browser_privacy_pass').keyup(function() {
$('#snmp3_privacy_pass').val($(this).val());
});
var custom_ip_target = "<?php echo $custom_ip_target; ?>";
if(custom_ip_target == ''){
$("#text-custom_ip_target").hide();

View File

@ -1120,6 +1120,12 @@ function show_add_action(id_alert) {
opacity: 0.5,
background: "black"
},
open: function() {
$("#action_select, #action_select").select2({
tags: true,
dropdownParent: $("#add_action-div-" + id_alert)
});
},
width: 500,
height: 300
})
@ -1150,6 +1156,12 @@ function show_display_update_action(id_module_action, alert_id, alert_id_agent_m
opacity: 0.5,
background: "black"
},
open: function() {
$("#action_select_ajax, #action_select_ajax").select2({
tags: true,
dropdownParent: $("#update_action-div")
});
},
width: 500,
height: 300
})

View File

@ -95,6 +95,7 @@ $fields_available['id_evento'] = __('Event Id');
$fields_available['evento'] = __('Event Name');
$fields_available['id_agente'] = __('Agent ID');
$fields_available['agent_name'] = __('Agent Name');
$fields_available['direccion'] = __('Agent IP');
$fields_available['id_usuario'] = __('User');
$fields_available['id_grupo'] = __('Group');
$fields_available['estado'] = __('Status');

View File

@ -404,7 +404,8 @@ $(document).ready (function () {
"get_agent_modules_json" : 1,
"get_id_and_name" : 1,
"disabled" : 0,
"id_agent" : id_agent
"id_agent" : id_agent,
"safe_name": 1,
};
var tags_to_search = $('#tags').val();
@ -434,7 +435,7 @@ $(document).ready (function () {
jQuery.each (data, function (i, val) {
option = $("<option></option>")
.attr ("value", val["id_agente_modulo"])
.append (val["nombre"]);
.append (val["safe_name"]);
$("#target_modules").append (option);
});

View File

@ -685,7 +685,8 @@ $(document).ready (function () {
"get_agent_modules_json" : 1,
"get_distinct_name" : 1,
"indexed" : 0,
"privilege" : "AW"
"privilege" : "AW",
"safe_name": 1
};
if (this.value != '0')
@ -712,7 +713,7 @@ $(document).ready (function () {
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr("value", value["nombre"])
.html(value["nombre"]);
.html(value["safe_name"]);
$("#module_name").append (option);
});
hideSpinner();

View File

@ -1326,7 +1326,8 @@ $(document).ready (function () {
"page" : "operation/agentes/ver_agente",
"get_agent_modules_json" : 1,
"get_distinct_name" : 1,
"indexed" : 0
"indexed" : 0,
"safe_name" : 1
};
if (this.value != '0')
@ -1351,7 +1352,7 @@ $(document).ready (function () {
params,
function (data, status) {
jQuery.each (data, function (id, value) {
option = $("<option></option>").attr ("value", value["nombre"]).html (value["nombre"]);
option = $("<option></option>").attr("value", value["nombre"]).html(value["safe_name"]);
$("#module_name").append (option);
});
hideSpinner();

View File

@ -525,10 +525,8 @@ if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager'])
$menu_godmode['messages']['id'] = 'god-um_messages';
$sub = [];
if ($config['enterprise_installed']) {
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
$sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline';
}
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update Manager online');
$sub['godmode/update_manager/update_manager&tab=online']['id'] = 'Online';

View File

@ -331,9 +331,9 @@ echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting
echo "<table width='100%' cellpadding='4' cellpadding='4' class='databox filters'>";
echo '<tr>';
echo "<td colspan='3'>".__('Filter group').'</td>';
echo "<td colspan='1'>".__('Filter group').'</td>';
echo '</tr><tr>';
echo "<td colspan='3'>".html_print_select_groups(
echo "<td colspan='1'>".html_print_select_groups(
$config['id_user'],
($report_w == true) ? 'RW' : (($report_m == true) ? 'RM' : 'RW'),
true,

View File

@ -748,6 +748,7 @@ switch ($action) {
$selected_agent_group_filter = $es['agent_group_filter'];
$selected_agents_inventory_display_options = $es['agents_inventory_display_options'];
$selected_agent_os_filter = $es['agent_os_filter'];
$selected_agent_custom_fields = $es['agent_custom_fields'];
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
$selected_agent_status_filter = $es['agent_status_filter'];
$selected_agent_module_search_filter = $es['agent_module_search_filter'];
@ -3080,6 +3081,7 @@ $class = 'databox filters';
</tr>
<?php
if (is_metaconsole()) {
$server_fields = [];
$server_fields[0] = __('All');
@ -3106,7 +3108,6 @@ $class = 'databox filters';
'min-width: 180px'
).'</td></tr>';
if (is_metaconsole()) {
echo $server_filter_markup;
}
?>
@ -3158,6 +3159,28 @@ $class = 'databox filters';
</tr>
<tr id="row_custom_field" class="datos">
<td class="bolder">
<?php
echo __('Agent custom field');
?>
</td>
<td >
<?php
html_print_select_from_sql(
'SELECT id_field, name FROM tagent_custom_fields',
'agent_custom_fields[]',
$selected_agent_custom_fields,
'',
__('All'),
'0',
false,
true
);
?>
</td>
</tr>
<tr id="row_custom_field_filter" class="datos">
<td class="bolder">
<?php
echo __('Agent custom field filter');
@ -5159,7 +5182,6 @@ function addSLARow() {
$("input[name=id_agent_failover]").val('');
$("input[name=id_server]").val('');
$("input[name=agent_sla]").val('');
$("input[name=agent_sla]").css("background","url('<?php echo $autocompleteImage; ?>') right center no-repeat")
$("input[name=agent_failover]").val('');
$("#id_agent_module_sla").empty();
$("#id_agent_module_sla").attr('disabled', 'true');
@ -5486,6 +5508,7 @@ function chooseType() {
$("#row_agent_server_filter").hide();
$("#row_agent_group_filter").hide();
$("#row_os").hide();
$("#row_custom_field_filter").hide();
$("#row_custom_field").hide();
$("#row_agent_status").hide();
$("#row_agent_version").hide();
@ -6039,11 +6062,26 @@ function chooseType() {
$("#row_group").show();
$("#row_os").show();
$("#row_custom_field").show();
$("#row_custom_field_filter").show();
$("#row_agent_status").show();
$("#row_agent_version").show();
$("#row_agent_remote_conf").show();
$("#row_module_free_search").show();
if ($('#agent_custom_fields :selected').length > 0) {
$('#text-agent_custom_field_filter').removeAttr('disabled');
} else {
$('#text-agent_custom_field_filter').prop('disabled', true);
}
$("#agent_custom_fields").change(function(e) {
if ($('#agent_custom_fields :selected').length > 0) {
$('#text-agent_custom_field_filter').removeAttr('disabled');
} else {
$('#text-agent_custom_field_filter').prop('disabled', true);
}
});
break;
case 'inventory':

View File

@ -2219,6 +2219,7 @@ switch ($action) {
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['agent_os_filter'] = get_parameter('agent_os_filter');
$es['agent_custom_fields'] = get_parameter('agent_custom_fields');
$es['agent_status_filter'] = get_parameter('agent_status_filter');
$es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
@ -2858,6 +2859,7 @@ switch ($action) {
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['agent_os_filter'] = get_parameter('agent_os_filter');
$es['agent_custom_fields'] = get_parameter('agent_custom_fields');
$es['agent_status_filter'] = get_parameter('agent_status_filter');
$es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
@ -3370,7 +3372,7 @@ $buttons['view'] = [
$buttons[$activeTab]['active'] = true;
if ($idReport != 0) {
$textReportName = $reportName;
$textReportName = (empty($reportName) === false) ? $reportName : $report['name'];
} else {
$temp = $buttons['main'];
$buttons = null;

View File

@ -327,6 +327,12 @@ if (is_array($config) === true) {
) {
ui_print_error_message(__('Update manager online requires registration.'));
}
if ($mode === Manager::MODE_OFFLINE) {
ui_print_warning_message(
__('Applying offline patches may make your console unusable, we recommend to completely backup your files before applying any patch.')
);
}
}
$url_update_manager = $config['url_update_manager'];
@ -381,6 +387,20 @@ if (is_array($config) === true) {
}
}
$proxy = null;
if (empty($config['update_manager_proxy_server']) === false
|| empty($config['update_manager_proxy_port']) === false
|| empty($config['update_manager_proxy_user']) === false
|| empty($config['update_manager_proxy_password']) === false
) {
$proxy = [
'host' => $config['update_manager_proxy_server'],
'port' => $config['update_manager_proxy_port'],
'user' => $config['update_manager_proxy_user'],
'password' => $config['update_manager_proxy_password'],
];
}
$ui = new Manager(
((is_array($config) === true) ? $pandora_url : 'http://'.$_SERVER['SERVER_ADDR'].'/'),
((is_array($config) === true) ? ui_get_full_url('ajax.php') : ''),
@ -400,6 +420,7 @@ $ui = new Manager(
'registration_code' => $puid,
'remote_config' => $remote_config,
'propagate_updates' => $is_metaconsole,
'proxy' => $proxy,
'set_maintenance_mode' => function () {
if (function_exists('config_update_value') === true) {
config_update_value('maintenance_mode', 1);

View File

@ -666,6 +666,7 @@ class Client
$target = __('console update %d', $request['version']);
}
// phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.Found
curl_setopt(
$ch,
CURLOPT_PROGRESSFUNCTION,
@ -1673,7 +1674,7 @@ class Client
);
$this->updateMR(
$this->productPath.'/extras/mr/'.$mr,
$this->extract_to.'/extras/mr/'.$mr,
$this->dbhHistory,
$historical_MR
);

View File

@ -34,7 +34,7 @@
<script type="text/javascript">
if (typeof $ != "function") {
// Dynamically include jquery if not added to this page.
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery-3.3.1.min.js'); ?>"></'+'script>');
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery.current.js'); ?>"></'+'script>');
}
</script>
<script src="<?php $asset('resources/javascript/umc.js'); ?>" type="text/javascript"></script>

View File

@ -34,7 +34,7 @@ $product_name = get_product_name(); ?>
<script type="text/javascript">
if (typeof $ != "function") {
// Dynamically include jquery if not added to this page.
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery-3.3.1.min.js'); ?>"></'+'script>');
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery.current.js'); ?>"></'+'script>');
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery-ui.min.js'); ?>"></'+'script>');
}
</script>

View File

@ -37,12 +37,10 @@ $buttons['setup'] = [
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup">'.html_print_image('images/gm_setup.png', true, ['title' => __('Options'), 'class' => 'invert_filter']).'</a>',
];
if (enterprise_installed()) {
$buttons['offline'] = [
'active' => ($tab == 'offline') ? true : false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offline">'.html_print_image('images/box.png', true, ['title' => __('Offline update manager'), 'class' => 'invert_filter']).'</a>',
];
}
$buttons['online'] = [
'active' => ($tab == 'online') ? true : false,
@ -60,6 +58,7 @@ switch ($tab) {
break;
case 'online':
default:
$title = __('Update manager » Online');
break;
}

View File

@ -30,6 +30,7 @@
global $config;
require_once __DIR__.'/../../include/functions_users.php';
require_once __DIR__.'/../../include/functions_update_manager.php';
check_login();

View File

@ -100,7 +100,7 @@ $update_profile = (bool) get_parameter('update_profile');
$id_profile = (int) get_parameter('id');
$is_management_allowed = true;
if (is_management_allowed() === false) {
if (is_metaconsole() === false && is_management_allowed() === false) {
$is_management_allowed = false;
ui_print_warning_message(
__(

View File

@ -129,7 +129,7 @@ switch ($sortField) {
break;
default:
// Not possible.
// Nothing to do.
break;
}
break;
@ -153,7 +153,7 @@ switch ($sortField) {
break;
default:
// Not possible.
// Nothing to do.
break;
}
break;
@ -177,7 +177,7 @@ switch ($sortField) {
break;
default:
// Not possible.
// Nothing to do.
break;
}
break;
@ -395,7 +395,7 @@ $table->data[0][4] = html_print_submit_button(
);
$is_management_allowed = true;
if (is_management_allowed() === false) {
if (is_metaconsole() === false && is_management_allowed() === false) {
$is_management_allowed = false;
ui_print_warning_message(
__(
@ -585,11 +585,11 @@ foreach ($info as $user_id => $user_info) {
$cont++;
// Manual pagination due the complicated process of the ACL data.
if ($cont <= $offset) {
if ($cont <= $offset && $search !== true) {
continue;
}
if ($cont > ($limit + $offset)) {
if ($cont > ($limit + $offset) && $search !== true) {
break;
}
@ -820,6 +820,9 @@ foreach ($info as $user_id => $user_info) {
$data[6] .= '';
// Delete button not in this mode.
}
} else {
$data[6] .= '';
// Delete button not in this mode.
}
}

View File

@ -95,7 +95,7 @@ if (check_login(false) === false) {
<link rel="stylesheet" href="styles/js/jquery-ui_custom.css" type="text/css" />
<script language="javascript" type='text/javascript' src='javascript/pandora.js'></script>
<script language="javascript" type='text/javascript' src='javascript/pandora_ui.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery-3.3.1.min.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery.current.js'></script>
</head>
<body>
<h1>Access is not granted</h1>
@ -153,7 +153,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
<link rel="stylesheet" href="styles/js/jquery-ui_custom.css" type="text/css" />
<script language="javascript" type='text/javascript' src='javascript/pandora.js'></script>
<script language="javascript" type='text/javascript' src='javascript/pandora_ui.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery-3.3.1.min.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery.current.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery.pandora.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery-ui.min.js'></script>
<script language="javascript" type="text/javascript" src="graphs/flot/jquery.flot.js"></script>

View File

@ -2336,7 +2336,7 @@ class ConsoleSupervisor
// Check if DiscoveryCronTasks is running. Warn user if not.
if ($config['cron_last_run'] == 0
|| (get_system_time() - $config['cron_last_run']) > 3600
|| (get_system_time() - $config['cron_last_run']) > SECONDS_10MINUTES
) {
$message_conf_cron = __('DiscoveryConsoleTasks is not running properly');
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
@ -2359,12 +2359,17 @@ class ConsoleSupervisor
$message_conf_cron .= __('Please, make sure process is not locked.');
}
$url = '__url__/index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist';
if (is_metaconsole() === true) {
$url = '__url__index.php?sec=extensions&sec2=enterprise/extensions/cron';
}
$this->notify(
[
'type' => 'NOTIF.CRON.CONFIGURED',
'title' => __('DiscoveryConsoleTasks is not configured.'),
'message' => __($message_conf_cron),
'url' => '__url__/index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist',
'url' => $url,
]
);
} else {

View File

@ -3043,6 +3043,7 @@ class NetworkMap
$table->data = [];
$table->rowstyle['template_row'] = 'display: none;';
$table->data['template_row']['node_source'] = '';
// Inputs must be not select2, cause duplication make issues.
$table->data['template_row']['interface_source'] = html_print_select(
[],
'interface_source',
@ -3050,7 +3051,21 @@ class NetworkMap
'',
__('None'),
0,
true
true,
false,
true,
'',
false,
false,
false,
false,
false,
'',
false,
false,
false,
false,
false
);
$table->data['template_row']['interface_target'] = html_print_select(
[],
@ -3059,7 +3074,21 @@ class NetworkMap
'',
__('None'),
0,
true
true,
false,
true,
'',
false,
false,
false,
false,
false,
'',
false,
false,
false,
false,
false
);
$table->data['template_row']['node_target'] = '';

View File

@ -593,7 +593,7 @@ class Tree
$module['type'] = 'module';
$module['id'] = (int) $module['id'];
$module['name'] = io_safe_output($module['name']);
$module['name'] = $module['name'];
$module['id_module_type'] = (int) $module['id_tipo_modulo'];
$module['server_type'] = (int) $module['id_modulo'];
$module['status'] = $module['estado'];
@ -1097,7 +1097,7 @@ class Tree
protected function getThirdLevelSql()
{
// Get the server id
// Get the server id.
$serverID = $this->serverID;
$group_acl = $this->getGroupAclCondition();

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC210811';
$build_version = 'PC210901';
$pandora_version = 'v7.0NG.756';
// Do not overwrite default timezone set if defined.
@ -306,7 +306,7 @@ switch ($config['dbtype']) {
// ======================================================================
// Menu display mode.
if (isset($_SESSION['meny_type']) === true && $_SESSION['menu_type']) {
if (isset($_SESSION['meny_type']) === true && empty($_SESSION['menu_type']) === false) {
$config['menu_type'] = $_SESSION['menu_type'];
} else {
$config['menu_type'] = 'classic';

View File

@ -1585,7 +1585,7 @@ function enterprise_include($filename, $variables=[])
extract($variables);
}
include $filepath;
include_once $filepath;
return true;
}

View File

@ -3187,6 +3187,7 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
$module_description = $module['descripcion'];
$db_status = modules_get_agentmodule_status($module_id);
$module_value = modules_get_last_value($module_id);
$last_contact = modules_get_last_contact($module_id);
modules_get_status($module_id, $db_status, $module_value, $status, $title);
$status_image = ui_print_status_image($status, $title, true);
@ -3267,6 +3268,7 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
$agent_interfaces[$interface_name]['status_module_name'] = $module_name;
$agent_interfaces[$interface_name]['ip'] = $ip_target;
$agent_interfaces[$interface_name]['mac'] = $mac;
$agent_interfaces[$interface_name]['last_contact'] = $last_contact;
if ($interface_traffic_modules !== false) {
$agent_interfaces[$interface_name]['traffic'] = [];

View File

@ -17341,7 +17341,7 @@ function remove_agent_from_policy($id_policy, $use_agent_name, $params)
$agent = db_get_row_filter('tmetaconsole_agent', ['id_tagente' => $id_agent, 'id_tmetaconsole_setup' => $id_node]);
}
$policy = policies_get_policy($id_policy, false, false);
$policy = policies_get_policy($id_policy);
$policy_agent = (is_metaconsole()) ? db_get_row_filter('tpolicy_agents', ['id_policy' => $id_policy, 'id_agent' => $id_agent, 'id_node' => $id_node]) : db_get_row_filter('tpolicy_agents', ['id_policy' => $id_policy, 'id_agent' => $id_agent]);

View File

@ -2243,7 +2243,7 @@ function config_process_config()
if (!isset($config['fontpath'])) {
config_update_value(
'fontpath',
'lato.ttf'
'Lato-Regular.ttf'
);
}
@ -3126,7 +3126,7 @@ function config_process_config()
}
if (!isset($config['custom_report_front_font'])) {
config_update_value('custom_report_front_font', 'lato.ttf');
config_update_value('custom_report_front_font', 'Lato-Regular.ttf');
}
if (!isset($config['custom_report_front_logo'])) {

View File

@ -305,6 +305,9 @@ function events_get_column_name($field, $table_alias=false)
return __('Severity mini');
}
case 'direccion':
return __('Agent IP');
default:
return __($field);
}
@ -3581,7 +3584,12 @@ function events_page_responses($event, $childrens_ids=[])
'',
__('None'),
-1,
true
true,
false,
true,
'',
false,
'width: 70%'
);
$data[2] .= html_print_button(
__('Update'),
@ -4872,6 +4880,14 @@ function events_page_general($event)
$data[1] = '<span class="break_word">'.events_display_name($event['evento']).'</span>';
$table_general->data[] = $data;
// Show server name in metaconsole.
if (is_metaconsole() === true && $event['server_name'] !== '') {
$data = [];
$data[0] = __('Node');
$data[1] = '<span class="break_word">'.$event['server_name'].'</span>';
$table_general->data[] = $data;
}
$data = [];
$data[0] = __('Timestamp');

View File

@ -740,7 +740,7 @@ function filemanager_file_explorer(
if ((!$fileinfo['is_dir']) && ($download_button)) {
$filename = base64_encode($fileinfo['name']);
$hash = md5($filename.$config['server_unique_identifier']);
$data[4] .= '<a href="include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'" style="vertical-align: 25%;">';
$data[4] .= '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'" style="vertical-align: 25%;">';
$data[4] .= html_print_image('images/file.png', true, ['class' => 'invert_filter']);
$data[4] .= '</a>';
}

View File

@ -735,7 +735,7 @@ function grafico_modulo_sparse($params)
$params['backgroundColor'] = 'white';
}
if (isset($params['only_image']) === true) {
if (isset($params['only_image']) === true && $params['vconsole'] !== true) {
$params['backgroundColor'] = 'transparent';
}

View File

@ -436,6 +436,7 @@ function html_print_select_style($fields, $name, $selected='', $style='', $scrip
* @param string $size Style, size (width) of element.
* @param boolean $simple_multiple_options Discovery simple multiple inputs.
* @param boolean $required Required input.
* @param string $inverse Change All to None with inverse condition.
*
* @return string HTML code if return parameter is true.
*/
@ -462,7 +463,8 @@ function html_print_select_groups(
$include_groups=false,
$size=false,
$simple_multiple_options=false,
$required=false
$required=false,
$inverse=''
) {
$output = '';
@ -522,8 +524,12 @@ function html_print_select_groups(
if (empty($selected) === false) {
$fields = [ $selected => groups_get_name($selected) ];
} else if ($returnAllGroup === true && $multiple === false) {
if ($selected === 0 && $inverse !== '') {
$fields = [ $selected => 'None' ];
} else {
$fields = [ $selected => groups_get_name(null, true) ];
}
}
} else {
foreach ($selected as $k) {
if ($k === null || $k === '') {
@ -595,7 +601,9 @@ function html_print_select_groups(
</style>
<script type="text/javascript">
$(document).ready(function() {
$('select[name="<?php echo $name; ?>"]').each(
function() {
$(this).select2({
@ -625,6 +633,7 @@ function html_print_select_groups(
inclusions: '<?php echo $json_inclusions; ?>',
step: params.page || 1,
strict: "<?php echo $strict_user; ?>",
not_condition: $('#not_condition_switch').prop('checked'),
returnAllGroup: <?php echo (int) $returnAllGroup; ?>
}
@ -781,7 +790,7 @@ function html_print_select(
$required = 'required';
}
$output .= '<select '.$required.' id="'.$id.'" name="'.$name.'"'.$attributes.' '.$styleText.'>';
$output .= '<select '.$required.' onclick="'.$script.'" id="'.$id.'" name="'.$name.'"'.$attributes.' '.$styleText.'>';
if ($nothing !== false) {
if ($nothing != '' || empty($fields)) {

View File

@ -30,7 +30,7 @@
global $config;
// Set variable to store menu type (classic or collapsed).
if (!empty(get_parameter('menuType'))) {
if (is_ajax() === true && empty(get_parameter('menuType')) === false) {
$_SESSION['menu_type'] = get_parameter('menuType', 'classic');
return;
}
@ -39,11 +39,14 @@ if (!empty(get_parameter('menuType'))) {
/**
* Prints a complete menu structure.
*
* @param array Menu structure to print.
* @param array $menu Menu structure to print.
*
* @return void
*/
function menu_print_menu(&$menu)
{
global $config;
global $menuTypeClass;
static $idcounter = 0;
echo '<div class="menu">';
@ -108,7 +111,7 @@ function menu_print_menu(&$menu)
$submenu = false;
if ($config['menu_type'] == 'classic') {
if ($menuTypeClass === 'classic') {
$classes = [
'menu_icon',
'no_hidden_menu',
@ -120,12 +123,12 @@ function menu_print_menu(&$menu)
];
}
if (isset($main['sub'])) {
if (isset($main['sub']) === true) {
$classes[] = '';
$submenu = true;
}
if (!isset($main['refr'])) {
if (isset($main['refr']) === false) {
$main['refr'] = 0;
}
@ -409,23 +412,14 @@ function menu_print_menu(&$menu)
// Print out the first level.
$output .= '<li title="'.$main['text'].'" class="'.implode(' ', $classes).' '.$seleccionado.'" id="icon_'.$id.'">';
// onclick="location.href=\'index.php?sec='.$mainsec.'&amp;sec2='.$main["sec2"].($main["refr"] ? '&amp;refr='.$main["refr"] : '').'\'">';
$length = strlen(__($main['text']));
$padding_top = ( $length >= 18) ? 6 : 12;
if ($config['menu_type'] == 'classic') {
$output .= '<div id="title_menu" class="title_menu_classic">'.$main['text'].'</div>';
} else {
$output .= '<div id="title_menu" class="title_menu_collapsed">'.$main['text'].'</div>';
}
$output .= sprintf('<div id="title_menu" class="title_menu_%s">%s</div>', $menuTypeClass, $main['text']);
// Add the notification ball if defined
if (isset($main['notification'])) {
// Add the notification ball if defined.
if (isset($main['notification']) === true) {
$output .= '<div class="notification_ball">'.$main['notification'].'</div>';
}
$padding_top = 0;
$length = 0;
if ($submenu_output != '') {
// WARNING: IN ORDER TO MODIFY THE VISIBILITY OF MENU'S AND SUBMENU'S (eg. with cookies) YOU HAVE TO ADD TO THIS ELSEIF. DON'T MODIFY THE CSS.
if ($visible || in_array('selected', $classes)) {
@ -436,10 +430,7 @@ function menu_print_menu(&$menu)
$visible = false;
}
// $output .= '<ul id="subicon_'.$id.'" class="submenu'.($visible ? '' : ' invisible').'">';
$output .= '<ul id="subicon_'.$id.'" class="submenu">';
$output .= $submenu_output;
$output .= '</ul>';
$output .= sprintf('<ul id="subicon_%s" class="submenu">%s</ul>', $id, $submenu_output);
}
$config['count_main_menu']++;

View File

@ -2295,17 +2295,19 @@ function modules_get_agentmodule_data(
$search_in_history_db = db_search_in_history_db($datelimit);
switch ($module['id_tipo_modulo']) {
// generic_data_string
// Generic_data_string.
case 3:
// remote_tcp_string
// Remote_tcp_string.
case 10:
// remote_snmp_string
// Remote_snmp_string.
case 17:
// async_string
// Async_string.
case 36:
// remote_cmd_string
// Remote_cmd_string.
case 23:
// Free search is a json with value and exact modifier
// Web content string.
case 33:
// Free search is a json with value and exact modifier.
$freesearch = json_decode($freesearch, true);
$freesearch_sql = '';
if (isset($freesearch['value']) && !empty($freesearch['value'])) {

View File

@ -264,7 +264,19 @@ function show_configuration_wizard() {
background: "black"
},
closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
if ($.ui && $.ui.dialog && $.ui.dialog.prototype._allowInteraction) {
var ui_dialog_interaction = $.ui.dialog.prototype._allowInteraction;
$.ui.dialog.prototype._allowInteraction = function(e) {
if ($(e.target).closest('.select2-dropdown').length) return true;
return ui_dialog_interaction.apply(this, arguments);
};
}
},
_allowInteraction: function (event) {
return !!$(event.target).is(".select2-input") || this._super(event);
}
});
default_language_displayed = $("#language").val();

View File

@ -2285,6 +2285,7 @@ function reporting_agents_inventory($report, $content)
$external_source = io_safe_input(json_decode($content['external_source'], true));
$es_agents_inventory_display_options = $external_source['agents_inventory_display_options'];
$es_agent_custom_fields = $external_source['agent_custom_fields'];
$es_custom_fields = $external_source['agent_custom_field_filter'];
$es_os_filter = $external_source['agent_os_filter'];
$es_agent_status_filter = $external_source['agent_status_filter'];
@ -2299,10 +2300,20 @@ function reporting_agents_inventory($report, $content)
$es_agents_inventory_display_options = [];
}
$custom_field_sql = '';
$search_sql = '';
if ($es_custom_fields != '') {
$search_sql .= ' AND id_os = '.$es_custom_fields;
if (!empty($es_agent_custom_fields)) {
$custom_field_sql = 'INNER JOIN tagent_custom_data tacd ON tacd.id_agent = tagente.id_agente';
if ($es_agent_custom_fields[0] != 0) {
$custom_field_sql .= ' AND tacd.id_field IN ('.implode(',', $es_agent_custom_fields).')';
}
if (!empty($es_custom_fields)) {
$custom_field_sql .= ' AND tacd.description like "%'.$es_custom_fields.'%"';
} else {
$custom_field_sql .= ' AND tacd.description <> ""';
}
}
if (in_array('0', $es_os_filter) === false) {
@ -2341,8 +2352,10 @@ function reporting_agents_inventory($report, $content)
ON tagente.id_agente = tasg.id_agent
LEFT JOIN tagente_modulo tam
ON tam.id_agente = tagente.id_agente
%s
WHERE (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s))
%s',
$custom_field_sql,
$user_groups_to_sql,
$user_groups_to_sql,
$search_sql

View File

@ -2559,12 +2559,19 @@ function reporting_html_last_value($table, $item, $pdf=0)
'Y-m-d H:i:s',
$item['data']['utimestamp']
);
$table_data->data[1][2] = remove_right_zeros(
if (is_numeric($item['data']['datos']) === true) {
$dataDatos = remove_right_zeros(
number_format(
$item['data']['datos'],
$config['graph_precision']
)
);
} else {
$dataDatos = trim($item['data']['datos']);
}
$table_data->data[1][2] = $dataDatos;
switch ($item['data']['estado']) {
case AGENT_MODULE_STATUS_CRITICAL_BAD:

View File

@ -69,9 +69,9 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
// Module name
if ($module['disabled']) {
$cellName = '<em>'.ui_print_truncate_text(io_safe_output($module['nombre']), GENERIC_SIZE_TEXT, true, true, true, '[&hellip;]', 'text-transform: uppercase;').ui_print_help_tip(__('Disabled'), true).'<em>';
$cellName = '<em>'.ui_print_truncate_text($module['nombre'], GENERIC_SIZE_TEXT, true, true, true, '[&hellip;]', 'text-transform: uppercase;').ui_print_help_tip(__('Disabled'), true).'<em>';
} else {
$cellName = ui_print_truncate_text(io_safe_output($module['nombre']), GENERIC_SIZE_TEXT, true, true, true, '[&hellip;]', 'text-transform: uppercase;');
$cellName = ui_print_truncate_text($module['nombre'], GENERIC_SIZE_TEXT, true, true, true, '[&hellip;]', 'text-transform: uppercase;');
}
$row = [];
@ -817,7 +817,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$events_graph .= graph_graphic_agentevents(
$id_agente,
'340px;margin:0',
45,
'130px',
SECONDS_1DAY,
'',
true,

View File

@ -1869,7 +1869,7 @@ function ui_process_page_head($string, $bitfield)
} else {
$config['jquery'] = array_merge(
[
'jquery' => 'include/javascript/jquery-3.3.1.min.js',
'jquery' => 'include/javascript/jquery.current.js',
'pandora' => 'include/javascript/jquery.pandora.js',
'jquery-ui' => 'include/javascript/jquery-ui.min.js',
],
@ -4438,6 +4438,13 @@ function ui_print_standard_header(
true
);
// Create the header.
if (is_metaconsole() === true) {
$output = ui_meta_print_header(
$title,
false,
$options
);
} else {
$output = ui_print_page_header(
$title,
$icon,
@ -4451,6 +4458,7 @@ function ui_print_standard_header(
'',
$headerInformation->printHeader(true)
);
}
if ($return !== true) {
echo $output;

View File

@ -55,6 +55,10 @@ if ($file === '' || $hash === '' || $hash !== md5($file_raw.$config['server_uniq
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/files_repo/'.$file;
break;
case 'godmode/servers/plugin':
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/plugin/'.$file;
break;
case $main_collections:
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/collection/'.$file;
break;

View File

@ -118,6 +118,7 @@ function flot_area_graph(
$array_events_alerts
) {
global $config;
global $is_mobile;
// Get a unique identifier to graph.
$graph_id = uniqid('graph_');
@ -145,7 +146,7 @@ function flot_area_graph(
break;
}
if ($config['style'] === 'pandora_black' && ($params['pdf'] === false || $params['pdf'] === null )
if ($config['style'] === 'pandora_black' && ($params['pdf'] === false || $params['pdf'] === null) && (isset($is_mobile) === false || $is_mobile === false)
) {
$background_style = '#222';
$params['grid_color'] = '#fff';
@ -170,7 +171,7 @@ function flot_area_graph(
// Set some containers to legend, graph, timestamp tooltip, etc.
if ($params['show_legend']) {
$return .= '<p id="legend_'.$graph_id.'" style="text-align:left; width: '.$params['width'].'px;"></p>';
$return .= '<p id="legend_'.$graph_id.'" class="legend_background" style="text-align:left; width: '.$params['width'].'px;"></p>';
}
if (isset($params['graph_combined']) === true && $params['graph_combined']
@ -760,11 +761,23 @@ function flot_slicesbar_graph(
$graph_id = uniqid('graph_');
// Set some containers to legend, graph, timestamp tooltip, etc.
if (is_numeric($height) === true) {
$height = ((int) $height + 15);
}
$style = 'width:'.$width.'%;';
// Fixed height size.
if (empty($height) === true) {
$style .= 'height: 100%;';
} else {
if (is_numeric($height) === true) {
$style .= 'height: '.$height.'px;';
} else {
$style .= 'height: '.$height.';';
}
}
$return = "<div id='".$graph_id."' class='noresizevc graph ".$adapt_key."' style='".$style."'></div>";
$return .= "<div id='value_".$graph_id."' class='flot_container'></div>";

View File

@ -1113,6 +1113,10 @@ function load_interfaces(selected_links) {
);
$("#relations_table tbody").append(template_relation_row);
// Update input for transform in select2.
$("#interface_source_" + i).select2();
$("#interface_target_" + i).select2();
template_relation_row = null;
});
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1333,9 +1333,13 @@ function defineTinyMCE(added_config) {
theme_advanced_buttons1: buttons1,
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "none",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
convert_urls: false,
element_format: "html"
element_format: "html",
object_resizing: true,
autoresize_bottom_margin: 50,
autoresize_on_init: true
});
if (!isEmptyObject(added_config)) {
@ -1385,6 +1389,8 @@ function removeTinyMCE(elementID) {
function addTinyMCE(elementID) {
if (elementID.length > 0 && !isEmptyObject(tinyMCE))
tinyMCE.EditorManager.execCommand("mceAddControl", true, elementID);
tinyMCE.EditorManager.execCommand("mceAutoResize");
tinymce.EditorManager.execCommand("mceTableSizingMode", false, "responsive");
}
function toggle_full_value(id) {

View File

@ -12,7 +12,6 @@ function parse_alert_command(command, classs) {
// Only render values different from ''
var field = "_field" + nfield + "_";
var regex = new RegExp(field, "gi");
console.log($(this).val());
if ($(this).val() == "") {
if (
classs == "fields_recovery" &&

View File

@ -1169,6 +1169,10 @@ function dashboardLoadVC(settings) {
// eslint-disable-next-line no-unused-vars
function dashboardShowEventDialog(settings) {
settings = JSON.parse(atob(settings));
var dialog_exist = $("div[aria-describedby='event_details_window']");
if (dialog_exist.length == 1) {
$("div[aria-describedby='event_details_window']").remove();
}
$.ajax({
method: "post",
url: settings.ajaxUrl,

View File

@ -721,6 +721,7 @@ final class DBMaintainer
$umc->updateMR($path);
} catch (\Exception $e) {
// TODO: Send an event to notify errors.
$this->lastError = $e->getMessage();
$return = false;
}
} else {

View File

@ -413,7 +413,7 @@ class AgentModuleWidget extends Widget
array $visualData,
array $allModules
):string {
$style = 'display:flex; width:100%; height:100%; margin: 10px;';
$style = 'display:flex; width:100%; margin: 10px;';
$table_data = '<div style="'.$style.'">';
$table_data .= '<table class="widget_agent_module transparent mrgn_0px" cellpadding="1" cellspacing="0" border="0">';
@ -645,9 +645,18 @@ class AgentModuleWidget extends Widget
$all_modules = $target_modules;
} else {
if (is_array($target_modules) === true
|| is_numeric($target_modules) === true
) {
$all_modules = Module::search(
['id_agente_modulo' => $target_modules]
);
} else {
// From previous definitions.
$all_modules = Module::search(
['id_agente_modulo' => explode(',', $target_modules)]
);
}
}
if ($all_modules !== null) {

View File

@ -761,11 +761,6 @@ class EventsListWidget extends Widget
$output .= "<div id='event_response_window'></div>";
$output .= "<div id='event_response_command_window' title='";
$output .= \__('Parameters')."'></div>";
$output .= \ui_require_javascript_file(
'pandora_events',
'include/javascript/',
true
);
} else {
$output .= '<div class="container-center">';
$output .= \ui_print_info_message(

View File

@ -396,9 +396,20 @@ class ModuleValueWidget extends Widget
$output .= '<div class="container-icon">';
// Div value.
$output .= '<div style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
$output .= remove_right_zeros(
number_format($data_module, $config['graph_precision'])
if (is_numeric($data_module) === true) {
$dataDatos = remove_right_zeros(
number_format(
$data_module,
$config['graph_precision']
)
);
} else {
$dataDatos = trim($data_module);
}
$output .= $dataDatos;
$output .= '</div>';
if (empty($label) === false) {

View File

@ -386,6 +386,7 @@ class Group extends Entity
$search = get_parameter('search', '');
$step = get_parameter('step', 1);
$limit = get_parameter('limit', false);
$not_condition = get_parameter('not_condition', false);
$exclusions = get_parameter('exclusions', '[]');
$inclusions = get_parameter('inclusions', '[]');
@ -430,6 +431,11 @@ class Group extends Entity
$return = self::prepareGroups($groups);
// When not_condition is select firts option text change All to None.
if ($not_condition === 'true') {
$return[0]['text'] = 'None';
}
if (is_array($return) === false) {
return;
}

View File

@ -1517,6 +1517,20 @@ class Item extends CachedModel
$result['border_color'] = $border_color;
}
$id_custom_graph = static::parseIntOr(
static::issetInArray(
$data,
[
'customGraphId',
'id_custom_graph',
]
),
null
);
if ($id_custom_graph !== null) {
$result['id_custom_graph'] = $id_custom_graph;
}
$linked_layout_node_id = static::parseIntOr(
static::issetInArray(
$data,

View File

@ -134,8 +134,7 @@ final class EventsHistory extends Item
}
}
$data['height'] = ($data['height'] - 20);
// $data['height'] = ($data['height'] - 20);
if ((int) $data['width'] < 11) {
$data['width'] = 11;
}

View File

@ -356,10 +356,15 @@ class View extends \HTML
case MODULE_GRAPH:
$data['backgroundType'] = \get_parameter('backgroundType');
$type = \get_parameter('choosetype');
$data['agentId'] = \get_parameter('agentId');
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
$data['moduleId'] = \get_parameter('moduleId');
$data['customGraphId'] = \get_parameter('customGraphId');
if ($type === 'module') {
$data['customGraphId'] = 0;
}
$data['graphType'] = \get_parameter('graphType');
$data['showLegend'] = \get_parameter_switch('showLegend');
$data['period'] = \get_parameter('period');

View File

@ -401,6 +401,12 @@ table.group_modules_status_box tr td span a {
text-align: center;
}
table.widget_agent_module,
table.widget_agent_module img {
width: auto;
height: auto;
}
table.widget_agent_module tbody tr td {
padding: 5px;
}

View File

@ -416,11 +416,14 @@ ul li {
}
.menu_full_classic .title_menu_classic {
display: flex;
display: flex !important;
}
.menu_icon_collapsed {
background-position: 50% 50%;
}
.menu_full_collapsed .title_menu_collapsed {
display: none;
display: none !important;
}
.button_classic {
@ -474,15 +477,3 @@ ul li {
.header_table_collapsed {
padding-left: 80px; /* 60 + 35 */
}
.title_menu_classic {
display: flex;
}
.title_menu_collapsed {
display: none;
}
.menu_icon_collapsed {
background-position: 50% 50%;
}

View File

@ -0,0 +1,178 @@
/*
* ---------------------------------------------------------------------
* - Notifications
* ---------------------------------------------------------------------
*/
#meta_total_container #header_discovery {
padding-left: 10px;
}
.notification-ball {
border-radius: 50%;
width: 24px;
height: 24px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
color: #fff;
font-weight: bold;
}
.notification-ball.notification-ball-new-messages:hover {
box-shadow: 0 0 3px #888;
}
.notification-ball-no-messages {
background-color: #82b92e;
cursor: pointer;
}
.notification-ball-new-messages {
background-color: #e63c52;
}
#notification-wrapper {
background: white;
border: #a5a5a5 solid 1px;
z-index: 900000;
position: absolute;
width: 550px;
margin-top: -5px;
border-radius: 5px;
}
#notification-wrapper::before {
content: "";
display: block;
position: absolute;
width: 0px;
height: 0;
border-color: transparent;
border-width: 12px;
border-style: solid;
bottom: 100%;
left: calc(58% - 7px);
margin-left: -12px;
border-bottom-color: white;
}
#notification-wrapper-inner {
max-height: 400px;
overflow: auto;
}
#notification-wrapper-shadow {
height: 100%;
width: 100%;
background: #111;
position: fixed;
z-index: 9009;
top: 0;
opacity: 0.3;
}
.notification-item {
background: whitesmoke;
height: 100px;
margin: 7px;
border: #e4e4e4 solid 1px;
display: flex;
flex-flow: row nowrap;
align-items: center;
padding: 5px;
}
.notification-item:hover {
border: #ccc solid 1px;
text-decoration: none;
}
.notification-item > * {
padding-left: 15px;
pointer-events: none;
}
.notification-item > img {
width: 75px;
}
.notification-info {
width: 87%;
display: flex;
flex-flow: column nowrap;
overflow: hidden;
max-height: 83px;
line-height: 1.4em;
}
.notification-item img {
max-width: 100%;
max-height: 100%;
}
.notification-title {
margin: 0;
}
h4.notification-title {
font-size: 13px;
color: #3f3f3f;
text-transform: none;
}
.notification-subtitle,
.color-black-grey {
color: #373737;
}
.global-config-notification-title {
display: flex;
flex-direction: row;
align-items: center;
}
.global-config-notification-title h2 {
margin-left: 10px;
}
.global-config-notification-checkboxes :first-child {
font-weight: bold;
}
.global-config-notification-selectors {
display: flex;
flex-direction: row;
margin-bottom: 10px;
}
.global-config-notification-selectors h4 {
margin: 0;
}
.global-config-notification-single-selector,
.global_config_notifications_dialog_add select {
display: flex;
width: 100%;
padding: 0 10px;
}
.global-config-notification-single-selector :first-child,
.global-config-notification-single-selector :first-child select {
width: 99%;
}
.global-config-notification-single-selector :last-child,
.global_config_notifications_dialog_add_wrapper {
flex-direction: column;
display: flex;
justify-content: flex-end;
}
.global_config_notifications_dialog_add {
display: flex;
flex-direction: row;
margin: 8px;
}
.global_config_notifications_two_ways_form_arrows {
display: flex;
flex-flow: column;
justify-content: center;
margin: 0 5px;
}
.global_config_notifications_two_ways_form_arrows img {
margin: 15px 0;
}

View File

@ -399,7 +399,7 @@ table#diagnostic_info tbody td div {
}
.ui-widget-content,
.ui-widget-content a {
color: #fff;
color: #fff !important;
}
.ui-widget-content.ui-autocomplete a {
@ -1161,3 +1161,8 @@ a.pandora_pagination,
padding-right: 35px;
background-color: #222;
}
.legend_background {
background-color: #222;
color: #fff !important;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1112,17 +1112,36 @@ if (get_parameter('login', 0) !== 0) {
}
}
// Header.
if ($config['pure'] == 0) {
echo '<div id="container"><div id="head">';
include 'general/header.php';
if ($config['menu_type'] == 'classic') {
echo '</div><div id="page" class="page_classic"><div id="menu">';
} else {
echo '</div><div id="page" class="page_collapsed"><div id="menu">';
if ((bool) $config['maintenance_mode'] === true
&& (bool) users_is_admin() === false
) {
// Show maintenance web-page. For non-admin users only.
include 'general/maintenance.php';
while (ob_get_length() > 0) {
ob_end_flush();
}
exit('</html>');
}
// Pure.
if ($config['pure'] == 0) {
// Menu container prepared to autohide menu.
$menuCollapsed = (isset($_SESSION['menu_type']) === true && $_SESSION['menu_type'] !== 'classic');
$menuTypeClass = ($menuCollapsed === true) ? 'collapsed' : 'classic';
// Container.
echo '<div id="container">';
// Header.
echo '<div id="head">';
include 'general/header.php';
echo '</div>';
// Main menu.
echo sprintf('<div id="page" class="page_%s">', $menuTypeClass);
echo '<div id="menu">';
include 'general/main_menu.php';
echo '</div>';
echo '<button onclick="topFunction()" id="top_btn" title="Go to top"></button>';
@ -1330,11 +1349,15 @@ if ($config['pure'] == 0) {
// Main pure.
}
echo '<div id="wiz_container">';
echo '</div>';
html_print_div(
['id' => 'wiz_container'],
true
);
echo '<div id="um_msg_receiver">';
echo '</div>';
html_print_div(
['id' => 'um_msg_receiver'],
true
);
// Connection lost alert.
ui_require_javascript_file('connection_check');

View File

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

View File

@ -1,3 +1,37 @@
/**
*
* Default mobile theme
*
* @category Stylesheet
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
@font-face {
font-family: "lato";
src: url("../../../fonts/lato.woff2") format("woff");
font-weight: 400;
}
* {
text-decoration: none !important;
font-size: 12px;
@ -11,6 +45,8 @@ body {
margin: 0;
text-align: left;
vertical-align: top;
font-weight: 400;
font-family: "Lato";
}
.small {

View File

@ -96,7 +96,7 @@ if ($refresh > 0) {
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
<link rel="stylesheet" href="../../include/styles/js/jquery-ui.min.css" type="text/css" />
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-3.3.1.min.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-ui.min.js'></script>
<?php

View File

@ -666,12 +666,6 @@ function print_table(
time()
);
// Get last data timestamp.
$timestamps_array = array_merge(
array_column(ifInOctets, 'utimestamp'),
array_column(ifOutOctets, 'utimestamp')
);
if ($sec === 'view') {
$table_data[$loop_index]['if_agent_name'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$agent_interfaces['agent_id'].'">'.$agent_interfaces['agent_alias'].'</a>';
}
@ -683,12 +677,7 @@ function print_table(
$table_data[$loop_index]['if_out_octets'] = ($ifOutOctets['datos'] === null) ? __('N/A') : $ifOutOctets['datos'];
$table_data[$loop_index]['if_usage_module_data_in'] = ($usage_module_data_in['datos'] === null) ? __('N/A') : $usage_module_data_in['datos'];
$table_data[$loop_index]['if_usage_module_data_out'] = ($usage_module_data_out['datos'] === null) ? __('N/A') : $usage_module_data_out['datos'];
$table_data[$loop_index]['if_last_data'] = human_time_comparation(
max(
$ifInOctets['utimestamp'],
$ifOutOctets['utimestamp']
)
);
$table_data[$loop_index]['if_last_data'] = human_time_comparation($agent_interfaces['last_contact']);
$loop_index++;
}

View File

@ -87,7 +87,7 @@ echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/
<link rel="stylesheet" href="../../include/styles/js/jquery-ui.min.css" type="text/css" />
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/pandora_ui.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-3.3.1.min.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-ui.min.js'></script>
<?php

View File

@ -86,7 +86,7 @@ if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AR')) {
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo __('%s Snapshot data view for module (%s)', get_product_name(), $label); ?></title>
<script type='text/javascript' src='../../include/javascript/jquery-3.3.1.min.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
</head>
<body class=''>
<?php

View File

@ -119,7 +119,7 @@ ui_print_message_dialog(
<link rel="stylesheet" href="../../include/styles/js/jquery-ui_custom.css" type="text/css" />
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/pandora_ui.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-3.3.1.min.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-ui.min.js'></script>
<?php

View File

@ -141,9 +141,24 @@ $sort = get_parameter('sort', 'none');
$id_module = (int) get_parameter('id_module', 0);
$ag_custom_fields = (array) get_parameter('ag_custom_fields', []);
$module_option = (int) get_parameter('module_option', 1);
$not_condition = (string) get_parameter('not_condition', '');
$is_none = 'All';
if ($not_condition !== '') {
$is_none = 'None';
$not_condition = 'NOT';
}
// If option not_condition is enabled, the conditions of the queries are reversed.
$condition_query = '=';
if ($not_condition !== '') {
$condition_query = '!=';
}
$autosearch = false;
// It is validated if it receives parameters different from those it has by default
// It is validated if it receives parameters different from those it has by default.
if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
|| $ag_modulename !== '' || $refr !== 0 || $offset !== 0 || $status !== 4
|| $modulegroup !== -1 || $tag_filter !== 0 || $sortField !== ''
@ -177,10 +192,10 @@ if ($id_module) {
enterprise_hook('open_meta_frame');
// Get Groups and profiles from user
// Get Groups and profiles from user.
$user_groups = implode(',', array_keys(users_get_groups(false, 'AR', false)));
// Begin Build SQL sentences
// Begin Build SQL sentences.
$sql_from = ' FROM tagente_modulo
INNER JOIN tagente
ON tagente_modulo.id_agente = tagente.id_agente
@ -203,7 +218,7 @@ if (is_numeric($ag_group)) {
$id_ag_group = db_get_value('id_grupo', 'tgrupo', 'nombre', $ag_group);
}
// Agent group selector
// Agent group selector.
if (!is_metaconsole()) {
if ($ag_group > 0 && check_acl($config['id_user'], $ag_group, 'AR')) {
if ($recursion) {
@ -217,7 +232,7 @@ if (!is_metaconsole()) {
);
} else {
$sql_conditions_group = sprintf(
' AND (tagente.id_grupo = %d OR tasg.id_group = %d)',
' AND (tagente.id_grupo '.$condition_query.' %d OR tasg.id_group '.$condition_query.' %d)',
$ag_group,
$ag_group
);
@ -242,7 +257,7 @@ if (!is_metaconsole()) {
);
} else {
$sql_conditions_group = sprintf(
' AND (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s))',
' AND (tagente.id_grupo '.$not_condition.' IN (%s) OR tasg.id_group '.$not_condition.' IN (%s))',
$ag_group,
$ag_group
);
@ -256,18 +271,18 @@ if (!is_metaconsole()) {
}
}
// Module group
// Module group.
if (is_metaconsole()) {
if ($modulegroup != '-1') {
$sql_conditions .= sprintf(' AND tagente_modulo.id_module_group IN (%s)', $modulegroup);
$sql_conditions .= sprintf(' AND tagente_modulo.id_module_group '.$not_condition.' IN (%s)', $modulegroup);
}
} else if ($modulegroup > -1) {
$sql_conditions .= sprintf(' AND tagente_modulo.id_module_group = \'%d\'', $modulegroup);
$sql_conditions .= sprintf(' AND tagente_modulo.id_module_group '.$condition_query.' \'%d\'', $modulegroup);
}
// Module name selector
// Module name selector.
if ($ag_modulename != '') {
$sql_conditions .= " AND tagente_modulo.nombre LIKE '%".$ag_modulename."%'";
$sql_conditions .= " AND tagente_modulo.nombre $not_condition LIKE '%".$ag_modulename."%'";
}
if ($id_module) {
@ -276,96 +291,101 @@ if ($id_module) {
if ($module_option !== 0) {
if ($module_option == 1) {
// Only enabled
$sql_conditions .= sprintf(' AND tagente_modulo.disabled = 0');
// Only enabled.
$sql_conditions .= sprintf(' AND tagente_modulo.disabled '.$condition_query.' 0');
} else if ($module_option == 2) {
// Only disabled
$sql_conditions .= sprintf(' AND tagente_modulo.disabled = 1');
// Only disabled.
$sql_conditions .= sprintf(' AND tagente_modulo.disabled '.$condition_query.' 1');
}
}
if ($datatype != '') {
$sql_conditions .= sprintf(' AND ttipo_modulo.id_tipo ='.$datatype);
$sql_conditions .= sprintf(' AND ttipo_modulo.id_tipo '.$condition_query.' '.$datatype);
}
if ($moduletype != '') {
$sql_conditions .= sprintf(' AND tagente_modulo.id_modulo ='.$moduletype);
$sql_conditions .= sprintf(' AND tagente_modulo.id_modulo '.$condition_query.' '.$moduletype.'');
}
// Freestring selector
// Freestring selector.
if ($ag_freestring != '') {
$sql_conditions .= ' AND (tagente.nombre COLLATE utf8_general_ci LIKE \'%%'.$ag_freestring.'%%\'
OR tagente.alias COLLATE utf8_general_ci LIKE \'%%'.$ag_freestring.'%%\'
OR tagente_modulo.nombre COLLATE utf8_general_ci LIKE \'%%'.$ag_freestring.'%%\'
OR tagente_modulo.descripcion COLLATE utf8_general_ci LIKE \'%%'.$ag_freestring.'%%\')';
$sql_conditions .= ' AND (tagente.nombre COLLATE utf8_general_ci '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\'
OR tagente.alias COLLATE utf8_general_ci '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\'
OR tagente_modulo.nombre COLLATE utf8_general_ci '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\'
OR tagente_modulo.descripcion COLLATE utf8_general_ci '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\')';
}
// Status selector
// Status selector.
if ($status == AGENT_MODULE_STATUS_NORMAL) {
// Normal
$sql_conditions .= ' AND tagente_estado.estado = 0
// Normal.
$sql_conditions .= ' AND tagente_estado.estado '.$condition_query.' 0
AND (utimestamp > 0 OR (tagente_modulo.id_tipo_modulo IN(21,22,23,100))) ';
} else if ($status == AGENT_MODULE_STATUS_CRITICAL_BAD) {
// Critical
$sql_conditions .= ' AND tagente_estado.estado = 1 AND utimestamp > 0';
// Critical.
$sql_conditions .= ' AND tagente_estado.estado '.$condition_query.' 1 AND utimestamp > 0';
} else if ($status == AGENT_MODULE_STATUS_WARNING) {
// Warning
$sql_conditions .= ' AND tagente_estado.estado = 2 AND utimestamp > 0';
// Warning.
$sql_conditions .= ' AND tagente_estado.estado '.$condition_query.' 2 AND utimestamp > 0';
} else if ($status == AGENT_MODULE_STATUS_NOT_NORMAL) {
// Not normal
// Not normal.
$sql_conditions .= ' AND tagente_estado.estado <> 0';
} else if ($status == AGENT_MODULE_STATUS_UNKNOWN) {
// Unknown
$sql_conditions .= ' AND tagente_estado.estado = 3 AND tagente_estado.utimestamp <> 0';
// Unknown.
$sql_conditions .= ' AND tagente_estado.estado '.$condition_query.' 3 AND tagente_estado.utimestamp <> 0';
} else if ($status == AGENT_MODULE_STATUS_NOT_INIT) {
// Not init
$sql_conditions .= ' AND tagente_estado.utimestamp = 0
// Not init.
$sql_conditions .= ' AND tagente_estado.utimestamp '.$condition_query.' 0
AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,100)';
}
$min_hours_condition = '<';
if ($not_condition !== '') {
$min_hours_condition = '>';
}
if (!empty($min_hours_status)) {
$date = new DateTime(null, new DateTimeZone($config['timezone']));
$current_timestamp = $date->getTimestamp();
$max_time = ($current_timestamp - ((int) $min_hours_status * 3600));
$sql_conditions .= sprintf(' AND tagente_estado.last_status_change < %d', $max_time);
$sql_conditions .= sprintf(' AND tagente_estado.last_status_change '.$min_hours_condition.' %d', $max_time);
}
// Filter by agent custom fields
// Filter by agent custom fields.
$sql_conditions_custom_fields = '';
if (!empty($ag_custom_fields)) {
$cf_filter = [];
foreach ($ag_custom_fields as $field_id => $value) {
if (!empty($value)) {
$cf_filter[] = '(tagent_custom_data.id_field = '.$field_id.' AND tagent_custom_data.description LIKE \'%'.$value.'%\')';
$cf_filter[] = '(tagent_custom_data.id_field '.$condition_query.' '.$field_id.' AND tagent_custom_data.description '.$not_condition.' LIKE \'%'.$value.'%\')';
}
}
if (!empty($cf_filter)) {
$sql_conditions_custom_fields = ' AND tagente.id_agente IN (
$sql_conditions_custom_fields = ' AND tagente.id_agente '.$not_condition.' IN (
SELECT tagent_custom_data.id_agent
FROM tagent_custom_data
WHERE '.implode(' AND ', $cf_filter).')';
}
}
// Filter by tag
// Filter by tag.
if ($tag_filter !== 0) {
if (is_metaconsole()) {
$sql_conditions .= ' AND tagente_modulo.id_agente_modulo IN (
SELECT ttag_module.id_agente_modulo
FROM ttag_module
WHERE ttag_module.id_tag IN ('.$tag_filter.'))';
WHERE ttag_module.id_tag '.$not_condition.' IN ('.$tag_filter.'))';
} else {
$sql_conditions .= ' AND tagente_modulo.id_agente_modulo IN (
SELECT ttag_module.id_agente_modulo
FROM ttag_module
WHERE ttag_module.id_tag = '.$tag_filter.')';
WHERE ttag_module.id_tag '.$condition_query.' '.$tag_filter.')';
}
}
// Apply the module ACL with tags
// Apply the module ACL with tags.
$sql_conditions_tags = '';
if (!users_is_admin()) {
@ -386,20 +406,20 @@ if (!users_is_admin()) {
}
}
// Two modes of filter. All the filters and only ACLs filter
// Two modes of filter. All the filters and only ACLs filter.
$sql_conditions_all = $sql_conditions.$sql_conditions_group.$sql_conditions_tags.$sql_conditions_custom_fields;
// Get count to paginate
// Get count to paginate.
if (!defined('METACONSOLE')) {
$count = db_get_sql('SELECT COUNT(DISTINCT tagente_modulo.id_agente_modulo)'.$sql_from.$sql_conditions_all);
}
// Get limit_sql depend of the metaconsole or standard mode
// Get limit_sql depend of the metaconsole or standard mode.
if (is_metaconsole()) {
// Offset will be used to get the subset of modules
// Offset will be used to get the subset of modules.
$inferior_limit = $offset;
$superior_limit = ($config['block_size'] + $offset);
// Offset reset to get all elements
// Offset reset to get all elements.
$offset = 0;
if (!isset($config['meta_num_elements'])) {
$config['meta_num_elements'] = 100;
@ -410,9 +430,9 @@ if (is_metaconsole()) {
$limit_sql = $config['block_size'];
}
// End Build SQL sentences
// End Build SQL sentences.
//
// Start Build Search Form
// Start Build Search Form.
//
$table = new StdClass();
$table->width = '100%';
@ -445,7 +465,13 @@ $table->data[0][1] .= html_print_select_groups(
false,
false,
'id_grupo',
false
false,
false,
false,
false,
false,
false,
$not_condition
);
$table->data[0][1] .= '</div><div>';
$table->data[0][1] .= html_print_input(
@ -466,7 +492,7 @@ $fields[AGENT_MODULE_STATUS_WARNING] = __('Warning');
$fields[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
$fields[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
$fields[AGENT_MODULE_STATUS_NOT_NORMAL] = __('Not normal');
// default
// Default.
$fields[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
$table->data[0][2] = __('Monitor status');
@ -475,7 +501,7 @@ $table->data[0][3] = html_print_select(
'status',
$status,
'',
__('All'),
__($is_none),
-1,
true,
false,
@ -503,7 +529,7 @@ if (!is_metaconsole()) {
$rows_select = modules_get_modulegroups();
}
$table->data[0][5] = html_print_select($rows_select, 'modulegroup', $modulegroup, '', __('All'), -1, true, false, true, '', false, 'width: 120px;');
$table->data[0][5] = html_print_select($rows_select, 'modulegroup', $modulegroup, '', __($is_none), -1, true, false, true, '', false, 'width: 120px;');
$table->rowspan[0][6] = 3;
$table->data[0][6] = html_print_submit_button(
@ -540,7 +566,7 @@ if (empty($tags)) {
'tag_filter',
$tag_filter,
'',
__('All'),
__($is_none),
'',
true,
false,
@ -558,32 +584,32 @@ $network_available = db_get_sql(
FROM tserver
WHERE server_type = 1'
);
// POSTGRESQL AND ORACLE COMPATIBLE
// POSTGRESQL AND ORACLE COMPATIBLE.
$wmi_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = 6'
);
// POSTGRESQL AND ORACLE COMPATIBLE
// POSTGRESQL AND ORACLE COMPATIBLE.
$plugin_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = 4'
);
// POSTGRESQL AND ORACLE COMPATIBLE
// POSTGRESQL AND ORACLE COMPATIBLE.
$prediction_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = 5'
);
// POSTGRESQL AND ORACLE COMPATIBLE
// POSTGRESQL AND ORACLE COMPATIBLE.
$wux_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = 17'
);
// POSTGRESQL AND ORACLE COMPATIBLE
// Development mode to use all servers
// POSTGRESQL AND ORACLE COMPATIBLE.
// Development mode to use all servers.
if ($develop_bypass) {
$network_available = 1;
$wmi_available = 1;
@ -619,7 +645,7 @@ if (enterprise_installed()) {
$table->data[2][0] = '<span>'.__('Server type').'</span>';
$table->data[2][1] = html_print_select($typemodules, 'moduletype', $moduletype, '', __('All'), '', true, false, true, '', false, 'width: 150px;');
$table->data[2][1] = html_print_select($typemodules, 'moduletype', $moduletype, '', __($is_none), '', true, false, true, '', false, 'width: 150px;');
$monitor_options = [
0 => __('All'),
@ -649,7 +675,7 @@ switch ($moduletype) {
$sql = sprintf(
'SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria IN (6,7,8,0,1,2,-1) order by descripcion '
WHERE categoria '.$not_condition.' IN (6,7,8,0,1,2,-1) order by descripcion '
);
break;
@ -657,7 +683,7 @@ switch ($moduletype) {
$sql = sprintf(
'SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria between 3 and 5 '
WHERE categoria '.$not_condition.' between 3 and 5 '
);
break;
@ -665,7 +691,7 @@ switch ($moduletype) {
$sql = sprintf(
'SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria between 0 and 2 '
WHERE categoria '.$not_condition.' between 0 and 2 '
);
break;
@ -673,7 +699,7 @@ switch ($moduletype) {
$sql = sprintf(
'SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria between 0 and 2 '
WHERE categoria '.$not_condition.' between 0 and 2 '
);
break;
@ -681,7 +707,7 @@ switch ($moduletype) {
$sql = sprintf(
'SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria = 9'
WHERE categoria '.$condition_query.' 9'
);
break;
@ -689,7 +715,7 @@ switch ($moduletype) {
$sql = sprintf(
'SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria = 0'
WHERE categoria '.$condition_query.' 0'
);
break;
@ -697,7 +723,7 @@ switch ($moduletype) {
$sql = sprintf(
'SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE nombre = \'web_analysis\''
WHERE nombre '.$condition_query.' \'web_analysis\''
);
break;
@ -707,6 +733,10 @@ switch ($moduletype) {
FROM ttipo_modulo'
);
break;
default:
// Nothing.
break;
}
$a = db_get_all_rows_sql($sql);
@ -714,7 +744,7 @@ $table->data[3][1] .= '<select id="datatype" name="datatype" ';
$table->data[3][1] .= '>';
$table->data[3][1] .= '<option name="datatype" value="">'.__('All').'</option>';
$table->data[3][1] .= '<option name="datatype" value="">'.__($is_none).'</option>';
foreach ($a as $valor) {
@ -733,7 +763,27 @@ foreach ($a as $valor) {
$table->data[3][1] .= '</div>';
$check_not_condition = '';
if ($not_condition !== '') {
$check_not_condition = true;
}
$table->data[4][0] .= __('Not condition');
$table->data[4][1] .= '<div class="w120px mrgn_top_20px">';
$table->data[4][1] .= html_print_input(
[
'type' => 'switch',
'name' => 'not_condition',
'return' => false,
'checked' => $check_not_condition,
'value' => 'NOT',
'id' => 'not_condition_switch',
'onclick' => 'changeNotConditionStatus(this)',
]
);
$table->data[4][1] .= ui_print_help_tip(__('If you check this option, those elements that do NOT meet any of the requirements will be shown'), true);
$table->data[4][1] .= '</div>';
$table_custom_fields = new stdClass();
$table_custom_fields->class = 'filters';
@ -778,10 +828,12 @@ foreach ($custom_fields as $custom_field) {
}
$filters = '<form method="post" action="index.php?sec='.$section.'&sec2=operation/agentes/status_monitor&refr='.$refr.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&module_option='.$module_option.'&ag_modulename='.$ag_modulename.'&moduletype='.$moduletype.'&datatype='.$datatype.'&status='.$status.'&sort_field='.$sortField.'&sort='.$sort.'&pure='.$config['pure'].$ag_custom_fields_params.'">';
if (is_metaconsole()) {
$table->colspan[4][0] = 7;
$table->cellstyle[4][0] = 'padding: 10px;';
$table->data[4][0] = ui_toggle(
$table->colspan[5][0] = 7;
$table->cellstyle[5][0] = 'padding: 10px;';
$table->data[5][0] = ui_toggle(
html_print_table($table_custom_fields, true),
__('Advanced Options'),
'',
@ -794,9 +846,9 @@ if (is_metaconsole()) {
$filters .= '</form>';
ui_toggle($filters, __('Show filters'), '', '', false);
} else {
$table->colspan[4][0] = 7;
$table->cellstyle[4][0] = 'padding-left: 10px;';
$table->data[4][0] = ui_toggle(
$table->colspan[5][0] = 7;
$table->cellstyle[5][0] = 'padding-left: 10px;';
$table->data[5][0] = ui_toggle(
html_print_table(
$table_custom_fields,
true
@ -817,9 +869,9 @@ if (is_metaconsole()) {
}
unset($table);
// End Build Search Form
// End Build Search Form.
//
// Sort functionality
// Sort functionality.
$selected = true;
$selectAgentNameUp = false;
$selectAgentNameDown = false;
@ -1090,7 +1142,7 @@ $sql = 'SELECT
LIMIT '.$offset.','.$limit_sql;
// We do not show the modules until the user searches with the filter
// We do not show the modules until the user searches with the filter.
if ($autosearch) {
if (! defined('METACONSOLE')) {
$result = db_get_all_rows_sql($sql);
@ -1101,7 +1153,7 @@ if ($autosearch) {
ui_pagination($count, false, $offset, 0, false, 'offset', true);
}
} else {
// For each server defined and not disabled:
// For each server defined and not disabled.
$servers = db_get_all_rows_sql(
'SELECT *
FROM tmetaconsole_setup
@ -1114,7 +1166,7 @@ if ($autosearch) {
$result = [];
$count_modules = 0;
foreach ($servers as $server) {
// If connection was good then retrieve all data server
// If connection was good then retrieve all data server.
if (metaconsole_connect($server) == NOERR) {
$connection = true;
} else {
@ -1124,7 +1176,7 @@ if ($autosearch) {
$result_server = db_get_all_rows_sql($sql);
if (!empty($result_server)) {
// Create HASH login info
// Create HASH login info.
$pwd = $server['auth_token'];
$auth_serialized = json_decode($pwd, true);
@ -1165,7 +1217,7 @@ if ($autosearch) {
ui_pagination($count_modules, false, $offset);
}
// Get number of elements of the pagination
// Get number of elements of the pagination.
$result = ui_meta_get_subset_array($result, $inferior_limit, $superior_limit);
}
}
@ -1224,7 +1276,7 @@ $url_data .= '&sort_field=data&sort=';
$url_timestamp_up .= '&sort_field=timestamp&sort=up';
$url_timestamp_down .= '&sort_field=timestamp&sort=down';
// Start Build List Result
// Start Build List Result.
if (!empty($result)) {
$table = new StdClass();
$table->cellpadding = 0;
@ -1316,7 +1368,7 @@ if (!empty($result)) {
);
foreach ($result as $row) {
// Avoid unset, null and false value
// Avoid unset, null and false value.
if (empty($row['server_name'])) {
$row['server_name'] = '';
}
@ -1330,13 +1382,13 @@ if (!empty($result)) {
]
);
// Fixed the goliat sends the strings from web
// without HTML entities
// Fixed the goliat sends the strings from web.
// Without HTML entities.
if ($is_web_content_string) {
$row['datos'] = io_safe_input($row['datos']);
}
// Fixed the data from Selenium Plugin
// Fixed the data from Selenium Plugin.
if ($row['datos'] != strip_tags($row['datos'])) {
$row['datos'] = io_safe_input($row['datos']);
}
@ -1455,6 +1507,29 @@ if (!empty($result)) {
}
}
if (in_array('module_name', $show_fields) || is_metaconsole()) {
$data[3] = ui_print_truncate_text($row['module_name'], 'module_small', false, true, true);
if ($row['extended_info'] != '') {
$data[3] .= ui_print_help_tip($row['extended_info'], true, '/images/default_list.png');
}
if ($row['tags'] != '') {
$data[3] .= html_print_image(
'/images/tag_red.png',
true,
[
'title' => $row['tags'],
'class' => 'tag_row',
]
);
}
}
if (in_array('server_type', $show_fields) || is_metaconsole()) {
$data[4] = servers_show_type($row['id_modulo']);
}
if (in_array('module_name', $show_fields) || is_metaconsole()) {
$data[3] = ui_print_truncate_text($row['module_name'], 'module_small', false, true, true);
if ($row['extended_info'] != '') {
@ -1509,7 +1584,9 @@ if (!empty($result)) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_CRITICAL,
__('CRITICAL').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
__('CRITICAL').': '.remove_right_zeros(
number_format($row['datos'], $config['graph_precision'])
),
true
);
} else {
@ -1523,7 +1600,9 @@ if (!empty($result)) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_WARNING,
__('WARNING').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
__('WARNING').': '.remove_right_zeros(
number_format($row['datos'], $config['graph_precision'])
),
true
);
} else {
@ -1537,7 +1616,9 @@ if (!empty($result)) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_UNKNOWN,
__('UNKNOWN').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
__('UNKNOWN').': '.remove_right_zeros(
number_format($row['datos'], $config['graph_precision'])
),
true
);
} else {
@ -1551,7 +1632,9 @@ if (!empty($result)) {
if (is_numeric($row['datos'])) {
$data[6] = ui_print_status_image(
STATUS_MODULE_NO_DATA,
__('NO DATA').': '.remove_right_zeros(number_format($row['datos'], $config['graph_precision'])),
__('NO DATA').': '.remove_right_zeros(
number_format($row['datos'], $config['graph_precision'])
),
true
);
} else {
@ -1626,7 +1709,7 @@ if (!empty($result)) {
$acl_graphs = false;
// Avoid the check on the metaconsole. Too slow to show/hide an icon depending on the permissions
// Avoid the check on the metaconsole. Too slow to show/hide an icon depending on the permissions.
if (!is_metaconsole()) {
$agent_groups = agents_get_all_groups_agent($row['id_agent'], $row['id_group']);
$acl_graphs = check_acl_one_of_groups($config['id_user'], $agent_groups, 'RR');
@ -1649,7 +1732,7 @@ if (!empty($result)) {
];
if (is_metaconsole() && isset($row['server_id'])) {
// Set the server id
// Set the server id.
$graph_params['server'] = $row['server_id'];
}
@ -1740,7 +1823,7 @@ if (!empty($result)) {
}
}
// Show units ONLY in numeric data types
// Show units ONLY in numeric data types.
if (isset($row['unit'])) {
$data_macro = modules_get_unit_macro($row['datos'], $row['unit']);
if ($data_macro) {
@ -1749,7 +1832,7 @@ if (!empty($result)) {
$salida .= '&nbsp;'.'<i>'.io_safe_output($row['unit']).'</i>';
if (strlen($salida) > $config['agent_size_text_small']) {
$salida = ui_print_truncate_text($salida, 'agent_small', true, true, false, '[&hellip;]', 'font-size:7.5pt;');
// clean tag <i>
// Clean tag <i>.
$text_aux = explode('<a', $salida);
$match = preg_replace('/(&lt;i&gt;|&lt;\/i&gt;|&lt;i|&lt;\/i|i&gt;|\/i&gt;|&lt;|&gt;)/', '', $text_aux[0]);
$salida = $match.'<a'.$text_aux[1];
@ -1759,8 +1842,8 @@ if (!empty($result)) {
}
}
} else {
// Fixed the goliat sends the strings from web
// without HTML entities
// Fixed the goliat sends the strings from web.
// Without HTML entities.
if ($is_web_content_string) {
$module_value = $row['datos'];
} else {
@ -1794,12 +1877,12 @@ if (!empty($result)) {
}
}
} else {
// Fixed the goliat sends the strings from web
// without HTML entities
// Fixed the goliat sends the strings from web.
// Without HTML entities.
if ($is_web_content_string) {
$sub_string = substr($row['datos'], 0, 12);
} else {
// Fixed the data from Selenium Plugin
// Fixed the data from Selenium Plugin.
if ($module_value != strip_tags($module_value)) {
$module_value = io_safe_input($module_value);
$sub_string = substr($row['datos'], 0, 12);
@ -1848,6 +1931,7 @@ if (!empty($result)) {
html_print_table($table);
if ($count_modules > $config['block_size']) {
ui_pagination($count_modules, false, $offset, 0, false, 'offset', true, 'pagination-bottom');
}
@ -1859,6 +1943,7 @@ if (!empty($result)) {
}
}
// End Build List Result.
echo "<div id='monitor_details_window'></div>";
@ -1869,6 +1954,11 @@ ui_require_javascript_file('pandora_modules');
?>
<script type="text/javascript">
if(!document.getElementById('not_condition_switch').checked){
document.getElementById("select2-ag_group-container").innerHTML = "None";
}
$('#moduletype').click(function() {
jQuery.get (
"ajax.php",
@ -1899,7 +1989,7 @@ function toggle_full_value(id) {
$("#value_module_text_" + id).html(text);
}
// Show the modal window of an module
// Show the modal window of an module.
function show_module_detail_dialog(module_id, id_agent, server_name, offset, period, module_name) {
if (period == -1) {
if ($("#period").length == 1) {
@ -1967,4 +2057,63 @@ function refresh_pagination_callback (module_id, id_agent, server_name,module_na
return false;
});
}
function changeNotConditionStatus() {
let chkbox =document.getElementById('not_condition_switch');
if(chkbox.checked) {
$('select[name=datatypebox] > option:first-child').val('None');
$('#datatypebox option:first').text('None');
$('select[name=status] > option:first-child').text('None');
$('select[name=moduletype] > option:first-child').text('None');
$('select[name=modulegroup] > option:first-child').text('None');
$('select[name=tag_filter] > option:first-child').text('None');
$("#status").select2().val(["None"]).trigger("change");
$("#moduletype").select2().val(["None"]).trigger("change");
$("#modulegroup").select2().val(["None"]).trigger("change");
$("#tag_filter").select2().val(["None"]).trigger("change");
document.getElementById("select2-status-container").innerHTML = "None";
document.getElementById("select2-moduletype-container").innerHTML = "None";
document.getElementById("select2-ag_group-container").innerHTML = "None";
document.getElementById("select2-modulegroup-container").innerHTML = "None";
document.getElementById("select2-tag_filter-container").innerHTML = "None";
}else {
$('select[name=datatypebox] > option:first-child').val('All');
$('#datatypebox option:first').text('All');
$('select[name=status] > option:first-child').text('All');
$('select[name=moduletype] > option:first-child').text('All');
$('select[name=modulegroup] > option:first-child').text('All');
$('select[name=tag_filter] > option:first-child').text('All');
$('#datatypebox option:first').text('All');
$("#status").select2().val(["All"]).trigger("change");
$("#moduletype").select2().val(["All"]).trigger("change");
$("#modulegroup").select2().val(["All"]).trigger("change");
$("#tag_filter").select2().val(["All"]).trigger("change");
document.getElementById("select2-status-container").innerHTML = "All";
document.getElementById("select2-moduletype-container").innerHTML = "All";
document.getElementById("select2-ag_group-container").innerHTML = "All";
document.getElementById("select2-modulegroup-container").innerHTML = "All";
document.getElementById("select2-tag_filter-container").innerHTML = "All";
}
}
let chkbox =document.getElementById('not_condition_switch');
let value_swtich = "<?php echo $not_condition; ?>";
if( value_swtich != "") {
chkbox.checked = true;
}else {
chkbox.checked = false;
}
</script>

View File

@ -887,6 +887,8 @@ if (is_ajax()) {
$tags = (array) get_parameter('tags', []);
$safe_name = (bool) get_parameter('safe_name', false);
// Filter.
$filter = [];
if ($disabled !== -1) {
@ -1024,6 +1026,9 @@ if (is_ajax()) {
foreach ($agent_modules as $key => $module) {
$agent_modules[$key]['nombre'] = io_safe_output($module['nombre']);
if ($safe_name == true) {
$agent_modules[$key]['safe_name'] = $module['nombre'];
}
}
$get_order_json = (bool) get_parameter('get_order_json', false);

View File

@ -293,6 +293,7 @@ if (is_ajax()) {
'te.module_status',
'ta.alias as agent_name',
'tg.nombre as group_name',
'ta.direccion',
];
if (!is_metaconsole()) {
$fields[] = 'am.nombre as module_name';
@ -391,10 +392,14 @@ if (is_ajax()) {
true
);
if (is_numeric($tmp->data) === true) {
$tmp->data = format_numeric(
$tmp->data,
$config['graph_precision']
);
} else {
$tmp->data = ui_print_truncate_text($tmp->data, 10);
}
$tmp->instructions = events_get_instructions($item);

View File

@ -29,9 +29,9 @@
// Begin.
global $config;
require_once 'include/functions_users.php';
require_once 'include/functions_groups.php';
require_once 'include/functions_io.php';
require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/functions_groups.php';
require_once $config['homedir'].'/include/functions_io.php';
// Parse parameters.
$send_mes = (bool) get_parameter('send_mes', false);
@ -82,6 +82,10 @@ $buttons['create_message'] = [
];
// Header.
if (is_metaconsole() === true) {
enterprise_hook('open_meta_frame');
}
ui_print_standard_header(
__('Compose message'),
'images/email_mc.png',
@ -400,3 +404,6 @@ html_print_div(
echo '</form>';
echo $jsOutput;
if (is_metaconsole() === true) {
enterprise_hook('close_meta_frame');
}

View File

@ -27,10 +27,10 @@
*/
// Begin.
require_once 'include/functions_messages.php';
global $config;
require_once $config['homedir'].'/include/functions_messages.php';
$delete_msg = get_parameter('delete_message', 0);
$multiple_delete = get_parameter('multiple_delete', 0);
$show_sent = (bool) get_parameter('show_sent', false);
@ -68,6 +68,10 @@ $buttons['create_message'] = [
];
if (is_ajax() === false) {
if (is_metaconsole() === true) {
enterprise_hook('open_meta_frame');
}
// Header.
ui_print_standard_header(
$tabSelectedMessage,
@ -300,6 +304,10 @@ echo "<div class='float-right'>";
html_print_submit_button(__('Create message'), 'create', false, 'class="sub next mrgn_right_5px"');
echo '</form>';
echo '</div>';
if (is_ajax() !== true && is_metaconsole() === true) {
enterprise_hook('close_meta_frame');
}
?>
<script type="text/javascript">

View File

@ -235,7 +235,7 @@ if (is_metaconsole() === true) {
}
$is_management_allowed = true;
if (is_management_allowed() === false) {
if (is_metaconsole() === false && is_management_allowed() === false) {
$is_management_allowed = false;
ui_print_warning_message(
__(

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.756
%define release 210811
%define release 210901
# 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.756
%define release 210811
%define release 210901
# 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.756
%define release 210811
%define release 210901
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -694,7 +694,7 @@ CREATE TABLE IF NOT EXISTS `tevento` (
`owner_user` VARCHAR(100) NOT NULL DEFAULT '',
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
`custom_data` TEXT NOT NULL,
`data` double(50,5) default NULL,
`data` tinytext default NULL,
`module_status` int(4) NOT NULL default '0',
PRIMARY KEY (`id_evento`),
KEY `idx_agente` (`id_agente`),
@ -3291,7 +3291,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
`server_id` int(10) NOT NULL,
`custom_data` TEXT NOT NULL DEFAULT '',
`data` double(50,5) default NULL,
`data` tinytext default NULL,
`module_status` int(4) NOT NULL default '0',
PRIMARY KEY (`id_evento`),
KEY `idx_agente` (`id_agente`),

View File

@ -105,7 +105,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('show_vc', 1),
('inventory_changes_blacklist', '1,2,20,21'),
('custom_report_front', 0),
('custom_report_front_font', 'lato.ttf'),
('custom_report_front_font', 'Lato-Regular.ttf'),
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''),
('custom_report_front_footer', ''),
@ -202,7 +202,7 @@ INSERT INTO `tlanguage` VALUES ('en_GB','English (UK)');
INSERT INTO `tlanguage` VALUES ('es','Español');
INSERT INTO `tlanguage` VALUES ('ar','العربية');
INSERT INTO `tlanguage` VALUES ('cs','Česky');
INSERT INTO `tlanguage` VALUES ('de','Deutch');
INSERT INTO `tlanguage` VALUES ('de','Deutsch');
INSERT INTO `tlanguage` VALUES ('el','Ελληνικά');
INSERT INTO `tlanguage` VALUES ('fr','Français');
INSERT INTO `tlanguage` VALUES ('it','Italiano');

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.756-210811
Version: 7.0NG.756-210901
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.756-210811"
pandora_version="7.0NG.756-210901"
package_cpan=0
package_pandora=1

View File

@ -17,6 +17,8 @@
. "/etc/rc.subr"
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
name="pandora_ha"
rcvar=pandora_server_enable

Some files were not shown because too many files have changed in this diff Show More