Merge remote-tracking branch 'origin/develop' into ent-2441-despliegue-de-agentes-desde-pandora
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-agent-unix
|
package: pandorafms-agent-unix
|
||||||
Version: 7.0NG.736-190711
|
Version: 7.0NG.736-190717
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
pandora_version="7.0NG.736-190711"
|
pandora_version="7.0NG.736-190717"
|
||||||
|
|
||||||
echo "Test if you has the tools for to make the packages."
|
echo "Test if you has the tools for to make the packages."
|
||||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||||
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
|||||||
my $ThreadSem = undef;
|
my $ThreadSem = undef;
|
||||||
|
|
||||||
use constant AGENT_VERSION => '7.0NG.736';
|
use constant AGENT_VERSION => '7.0NG.736';
|
||||||
use constant AGENT_BUILD => '190711';
|
use constant AGENT_BUILD => '190717';
|
||||||
|
|
||||||
# Agent log default file size maximum and instances
|
# Agent log default file size maximum and instances
|
||||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_agent_unix
|
%define name pandorafms_agent_unix
|
||||||
%define version 7.0NG.736
|
%define version 7.0NG.736
|
||||||
%define release 190711
|
%define release 190717
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_agent_unix
|
%define name pandorafms_agent_unix
|
||||||
%define version 7.0NG.736
|
%define version 7.0NG.736
|
||||||
%define release 190711
|
%define release 190717
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.736"
|
PI_VERSION="7.0NG.736"
|
||||||
PI_BUILD="190711"
|
PI_BUILD="190717"
|
||||||
OS_NAME=`uname -s`
|
OS_NAME=`uname -s`
|
||||||
|
|
||||||
FORCE=0
|
FORCE=0
|
||||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
Version
|
Version
|
||||||
{190711}
|
{190717}
|
||||||
|
|
||||||
ViewReadme
|
ViewReadme
|
||||||
{Yes}
|
{Yes}
|
||||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||||||
using namespace Pandora_Strutils;
|
using namespace Pandora_Strutils;
|
||||||
|
|
||||||
#define PATH_SIZE _MAX_PATH+1
|
#define PATH_SIZE _MAX_PATH+1
|
||||||
#define PANDORA_VERSION ("7.0NG.736(Build 190711)")
|
#define PANDORA_VERSION ("7.0NG.736(Build 190717)")
|
||||||
|
|
||||||
string pandora_path;
|
string pandora_path;
|
||||||
string pandora_dir;
|
string pandora_dir;
|
||||||
|
@ -11,7 +11,7 @@ BEGIN
|
|||||||
VALUE "LegalCopyright", "Artica ST"
|
VALUE "LegalCopyright", "Artica ST"
|
||||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||||
VALUE "ProductVersion", "(7.0NG.736(Build 190711))"
|
VALUE "ProductVersion", "(7.0NG.736(Build 190717))"
|
||||||
VALUE "FileVersion", "1.0.0.0"
|
VALUE "FileVersion", "1.0.0.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-console
|
package: pandorafms-console
|
||||||
Version: 7.0NG.736-190711
|
Version: 7.0NG.736-190717
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
pandora_version="7.0NG.736-190711"
|
pandora_version="7.0NG.736-190717"
|
||||||
|
|
||||||
package_pear=0
|
package_pear=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
1
pandora_console/extras/delete_files/delete_files.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
operation/servers/recon_view.php
|
@ -10,6 +10,8 @@ ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEF
|
|||||||
|
|
||||||
ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
|
ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
|
||||||
|
|
||||||
|
ALTER TABLE `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
|
||||||
|
|
||||||
CREATE TABLE `ttask_credentials` (
|
CREATE TABLE `ttask_credentials` (
|
||||||
`id_rt` int(10) unsigned NOT NULL,
|
`id_rt` int(10) unsigned NOT NULL,
|
||||||
`identifier` varchar(100) NOT NULL,
|
`identifier` varchar(100) NOT NULL,
|
||||||
|
@ -1446,6 +1446,7 @@ ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1
|
|||||||
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
|
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
|
||||||
ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
|
ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
|
||||||
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
|
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
|
||||||
|
ALTER table `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
|
||||||
|
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tmodule_relationship`
|
-- Table `tmodule_relationship`
|
||||||
|
@ -376,6 +376,9 @@ if (isset($correct_reset_pass_process)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($login_failed)) {
|
if (isset($login_failed)) {
|
||||||
|
$nick = get_parameter_post('nick');
|
||||||
|
$fails = db_get_value('failed_attempt', 'tusuario', 'id_user', $nick);
|
||||||
|
$attemps = ($config['number_attempts'] - $fails);
|
||||||
echo '<div id="login_failed" title="'.__('Login failed').'">';
|
echo '<div id="login_failed" title="'.__('Login failed').'">';
|
||||||
echo '<div class="content_alert">';
|
echo '<div class="content_alert">';
|
||||||
echo '<div class="icon_message_alert">';
|
echo '<div class="icon_message_alert">';
|
||||||
@ -386,6 +389,9 @@ if (isset($login_failed)) {
|
|||||||
echo '<h1>'.__('ERROR').'</h1>';
|
echo '<h1>'.__('ERROR').'</h1>';
|
||||||
echo '<p>'.$config['auth_error'].'</p>';
|
echo '<p>'.$config['auth_error'].'</p>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
echo '<div class="text_message_alert">';
|
||||||
|
echo '<p><strong>Remaining attempts: '.$attemps.'</strong></p>';
|
||||||
|
echo '</div>';
|
||||||
echo '<div class="button_message_alert">';
|
echo '<div class="button_message_alert">';
|
||||||
html_print_submit_button('Ok', 'hide-login-error', false);
|
html_print_submit_button('Ok', 'hide-login-error', false);
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
@ -680,5 +686,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||||||
$("#final_process_correct").dialog('close');
|
$("#final_process_correct").dialog('close');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
</script>
|
</script>
|
||||||
|
@ -77,6 +77,7 @@ if (is_ajax()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$get_modules_json_for_multiple_snmp = (bool) get_parameter('get_modules_json_for_multiple_snmp', 0);
|
$get_modules_json_for_multiple_snmp = (bool) get_parameter('get_modules_json_for_multiple_snmp', 0);
|
||||||
|
$get_common_modules = (bool) get_parameter('get_common_modules', 1);
|
||||||
if ($get_modules_json_for_multiple_snmp) {
|
if ($get_modules_json_for_multiple_snmp) {
|
||||||
include_once 'include/graphs/functions_utils.php';
|
include_once 'include/graphs/functions_utils.php';
|
||||||
|
|
||||||
@ -100,7 +101,16 @@ if (is_ajax()) {
|
|||||||
if ($out === false) {
|
if ($out === false) {
|
||||||
$out = $oid_snmp;
|
$out = $oid_snmp;
|
||||||
} else {
|
} else {
|
||||||
$out = array_intersect($out, $oid_snmp);
|
$commons = array_intersect($out, $oid_snmp);
|
||||||
|
if ($get_common_modules) {
|
||||||
|
// Common modules is selected (default)
|
||||||
|
$out = $commons;
|
||||||
|
} else {
|
||||||
|
// All modules is selected
|
||||||
|
$array1 = array_diff($out, $oid_snmp);
|
||||||
|
$array2 = array_diff($oid_snmp, $out);
|
||||||
|
$out = array_merge($commons, $array1, $array2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$oid_snmp = [];
|
$oid_snmp = [];
|
||||||
@ -201,7 +211,7 @@ if (!$new_agent && $alias != '') {
|
|||||||
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name" style="width: 40%;">';
|
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name" style="width: 40%;">';
|
||||||
|
|
||||||
if ($id_agente) {
|
if ($id_agente) {
|
||||||
$table_agent_name .= '<label>'.__('ID').'</label><input style="width: 50%;" type="text" disabled="true" value="'.$id_agente.'" />';
|
$table_agent_name .= '<label>'.__('ID').'</label><input style="width: 50%;" type="text" readonly value="'.$id_agente.'" />';
|
||||||
$table_agent_name .= '<a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
$table_agent_name .= '<a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
||||||
$table_agent_name .= html_print_image(
|
$table_agent_name .= html_print_image(
|
||||||
'images/zoom.png',
|
'images/zoom.png',
|
||||||
@ -372,13 +382,13 @@ $table_server = '<div class="label_select"><p class="input_label">'.__('Server')
|
|||||||
$table_server .= '<div class="label_select_parent">';
|
$table_server .= '<div class="label_select_parent">';
|
||||||
if ($new_agent) {
|
if ($new_agent) {
|
||||||
// Set first server by default.
|
// Set first server by default.
|
||||||
$servers_get_names = servers_get_names();
|
$servers_get_names = $servers;
|
||||||
$array_keys_servers_get_names = array_keys($servers_get_names);
|
$array_keys_servers_get_names = array_keys($servers_get_names);
|
||||||
$server_name = reset($array_keys_servers_get_names);
|
$server_name = reset($array_keys_servers_get_names);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table_server .= html_print_select(
|
$table_server .= html_print_select(
|
||||||
servers_get_names(),
|
$servers,
|
||||||
'server_name',
|
'server_name',
|
||||||
$server_name,
|
$server_name,
|
||||||
'',
|
'',
|
||||||
@ -1164,6 +1174,19 @@ ui_require_jquery_file('bgiframe');
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready (function() {
|
$(document).ready (function() {
|
||||||
|
|
||||||
|
var previous_primary_group_select;
|
||||||
|
$("#grupo").on('focus', function () {
|
||||||
|
previous_primary_group_select = this.value;
|
||||||
|
}).change(function() {
|
||||||
|
if ($("#secondary_groups_selected option[value="+$("#grupo").val()+"]").length) {
|
||||||
|
alert("<?php echo __('Secondary group cannot be primary too.'); ?>");
|
||||||
|
$("#grupo").val(previous_primary_group_select);
|
||||||
|
} else {
|
||||||
|
previous_primary_group_select = this.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$("select#id_os").pandoraSelectOS ();
|
$("select#id_os").pandoraSelectOS ();
|
||||||
|
|
||||||
var checked = $("#checkbox-cascade_protection").is(":checked");
|
var checked = $("#checkbox-cascade_protection").is(":checked");
|
||||||
@ -1212,7 +1235,7 @@ ui_require_jquery_file('bgiframe');
|
|||||||
128,
|
128,
|
||||||
128
|
128
|
||||||
);
|
);
|
||||||
$("#text-agente").prop('disabled', true);
|
$("#text-agente").prop('readonly', true);
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,16 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Extension to manage a list of gateways and the node address where they should
|
||||||
|
* point to.
|
||||||
|
*
|
||||||
|
* @category SNMP interfaces.
|
||||||
|
* @package Pandora FMS
|
||||||
|
* @subpackage Community
|
||||||
|
* @version 1.0.0
|
||||||
|
* @license See below
|
||||||
|
*
|
||||||
|
* ______ ___ _______ _______ ________
|
||||||
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||||
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||||
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||||
|
*
|
||||||
|
* ============================================================================
|
||||||
|
* Copyright (c) 2005-2019 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-2011 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.
|
|
||||||
global $config;
|
global $config;
|
||||||
require_once $config['homedir'].'/include/functions_agents.php';
|
require_once $config['homedir'].'/include/functions_agents.php';
|
||||||
require_once 'include/functions_modules.php';
|
require_once 'include/functions_modules.php';
|
||||||
@ -36,10 +52,10 @@ $snmp3_privacy_method = get_parameter('snmp3_privacy_method');
|
|||||||
$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass'));
|
$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass'));
|
||||||
$tcp_port = (string) get_parameter('tcp_port');
|
$tcp_port = (string) get_parameter('tcp_port');
|
||||||
|
|
||||||
// See if id_agente is set (either POST or GET, otherwise -1
|
// See if id_agente is set (either POST or GET, otherwise -1.
|
||||||
$id_agent = $idAgent;
|
$id_agent = $idAgent;
|
||||||
|
|
||||||
// Get passed variables
|
// Get passed variables.
|
||||||
$snmpwalk = (int) get_parameter('snmpwalk', 0);
|
$snmpwalk = (int) get_parameter('snmpwalk', 0);
|
||||||
$create_modules = (int) get_parameter('create_modules', 0);
|
$create_modules = (int) get_parameter('create_modules', 0);
|
||||||
|
|
||||||
@ -47,7 +63,7 @@ $interfaces = [];
|
|||||||
$interfaces_ip = [];
|
$interfaces_ip = [];
|
||||||
|
|
||||||
if ($snmpwalk) {
|
if ($snmpwalk) {
|
||||||
// OID Used is for SNMP MIB-2 Interfaces
|
// OID Used is for SNMP MIB-2 Interfaces.
|
||||||
$snmpis = get_snmpwalk(
|
$snmpis = get_snmpwalk(
|
||||||
$ip_target,
|
$ip_target,
|
||||||
$snmp_version,
|
$snmp_version,
|
||||||
@ -63,7 +79,7 @@ if ($snmpwalk) {
|
|||||||
$tcp_port,
|
$tcp_port,
|
||||||
$server_to_exec
|
$server_to_exec
|
||||||
);
|
);
|
||||||
// ifXTable is also used
|
// IfXTable is also used.
|
||||||
$ifxitems = get_snmpwalk(
|
$ifxitems = get_snmpwalk(
|
||||||
$ip_target,
|
$ip_target,
|
||||||
$snmp_version,
|
$snmp_version,
|
||||||
@ -80,7 +96,7 @@ if ($snmpwalk) {
|
|||||||
$server_to_exec
|
$server_to_exec
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get the interfaces IPV4/IPV6
|
// Get the interfaces IPV4/IPV6.
|
||||||
$snmp_int_ip = get_snmpwalk(
|
$snmp_int_ip = get_snmpwalk(
|
||||||
$ip_target,
|
$ip_target,
|
||||||
$snmp_version,
|
$snmp_version,
|
||||||
@ -97,12 +113,12 @@ if ($snmpwalk) {
|
|||||||
$server_to_exec
|
$server_to_exec
|
||||||
);
|
);
|
||||||
|
|
||||||
// Build a [<interface id>] => [<interface ip>] array
|
// Build a [<interface id>] => [<interface ip>] array.
|
||||||
if (!empty($snmp_int_ip)) {
|
if (!empty($snmp_int_ip)) {
|
||||||
foreach ($snmp_int_ip as $key => $value) {
|
foreach ($snmp_int_ip as $key => $value) {
|
||||||
// The key is something like IP-MIB::ipAddressIfIndex.ipv4."<ip>"
|
// The key is something like IP-MIB::ipAddressIfIndex.ipv4."<ip>".
|
||||||
// or IP-MIB::ipAddressIfIndex.ipv6."<ip>"
|
// or IP-MIB::ipAddressIfIndex.ipv6."<ip>".
|
||||||
// The value is something like INTEGER: <interface id>
|
// The value is something like INTEGER: <interface id>.
|
||||||
$data = explode(': ', $value);
|
$data = explode(': ', $value);
|
||||||
$interface_id = !empty($data) && isset($data[1]) ? $data[1] : false;
|
$interface_id = !empty($data) && isset($data[1]) ? $data[1] : false;
|
||||||
|
|
||||||
@ -110,7 +126,7 @@ if ($snmpwalk) {
|
|||||||
$interface_ip = $matches[1];
|
$interface_ip = $matches[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the first ip
|
// Get the first ip.
|
||||||
if ($interface_id !== false && !empty($interface_ip) && !isset($interfaces_ip[$interface_id])) {
|
if ($interface_id !== false && !empty($interface_ip) && !isset($interfaces_ip[$interface_id])) {
|
||||||
$interfaces_ip[$interface_id] = $interface_ip;
|
$interfaces_ip[$interface_id] = $interface_ip;
|
||||||
}
|
}
|
||||||
@ -119,17 +135,17 @@ if ($snmpwalk) {
|
|||||||
unset($snmp_int_ip);
|
unset($snmp_int_ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
$snmpis = array_merge(($snmpis === false ? [] : $snmpis), ($ifxitems === false ? [] : $ifxitems));
|
$snmpis = array_merge((($snmpis === false) ? [] : $snmpis), (($ifxitems === false) ? [] : $ifxitems));
|
||||||
|
|
||||||
$interfaces = [];
|
$interfaces = [];
|
||||||
|
|
||||||
// We get here only the interface part of the MIB, not full mib
|
// We get here only the interface part of the MIB, not full mib.
|
||||||
foreach ($snmpis as $key => $snmp) {
|
foreach ($snmpis as $key => $snmp) {
|
||||||
$data = explode(': ', $snmp, 2);
|
$data = explode(': ', $snmp, 2);
|
||||||
$keydata = explode('::', $key);
|
$keydata = explode('::', $key);
|
||||||
$keydata2 = explode('.', $keydata[1]);
|
$keydata2 = explode('.', $keydata[1]);
|
||||||
|
|
||||||
// Avoid results without index and interfaces without name
|
// Avoid results without index and interfaces without name.
|
||||||
if (!isset($keydata2[1]) || !isset($data[1])) {
|
if (!isset($keydata2[1]) || !isset($data[1])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -239,24 +255,22 @@ if ($create_modules) {
|
|||||||
$oid_array[(count($oid_array) - 1)] = $id;
|
$oid_array[(count($oid_array) - 1)] = $id;
|
||||||
$oid = implode('.', $oid_array);
|
$oid = implode('.', $oid_array);
|
||||||
|
|
||||||
// Get the name
|
// Get the name.
|
||||||
$name_array = explode('::', $oid_array[0]);
|
$name_array = explode('::', $oid_array[0]);
|
||||||
$name = $ifname.'_'.$name_array[1];
|
$name = $ifname.'_'.$name_array[1];
|
||||||
|
|
||||||
// Clean the name
|
// Clean the name.
|
||||||
$name = str_replace('"', '', $name);
|
$name = str_replace('"', '', $name);
|
||||||
|
|
||||||
// Proc moduletypes
|
// Proc moduletypes.
|
||||||
if (preg_match('/Status/', $name_array[1])) {
|
if (preg_match('/Status/', $name_array[1])) {
|
||||||
$module_type = 18;
|
$module_type = 18;
|
||||||
} else if (preg_match('/Present/', $name_array[1])) {
|
} else if (preg_match('/Present/', $name_array[1])) {
|
||||||
$module_type = 18;
|
$module_type = 18;
|
||||||
} else if (preg_match('/PromiscuousMode/', $name_array[1])) {
|
} else if (preg_match('/PromiscuousMode/', $name_array[1])) {
|
||||||
$module_type = 18;
|
$module_type = 18;
|
||||||
}
|
} else if (preg_match('/Alias/', $name_array[1])) {
|
||||||
|
// String moduletypes.
|
||||||
// String moduletypes
|
|
||||||
else if (preg_match('/Alias/', $name_array[1])) {
|
|
||||||
$module_type = 17;
|
$module_type = 17;
|
||||||
} else if (preg_match('/Address/', $name_array[1])) {
|
} else if (preg_match('/Address/', $name_array[1])) {
|
||||||
$module_type = 17;
|
$module_type = 17;
|
||||||
@ -266,15 +280,11 @@ if ($create_modules) {
|
|||||||
$module_type = 17;
|
$module_type = 17;
|
||||||
} else if (preg_match('/Descr/', $name_array[1])) {
|
} else if (preg_match('/Descr/', $name_array[1])) {
|
||||||
$module_type = 17;
|
$module_type = 17;
|
||||||
}
|
} else if (preg_match('/s$/', $name_array[1])) {
|
||||||
|
// Specific counters (ends in s).
|
||||||
// Specific counters (ends in s)
|
|
||||||
else if (preg_match('/s$/', $name_array[1])) {
|
|
||||||
$module_type = 16;
|
$module_type = 16;
|
||||||
}
|
} else {
|
||||||
|
// Otherwise, numeric.
|
||||||
// Otherwise, numeric
|
|
||||||
else {
|
|
||||||
$module_type = 15;
|
$module_type = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,7 +340,7 @@ if ($create_modules) {
|
|||||||
|
|
||||||
$output_oid = '';
|
$output_oid = '';
|
||||||
|
|
||||||
exec('ssh pandora_exec_proxy@'.$row['ip_address'].' snmptranslate -On '.$oid, $output_oid, $rc);
|
exec('snmptranslate -On '.$oid, $output_oid, $rc);
|
||||||
|
|
||||||
$conf_oid = $output_oid[0];
|
$conf_oid = $output_oid[0];
|
||||||
$oid = $conf_oid;
|
$oid = $conf_oid;
|
||||||
@ -397,7 +407,9 @@ if ($create_modules) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($done > 0) {
|
if ($done > 0) {
|
||||||
ui_print_success_message(__('Successfully modules created')." ($done)");
|
ui_print_success_message(
|
||||||
|
__('Successfully modules created').' ('.$done.')'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($errors)) {
|
if (!empty($errors)) {
|
||||||
@ -407,17 +419,17 @@ if ($create_modules) {
|
|||||||
foreach ($errors as $code => $number) {
|
foreach ($errors as $code => $number) {
|
||||||
switch ($code) {
|
switch ($code) {
|
||||||
case ERR_EXIST:
|
case ERR_EXIST:
|
||||||
$msg .= '<br>'.__('Another module already exists with the same name')." ($number)";
|
$msg .= '<br>'.__('Another module already exists with the same name').' ('.$number.')';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ERR_INCOMPLETE:
|
case ERR_INCOMPLETE:
|
||||||
$msg .= '<br>'.__('Some required fields are missed').': ('.__('name').') '." ($number)";
|
$msg .= '<br>'.__('Some required fields are missed').': ('.__('name').') ('.$number.')';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ERR_DB:
|
case ERR_DB:
|
||||||
case ERR_GENERIC:
|
case ERR_GENERIC:
|
||||||
default:
|
default:
|
||||||
$msg .= '<br>'.__('Processing error')." ($number)";
|
$msg .= '<br>'.__('Processing error').' ('.$number.')';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -426,10 +438,10 @@ if ($create_modules) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the interface list for the interface
|
// Create the interface list for the interface.
|
||||||
$interfaces_list = [];
|
$interfaces_list = [];
|
||||||
foreach ($interfaces as $interface) {
|
foreach ($interfaces as $interface) {
|
||||||
// Get the interface name, removing " " characters and avoid "blank" interfaces
|
// Get the interface name, removing " " characters and avoid "blank" interfaces.
|
||||||
if (isset($interface['ifDescr']) && $interface['ifDescr']['value'] != '') {
|
if (isset($interface['ifDescr']) && $interface['ifDescr']['value'] != '') {
|
||||||
$ifname = $interface['ifDescr']['value'];
|
$ifname = $interface['ifDescr']['value'];
|
||||||
} else if (isset($interface['ifName']) && $interface['ifName']['value'] != '') {
|
} else if (isset($interface['ifName']) && $interface['ifName']['value'] != '') {
|
||||||
@ -442,7 +454,7 @@ foreach ($interfaces as $interface) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
|
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
|
||||||
echo "<form method='post' id='walk_form' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente=$id_agent'>";
|
echo "<form method='post' id='walk_form' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente=".$id_agent."'>";
|
||||||
|
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->cellpadding = 0;
|
$table->cellpadding = 0;
|
||||||
@ -464,12 +476,14 @@ if (enterprise_installed()) {
|
|||||||
enterprise_include_once('include/functions_satellite.php');
|
enterprise_include_once('include/functions_satellite.php');
|
||||||
|
|
||||||
$rows = get_proxy_servers();
|
$rows = get_proxy_servers();
|
||||||
|
|
||||||
|
// Check if satellite server has remote configuration enabled.
|
||||||
|
$satellite_remote = config_agents_has_remote_configuration($id_agent);
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
if ($row['server_type'] != 13) {
|
if ($row['server_type'] != 13) {
|
||||||
$s_type = ' (Standard)';
|
$s_type = ' (Standard)';
|
||||||
} else {
|
} else {
|
||||||
// Check if satellite server has remote configuration enabled
|
|
||||||
$satellite_remote = config_agents_has_remote_configuration($id_agent);
|
|
||||||
$id_satellite = $row['id_server'];
|
$id_satellite = $row['id_server'];
|
||||||
$s_type = ' (Satellite)';
|
$s_type = ' (Satellite)';
|
||||||
}
|
}
|
||||||
@ -484,8 +498,7 @@ $table->data[1][4] = html_print_select(
|
|||||||
$servers_to_exec,
|
$servers_to_exec,
|
||||||
'server_to_exec',
|
'server_to_exec',
|
||||||
$server_to_exec,
|
$server_to_exec,
|
||||||
'satellite_remote_warn('.$id_satellite.','.$satellite_remote.')
|
'satellite_remote_warn('.$id_satellite.','.$satellite_remote.')',
|
||||||
',
|
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
true
|
true
|
||||||
@ -509,7 +522,7 @@ html_print_table($table);
|
|||||||
|
|
||||||
unset($table);
|
unset($table);
|
||||||
|
|
||||||
// SNMP3 OPTIONS
|
// SNMP3 OPTIONS.
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
|
|
||||||
$table->data[2][1] = '<b>'.__('Auth user').'</b>';
|
$table->data[2][1] = '<b>'.__('Auth user').'</b>';
|
||||||
@ -564,7 +577,7 @@ echo '</form>';
|
|||||||
|
|
||||||
if (!empty($interfaces_list)) {
|
if (!empty($interfaces_list)) {
|
||||||
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
|
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
|
||||||
echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente=$id_agent'>";
|
echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente=".$id_agent."'>";
|
||||||
echo '<span id="form_interfaces">';
|
echo '<span id="form_interfaces">';
|
||||||
|
|
||||||
$id_snmp_serialize = serialize_in_temp($interfaces, $config['id_user'].'_snmp');
|
$id_snmp_serialize = serialize_in_temp($interfaces, $config['id_user'].'_snmp');
|
||||||
@ -589,13 +602,30 @@ if (!empty($interfaces_list)) {
|
|||||||
|
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
|
|
||||||
// Agent selector
|
// Agent selector.
|
||||||
$table->data[0][0] = '<b>'.__('Interfaces').'</b>';
|
$table->data[0][0] = '<b>'.__('Interfaces').'</b>';
|
||||||
$table->data[0][1] = '';
|
$table->data[0][1] = '';
|
||||||
$table->data[0][2] = '<b>'.__('Modules').'</b>';
|
$table->data[0][2] = '<b>'.__('Modules').'</b>';
|
||||||
|
|
||||||
$table->data[1][0] = html_print_select($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px; overflow: auto;');
|
$table->data[1][0] = html_print_select($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px; overflow: auto;');
|
||||||
$table->data[1][1] = html_print_image('images/darrowright.png', true);
|
|
||||||
|
$table->data[1][1] = __('When selecting interfaces');
|
||||||
|
$table->data[1][1] .= '<br>';
|
||||||
|
$table->data[1][1] .= html_print_select(
|
||||||
|
[
|
||||||
|
1 => __('Show common modules'),
|
||||||
|
0 => __('Show all modules'),
|
||||||
|
],
|
||||||
|
'modules_selection_mode',
|
||||||
|
1,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
$table->data[1][2] = html_print_select([], 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:200px;');
|
$table->data[1][2] = html_print_select([], 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:200px;');
|
||||||
$table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true);
|
$table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true);
|
||||||
|
|
||||||
@ -619,8 +649,6 @@ ui_require_jquery_file('bgiframe');
|
|||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
|
||||||
|
|
||||||
var inputActive = true;
|
var inputActive = true;
|
||||||
|
|
||||||
$('#server_to_exec option').trigger('change');
|
$('#server_to_exec option').trigger('change');
|
||||||
@ -645,10 +673,16 @@ $(document).ready (function () {
|
|||||||
$("#form_interfaces").hide ();
|
$("#form_interfaces").hide ();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// When select interfaces changes
|
||||||
|
$("#modules_selection_mode").change (function() {
|
||||||
|
$("#id_snmp").trigger('change');
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
|
function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
|
||||||
var idSNMP = Array();
|
var idSNMP = Array();
|
||||||
|
var get_common_modules = $("#modules_selection_mode option:selected").val();
|
||||||
|
|
||||||
jQuery.each ($("#id_snmp option:selected"), function (i, val) {
|
jQuery.each ($("#id_snmp option:selected"), function (i, val) {
|
||||||
idSNMP.push($(val).val());
|
idSNMP.push($(val).val());
|
||||||
@ -660,6 +694,7 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
|
|||||||
jQuery.post ('ajax.php',
|
jQuery.post ('ajax.php',
|
||||||
{"page" : "godmode/agentes/agent_manager",
|
{"page" : "godmode/agentes/agent_manager",
|
||||||
"get_modules_json_for_multiple_snmp": 1,
|
"get_modules_json_for_multiple_snmp": 1,
|
||||||
|
"get_common_modules" : get_common_modules,
|
||||||
"id_snmp[]": idSNMP,
|
"id_snmp[]": idSNMP,
|
||||||
"id_snmp_serialize": $("#hidden-id_snmp_serialize").val()
|
"id_snmp_serialize": $("#hidden-id_snmp_serialize").val()
|
||||||
},
|
},
|
||||||
|
@ -141,7 +141,9 @@ $largeClassDisabledBecauseInPolicy = '';
|
|||||||
|
|
||||||
$page = get_parameter('page', '');
|
$page = get_parameter('page', '');
|
||||||
|
|
||||||
if (strstr($page, 'policy_modules') === false && $id_agent_module) {
|
$in_policies_page = strstr($page, 'policy_modules');
|
||||||
|
|
||||||
|
if ($in_policies_page === false && $id_agent_module) {
|
||||||
if ($config['enterprise_installed']) {
|
if ($config['enterprise_installed']) {
|
||||||
if (policies_is_module_linked($id_agent_module) == 1) {
|
if (policies_is_module_linked($id_agent_module) == 1) {
|
||||||
$disabledBecauseInPolicy = 1;
|
$disabledBecauseInPolicy = 1;
|
||||||
@ -250,6 +252,12 @@ $table_simple->data[0][3] .= html_print_select_from_sql(
|
|||||||
$disabledBecauseInPolicy
|
$disabledBecauseInPolicy
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ((isset($id_agent_module) && $id_agent_module) || $id_policy_module != 0) {
|
||||||
|
$edit = false;
|
||||||
|
} else {
|
||||||
|
$edit = true;
|
||||||
|
}
|
||||||
|
|
||||||
$in_policy = strstr($page, 'policy_modules');
|
$in_policy = strstr($page, 'policy_modules');
|
||||||
if (!$in_policy) {
|
if (!$in_policy) {
|
||||||
// Cannot select the current module to be itself parent
|
// Cannot select the current module to be itself parent
|
||||||
@ -280,17 +288,6 @@ if (!$in_policy) {
|
|||||||
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
|
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
|
||||||
$table_simple->data[2][0] .= html_print_input_hidden('id_module_type_hidden', $id_module_type, true);
|
$table_simple->data[2][0] .= html_print_input_hidden('id_module_type_hidden', $id_module_type, true);
|
||||||
|
|
||||||
if (isset($id_agent_module)) {
|
|
||||||
if ($id_agent_module) {
|
|
||||||
$edit = false;
|
|
||||||
} else {
|
|
||||||
$edit = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Run into a policy
|
|
||||||
$edit = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$edit) {
|
if (!$edit) {
|
||||||
$sql = sprintf(
|
$sql = sprintf(
|
||||||
'SELECT id_tipo, nombre
|
'SELECT id_tipo, nombre
|
||||||
|
@ -84,7 +84,9 @@ if ($create_profiles) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($table !== null) {
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
|
}
|
||||||
|
|
||||||
unset($table);
|
unset($table);
|
||||||
|
|
||||||
|
@ -273,6 +273,9 @@ $table->data[1][1] = html_print_select(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$table->data['form_agents_filter'][0] = __('Filter Agents');
|
||||||
|
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
|
||||||
|
|
||||||
$table->data[2][0] = __('Agent');
|
$table->data[2][0] = __('Agent');
|
||||||
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
|
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
|
||||||
$table->data[2][0] .= html_print_image('images/spinner.png', true);
|
$table->data[2][0] .= html_print_image('images/spinner.png', true);
|
||||||
@ -354,6 +357,11 @@ $(document).ready (function () {
|
|||||||
/* Hide source agent */
|
/* Hide source agent */
|
||||||
var selected_agent = $("#source_id_agent").val();
|
var selected_agent = $("#source_id_agent").val();
|
||||||
$("#destiny_id_agent option[value='" + selected_agent + "']").remove();
|
$("#destiny_id_agent option[value='" + selected_agent + "']").remove();
|
||||||
|
},
|
||||||
|
callbackAfter:function() {
|
||||||
|
//Filter agents. Call the function when the select is fully loaded.
|
||||||
|
var textNoData = "<?php echo __('None'); ?>";
|
||||||
|
filterByText($('#destiny_id_agent'), $("#text-filter_agents"), textNoData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -455,13 +463,14 @@ $(document).ready (function () {
|
|||||||
$("#fieldset_destiny").hide ();
|
$("#fieldset_destiny").hide ();
|
||||||
|
|
||||||
$("span.without_modules, span.without_alerts").show ();
|
$("span.without_modules, span.without_alerts").show ();
|
||||||
$("span.with_modules, span.with_alerts, #target_table-operations").hide ();
|
$("span.with_modules, span.with_alerts, #target_table-operations, #target_table-form_modules_filter").hide ();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (no_modules) {
|
if (no_modules) {
|
||||||
$("span.without_modules").show ();
|
$("span.without_modules").show ();
|
||||||
$("span.with_modules").hide ();
|
$("span.with_modules").hide ();
|
||||||
$("#checkbox-copy_modules").uncheck ();
|
$("#checkbox-copy_modules").uncheck ();
|
||||||
|
$("#target_table-form_modules_filter").hide ();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("span.without_modules").hide ();
|
$("span.without_modules").hide ();
|
||||||
@ -479,7 +488,7 @@ $(document).ready (function () {
|
|||||||
$("span.with_alerts").show ();
|
$("span.with_alerts").show ();
|
||||||
$("#checkbox-copy_alerts").check ();
|
$("#checkbox-copy_alerts").check ();
|
||||||
}
|
}
|
||||||
$("#fieldset_destiny, #target_table-operations").show ();
|
$("#fieldset_destiny, #target_table-operations, #target_table-form_modules_filter").show ();
|
||||||
}
|
}
|
||||||
$("#fieldset_targets").show ();
|
$("#fieldset_targets").show ();
|
||||||
$("#target_modules, #target_alerts").enable ();
|
$("#target_modules, #target_alerts").enable ();
|
||||||
|
@ -501,6 +501,11 @@ $table->data['form_agents_4'][1] = html_print_select(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$table->rowstyle['form_agents_filter'] = 'vertical-align: top;';
|
||||||
|
$table->rowclass['form_agents_filter'] = 'select_agents_row select_agents_row_2';
|
||||||
|
$table->data['form_agents_filter'][0] = __('Filter Agents');
|
||||||
|
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
|
||||||
|
|
||||||
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
|
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
|
||||||
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
|
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
|
||||||
$table->data['form_agents_3'][0] = __('Agents');
|
$table->data['form_agents_3'][0] = __('Agents');
|
||||||
@ -763,6 +768,9 @@ $(document).ready (function () {
|
|||||||
.html (value["alias"]);
|
.html (value["alias"]);
|
||||||
$("#id_agents").append (option);
|
$("#id_agents").append (option);
|
||||||
});
|
});
|
||||||
|
//Filter agents. Call the function when the select is fully loaded.
|
||||||
|
var textNoData = "<?php echo __('None'); ?>";
|
||||||
|
filterByText($('#id_agents'), $("#text-filter_agents"), textNoData);
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
);
|
);
|
||||||
|
@ -92,7 +92,9 @@ if ($delete_profiles) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($table !== null) {
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
|
}
|
||||||
|
|
||||||
unset($table);
|
unset($table);
|
||||||
|
|
||||||
|
@ -170,6 +170,8 @@ if ($update_agents) {
|
|||||||
$n_edited = 0;
|
$n_edited = 0;
|
||||||
$result = false;
|
$result = false;
|
||||||
foreach ($id_agents as $id_agent) {
|
foreach ($id_agents as $id_agent) {
|
||||||
|
$old_interval_value = db_get_value_filter('intervalo', 'tagente', ['id_agente' => $id_agent]);
|
||||||
|
|
||||||
if (!empty($values)) {
|
if (!empty($values)) {
|
||||||
$group_old = false;
|
$group_old = false;
|
||||||
$disabled_old = false;
|
$disabled_old = false;
|
||||||
@ -196,6 +198,18 @@ if ($update_agents) {
|
|||||||
$result_metaconsole = agent_update_from_cache($id_agent, $values, $server_name);
|
$result_metaconsole = agent_update_from_cache($id_agent, $values, $server_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update the configuration files.
|
||||||
|
if ($result && ($old_interval_value != $values['intervalo'])) {
|
||||||
|
enterprise_hook(
|
||||||
|
'config_agents_update_config_token',
|
||||||
|
[
|
||||||
|
$id_agent,
|
||||||
|
'interval',
|
||||||
|
$values['intervalo'],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if ($disabled_old !== false && $disabled_old != $values['disabled']) {
|
if ($disabled_old !== false && $disabled_old != $values['disabled']) {
|
||||||
enterprise_hook(
|
enterprise_hook(
|
||||||
'config_agents_update_config_token',
|
'config_agents_update_config_token',
|
||||||
|
@ -473,6 +473,11 @@ $table->data['form_agents_4'][1] = html_print_select(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$table->rowstyle['form_agents_filter'] = 'vertical-align: top;';
|
||||||
|
$table->rowclass['form_agents_filter'] = 'select_agents_row select_agents_row_2';
|
||||||
|
$table->data['form_agents_filter'][0] = __('Filter agents');
|
||||||
|
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
|
||||||
|
|
||||||
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
|
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
|
||||||
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
|
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
|
||||||
$table->data['form_agents_3'][0] = __('Agents');
|
$table->data['form_agents_3'][0] = __('Agents');
|
||||||
@ -1638,6 +1643,9 @@ $(document).ready (function () {
|
|||||||
.html(value["alias"]);
|
.html(value["alias"]);
|
||||||
$("#id_agents").append (option);
|
$("#id_agents").append (option);
|
||||||
});
|
});
|
||||||
|
//Filter agents. Call the function when the select is fully loaded.
|
||||||
|
var textNoData = "<?php echo __('None'); ?>";
|
||||||
|
filterByText($('#id_agents'), $("#text-filter_agents"), textNoData);
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
);
|
);
|
||||||
|
@ -853,7 +853,10 @@ $class = 'databox filters';
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
|
if (!isset($text)) {
|
||||||
$text = __('This type of report brings a lot of data loading, it is recommended to use it for scheduled reports and not for real-time view.');
|
$text = __('This type of report brings a lot of data loading, it is recommended to use it for scheduled reports and not for real-time view.');
|
||||||
|
}
|
||||||
|
|
||||||
echo '<a id="log_help_tip" style="visibility: hidden;" href="javascript:" class="tip" >'.html_print_image('images/tip.png', true, ['title' => $text]).'</a>';
|
echo '<a id="log_help_tip" style="visibility: hidden;" href="javascript:" class="tip" >'.html_print_image('images/tip.png', true, ['title' => $text]).'</a>';
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
@ -865,7 +868,18 @@ $class = 'databox filters';
|
|||||||
</td>
|
</td>
|
||||||
<td style="">
|
<td style="">
|
||||||
<?php
|
<?php
|
||||||
html_print_input_text('name', $name, '', 80, 100);
|
html_print_input_text(
|
||||||
|
'name',
|
||||||
|
$name,
|
||||||
|
'',
|
||||||
|
80,
|
||||||
|
100,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'fullwidth'
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -923,7 +937,18 @@ $class = 'databox filters';
|
|||||||
</td>
|
</td>
|
||||||
<td style="">
|
<td style="">
|
||||||
<?php
|
<?php
|
||||||
echo html_print_input_text('label', $label, '', 50, 255, true);
|
echo html_print_input_text(
|
||||||
|
'label',
|
||||||
|
$label,
|
||||||
|
'',
|
||||||
|
50,
|
||||||
|
255,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'fullwidth'
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -774,14 +774,14 @@ switch ($action) {
|
|||||||
$table->head[1] = __('Description');
|
$table->head[1] = __('Description');
|
||||||
$table->head[2] = __('HTML');
|
$table->head[2] = __('HTML');
|
||||||
$table->head[3] = __('XML');
|
$table->head[3] = __('XML');
|
||||||
$table->size[0] = '60%';
|
$table->size[0] = '50%';
|
||||||
$table->size[1] = '20%';
|
$table->size[1] = '20%';
|
||||||
$table->size[2] = '2%';
|
$table->size[2] = '2%';
|
||||||
$table->headstyle[2] = 'min-width: 35px;text-align: center;';
|
$table->headstyle[2] = 'min-width: 35px;text-align: left;';
|
||||||
$table->size[3] = '2%';
|
$table->size[3] = '2%';
|
||||||
$table->headstyle[3] = 'min-width: 35px;text-align: center;';
|
$table->headstyle[3] = 'min-width: 35px;text-align: left;';
|
||||||
$table->size[4] = '2%';
|
$table->size[4] = '2%';
|
||||||
$table->headstyle[4] = 'min-width: 35px;text-align: center;';
|
$table->headstyle[4] = 'min-width: 35px;text-align: left;';
|
||||||
|
|
||||||
$next = 4;
|
$next = 4;
|
||||||
// Calculate dinamically the number of the column.
|
// Calculate dinamically the number of the column.
|
||||||
@ -790,15 +790,16 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$table->size[$next] = '2%';
|
$table->size[$next] = '2%';
|
||||||
$table->style[$next] = 'text-align: center;';
|
$table->style[$next] = 'text-align: left;';
|
||||||
|
|
||||||
$table->headstyle[($next + 2)] = 'min-width: 100px;';
|
$table->headstyle[($next + 2)] = 'min-width: 130px; text-align:right;';
|
||||||
$table->style[($next + 2)] = 'text-align: center;';
|
$table->style[($next + 2)] = 'text-align: right;';
|
||||||
|
|
||||||
|
|
||||||
// Admin options only for RM flag.
|
// Admin options only for RM flag.
|
||||||
if (check_acl($config['id_user'], 0, 'RM')) {
|
if (check_acl($config['id_user'], 0, 'RM')) {
|
||||||
$table->head[$next] = __('Private');
|
$table->head[$next] = __('Private');
|
||||||
|
$table->headstyle[$next] = 'min-width: 40px;text-align: left;';
|
||||||
$table->size[$next] = '2%';
|
$table->size[$next] = '2%';
|
||||||
if (defined('METACONSOLE')) {
|
if (defined('METACONSOLE')) {
|
||||||
$table->align[$next] = '';
|
$table->align[$next] = '';
|
||||||
@ -808,7 +809,9 @@ switch ($action) {
|
|||||||
|
|
||||||
$next++;
|
$next++;
|
||||||
$table->head[$next] = __('Group');
|
$table->head[$next] = __('Group');
|
||||||
$table->size[$next] = '15%';
|
$table->headstyle[$next] = 'min-width: 40px;text-align: left;';
|
||||||
|
$table->size[$next] = '2%';
|
||||||
|
$table->align[$next] = 'left';
|
||||||
|
|
||||||
$next++;
|
$next++;
|
||||||
$op_column = false;
|
$op_column = false;
|
||||||
@ -826,7 +829,7 @@ switch ($action) {
|
|||||||
|
|
||||||
// $table->size = array ();
|
// $table->size = array ();
|
||||||
$table->size[$next] = '10%';
|
$table->size[$next] = '10%';
|
||||||
$table->align[$next] = 'left';
|
$table->align[$next] = 'right';
|
||||||
}
|
}
|
||||||
|
|
||||||
$columnview = false;
|
$columnview = false;
|
||||||
@ -1341,6 +1344,16 @@ switch ($action) {
|
|||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'update':
|
case 'update':
|
||||||
$values = [];
|
$values = [];
|
||||||
|
$server_name = get_parameter('server_id');
|
||||||
|
if (is_metaconsole() && $server_name != '') {
|
||||||
|
$id_meta = metaconsole_get_id_server($server_name);
|
||||||
|
$connection = metaconsole_get_connection_by_id(
|
||||||
|
$id_meta
|
||||||
|
);
|
||||||
|
metaconsole_connect($connection);
|
||||||
|
$values['server_name'] = $connection['server_name'];
|
||||||
|
}
|
||||||
|
|
||||||
$values['id_report'] = $idReport;
|
$values['id_report'] = $idReport;
|
||||||
$values['description'] = get_parameter('description');
|
$values['description'] = get_parameter('description');
|
||||||
$values['type'] = get_parameter('type', null);
|
$values['type'] = get_parameter('type', null);
|
||||||
@ -1349,14 +1362,36 @@ switch ($action) {
|
|||||||
|
|
||||||
$label = get_parameter('label', '');
|
$label = get_parameter('label', '');
|
||||||
|
|
||||||
|
$id_agent = get_parameter('id_agent');
|
||||||
|
$id_agent_module = get_parameter('id_agent_module');
|
||||||
|
|
||||||
// Add macros name.
|
// Add macros name.
|
||||||
$items_label = [];
|
|
||||||
$items_label['type'] = get_parameter('type');
|
|
||||||
$items_label['id_agent'] = get_parameter('id_agent');
|
|
||||||
$items_label['id_agent_module'] = get_parameter(
|
|
||||||
'id_agent_module'
|
|
||||||
);
|
|
||||||
$name_it = (string) get_parameter('name');
|
$name_it = (string) get_parameter('name');
|
||||||
|
|
||||||
|
$agent_description = agents_get_description($id_agent);
|
||||||
|
$agent_group = agents_get_agent_group($id_agent);
|
||||||
|
$agent_address = agents_get_address($id_agent);
|
||||||
|
$agent_alias = agents_get_alias($id_agent);
|
||||||
|
$module_name = modules_get_agentmodule_name(
|
||||||
|
$id_agent_module
|
||||||
|
);
|
||||||
|
|
||||||
|
$module_description = modules_get_agentmodule_descripcion(
|
||||||
|
$id_agent_module
|
||||||
|
);
|
||||||
|
|
||||||
|
$items_label = [
|
||||||
|
'type' => get_parameter('type'),
|
||||||
|
'id_agent' => $id_agent,
|
||||||
|
'id_agent_module' => $id_agent_module,
|
||||||
|
'agent_description' => $agent_description,
|
||||||
|
'agent_group' => $agent_group,
|
||||||
|
'agent_address' => $agent_address,
|
||||||
|
'agent_alias' => $agent_alias,
|
||||||
|
'module_name' => $module_name,
|
||||||
|
'module_description' => $module_description,
|
||||||
|
];
|
||||||
|
|
||||||
$values['name'] = reporting_label_macro(
|
$values['name'] = reporting_label_macro(
|
||||||
$items_label,
|
$items_label,
|
||||||
$name_it
|
$name_it
|
||||||
@ -1712,13 +1747,6 @@ switch ($action) {
|
|||||||
);
|
);
|
||||||
$values['id_group'] = get_parameter('combo_group');
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
$values['server_name'] = get_parameter('server_name');
|
$values['server_name'] = get_parameter('server_name');
|
||||||
$server_id = (int) get_parameter('server_id');
|
|
||||||
if ($server_id != 0) {
|
|
||||||
$connection = metaconsole_get_connection_by_id(
|
|
||||||
$server_id
|
|
||||||
);
|
|
||||||
$values['server_name'] = $connection['server_name'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($values['server_name'] == '') {
|
if ($values['server_name'] == '') {
|
||||||
$values['server_name'] = get_parameter(
|
$values['server_name'] = get_parameter(
|
||||||
@ -1975,22 +2003,11 @@ switch ($action) {
|
|||||||
|
|
||||||
$values['style'] = io_safe_input(json_encode($style));
|
$values['style'] = io_safe_input(json_encode($style));
|
||||||
|
|
||||||
|
if (is_metaconsole()) {
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
|
||||||
if ($good_format) {
|
if ($good_format) {
|
||||||
switch ($config['dbtype']) {
|
|
||||||
case 'oracle':
|
|
||||||
if (isset($values['type'])) {
|
|
||||||
$values[db_escape_key_identifier(
|
|
||||||
'type'
|
|
||||||
)] = $values['type'];
|
|
||||||
unset($values['type']);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
// Default.
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$resultOperationDB = db_process_sql_update(
|
$resultOperationDB = db_process_sql_update(
|
||||||
'treport_content',
|
'treport_content',
|
||||||
$values,
|
$values,
|
||||||
@ -2003,21 +2020,62 @@ switch ($action) {
|
|||||||
|
|
||||||
case 'save':
|
case 'save':
|
||||||
$values = [];
|
$values = [];
|
||||||
|
|
||||||
|
$values['server_name'] = get_parameter('server_name');
|
||||||
|
$server_id = (int) get_parameter('server_id');
|
||||||
|
if ($server_id != 0) {
|
||||||
|
$connection = metaconsole_get_connection_by_id(
|
||||||
|
$server_id
|
||||||
|
);
|
||||||
|
metaconsole_connect($connection);
|
||||||
|
$values['server_name'] = $connection['server_name'];
|
||||||
|
}
|
||||||
|
|
||||||
$values['id_report'] = $idReport;
|
$values['id_report'] = $idReport;
|
||||||
$values['type'] = get_parameter('type', null);
|
$values['type'] = get_parameter('type', null);
|
||||||
$values['description'] = get_parameter('description');
|
$values['description'] = get_parameter('description');
|
||||||
$label = get_parameter('label', '');
|
$label = get_parameter('label', '');
|
||||||
|
|
||||||
// Add macros name.
|
|
||||||
$items_label = [];
|
|
||||||
$items_label['type'] = get_parameter('type');
|
|
||||||
$items_label['id_agent'] = get_parameter('id_agent');
|
|
||||||
$items_label['id_agent_module'] = get_parameter(
|
|
||||||
'id_agent_module'
|
|
||||||
);
|
|
||||||
$name_it = (string) get_parameter('name');
|
|
||||||
$values['recursion'] = get_parameter('recursion', null);
|
$values['recursion'] = get_parameter('recursion', null);
|
||||||
$values['show_extended_events'] = get_parameter('include_extended_events', null);
|
$values['show_extended_events'] = get_parameter(
|
||||||
|
'include_extended_events',
|
||||||
|
null
|
||||||
|
);
|
||||||
|
|
||||||
|
$id_agent = get_parameter('id_agent');
|
||||||
|
$id_agent_module = get_parameter('id_agent_module');
|
||||||
|
|
||||||
|
// Add macros name.
|
||||||
|
$name_it = (string) get_parameter('name');
|
||||||
|
|
||||||
|
$agent_description = agents_get_description($id_agent);
|
||||||
|
$agent_group = agents_get_agent_group($id_agent);
|
||||||
|
$agent_address = agents_get_address($id_agent);
|
||||||
|
$agent_alias = agents_get_alias($id_agent);
|
||||||
|
$module_name = modules_get_agentmodule_name(
|
||||||
|
$id_agent_module
|
||||||
|
);
|
||||||
|
|
||||||
|
$module_description = modules_get_agentmodule_descripcion(
|
||||||
|
$id_agent_module
|
||||||
|
);
|
||||||
|
|
||||||
|
if (is_metaconsole()) {
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
|
||||||
|
$items_label = [
|
||||||
|
'type' => get_parameter('type'),
|
||||||
|
'id_agent' => $id_agent,
|
||||||
|
'id_agent_module' => $id_agent_module,
|
||||||
|
'agent_description' => $agent_description,
|
||||||
|
'agent_group' => $agent_group,
|
||||||
|
'agent_address' => $agent_address,
|
||||||
|
'agent_alias' => $agent_alias,
|
||||||
|
'module_name' => $module_name,
|
||||||
|
'module_description' => $module_description,
|
||||||
|
];
|
||||||
|
|
||||||
$values['name'] = reporting_label_macro(
|
$values['name'] = reporting_label_macro(
|
||||||
$items_label,
|
$items_label,
|
||||||
$name_it
|
$name_it
|
||||||
@ -2222,18 +2280,6 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$values['server_name'] = get_parameter('server_name');
|
|
||||||
$server_id = (int) get_parameter('server_id');
|
|
||||||
if ($server_id != 0) {
|
|
||||||
$connection = metaconsole_get_connection_by_id(
|
|
||||||
$server_id
|
|
||||||
);
|
|
||||||
|
|
||||||
$values['server_name'] = $connection['server_name'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($values['server_name'] == '') {
|
if ($values['server_name'] == '') {
|
||||||
$values['server_name'] = get_parameter(
|
$values['server_name'] = get_parameter(
|
||||||
'combo_server'
|
'combo_server'
|
||||||
|
@ -171,7 +171,7 @@ foreach ($layoutDatas as $layoutData) {
|
|||||||
$table->data[($i + 1)]['icon'] = html_print_image(
|
$table->data[($i + 1)]['icon'] = html_print_image(
|
||||||
'images/camera.png',
|
'images/camera.png',
|
||||||
true,
|
true,
|
||||||
['title' => __('Static Graph')]
|
['title' => __('Static Image')]
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ if (is_ajax()) {
|
|||||||
$table->head[0] = __('Agent');
|
$table->head[0] = __('Agent');
|
||||||
$table->head[1] = __('Module');
|
$table->head[1] = __('Module');
|
||||||
foreach ($modules as $mod) {
|
foreach ($modules as $mod) {
|
||||||
$agent_name = '<a href="'.$config['homeurl'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$mod['id_agente'].'">'.modules_get_agentmodule_agent_name(
|
$agent_name = '<a href="'.ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$mod['id_agente']).'">'.modules_get_agentmodule_agent_alias(
|
||||||
$mod['id_agente_modulo']
|
$mod['id_agente_modulo']
|
||||||
).'</a>';
|
).'</a>';
|
||||||
|
|
||||||
@ -1215,4 +1215,3 @@ ui_require_javascript_file('pandora_modules');
|
|||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -152,12 +152,12 @@ foreach ($servers as $server) {
|
|||||||
$data[8] = '';
|
$data[8] = '';
|
||||||
|
|
||||||
if ($server['type'] == 'recon') {
|
if ($server['type'] == 'recon') {
|
||||||
$data[8] .= '<a href="index.php?sec=gservers&sec2=operation/servers/recon_view">';
|
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
||||||
$data[8] .= html_print_image(
|
$data[8] .= html_print_image(
|
||||||
'images/firts_task/icono_grande_reconserver.png',
|
'images/firts_task/icono_grande_reconserver.png',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('Manage recon tasks'),
|
'title' => __('Manage Discovery tasks'),
|
||||||
'style' => 'width:21px;height:21px;',
|
'style' => 'width:21px;height:21px;',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@ -165,7 +165,7 @@ foreach ($servers as $server) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($server['type'] == 'data') {
|
if ($server['type'] == 'data') {
|
||||||
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server'].'">';
|
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
|
||||||
$data[8] .= html_print_image(
|
$data[8] .= html_print_image(
|
||||||
'images/target.png',
|
'images/target.png',
|
||||||
true,
|
true,
|
||||||
@ -173,7 +173,7 @@ foreach ($servers as $server) {
|
|||||||
);
|
);
|
||||||
$data[8] .= '</a>';
|
$data[8] .= '</a>';
|
||||||
} else if ($server['type'] == 'enterprise snmp') {
|
} else if ($server['type'] == 'enterprise snmp') {
|
||||||
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server'].'">';
|
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
|
||||||
$data[8] .= html_print_image(
|
$data[8] .= html_print_image(
|
||||||
'images/target.png',
|
'images/target.png',
|
||||||
true,
|
true,
|
||||||
@ -182,7 +182,7 @@ foreach ($servers as $server) {
|
|||||||
$data[8] .= '</a>';
|
$data[8] .= '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server'].'">';
|
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
|
||||||
$data[8] .= html_print_image(
|
$data[8] .= html_print_image(
|
||||||
'images/config.png',
|
'images/config.png',
|
||||||
true,
|
true,
|
||||||
@ -191,7 +191,7 @@ foreach ($servers as $server) {
|
|||||||
$data[8] .= '</a>';
|
$data[8] .= '</a>';
|
||||||
|
|
||||||
if (($names_servers[$safe_server_name] === true) && ($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) {
|
if (($names_servers[$safe_server_name] === true) && ($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) {
|
||||||
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'">';
|
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
|
||||||
$data[8] .= html_print_image(
|
$data[8] .= html_print_image(
|
||||||
'images/remote_configuration.png',
|
'images/remote_configuration.png',
|
||||||
true,
|
true,
|
||||||
@ -201,7 +201,7 @@ foreach ($servers as $server) {
|
|||||||
$names_servers[$safe_server_name] = false;
|
$names_servers[$safe_server_name] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&delete=1">';
|
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&delete=1').'">';
|
||||||
$data[8] .= html_print_image(
|
$data[8] .= html_print_image(
|
||||||
'images/cross.png',
|
'images/cross.png',
|
||||||
true,
|
true,
|
||||||
|
@ -86,7 +86,7 @@ $buttons = [];
|
|||||||
// Draws header.
|
// Draws header.
|
||||||
$buttons['general'] = [
|
$buttons['general'] = [
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general">'.html_print_image('images/gm_setup.png', true, ['title' => __('General')]).'</a>',
|
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=general').'">'.html_print_image('images/gm_setup.png', true, ['title' => __('General')]).'</a>',
|
||||||
];
|
];
|
||||||
|
|
||||||
if (enterprise_installed()) {
|
if (enterprise_installed()) {
|
||||||
@ -95,37 +95,37 @@ if (enterprise_installed()) {
|
|||||||
|
|
||||||
$buttons['auth'] = [
|
$buttons['auth'] = [
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=auth">'.html_print_image('images/key.png', true, ['title' => __('Authentication')]).'</a>',
|
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=auth').'">'.html_print_image('images/key.png', true, ['title' => __('Authentication')]).'</a>',
|
||||||
];
|
];
|
||||||
|
|
||||||
$buttons['perf'] = [
|
$buttons['perf'] = [
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=perf">'.html_print_image('images/performance.png', true, ['title' => __('Performance')]).'</a>',
|
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=perf').'">'.html_print_image('images/performance.png', true, ['title' => __('Performance')]).'</a>',
|
||||||
];
|
];
|
||||||
|
|
||||||
$buttons['vis'] = [
|
$buttons['vis'] = [
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=vis">'.html_print_image('images/chart.png', true, ['title' => __('Visual styles')]).'</a>',
|
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=vis').'">'.html_print_image('images/chart.png', true, ['title' => __('Visual styles')]).'</a>',
|
||||||
];
|
];
|
||||||
|
|
||||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||||
if ($config['activate_netflow']) {
|
if ($config['activate_netflow']) {
|
||||||
$buttons['net'] = [
|
$buttons['net'] = [
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=net">'.html_print_image('images/op_netflow.png', true, ['title' => __('Netflow')]).'</a>',
|
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=net').'">'.html_print_image('images/op_netflow.png', true, ['title' => __('Netflow')]).'</a>',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$buttons['ehorus'] = [
|
$buttons['ehorus'] = [
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup§ion=ehorus">'.html_print_image('images/ehorus/ehorus.png', true, ['title' => __('eHorus')]).'</a>',
|
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=ehorus').'">'.html_print_image('images/ehorus/ehorus.png', true, ['title' => __('eHorus')]).'</a>',
|
||||||
];
|
];
|
||||||
|
|
||||||
// FIXME: Not definitive icon
|
// FIXME: Not definitive icon
|
||||||
$buttons['notifications'] = [
|
$buttons['notifications'] = [
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup§ion=notifications">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
|
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=notifications').'">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
|
||||||
];
|
];
|
||||||
|
|
||||||
$help_header = '';
|
$help_header = '';
|
||||||
|
@ -1,5 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
|
* General setup.
|
||||||
|
*
|
||||||
|
* @category Setup
|
||||||
|
* @package Pandora FMS
|
||||||
|
* @subpackage Opensource
|
||||||
|
* @version 1.0.0
|
||||||
|
* @license See below
|
||||||
|
*
|
||||||
* ______ ___ _______ _______ ________
|
* ______ ___ _______ _______ ________
|
||||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||||
@ -18,8 +26,36 @@
|
|||||||
* ============================================================================
|
* ============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// File begin.
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return sounds path.
|
||||||
|
*
|
||||||
|
* @return string Path.
|
||||||
|
*/
|
||||||
|
function get_sounds()
|
||||||
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
$return = [];
|
||||||
|
|
||||||
|
$files = scandir($config['homedir'].'/include/sounds');
|
||||||
|
|
||||||
|
foreach ($files as $file) {
|
||||||
|
if (strstr($file, 'wav') !== false) {
|
||||||
|
$return['include/sounds/'.$file] = $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Begin.
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
|
||||||
check_login();
|
check_login();
|
||||||
|
|
||||||
$table = new StdClass();
|
$table = new StdClass();
|
||||||
@ -33,35 +69,18 @@ $table->style[0] = 'font-weight:bold';
|
|||||||
$table->size[1] = '70%';
|
$table->size[1] = '70%';
|
||||||
|
|
||||||
// Current config["language"] could be set by user, not taken from global setup !
|
// Current config["language"] could be set by user, not taken from global setup !
|
||||||
switch ($config['dbtype']) {
|
|
||||||
case 'mysql':
|
|
||||||
$current_system_lang = db_get_sql(
|
$current_system_lang = db_get_sql(
|
||||||
'SELECT `value`
|
'SELECT `value` FROM tconfig WHERE `token` = "language"'
|
||||||
FROM tconfig WHERE `token` = "language"'
|
|
||||||
);
|
);
|
||||||
break;
|
|
||||||
|
|
||||||
case 'postgresql':
|
|
||||||
$current_system_lang = db_get_sql(
|
|
||||||
'SELECT "value"
|
|
||||||
FROM tconfig WHERE "token" = \'language\''
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'oracle':
|
|
||||||
$current_system_lang = db_get_sql(
|
|
||||||
'SELECT value
|
|
||||||
FROM tconfig WHERE token = \'language\''
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($current_system_lang == '') {
|
if ($current_system_lang == '') {
|
||||||
$current_system_lang = 'en';
|
$current_system_lang = 'en';
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[0][0] = __('Language code');
|
$i = 0;
|
||||||
$table->data[0][1] = html_print_select_from_sql(
|
|
||||||
|
$table->data[$i][0] = __('Language code');
|
||||||
|
$table->data[$i++][1] = html_print_select_from_sql(
|
||||||
'SELECT id_language, name FROM tlanguage',
|
'SELECT id_language, name FROM tlanguage',
|
||||||
'language',
|
'language',
|
||||||
$current_system_lang,
|
$current_system_lang,
|
||||||
@ -71,68 +90,67 @@ $table->data[0][1] = html_print_select_from_sql(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[1][0] = __('Remote config directory').ui_print_help_tip(__('Directory where agent remote configuration is stored.'), true);
|
$table->data[$i][0] = __('Remote config directory').ui_print_help_tip(__('Directory where agent remote configuration is stored.'), true);
|
||||||
|
$table->data[$i++][1] = html_print_input_text('remote_config', io_safe_output($config['remote_config']), '', 30, 100, true);
|
||||||
|
|
||||||
$table->data[1][1] = html_print_input_text('remote_config', io_safe_output($config['remote_config']), '', 30, 100, true);
|
$table->data[$i][0] = __('Phantomjs bin directory').ui_print_help_tip(__('Directory where phantomjs binary file exists and has execution grants.'), true);
|
||||||
|
$table->data[$i++][1] = html_print_input_text('phantomjs_bin', io_safe_output($config['phantomjs_bin']), '', 30, 100, true);
|
||||||
|
|
||||||
$table->data[2][0] = __('Phantomjs bin directory').ui_print_help_tip(__('Directory where phantomjs binary file exists and has execution grants.'), true);
|
$table->data[$i][0] = __('Auto login (hash) password');
|
||||||
|
$table->data[$i++][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true);
|
||||||
|
|
||||||
$table->data[2][1] = html_print_input_text('phantomjs_bin', io_safe_output($config['phantomjs_bin']), '', 30, 100, true);
|
$table->data[$i][0] = __('Time source');
|
||||||
|
|
||||||
$table->data[6][0] = __('Auto login (hash) password');
|
|
||||||
$table->data[6][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true);
|
|
||||||
|
|
||||||
$table->data[9][0] = __('Time source');
|
|
||||||
$sources['system'] = __('System');
|
$sources['system'] = __('System');
|
||||||
$sources['sql'] = __('Database');
|
$sources['sql'] = __('Database');
|
||||||
$table->data[9][1] = html_print_select($sources, 'timesource', $config['timesource'], '', '', '', true);
|
$table->data[$i++][1] = html_print_select($sources, 'timesource', $config['timesource'], '', '', '', true);
|
||||||
|
|
||||||
$table->data[10][0] = __('Automatic check for updates');
|
$table->data[$i][0] = __('Automatic check for updates');
|
||||||
$table->data[10][1] = html_print_checkbox_switch('autoupdate', 1, $config['autoupdate'], true);
|
$table->data[$i++][1] = html_print_checkbox_switch('autoupdate', 1, $config['autoupdate'], true);
|
||||||
|
|
||||||
echo "<div id='dialog' title='".__('Enforce https Information')."' style='display:none;'>";
|
echo "<div id='dialog' title='".__('Enforce https Information')."' style='display:none;'>";
|
||||||
echo "<p style='text-align: center;'>".__('If SSL is not properly configured you will lose access to ').get_product_name().__(' Console').'</p>';
|
echo "<p style='text-align: center;'>".__('If SSL is not properly configured you will lose access to ').get_product_name().__(' Console').'</p>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
$table->data[11][0] = __('Enforce https');
|
$table->data[$i][0] = __('Enforce https');
|
||||||
$table->data[11][1] = html_print_checkbox_switch_extended('https', 1, $config['https'], false, '', '', true);
|
$table->data[$i++][1] = html_print_checkbox_switch_extended('https', 1, $config['https'], false, '', '', true);
|
||||||
|
|
||||||
$table->data[12][0] = __('Use cert of SSL');
|
$table->data[$i][0] = __('Use cert of SSL');
|
||||||
$table->data[12][1] = html_print_checkbox_switch_extended('use_cert', 1, $config['use_cert'], false, '', '', true);
|
$table->data[$i++][1] = html_print_checkbox_switch_extended('use_cert', 1, $config['use_cert'], false, '', '', true);
|
||||||
|
|
||||||
$table->rowstyle[13] = 'display: none;';
|
$table->rowstyle[$i] = 'display: none;';
|
||||||
$table->data[13][0] = __('Path of SSL Cert.').ui_print_help_tip(__('Path where you put your cert and name of this cert. Remember your cert only in .pem extension.'), true);
|
$table->rowid[$i] = 'ssl-path-tr';
|
||||||
$table->data[13][1] = html_print_input_text('cert_path', io_safe_output($config['cert_path']), '', 50, 255, true);
|
$table->data[$i][0] = __('Path of SSL Cert.').ui_print_help_tip(__('Path where you put your cert and name of this cert. Remember your cert only in .pem extension.'), true);
|
||||||
|
$table->data[$i++][1] = html_print_input_text('cert_path', io_safe_output($config['cert_path']), '', 50, 255, true);
|
||||||
|
|
||||||
$table->data[14][0] = __('Attachment store').ui_print_help_tip(__('Directory where temporary data is stored.'), true);
|
$table->data[$i][0] = __('Attachment store').ui_print_help_tip(__('Directory where temporary data is stored.'), true);
|
||||||
$table->data[14][1] = html_print_input_text('attachment_store', io_safe_output($config['attachment_store']), '', 50, 255, true);
|
$table->data[$i++][1] = html_print_input_text('attachment_store', io_safe_output($config['attachment_store']), '', 50, 255, true);
|
||||||
|
|
||||||
$table->data[15][0] = __('IP list with API access');
|
$table->data[$i][0] = __('IP list with API access');
|
||||||
if (isset($_POST['list_ACL_IPs_for_API'])) {
|
if (isset($_POST['list_ACL_IPs_for_API'])) {
|
||||||
$list_ACL_IPs_for_API = get_parameter_post('list_ACL_IPs_for_API');
|
$list_ACL_IPs_for_API = get_parameter_post('list_ACL_IPs_for_API');
|
||||||
} else {
|
} else {
|
||||||
$list_ACL_IPs_for_API = get_parameter_get('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API']));
|
$list_ACL_IPs_for_API = get_parameter_get('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API']));
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[15][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true);
|
$table->data[$i++][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true);
|
||||||
|
|
||||||
$table->data[16][0] = __('API password').ui_print_help_tip(__('Please be careful if you put a password put https access.'), true);
|
$table->data[$i][0] = __('API password').ui_print_help_tip(__('Please be careful if you put a password put https access.'), true);
|
||||||
$table->data[16][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true);
|
$table->data[$i++][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true);
|
||||||
|
|
||||||
$table->data[17][0] = __('Enable GIS features');
|
$table->data[$i][0] = __('Enable GIS features');
|
||||||
$table->data[17][1] = html_print_checkbox_switch('activate_gis', 1, $config['activate_gis'], true);
|
$table->data[$i++][1] = html_print_checkbox_switch('activate_gis', 1, $config['activate_gis'], true);
|
||||||
|
|
||||||
$table->data[19][0] = __('Enable Netflow');
|
$table->data[$i][0] = __('Enable Netflow');
|
||||||
$rbt_disabled = false;
|
$rbt_disabled = false;
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
|
||||||
$rbt_disabled = true;
|
$rbt_disabled = true;
|
||||||
$table->data[19][0] .= ui_print_help_tip(__('Not supported in Windows systems'), true);
|
$table->data[$i][0] .= ui_print_help_tip(__('Not supported in Windows systems'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[19][1] = html_print_checkbox_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true);
|
$table->data[$i++][1] = html_print_checkbox_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true);
|
||||||
|
|
||||||
$table->data[21][0] = __('Enable Network Traffic Analyzer');
|
$table->data[$i][0] = __('Enable Network Traffic Analyzer');
|
||||||
$table->data[21][1] = html_print_switch(
|
$table->data[$i++][1] = html_print_switch(
|
||||||
[
|
[
|
||||||
'name' => 'activate_nta',
|
'name' => 'activate_nta',
|
||||||
'value' => $config['activate_nta'],
|
'value' => $config['activate_nta'],
|
||||||
@ -171,11 +189,11 @@ foreach ($timezones as $timezone) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[23][0] = __('Timezone setup').' '.ui_print_help_tip(
|
$table->data[$i][0] = __('Timezone setup').' '.ui_print_help_tip(
|
||||||
__('Must have the same time zone as the system or database to avoid mismatches of time.'),
|
__('Must have the same time zone as the system or database to avoid mismatches of time.'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[23][1] = html_print_input_text_extended(
|
$table->data[$i][1] = html_print_input_text_extended(
|
||||||
'timezone_text',
|
'timezone_text',
|
||||||
$config['timezone'],
|
$config['timezone'],
|
||||||
'text-timezone_text',
|
'text-timezone_text',
|
||||||
@ -187,47 +205,63 @@ $table->data[23][1] = html_print_input_text_extended(
|
|||||||
'readonly',
|
'readonly',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[23][1] .= '<a id="change_timezone">'.html_print_image('images/pencil.png', true, ['title' => __('Change timezone')]).'</a>';
|
$table->data[$i][1] .= '<a id="change_timezone">'.html_print_image('images/pencil.png', true, ['title' => __('Change timezone')]).'</a>';
|
||||||
$table->data[23][1] .= ' '.html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true);
|
$table->data[$i][1] .= ' '.html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true);
|
||||||
$table->data[23][1] .= ' '.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
|
$table->data[$i++][1] .= ' '.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
|
||||||
|
|
||||||
$sounds = get_sounds();
|
$sounds = get_sounds();
|
||||||
$table->data[24][0] = __('Sound for Alert fired');
|
$table->data[$i][0] = __('Sound for Alert fired');
|
||||||
$table->data[24][1] = html_print_select($sounds, 'sound_alert', $config['sound_alert'], 'replaySound(\'alert\');', '', '', true);
|
$table->data[$i][1] = html_print_select($sounds, 'sound_alert', $config['sound_alert'], 'replaySound(\'alert\');', '', '', true);
|
||||||
$table->data[24][1] .= ' <a href="javascript: toggleButton(\'alert\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_alert', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
|
$table->data[$i][1] .= ' <a href="javascript: toggleButton(\'alert\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_alert', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
|
||||||
$table->data[24][1] .= '<div id="layer_sound_alert"></div>';
|
$table->data[$i++][1] .= '<div id="layer_sound_alert"></div>';
|
||||||
|
|
||||||
$table->data[25][0] = __('Sound for Monitor critical');
|
$table->data[$i][0] = __('Sound for Monitor critical');
|
||||||
$table->data[25][1] = html_print_select($sounds, 'sound_critical', $config['sound_critical'], 'replaySound(\'critical\');', '', '', true);
|
$table->data[$i][1] = html_print_select($sounds, 'sound_critical', $config['sound_critical'], 'replaySound(\'critical\');', '', '', true);
|
||||||
$table->data[25][1] .= ' <a href="javascript: toggleButton(\'critical\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_critical', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
|
$table->data[$i][1] .= ' <a href="javascript: toggleButton(\'critical\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_critical', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
|
||||||
$table->data[25][1] .= '<div id="layer_sound_critical"></div>';
|
$table->data[$i++][1] .= '<div id="layer_sound_critical"></div>';
|
||||||
|
|
||||||
$table->data[26][0] = __('Sound for Monitor warning');
|
$table->data[$i][0] = __('Sound for Monitor warning');
|
||||||
$table->data[26][1] = html_print_select($sounds, 'sound_warning', $config['sound_warning'], 'replaySound(\'warning\');', '', '', true);
|
$table->data[$i][1] = html_print_select($sounds, 'sound_warning', $config['sound_warning'], 'replaySound(\'warning\');', '', '', true);
|
||||||
$table->data[26][1] .= ' <a href="javascript: toggleButton(\'warning\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_warning', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
|
$table->data[$i][1] .= ' <a href="javascript: toggleButton(\'warning\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_warning', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
|
||||||
$table->data[26][1] .= '<div id="layer_sound_warning"></div>';
|
$table->data[$i++][1] .= '<div id="layer_sound_warning"></div>';
|
||||||
|
|
||||||
$table->data[28][0] = __('Public URL');
|
$table->data[$i][0] = __('Public URL');
|
||||||
$table->data[28][0] .= ui_print_help_tip(
|
$table->data[$i][0] .= ui_print_help_tip(
|
||||||
__('Set this value when your %s across inverse proxy or for example with mod_proxy of Apache.', get_product_name()).' '.__('Without the index.php such as http://domain/console_url/'),
|
__('Set this value when your %s across inverse proxy or for example with mod_proxy of Apache.', get_product_name()).' '.__('Without the index.php such as http://domain/console_url/'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[28][1] = html_print_input_text('public_url', $config['public_url'], '', 40, 255, true);
|
$table->data[$i++][1] = html_print_input_text('public_url', $config['public_url'], '', 40, 255, true);
|
||||||
|
|
||||||
$table->data[29][0] = __('Referer security');
|
$table->data[$i][0] = __('Force use Public URL');
|
||||||
$table->data[29][0] .= ui_print_help_tip(__("If enabled, actively checks if the user comes from %s's URL", get_product_name()), true);
|
$table->data[$i][0] .= ui_print_help_tip(__('Force using defined public URL).', get_product_name()), true);
|
||||||
$table->data[29][1] = html_print_checkbox_switch('referer_security', 1, $config['referer_security'], true);
|
$table->data[$i++][1] = html_print_switch(
|
||||||
|
[
|
||||||
|
'name' => 'force_public_url',
|
||||||
|
'value' => $config['force_public_url'],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$table->data[30][0] = __('Event storm protection');
|
echo "<div id='force_public_url_dialog' title='".__('Enforce public URL usage information')."' style='display:none;'>";
|
||||||
$table->data[30][0] .= ui_print_help_tip(__('If set to yes no events or alerts will be generated, but agents will continue receiving data.'), true);
|
echo "<p style='text-align: center;'>".__('If public URL is not properly configured you will lose access to ').get_product_name().__(' Console').'</p>';
|
||||||
$table->data[30][1] = html_print_checkbox_switch('event_storm_protection', 1, $config['event_storm_protection'], true);
|
echo '</div>';
|
||||||
|
|
||||||
|
$table->data[$i][0] = __('Public URL host exclusions');
|
||||||
|
$table->data[$i++][1] = html_print_textarea('public_url_exclusions', 2, 25, $config['public_url_exclusions'], 'style="height: 50px; width: 300px"', true);
|
||||||
|
|
||||||
|
$table->data[$i][0] = __('Referer security');
|
||||||
|
$table->data[$i][0] .= ui_print_help_tip(__("If enabled, actively checks if the user comes from %s's URL", get_product_name()), true);
|
||||||
|
$table->data[$i++][1] = html_print_checkbox_switch('referer_security', 1, $config['referer_security'], true);
|
||||||
|
|
||||||
|
$table->data[$i][0] = __('Event storm protection');
|
||||||
|
$table->data[$i][0] .= ui_print_help_tip(__('If set to yes no events or alerts will be generated, but agents will continue receiving data.'), true);
|
||||||
|
$table->data[$i++][1] = html_print_checkbox_switch('event_storm_protection', 1, $config['event_storm_protection'], true);
|
||||||
|
|
||||||
|
|
||||||
$table->data[31][0] = __('Command Snapshot').ui_print_help_tip(__('The string modules with several lines show as command output'), true);
|
$table->data[$i][0] = __('Command Snapshot').ui_print_help_tip(__('The string modules with several lines show as command output'), true);
|
||||||
$table->data[31][1] = html_print_checkbox_switch('command_snapshot', 1, $config['command_snapshot'], true);
|
$table->data[$i++][1] = html_print_checkbox_switch('command_snapshot', 1, $config['command_snapshot'], true);
|
||||||
|
|
||||||
$table->data[32][0] = __('Server logs directory').ui_print_help_tip(__('Directory where the server logs are stored.'), true);
|
$table->data[$i][0] = __('Server logs directory').ui_print_help_tip(__('Directory where the server logs are stored.'), true);
|
||||||
$table->data[32][1] = html_print_input_text(
|
$table->data[$i++][1] = html_print_input_text(
|
||||||
'server_log_dir',
|
'server_log_dir',
|
||||||
$config['server_log_dir'],
|
$config['server_log_dir'],
|
||||||
'',
|
'',
|
||||||
@ -236,8 +270,8 @@ $table->data[32][1] = html_print_input_text(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[33][0] = __('Log size limit in system logs viewer extension').ui_print_help_tip(__('Max size (in bytes) for the logs to be shown.'), true);
|
$table->data[$i][0] = __('Log size limit in system logs viewer extension').ui_print_help_tip(__('Max size (in bytes) for the logs to be shown.'), true);
|
||||||
$table->data[33][1] = html_print_input_text(
|
$table->data[$i++][1] = html_print_input_text(
|
||||||
'max_log_size',
|
'max_log_size',
|
||||||
$config['max_log_size'],
|
$config['max_log_size'],
|
||||||
'',
|
'',
|
||||||
@ -251,8 +285,8 @@ $modes_tutorial = [
|
|||||||
'on_demand' => __('On demand'),
|
'on_demand' => __('On demand'),
|
||||||
'expert' => __('Expert'),
|
'expert' => __('Expert'),
|
||||||
];
|
];
|
||||||
$table->data['tutorial_mode'][0] = __('Tutorial mode').ui_print_help_tip(__("Configuration of our clippy, 'full mode' show the icon in the header and the contextual helps and it is noise, 'on demand' it is equal to full but it is not noise and 'expert' the icons in the header and the context is not."), true);
|
$table->data[$i][0] = __('Tutorial mode').ui_print_help_tip(__("Configuration of our clippy, 'full mode' show the icon in the header and the contextual helps and it is noise, 'on demand' it is equal to full but it is not noise and 'expert' the icons in the header and the context is not."), true);
|
||||||
$table->data['tutorial_mode'][1] = html_print_select(
|
$table->data[$i++][1] = html_print_select(
|
||||||
$modes_tutorial,
|
$modes_tutorial,
|
||||||
'tutorial_mode',
|
'tutorial_mode',
|
||||||
$config['tutorial_mode'],
|
$config['tutorial_mode'],
|
||||||
@ -263,11 +297,11 @@ $table->data['tutorial_mode'][1] = html_print_select(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$config['past_planned_downtimes'] = isset($config['past_planned_downtimes']) ? $config['past_planned_downtimes'] : 1;
|
$config['past_planned_downtimes'] = isset($config['past_planned_downtimes']) ? $config['past_planned_downtimes'] : 1;
|
||||||
$table->data[34][0] = __('Allow create planned downtimes in the past').ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true);
|
$table->data[$i][0] = __('Allow create planned downtimes in the past').ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true);
|
||||||
$table->data[34][1] = html_print_checkbox_switch('past_planned_downtimes', 1, $config['past_planned_downtimes'], true);
|
$table->data[$i++][1] = html_print_checkbox_switch('past_planned_downtimes', 1, $config['past_planned_downtimes'], true);
|
||||||
|
|
||||||
$table->data[35][0] = __('Limit for bulk operations').ui_print_help_tip(__('Your PHP environment is set to 1000 max_input_vars. This parameter should have the same value or lower.', ini_get('max_input_vars')), true);
|
$table->data[$i][0] = __('Limit for bulk operations').ui_print_help_tip(__('Your PHP environment is set to 1000 max_input_vars. This parameter should have the same value or lower.', ini_get('max_input_vars')), true);
|
||||||
$table->data[35][1] = html_print_input_text(
|
$table->data[$i++][1] = html_print_input_text(
|
||||||
'limit_parameters_massive',
|
'limit_parameters_massive',
|
||||||
$config['limit_parameters_massive'],
|
$config['limit_parameters_massive'],
|
||||||
'',
|
'',
|
||||||
@ -276,17 +310,17 @@ $table->data[35][1] = html_print_input_text(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[36][0] = __('Include agents manually disabled');
|
$table->data[$i][0] = __('Include agents manually disabled');
|
||||||
$table->data[36][1] = html_print_checkbox_switch('include_agents', 1, $config['include_agents'], true);
|
$table->data[$i++][1] = html_print_checkbox_switch('include_agents', 1, $config['include_agents'], true);
|
||||||
|
|
||||||
$table->data[37][0] = __('Audit log directory').ui_print_help_tip(__('Directory where audit log is stored.'), true);
|
$table->data[$i][0] = __('Audit log directory').ui_print_help_tip(__('Directory where audit log is stored.'), true);
|
||||||
$table->data[37][1] = html_print_input_text('auditdir', io_safe_output($config['auditdir']), '', 30, 100, true);
|
$table->data[$i++][1] = html_print_input_text('auditdir', io_safe_output($config['auditdir']), '', 30, 100, true);
|
||||||
|
|
||||||
$table->data[38][0] = __('Set alias as name by default in agent creation');
|
$table->data[$i][0] = __('Set alias as name by default in agent creation');
|
||||||
$table->data[38][1] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true);
|
$table->data[$i++][1] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true);
|
||||||
|
|
||||||
$table->data[39][0] = __('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true);
|
$table->data[$i][0] = __('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true);
|
||||||
$table->data[39][1] = html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true);
|
$table->data[$i++][1] = html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true);
|
||||||
|
|
||||||
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
||||||
|
|
||||||
@ -352,44 +386,50 @@ $(document).ready (function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if ($("input[name=use_cert]").is(':checked')) {
|
if ($("input[name=use_cert]").is(':checked')) {
|
||||||
$('#setup_general-13').show();
|
$('#ssl-path-tr').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
$("input[name=use_cert]").change(function () {
|
$("input[name=use_cert]").change(function () {
|
||||||
if( $(this).is(":checked") )
|
if( $(this).is(":checked") )
|
||||||
$('#setup_general-13').show();
|
$('#ssl-path-tr').show();
|
||||||
else
|
else
|
||||||
$('#setup_general-13').hide();
|
$('#ssl-path-tr').hide();
|
||||||
|
|
||||||
});
|
});
|
||||||
$("input[name=https]").change(function (){
|
$("input[name=https]").change(function (){
|
||||||
if($("input[name=https]").prop('checked')) {
|
if($("input[name=https]").prop('checked')) {
|
||||||
$("#dialog").css({'display': 'inline', 'font-weight': 'bold'}).dialog({
|
$("#dialog").dialog({
|
||||||
modal: true,
|
modal: true,
|
||||||
buttons:{
|
width: 500,
|
||||||
"<?php echo __('Close'); ?>": function(){
|
buttons:[
|
||||||
|
{
|
||||||
|
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-next',
|
||||||
|
text: "<?php echo __('OK'); ?>",
|
||||||
|
click: function(){
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
$("input[name=force_public_url]").change(function (){
|
||||||
|
if($("input[name=force_public_url]").prop('checked')) {
|
||||||
|
$("#force_public_url_dialog").dialog({
|
||||||
|
modal: true,
|
||||||
|
width: 500,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-next',
|
||||||
|
text: "<?php echo __('OK'); ?>",
|
||||||
|
click: function(){
|
||||||
|
$(this).dialog("close");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php
|
|
||||||
function get_sounds()
|
|
||||||
{
|
|
||||||
global $config;
|
|
||||||
|
|
||||||
$return = [];
|
|
||||||
|
|
||||||
$files = scandir($config['homedir'].'/include/sounds');
|
|
||||||
|
|
||||||
foreach ($files as $file) {
|
|
||||||
if (strstr($file, 'wav') !== false) {
|
|
||||||
$return['include/sounds/'.$file] = $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $return;
|
|
||||||
}
|
|
||||||
|
@ -1505,7 +1505,7 @@ $(document).ready (function () {
|
|||||||
.prop('checked');
|
.prop('checked');
|
||||||
display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().parent().attr('id'));
|
display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().parent().attr('id'));
|
||||||
});
|
});
|
||||||
$(".databox.filters").css('margin-bottom','-10px');
|
$(".databox.filters").css('margin-bottom','0px');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Change the favicon preview when is changed
|
// Change the favicon preview when is changed
|
||||||
|
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 855 B After Width: | Height: | Size: 926 B |
@ -83,6 +83,7 @@ $validate_event = get_parameter('validate_event', 0);
|
|||||||
$delete_event = get_parameter('delete_event', 0);
|
$delete_event = get_parameter('delete_event', 0);
|
||||||
$get_event_filters = get_parameter('get_event_filters', 0);
|
$get_event_filters = get_parameter('get_event_filters', 0);
|
||||||
$get_comments = get_parameter('get_comments', 0);
|
$get_comments = get_parameter('get_comments', 0);
|
||||||
|
$get_events_fired = (bool) get_parameter('get_events_fired');
|
||||||
|
|
||||||
if ($get_comments) {
|
if ($get_comments) {
|
||||||
$event = get_parameter('event', false);
|
$event = get_parameter('event', false);
|
||||||
@ -1695,3 +1696,118 @@ if ($get_table_response_command) {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($get_events_fired) {
|
||||||
|
$id = get_parameter('id_row');
|
||||||
|
$idGroup = get_parameter('id_group');
|
||||||
|
$agents = get_parameter('agents', null);
|
||||||
|
|
||||||
|
$query = ' AND id_evento > '.$id;
|
||||||
|
|
||||||
|
$type = [];
|
||||||
|
$alert = get_parameter('alert_fired');
|
||||||
|
if ($alert == 'true') {
|
||||||
|
$resultAlert = alerts_get_event_status_group(
|
||||||
|
$idGroup,
|
||||||
|
[
|
||||||
|
'alert_fired',
|
||||||
|
'alert_ceased',
|
||||||
|
],
|
||||||
|
$query,
|
||||||
|
$agents
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$critical = get_parameter('critical');
|
||||||
|
if ($critical == 'true') {
|
||||||
|
$resultCritical = alerts_get_event_status_group(
|
||||||
|
$idGroup,
|
||||||
|
'going_up_critical',
|
||||||
|
$query,
|
||||||
|
$agents
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$warning = get_parameter('warning');
|
||||||
|
if ($warning == 'true') {
|
||||||
|
$resultWarning = alerts_get_event_status_group(
|
||||||
|
$idGroup,
|
||||||
|
'going_up_warning',
|
||||||
|
$query,
|
||||||
|
$agents
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$unknown = get_parameter('unknown');
|
||||||
|
if ($unknown == 'true') {
|
||||||
|
$resultUnknown = alerts_get_event_status_group(
|
||||||
|
$idGroup,
|
||||||
|
'going_unknown',
|
||||||
|
$query,
|
||||||
|
$agents
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($resultAlert) {
|
||||||
|
$return = [
|
||||||
|
'fired' => $resultAlert,
|
||||||
|
'sound' => $config['sound_alert'],
|
||||||
|
];
|
||||||
|
$event = events_get_event($resultAlert);
|
||||||
|
|
||||||
|
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
|
||||||
|
$agent_name = agents_get_alias($event['id_agente']);
|
||||||
|
|
||||||
|
$return['message'] = io_safe_output($agent_name).' - ';
|
||||||
|
$return['message'] .= __('Alert fired in module ');
|
||||||
|
$return['message'] .= io_safe_output($module_name).' - ';
|
||||||
|
$return['message'] .= $event['timestamp'];
|
||||||
|
} else if ($resultCritical) {
|
||||||
|
$return = [
|
||||||
|
'fired' => $resultCritical,
|
||||||
|
'sound' => $config['sound_critical'],
|
||||||
|
];
|
||||||
|
$event = events_get_event($resultCritical);
|
||||||
|
|
||||||
|
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
|
||||||
|
$agent_name = agents_get_alias($event['id_agente']);
|
||||||
|
|
||||||
|
$return['message'] = io_safe_output($agent_name).' - ';
|
||||||
|
$return['message'] .= __('Module ').io_safe_output($module_name);
|
||||||
|
$return['message'] .= __(' is going to critical').' - ';
|
||||||
|
$return['message'] .= $event['timestamp'];
|
||||||
|
} else if ($resultWarning) {
|
||||||
|
$return = [
|
||||||
|
'fired' => $resultWarning,
|
||||||
|
'sound' => $config['sound_warning'],
|
||||||
|
];
|
||||||
|
$event = events_get_event($resultWarning);
|
||||||
|
|
||||||
|
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
|
||||||
|
$agent_name = agents_get_alias($event['id_agente']);
|
||||||
|
|
||||||
|
$return['message'] = io_safe_output($agent_name).' - ';
|
||||||
|
$return['message'] .= __('Module ').io_safe_output($module_name);
|
||||||
|
$return['message'] .= __(' is going to warning').' - ';
|
||||||
|
$return['message'] .= $event['timestamp'];
|
||||||
|
} else if ($resultUnknown) {
|
||||||
|
$return = [
|
||||||
|
'fired' => $resultUnknown,
|
||||||
|
'sound' => $config['sound_alert'],
|
||||||
|
];
|
||||||
|
$event = events_get_event($resultUnknown);
|
||||||
|
|
||||||
|
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
|
||||||
|
$agent_name = agents_get_alias($event['id_agente']);
|
||||||
|
|
||||||
|
$return['message'] = io_safe_output($agent_name).' - ';
|
||||||
|
$return['message'] .= __('Module ').io_safe_output($module_name);
|
||||||
|
$return['message'] .= __(' is going to unknown').' - ';
|
||||||
|
$return['message'] .= $event['timestamp'];
|
||||||
|
} else {
|
||||||
|
$return = ['fired' => 0];
|
||||||
|
}
|
||||||
|
|
||||||
|
echo io_json_mb_encode($return);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1263,6 +1263,7 @@ class ConsoleSupervisor
|
|||||||
$PHPdisable_functions = ini_get('disable_functions');
|
$PHPdisable_functions = ini_get('disable_functions');
|
||||||
$PHPupload_max_filesize_min = config_return_in_bytes('800M');
|
$PHPupload_max_filesize_min = config_return_in_bytes('800M');
|
||||||
$PHPmemory_limit_min = config_return_in_bytes('500M');
|
$PHPmemory_limit_min = config_return_in_bytes('500M');
|
||||||
|
$PHPSerialize_precision = ini_get('serialize_precision');
|
||||||
|
|
||||||
// PhantomJS status.
|
// PhantomJS status.
|
||||||
$result_ejecution = exec($config['phantomjs_bin'].'/phantomjs --version');
|
$result_ejecution = exec($config['phantomjs_bin'].'/phantomjs --version');
|
||||||
@ -1438,6 +1439,30 @@ class ConsoleSupervisor
|
|||||||
} else {
|
} else {
|
||||||
$this->cleanNotifications('NOTIF.PHP.VERSION');
|
$this->cleanNotifications('NOTIF.PHP.VERSION');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($PHPSerialize_precision != -1) {
|
||||||
|
$url = 'https://www.php.net/manual/en/ini.core.php#ini.serialize-precision';
|
||||||
|
if ($config['language'] == 'es') {
|
||||||
|
$url = 'https://www.php.net/manual/es/ini.core.php#ini.serialize-precision';
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->notify(
|
||||||
|
[
|
||||||
|
'type' => 'NOTIF.PHP.SERIALIZE_PRECISION',
|
||||||
|
'title' => sprintf(
|
||||||
|
__("Not recommended '%s' value in PHP configuration"),
|
||||||
|
'serialze_precision'
|
||||||
|
), 'message' => sprintf(
|
||||||
|
__('Recommended value is: %s'),
|
||||||
|
sprintf('-1')
|
||||||
|
).'<br><br>'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator'),
|
||||||
|
'url' => $url,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$this->cleanNotifications('NOTIF.PHP.SERIALIZE_PRECISION');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* Pandora build version and version
|
* Pandora build version and version
|
||||||
*/
|
*/
|
||||||
$build_version = 'PC190711';
|
$build_version = 'PC190717';
|
||||||
$pandora_version = 'v7.0NG.736';
|
$pandora_version = 'v7.0NG.736';
|
||||||
|
|
||||||
// Do not overwrite default timezone set if defined.
|
// Do not overwrite default timezone set if defined.
|
||||||
|
@ -1513,29 +1513,30 @@ function agents_get_name($id_agent, $case='none')
|
|||||||
* Get alias of an agent (cached function).
|
* Get alias of an agent (cached function).
|
||||||
*
|
*
|
||||||
* @param integer $id_agent Agent id.
|
* @param integer $id_agent Agent id.
|
||||||
* @param string $case Case (upper, lower, none)
|
* @param string $case Case (upper, lower, none).
|
||||||
*
|
*
|
||||||
* @return string Alias of the given agent.
|
* @return string Alias of the given agent.
|
||||||
*/
|
*/
|
||||||
function agents_get_alias($id_agent, $case='none')
|
function agents_get_alias($id_agent, $case='none')
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
// Prepare cache
|
// Prepare cache.
|
||||||
static $cache = [];
|
static $cache = [];
|
||||||
if (empty($case)) {
|
if (empty($case)) {
|
||||||
$case = 'none';
|
$case = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check cache
|
// Check cache.
|
||||||
if (isset($cache[$case][$id_agent])) {
|
if (isset($cache[$case][$id_agent])) {
|
||||||
return $cache[$case][$id_agent];
|
return $cache[$case][$id_agent];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_metaconsole()) {
|
$alias = (string) db_get_value(
|
||||||
$alias = (string) db_get_value('alias', 'tmetaconsole_agent', 'id_tagente', (int) $id_agent);
|
'alias',
|
||||||
} else {
|
'tagente',
|
||||||
$alias = (string) db_get_value('alias', 'tagente', 'id_agente', (int) $id_agent);
|
'id_agente',
|
||||||
}
|
(int) $id_agent
|
||||||
|
);
|
||||||
|
|
||||||
switch ($case) {
|
switch ($case) {
|
||||||
case 'upper':
|
case 'upper':
|
||||||
@ -1545,6 +1546,10 @@ function agents_get_alias($id_agent, $case='none')
|
|||||||
case 'lower':
|
case 'lower':
|
||||||
$alias = mb_strtolower($alias, 'UTF-8');
|
$alias = mb_strtolower($alias, 'UTF-8');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Not posible.
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache[$case][$id_agent] = $alias;
|
$cache[$case][$id_agent] = $alias;
|
||||||
|
@ -266,6 +266,14 @@ function config_update_config()
|
|||||||
$error_update[] = __('Public URL');
|
$error_update[] = __('Public URL');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!config_update_value('force_public_url', get_parameter_switch('force_public_url'))) {
|
||||||
|
$error_update[] = __('Force use Public URL');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!config_update_value('public_url_exclusions', get_parameter('public_url_exclusions'))) {
|
||||||
|
$error_update[] = __('Public URL host exclusions');
|
||||||
|
}
|
||||||
|
|
||||||
if (!config_update_value('referer_security', get_parameter('referer_security'))) {
|
if (!config_update_value('referer_security', get_parameter('referer_security'))) {
|
||||||
$error_update[] = __('Referer security');
|
$error_update[] = __('Referer security');
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,17 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
* ============================================================================
|
* ============================================================================
|
||||||
*/
|
*/
|
||||||
|
global $config;
|
||||||
|
|
||||||
require_once $config['homedir'].'/include/functions_ui.php';
|
require_once $config['homedir'].'/include/functions_ui.php';
|
||||||
require_once $config['homedir'].'/include/functions_tags.php';
|
require_once $config['homedir'].'/include/functions_tags.php';
|
||||||
require_once $config['homedir'].'/include/functions.php';
|
require_once $config['homedir'].'/include/functions.php';
|
||||||
|
require_once $config['homedir'].'/include/functions_reporting.php';
|
||||||
|
enterprise_include_once('include/functions_metaconsole.php');
|
||||||
enterprise_include_once('meta/include/functions_events_meta.php');
|
enterprise_include_once('meta/include/functions_events_meta.php');
|
||||||
enterprise_include_once('meta/include/functions_agents_meta.php');
|
enterprise_include_once('meta/include/functions_agents_meta.php');
|
||||||
enterprise_include_once('meta/include/functions_modules_meta.php');
|
enterprise_include_once('meta/include/functions_modules_meta.php');
|
||||||
|
enterprise_include_once('meta/include/functions_events_meta.php');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -4852,10 +4856,6 @@ function events_get_count_events_by_agent(
|
|||||||
|
|
||||||
$tagente = 'tagente';
|
$tagente = 'tagente';
|
||||||
$tevento = 'tevento';
|
$tevento = 'tevento';
|
||||||
if ($dbmeta) {
|
|
||||||
$tagente = 'tmetaconsole_agent';
|
|
||||||
$tevento = 'tmetaconsole_event';
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = sprintf(
|
$sql = sprintf(
|
||||||
'SELECT id_agente,
|
'SELECT id_agente,
|
||||||
@ -4865,7 +4865,7 @@ function events_get_count_events_by_agent(
|
|||||||
COUNT(*) AS count
|
COUNT(*) AS count
|
||||||
FROM %s t3
|
FROM %s t3
|
||||||
WHERE utimestamp > %d AND utimestamp <= %d
|
WHERE utimestamp > %d AND utimestamp <= %d
|
||||||
AND id_grupo IN (%s) %s
|
AND id_grupo IN (%s)
|
||||||
GROUP BY id_agente',
|
GROUP BY id_agente',
|
||||||
$tagente,
|
$tagente,
|
||||||
$tevento,
|
$tevento,
|
||||||
@ -5032,9 +5032,6 @@ function events_get_count_events_validated_by_user(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tevento = 'tevento';
|
$tevento = 'tevento';
|
||||||
if ($dbmeta) {
|
|
||||||
$tevento = 'tmetaconsole_event';
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = sprintf(
|
$sql = sprintf(
|
||||||
'SELECT id_usuario,
|
'SELECT id_usuario,
|
||||||
@ -5210,9 +5207,6 @@ function events_get_count_events_by_criticity(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tevento = 'tevento';
|
$tevento = 'tevento';
|
||||||
if ($dbmeta) {
|
|
||||||
$tevento = 'tmetaconsole_event';
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = sprintf(
|
$sql = sprintf(
|
||||||
'SELECT criticity,
|
'SELECT criticity,
|
||||||
@ -5418,9 +5412,6 @@ function events_get_count_events_validated(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tevento = 'tevento';
|
$tevento = 'tevento';
|
||||||
if ($dbmeta) {
|
|
||||||
$tevento = 'tmetaconsole_event';
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = sprintf('SELECT estado, COUNT(*) AS count FROM %s WHERE %s %s GROUP BY estado', $tevento, $sql_filter, $sql_where);
|
$sql = sprintf('SELECT estado, COUNT(*) AS count FROM %s WHERE %s %s GROUP BY estado', $tevento, $sql_filter, $sql_where);
|
||||||
|
|
||||||
|
@ -1277,12 +1277,34 @@ function graphic_combined_module(
|
|||||||
array_push($modules, $source['id_agent_module']);
|
array_push($modules, $source['id_agent_module']);
|
||||||
array_push($weights, $source['weight']);
|
array_push($weights, $source['weight']);
|
||||||
if ($source['label'] != '' || $params_combined['labels']) {
|
if ($source['label'] != '' || $params_combined['labels']) {
|
||||||
$item['type'] = 'custom_graph';
|
$id_agent = agents_get_module_id(
|
||||||
$item['id_agent'] = agents_get_module_id(
|
|
||||||
$source['id_agent_module']
|
$source['id_agent_module']
|
||||||
);
|
);
|
||||||
$item['id_agent_module'] = $source['id_agent_module'];
|
$agent_description = agents_get_description($id_agent);
|
||||||
$labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($item, $source['label']) : reporting_label_macro($item, $params_combined['labels']);
|
$agent_group = agents_get_agent_group($id_agent);
|
||||||
|
$agent_address = agents_get_address($id_agent);
|
||||||
|
$agent_alias = agents_get_alias($id_agent);
|
||||||
|
$module_name = modules_get_agentmodule_name(
|
||||||
|
$source['id_agent_module']
|
||||||
|
);
|
||||||
|
|
||||||
|
$module_description = modules_get_agentmodule_descripcion(
|
||||||
|
$source['id_agent_module']
|
||||||
|
);
|
||||||
|
|
||||||
|
$items_label = [
|
||||||
|
'type' => 'custom_graph',
|
||||||
|
'id_agent' => $id_agent,
|
||||||
|
'id_agent_module' => $source['id_agent_module'],
|
||||||
|
'agent_description' => $agent_description,
|
||||||
|
'agent_group' => $agent_group,
|
||||||
|
'agent_address' => $agent_address,
|
||||||
|
'agent_alias' => $agent_alias,
|
||||||
|
'module_name' => $module_name,
|
||||||
|
'module_description' => $module_description,
|
||||||
|
];
|
||||||
|
|
||||||
|
$labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($items_label, $source['label']) : reporting_label_macro($item, $params_combined['labels']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2161,7 +2183,7 @@ function graphic_combined_module(
|
|||||||
$graph_values = $temp;
|
$graph_values = $temp;
|
||||||
|
|
||||||
if (!$params['vconsole']) {
|
if (!$params['vconsole']) {
|
||||||
$width = 1024;
|
$width = $width;
|
||||||
$height = 500;
|
$height = 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,8 +77,7 @@ function html_debug_print($var, $file='', $oneline=false)
|
|||||||
fprintf($f, '%s', $output);
|
fprintf($f, '%s', $output);
|
||||||
fclose($f);
|
fclose($f);
|
||||||
} else {
|
} else {
|
||||||
echo '<pre>'.date('Y/m/d H:i:s').' ('.gettype($var).') '.$more_info.'</pre>';
|
echo '<pre style="z-index: 10000; background: #fff; padding: 1em;">'.date('Y/m/d H:i:s').' ('.gettype($var).') '.$more_info."\n";
|
||||||
echo '<pre>';
|
|
||||||
print_r($var);
|
print_r($var);
|
||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
}
|
}
|
||||||
|
@ -566,11 +566,11 @@ function modules_update_agent_module(
|
|||||||
/**
|
/**
|
||||||
* Creates a module in an agent.
|
* Creates a module in an agent.
|
||||||
*
|
*
|
||||||
* @param int Agent id.
|
* @param integer $id_agent Agent id.
|
||||||
* @param int Module name id.
|
* @param integer $name Module name id.
|
||||||
* @param array Extra values for the module.
|
* @param array $values Extra values for the module.
|
||||||
* @param bool Disable the ACL checking, for default false.
|
* @param boolean $disableACL Disable the ACL checking, for default false.
|
||||||
* @param mixed Array with tag's ids or false.
|
* @param mixed $tags Array with tag's ids or false.
|
||||||
*
|
*
|
||||||
* @return New module id if the module was created. False if not.
|
* @return New module id if the module was created. False if not.
|
||||||
*/
|
*/
|
||||||
@ -584,7 +584,9 @@ function modules_create_agent_module(
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if (!$disableACL) {
|
if (!$disableACL) {
|
||||||
if (!users_is_admin() && (empty($id_agent) || ! users_access_to_agent($id_agent, 'AW'))) {
|
if (!users_is_admin() && (empty($id_agent)
|
||||||
|
|| !users_access_to_agent($id_agent, 'AW'))
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -593,7 +595,7 @@ function modules_create_agent_module(
|
|||||||
return ERR_INCOMPLETE;
|
return ERR_INCOMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for non valid characters in module name
|
// Check for non valid characters in module name.
|
||||||
if (mb_ereg_match('[\xc2\xa1\xc2\xbf\xc3\xb7\xc2\xba\xc2\xaa]', io_safe_output($name)) !== false) {
|
if (mb_ereg_match('[\xc2\xa1\xc2\xbf\xc3\xb7\xc2\xba\xc2\xaa]', io_safe_output($name)) !== false) {
|
||||||
return ERR_GENERIC;
|
return ERR_GENERIC;
|
||||||
}
|
}
|
||||||
@ -605,23 +607,33 @@ function modules_create_agent_module(
|
|||||||
$values['nombre'] = $name;
|
$values['nombre'] = $name;
|
||||||
$values['id_agente'] = (int) $id_agent;
|
$values['id_agente'] = (int) $id_agent;
|
||||||
|
|
||||||
$exists = (bool) db_get_value_filter('id_agente_modulo', 'tagente_modulo', ['nombre' => $name, 'id_agente' => (int) $id_agent]);
|
$exists = (bool) db_get_value_filter(
|
||||||
|
'id_agente_modulo',
|
||||||
|
'tagente_modulo',
|
||||||
|
[
|
||||||
|
'nombre' => $name,
|
||||||
|
'id_agente' => (int) $id_agent,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
if ($exists) {
|
if ($exists) {
|
||||||
return ERR_EXIST;
|
return ERR_EXIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encrypt passwords
|
// Encrypt passwords.
|
||||||
if (isset($values['plugin_pass'])) {
|
if (isset($values['plugin_pass'])) {
|
||||||
$values['plugin_pass'] = io_input_password($values['plugin_pass']);
|
$values['plugin_pass'] = io_input_password($values['plugin_pass']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encrypt SNMPv3 passwords
|
// Encrypt SNMPv3 passwords.
|
||||||
if (isset($values['id_tipo_modulo']) && ($values['id_tipo_modulo'] >= 15 && $values['id_tipo_modulo'] <= 18)
|
if (isset($values['id_tipo_modulo']) && ($values['id_tipo_modulo'] >= 15
|
||||||
|
&& $values['id_tipo_modulo'] <= 18)
|
||||||
&& isset($values['tcp_send']) && ($values['tcp_send'] == 3)
|
&& isset($values['tcp_send']) && ($values['tcp_send'] == 3)
|
||||||
&& isset($values['custom_string_2'])
|
&& isset($values['custom_string_2'])
|
||||||
) {
|
) {
|
||||||
$values['custom_string_2'] = io_input_password($values['custom_string_2']);
|
$values['custom_string_2'] = io_input_password(
|
||||||
|
$values['custom_string_2']
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$id_agent_module = db_process_sql_insert('tagente_modulo', $values);
|
$id_agent_module = db_process_sql_insert('tagente_modulo', $values);
|
||||||
@ -645,25 +657,33 @@ function modules_create_agent_module(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($values['id_tipo_modulo'])
|
if (isset($values['id_tipo_modulo'])
|
||||||
&& ($values['id_tipo_modulo'] == 21 || $values['id_tipo_modulo'] == 22 || $values['id_tipo_modulo'] == 23)
|
&& ($values['id_tipo_modulo'] == 21
|
||||||
|
|| $values['id_tipo_modulo'] == 22
|
||||||
|
|| $values['id_tipo_modulo'] == 23)
|
||||||
) {
|
) {
|
||||||
// Async modules start in normal status
|
// Async modules start in normal status.
|
||||||
$status = AGENT_MODULE_STATUS_NORMAL;
|
$status = AGENT_MODULE_STATUS_NORMAL;
|
||||||
} else {
|
} else {
|
||||||
// Sync modules start in unknown status
|
// Sync modules start in unknown status.
|
||||||
$status = AGENT_MODULE_STATUS_NO_DATA;
|
$status = AGENT_MODULE_STATUS_NO_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Condition for cron modules. Don't touch.
|
||||||
|
$time = 0;
|
||||||
|
if (empty($values['interval']) === false) {
|
||||||
|
$time = (time() - (int) $values['interval']);
|
||||||
|
}
|
||||||
|
|
||||||
$result = db_process_sql_insert(
|
$result = db_process_sql_insert(
|
||||||
'tagente_estado',
|
'tagente_estado',
|
||||||
[
|
[
|
||||||
'id_agente_modulo' => $id_agent_module,
|
'id_agente_modulo' => $id_agent_module,
|
||||||
'datos' => 0,
|
'datos' => '',
|
||||||
'timestamp' => '01-01-1970 00:00:00',
|
'timestamp' => '01-01-1970 00:00:00',
|
||||||
'estado' => $status,
|
'estado' => $status,
|
||||||
'known_status' => $status,
|
'known_status' => $status,
|
||||||
'id_agente' => (int) $id_agent,
|
'id_agente' => (int) $id_agent,
|
||||||
'utimestamp' => (time() - (int) $values['interval']),
|
'utimestamp' => $time,
|
||||||
'status_changes' => 0,
|
'status_changes' => 0,
|
||||||
'last_status' => $status,
|
'last_status' => $status,
|
||||||
'last_known_status' => $status,
|
'last_known_status' => $status,
|
||||||
@ -680,12 +700,20 @@ function modules_create_agent_module(
|
|||||||
return ERR_DB;
|
return ERR_DB;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update module status count if the module is not created disabled
|
// Update module status count if the module is not created disabled.
|
||||||
if (!isset($values['disabled']) || $values['disabled'] == 0) {
|
if (!isset($values['disabled']) || $values['disabled'] == 0) {
|
||||||
if ($status == 0) {
|
if ($status == 0) {
|
||||||
db_process_sql('UPDATE tagente SET total_count=total_count+1, normal_count=normal_count+1 WHERE id_agente='.(int) $id_agent);
|
db_process_sql(
|
||||||
|
'UPDATE tagente
|
||||||
|
SET total_count=total_count+1, normal_count=normal_count+1
|
||||||
|
WHERE id_agente='.(int) $id_agent
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
db_process_sql('UPDATE tagente SET total_count=total_count+1, notinit_count=notinit_count+1 WHERE id_agente='.(int) $id_agent);
|
db_process_sql(
|
||||||
|
'UPDATE tagente
|
||||||
|
SET total_count=total_count+1, notinit_count=notinit_count+1
|
||||||
|
WHERE id_agente='.(int) $id_agent
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ define('NETFLOW_RES_LOWD', 6);
|
|||||||
define('NETFLOW_RES_MEDD', 12);
|
define('NETFLOW_RES_MEDD', 12);
|
||||||
define('NETFLOW_RES_HID', 24);
|
define('NETFLOW_RES_HID', 24);
|
||||||
define('NETFLOW_RES_ULTRAD', 30);
|
define('NETFLOW_RES_ULTRAD', 30);
|
||||||
define('NETFLOW_RES_HOURLY', 'hourly');
|
define('NETFLOW_RES_HOURLY', -1);
|
||||||
define('NETFLOW_RES_DAILY', 'daily');
|
define('NETFLOW_RES_DAILY', -2);
|
||||||
|
|
||||||
define('NETFLOW_MAX_DATA_CIRCULAR_MESH', 10000);
|
define('NETFLOW_MAX_DATA_CIRCULAR_MESH', 10000);
|
||||||
|
|
||||||
@ -473,7 +473,7 @@ function netflow_get_data(
|
|||||||
|
|
||||||
// Put all points into an array.
|
// Put all points into an array.
|
||||||
$intervals = [($start_date - $multiplier_time)];
|
$intervals = [($start_date - $multiplier_time)];
|
||||||
while ((end($intervals) < $end_date) === true) {
|
while (($next = (end($intervals) + $multiplier_time) < $end_date) === true) {
|
||||||
$intervals[] = (end($intervals) + $multiplier_time);
|
$intervals[] = (end($intervals) + $multiplier_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +141,15 @@ function html_do_report_info($report)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print html report.
|
||||||
|
*
|
||||||
|
* @param array $report Info.
|
||||||
|
* @param boolean $mini Type.
|
||||||
|
* @param integer $report_info Show info.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
function reporting_html_print_report($report, $mini=false, $report_info=1)
|
function reporting_html_print_report($report, $mini=false, $report_info=1)
|
||||||
{
|
{
|
||||||
if ($report_info == 1) {
|
if ($report_info == 1) {
|
||||||
@ -161,7 +170,38 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||||||
$table->rowstyle = [];
|
$table->rowstyle = [];
|
||||||
|
|
||||||
if (isset($item['label']) && $item['label'] != '') {
|
if (isset($item['label']) && $item['label'] != '') {
|
||||||
$label = reporting_label_macro($item, $item['label']);
|
$id_agent = $item['id_agent'];
|
||||||
|
$id_agent_module = $item['id_agent_module'];
|
||||||
|
|
||||||
|
// Add macros name.
|
||||||
|
$agent_description = agents_get_description($id_agent);
|
||||||
|
$agent_group = agents_get_agent_group($id_agent);
|
||||||
|
$agent_address = agents_get_address($id_agent);
|
||||||
|
$agent_alias = agents_get_alias($id_agent);
|
||||||
|
$module_name = modules_get_agentmodule_name(
|
||||||
|
$id_agent_module
|
||||||
|
);
|
||||||
|
|
||||||
|
$module_description = modules_get_agentmodule_descripcion(
|
||||||
|
$id_agent_module
|
||||||
|
);
|
||||||
|
|
||||||
|
$items_label = [
|
||||||
|
'type' => $item['type'],
|
||||||
|
'id_agent' => $id_agent,
|
||||||
|
'id_agent_module' => $id_agent_module,
|
||||||
|
'agent_description' => $agent_description,
|
||||||
|
'agent_group' => $agent_group,
|
||||||
|
'agent_address' => $agent_address,
|
||||||
|
'agent_alias' => $agent_alias,
|
||||||
|
'module_name' => $module_name,
|
||||||
|
'module_description' => $module_description,
|
||||||
|
];
|
||||||
|
|
||||||
|
$label = reporting_label_macro(
|
||||||
|
$items_label,
|
||||||
|
$item['label']
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$label = '';
|
$label = '';
|
||||||
}
|
}
|
||||||
@ -180,7 +220,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||||||
|
|
||||||
$table->data['description_row']['description'] = $item['description'];
|
$table->data['description_row']['description'] = $item['description'];
|
||||||
|
|
||||||
if ($item['type'] == 'event_report_agent' || $item['type'] == 'event_report_group' || $item['type'] == 'event_report_module') {
|
if ($item['type'] == 'event_report_agent'
|
||||||
|
|| $item['type'] == 'event_report_group'
|
||||||
|
|| $item['type'] == 'event_report_module'
|
||||||
|
) {
|
||||||
$table->data['count_row']['count'] = 'Total events: '.$item['total_events'];
|
$table->data['count_row']['count'] = 'Total events: '.$item['total_events'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -759,7 +802,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
|
|||||||
$table1->size[10] = '2%';
|
$table1->size[10] = '2%';
|
||||||
$table1->data[0][10] = '<img src ="'.$src.'images/square_light_gray.png">';
|
$table1->data[0][10] = '<img src ="'.$src.'images/square_light_gray.png">';
|
||||||
$table1->size[11] = '15%';
|
$table1->size[11] = '15%';
|
||||||
$table1->data[0][11] = '<span>'.__('Ignore time').'</span>';
|
$table1->data[0][11] = '<span>'.__('Planned Downtime').'</span>';
|
||||||
|
|
||||||
if ($pdf === 0) {
|
if ($pdf === 0) {
|
||||||
$table->colspan['legend']['cell'] = 2;
|
$table->colspan['legend']['cell'] = 2;
|
||||||
@ -3399,7 +3442,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
|
|||||||
$table2->size[10] = '2%';
|
$table2->size[10] = '2%';
|
||||||
$table2->data[0][10] = '<img src ="'.$src.$hack_metaconsole.'images/square_light_gray.png">';
|
$table2->data[0][10] = '<img src ="'.$src.$hack_metaconsole.'images/square_light_gray.png">';
|
||||||
$table2->size[11] = '15%';
|
$table2->size[11] = '15%';
|
||||||
$table2->data[0][11] = '<span>'.__('Ignore time').'</span>';
|
$table2->data[0][11] = '<span>'.__('Planned Downtime').'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pdf !== 0) {
|
if ($pdf !== 0) {
|
||||||
|
@ -2055,7 +2055,7 @@ function ui_pagination(
|
|||||||
$actual_page = floor($offset / $pagination);
|
$actual_page = floor($offset / $pagination);
|
||||||
$ini_page = (floor($actual_page / $block_limit) * $block_limit);
|
$ini_page = (floor($actual_page / $block_limit) * $block_limit);
|
||||||
$end_page = ($ini_page + $block_limit - 1);
|
$end_page = ($ini_page + $block_limit - 1);
|
||||||
if ($end_page > $number_of_pages) {
|
if ($end_page >= $number_of_pages) {
|
||||||
$end_page = ($number_of_pages - 1);
|
$end_page = ($number_of_pages - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3699,6 +3699,24 @@ function ui_get_url_refresh($params=false, $relative=true, $add_post=true)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if public_url usage is being forced to target 'visitor'.
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
function ui_forced_public_url()
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
$exclusions = preg_split("/[\n\s,]+/", io_safe_output($config['public_url_exclusions']));
|
||||||
|
|
||||||
|
if (in_array($_SERVER['REMOTE_ADDR'], $exclusions)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (bool) $config['force_public_url'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a full URL in Pandora. (with the port and https in some systems)
|
* Returns a full URL in Pandora. (with the port and https in some systems)
|
||||||
*
|
*
|
||||||
@ -3745,12 +3763,18 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$no_proxy) {
|
if (!$no_proxy) {
|
||||||
// Check if the PandoraFMS runs across the proxy like as
|
// Check proxy.
|
||||||
// mod_proxy of Apache
|
$proxy = false;
|
||||||
// and check if public_url is set.
|
if (ui_forced_public_url()) {
|
||||||
if (!empty($config['public_url'])
|
$proxy = true;
|
||||||
|
$fullurl = $config['public_url'];
|
||||||
|
if ($url == 'index.php' && is_metaconsole()) {
|
||||||
|
$fullurl .= '/'.ENTERPRISE_DIR.'/meta';
|
||||||
|
}
|
||||||
|
} else if (!empty($config['public_url'])
|
||||||
&& (!empty($_SERVER['HTTP_X_FORWARDED_HOST']))
|
&& (!empty($_SERVER['HTTP_X_FORWARDED_HOST']))
|
||||||
) {
|
) {
|
||||||
|
// Forced to use public url when being forwarder by a reverse proxy.
|
||||||
$fullurl = $config['public_url'];
|
$fullurl = $config['public_url'];
|
||||||
$proxy = true;
|
$proxy = true;
|
||||||
} else {
|
} else {
|
||||||
@ -3782,7 +3806,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
|
|||||||
$url = $config['homeurl_static'].'/';
|
$url = $config['homeurl_static'].'/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('METACONSOLE') && $metaconsole_root) {
|
if (is_metaconsole() && $metaconsole_root) {
|
||||||
$url .= 'enterprise/meta/';
|
$url .= 'enterprise/meta/';
|
||||||
}
|
}
|
||||||
} else if (!strstr($url, '.php')) {
|
} else if (!strstr($url, '.php')) {
|
||||||
@ -3792,7 +3816,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
|
|||||||
$fullurl .= $config['homeurl_static'].'/';
|
$fullurl .= $config['homeurl_static'].'/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('METACONSOLE') && $metaconsole_root) {
|
if (is_metaconsole() && $metaconsole_root) {
|
||||||
$fullurl .= 'enterprise/meta/';
|
$fullurl .= 'enterprise/meta/';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -3804,7 +3828,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
|
|||||||
} else {
|
} else {
|
||||||
$fullurl .= $config['homeurl_static'].'/';
|
$fullurl .= $config['homeurl_static'].'/';
|
||||||
|
|
||||||
if (defined('METACONSOLE') && $metaconsole_root) {
|
if (is_metaconsole() && $metaconsole_root) {
|
||||||
$fullurl .= 'enterprise/meta/';
|
$fullurl .= 'enterprise/meta/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4271,7 +4271,7 @@ function visual_map_create_internal_name_item($label=null, $type, $image, $agent
|
|||||||
|
|
||||||
case 'static_graph':
|
case 'static_graph':
|
||||||
case STATIC_GRAPH:
|
case STATIC_GRAPH:
|
||||||
$text = __('Static graph').' - '.$image;
|
$text = __('Static Image').' - '.$image;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'simple_value':
|
case 'simple_value':
|
||||||
|
@ -1294,7 +1294,7 @@ function visual_map_editor_print_toolbox()
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo '<div id="toolbox">';
|
echo '<div id="toolbox">';
|
||||||
visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true);
|
visual_map_print_button_editor('static_graph', __('Static Image'), 'left', false, 'camera_min', true);
|
||||||
visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true);
|
visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true);
|
||||||
visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true);
|
visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true);
|
||||||
visual_map_print_button_editor('donut_graph', __('Serialized pie graph'), 'left', false, 'donut_graph_min', true);
|
visual_map_print_button_editor('donut_graph', __('Serialized pie graph'), 'left', false, 'donut_graph_min', true);
|
||||||
|
@ -2791,14 +2791,16 @@ function pandoraFlotArea(
|
|||||||
if (short_data) {
|
if (short_data) {
|
||||||
formatted = number_format(v, force_integer, "", short_data);
|
formatted = number_format(v, force_integer, "", short_data);
|
||||||
} else {
|
} else {
|
||||||
// It is an integer
|
// It is an integer.
|
||||||
if (v - Math.floor(v) == 0) {
|
if (v - Math.floor(v) == 0) {
|
||||||
formatted = number_format(v, force_integer, "", 2);
|
formatted = number_format(v, force_integer, "", 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get only two decimals
|
// Get only two decimals.
|
||||||
formatted = round_with_decimals(formatted, 100);
|
if (typeof formatted != "string") {
|
||||||
|
formatted = Math.round(formatted * 100) / 100;
|
||||||
|
}
|
||||||
return formatted;
|
return formatted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,19 +2,23 @@
|
|||||||
#cluetip-close img {
|
#cluetip-close img {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cluetip-title {
|
#cluetip-title {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cluetip-title #cluetip-close {
|
#cluetip-title #cluetip-close {
|
||||||
float: right;
|
float: right;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cluetip-waitimage {
|
#cluetip-waitimage {
|
||||||
width: 43px;
|
width: 43px;
|
||||||
height: 11px;
|
height: 11px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-image: url(../../../images/wait.gif);
|
background-image: url(../../../images/wait.gif);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cluetip-arrows {
|
.cluetip-arrows {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -25,9 +29,11 @@
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: 0 0;
|
background-position: 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cluetip-extra {
|
#cluetip-extra {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************
|
/***************************************
|
||||||
=cluetipClass: 'default'
|
=cluetipClass: 'default'
|
||||||
-------------------------------------- */
|
-------------------------------------- */
|
||||||
@ -36,11 +42,13 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cluetip-default #cluetip-outer {
|
.cluetip-default #cluetip-outer {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cluetip-default h3 {
|
.cluetip-default h3 {
|
||||||
margin: 0 0 5px;
|
margin: 0 0 5px;
|
||||||
padding: 8px 10px 4px;
|
padding: 8px 10px 4px;
|
||||||
@ -49,6 +57,7 @@
|
|||||||
background-color: #b1b1b1;
|
background-color: #b1b1b1;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cluetip-default h3#cluetip-title {
|
.cluetip-default h3#cluetip-title {
|
||||||
display: none;
|
display: none;
|
||||||
height: 0px;
|
height: 0px;
|
||||||
@ -56,41 +65,49 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cluetip-default #cluetip-title a {
|
.cluetip-default #cluetip-title a {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 0.95em;
|
font-size: 0.95em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cluetip-default #cluetip-inner {
|
.cluetip-default #cluetip-inner {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cluetip-default div#cluetip-close {
|
.cluetip-default div#cluetip-close {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
margin: 0 5px 5px;
|
margin: 0 5px 5px;
|
||||||
color: #900;
|
color: #900;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cluetip-default ul {
|
.cluetip-default ul {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* default arrows */
|
/* default arrows */
|
||||||
|
|
||||||
.clue-right-default .cluetip-arrows {
|
.clue-right-default .cluetip-arrows {
|
||||||
background-image: url(../../images/darrowleft.png);
|
background-image: url(../../../images/darrowleft.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
.clue-left-default .cluetip-arrows {
|
.clue-left-default .cluetip-arrows {
|
||||||
background-image: url(../../images/darrowright.png);
|
background-image: url(../../../images/darrowright.png);
|
||||||
left: 100%;
|
left: 100%;
|
||||||
margin-right: -11px;
|
margin-right: -11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.clue-top-default .cluetip-arrows {
|
.clue-top-default .cluetip-arrows {
|
||||||
background-image: url(../../images/darrowdown.png);
|
background-image: url(../../../images/darrowdown.png);
|
||||||
top: 100%;
|
top: 100%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
margin-left: -11px;
|
margin-left: -11px;
|
||||||
height: 11px;
|
height: 11px;
|
||||||
width: 22px;
|
width: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.clue-bottom-default .cluetip-arrows {
|
.clue-bottom-default .cluetip-arrows {
|
||||||
background-image: url(../../images/darrowup.png);
|
background-image: url(../../../images/darrowup.png);
|
||||||
top: -11px;
|
top: -11px;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
margin-left: -11px;
|
margin-left: -11px;
|
||||||
|
@ -235,11 +235,12 @@ pre {
|
|||||||
font-family: courier, serif;
|
font-family: courier, serif;
|
||||||
}
|
}
|
||||||
fieldset {
|
fieldset {
|
||||||
background-color: #f9faf9;
|
background-color: #fff;
|
||||||
border: 1px solid #e2e2e2;
|
border: 1px solid #e2e2e2;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
fieldset legend {
|
fieldset legend {
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
@ -5328,6 +5329,10 @@ table.info_table.policy_sub_table {
|
|||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.agent_options input[readonly] {
|
||||||
|
color: #848484;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ---------------------------------------------------------------------
|
* ---------------------------------------------------------------------
|
||||||
* - CLASSES FOR THE NEW TOGGLES -
|
* - CLASSES FOR THE NEW TOGGLES -
|
||||||
@ -5866,3 +5871,7 @@ table.table_modal_alternate tr td:first-child {
|
|||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
/* END - Table for show more info in events and config menu in modules graphs */
|
/* END - Table for show more info in events and config menu in modules graphs */
|
||||||
|
|
||||||
|
.fullwidth {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
@ -237,19 +237,12 @@ table.table_modal_alternate tr:nth-child(even) td {
|
|||||||
background-color: #555 !important;
|
background-color: #555 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info_table .datos3,
|
|
||||||
.datos3,
|
|
||||||
.info_table .datos4,
|
|
||||||
.datos4 {
|
|
||||||
background-color: #666;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info_table .datos3,
|
.info_table .datos3,
|
||||||
.datos3,
|
.datos3,
|
||||||
.info_table .datos4,
|
.info_table .datos4,
|
||||||
.datos4 {
|
.datos4 {
|
||||||
background-color: #444;
|
background-color: #444;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action_buttons a[href] img,
|
.action_buttons a[href] img,
|
||||||
@ -394,3 +387,8 @@ ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
|
|||||||
div#box_online * {
|
div#box_online * {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* discovery.css */
|
||||||
|
#text_wizard {
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
@ -262,11 +262,16 @@ a.pandora_pagination {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
color: #000;
|
color: #000;
|
||||||
border: 1px solid #cacaca;
|
border: 1px solid #cacaca;
|
||||||
|
border-left: none;
|
||||||
min-width: 12px;
|
min-width: 12px;
|
||||||
margin-right: -1px;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.dataTables_paginate > span > span.ellipsis + a.pandora_pagination:last-child,
|
||||||
|
.dataTables_paginate a.pandora_pagination.previous {
|
||||||
|
border-left: 1px solid #cacaca;
|
||||||
|
}
|
||||||
|
|
||||||
a.pandora_pagination.disabled {
|
a.pandora_pagination.disabled {
|
||||||
color: #cacaca;
|
color: #cacaca;
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Index.
|
||||||
|
*
|
||||||
|
* @category Main entrypoint.
|
||||||
|
* @package Pandora FMS
|
||||||
|
* @subpackage Opensource.
|
||||||
|
* @version 1.0.0
|
||||||
|
* @license See below
|
||||||
|
*
|
||||||
|
* ______ ___ _______ _______ ________
|
||||||
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||||
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||||
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||||
|
*
|
||||||
|
* ============================================================================
|
||||||
|
* Copyright (c) 2005-2019 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
|
// Begin.
|
||||||
// ==================================================
|
|
||||||
// Copyright (c) 2005-2012 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 Lesser 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.
|
|
||||||
// Enable profiler for testing
|
|
||||||
if (!defined('__PAN_XHPROF__')) {
|
if (!defined('__PAN_XHPROF__')) {
|
||||||
define('__PAN_XHPROF__', 0);
|
define('__PAN_XHPROF__', 0);
|
||||||
}
|
}
|
||||||
@ -24,17 +39,18 @@ if (__PAN_XHPROF__ === 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set character encoding to UTF-8 - fixes a lot of multibyte character headaches
|
// Set character encoding to UTF-8
|
||||||
|
// fixes a lot of multibyte character issues.
|
||||||
if (function_exists('mb_internal_encoding')) {
|
if (function_exists('mb_internal_encoding')) {
|
||||||
mb_internal_encoding('UTF-8');
|
mb_internal_encoding('UTF-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set to 1 to do not check for installer or config file (for development!).
|
// Set to 1 to do not check for installer or config file (for development!).
|
||||||
// Activate gives more error information, not useful for production sites
|
// Activate gives more error information, not useful for production sites.
|
||||||
$develop_bypass = 0;
|
$develop_bypass = 0;
|
||||||
|
|
||||||
if ($develop_bypass != 1) {
|
if ($develop_bypass != 1) {
|
||||||
// If no config file, automatically try to install
|
// If no config file, automatically try to install.
|
||||||
if (! file_exists('include/config.php')) {
|
if (! file_exists('include/config.php')) {
|
||||||
if (! file_exists('install.php')) {
|
if (! file_exists('install.php')) {
|
||||||
$url = explode('/', $_SERVER['REQUEST_URI']);
|
$url = explode('/', $_SERVER['REQUEST_URI']);
|
||||||
@ -74,14 +90,14 @@ if ($develop_bypass != 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for installer presence
|
// Check installer presence.
|
||||||
if (file_exists('install.php')) {
|
if (file_exists('install.php')) {
|
||||||
$login_screen = 'error_install';
|
$login_screen = 'error_install';
|
||||||
include 'general/error_screen.php';
|
include 'general/error_screen.php';
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check perms for config.php
|
// Check perms for config.php.
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
|
||||||
if ((substr(sprintf('%o', fileperms('include/config.php')), -4) != '0600')
|
if ((substr(sprintf('%o', fileperms('include/config.php')), -4) != '0600')
|
||||||
&& (substr(sprintf('%o', fileperms('include/config.php')), -4) != '0660')
|
&& (substr(sprintf('%o', fileperms('include/config.php')), -4) != '0660')
|
||||||
@ -110,15 +126,18 @@ if ($develop_bypass != 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((! file_exists('include/config.php')) || (! is_readable('include/config.php'))) {
|
if ((! file_exists('include/config.php'))
|
||||||
|
|| (! is_readable('include/config.php'))
|
||||||
|
) {
|
||||||
$login_screen = 'error_noconfig';
|
$login_screen = 'error_noconfig';
|
||||||
include 'general/error_screen.php';
|
include 'general/error_screen.php';
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/*
|
||||||
// PLEASE DO NOT CHANGE ORDER //////
|
* DO NOT CHANGE ORDER OF FOLLOWING REQUIRES.
|
||||||
//
|
*/
|
||||||
|
|
||||||
require_once 'include/config.php';
|
require_once 'include/config.php';
|
||||||
require_once 'include/functions_config.php';
|
require_once 'include/functions_config.php';
|
||||||
|
|
||||||
@ -128,11 +147,11 @@ if (isset($config['error'])) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If metaconsole activated, redirect to it
|
// If metaconsole activated, redirect to it.
|
||||||
if ($config['metaconsole'] == 1 && $config['enterprise_installed'] == 1) {
|
if (is_metaconsole()) {
|
||||||
header('Location: '.$config['homeurl'].'enterprise/meta');
|
header('Location: '.ui_get_full_url('index.php'));
|
||||||
|
// Always exit after sending location headers.
|
||||||
exit;
|
exit;
|
||||||
// Always exit after sending location headers
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) {
|
if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) {
|
||||||
@ -141,12 +160,12 @@ if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) {
|
|||||||
|
|
||||||
if (!empty($config['https']) && empty($_SERVER['HTTPS'])) {
|
if (!empty($config['https']) && empty($_SERVER['HTTPS'])) {
|
||||||
$query = '';
|
$query = '';
|
||||||
if (sizeof($_REQUEST)) {
|
if (count($_REQUEST)) {
|
||||||
// Some (old) browsers don't like the ?&key=var
|
// Some (old) browsers don't like the ?&key=var.
|
||||||
$query .= '?1=1';
|
$query .= '?1=1';
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't clean these variables up as they're only being passed along
|
// We don't clean these variables up as they're only being passed along.
|
||||||
foreach ($_GET as $key => $value) {
|
foreach ($_GET as $key => $value) {
|
||||||
if ($key == 1) {
|
if ($key == 1) {
|
||||||
continue;
|
continue;
|
||||||
@ -162,12 +181,12 @@ if (!empty($config['https']) && empty($_SERVER['HTTPS'])) {
|
|||||||
$url = ui_get_full_url($query);
|
$url = ui_get_full_url($query);
|
||||||
|
|
||||||
// Prevent HTTP response splitting attacks
|
// Prevent HTTP response splitting attacks
|
||||||
// http://en.wikipedia.org/wiki/HTTP_response_splitting
|
// http://en.wikipedia.org/wiki/HTTP_response_splitting.
|
||||||
$url = str_replace("\n", '', $url);
|
$url = str_replace("\n", '', $url);
|
||||||
|
|
||||||
header('Location: '.$url);
|
header('Location: '.$url);
|
||||||
|
// Always exit after sending location headers.
|
||||||
exit;
|
exit;
|
||||||
// Always exit after sending location headers
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pure mode (without menu, header and footer).
|
// Pure mode (without menu, header and footer).
|
||||||
@ -188,20 +207,21 @@ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www
|
|||||||
echo '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";
|
echo '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";
|
||||||
echo '<head>'."\n";
|
echo '<head>'."\n";
|
||||||
|
|
||||||
// This starts the page head. In the call back function, things from $page['head'] array will be processed into the head
|
// This starts the page head. In the callback function,
|
||||||
|
// $page['head'] array content will be processed into the head.
|
||||||
ob_start('ui_process_page_head');
|
ob_start('ui_process_page_head');
|
||||||
|
|
||||||
// Enterprise main
|
// Enterprise main.
|
||||||
enterprise_include('index.php');
|
enterprise_include('index.php');
|
||||||
|
|
||||||
echo '<script type="text/javascript">';
|
echo '<script type="text/javascript">';
|
||||||
echo 'var dispositivo = navigator.userAgent.toLowerCase();';
|
echo 'var dispositivo = navigator.userAgent.toLowerCase();';
|
||||||
echo 'if( dispositivo.search(/iphone|ipod|ipad|android/) > -1 ){';
|
echo 'if( dispositivo.search(/iphone|ipod|ipad|android/) > -1 ){';
|
||||||
echo 'document.location = "'.$config['homeurl'].'mobile"; }';
|
echo 'document.location = "'.ui_get_full_url('/mobile').'"; }';
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
|
|
||||||
// This tag is included in the buffer passed to ui_process_page_head so
|
// This tag is included in the buffer passed to ui_process_page_head so
|
||||||
// technically it can be stripped
|
// technically it can be stripped.
|
||||||
echo '</head>'."\n";
|
echo '</head>'."\n";
|
||||||
|
|
||||||
require_once 'include/functions_themes.php';
|
require_once 'include/functions_themes.php';
|
||||||
@ -212,13 +232,13 @@ $config['remote_addr'] = $_SERVER['REMOTE_ADDR'];
|
|||||||
$sec2 = get_parameter_get('sec2');
|
$sec2 = get_parameter_get('sec2');
|
||||||
$sec2 = safe_url_extraclean($sec2);
|
$sec2 = safe_url_extraclean($sec2);
|
||||||
$page = $sec2;
|
$page = $sec2;
|
||||||
// Reference variable for old time sake
|
// Reference variable for old time sake.
|
||||||
$sec = get_parameter_get('sec');
|
$sec = get_parameter_get('sec');
|
||||||
$sec = safe_url_extraclean($sec);
|
$sec = safe_url_extraclean($sec);
|
||||||
|
|
||||||
$process_login = false;
|
$process_login = false;
|
||||||
|
|
||||||
// Update user password
|
// Update user password.
|
||||||
$change_pass = get_parameter_post('renew_password', 0);
|
$change_pass = get_parameter_post('renew_password', 0);
|
||||||
|
|
||||||
if ($change_pass == 1) {
|
if ($change_pass == 1) {
|
||||||
@ -235,14 +255,14 @@ $searchPage = false;
|
|||||||
$search = get_parameter_get('head_search_keywords');
|
$search = get_parameter_get('head_search_keywords');
|
||||||
if (strlen($search) > 0) {
|
if (strlen($search) > 0) {
|
||||||
$config['search_keywords'] = io_safe_input(trim(io_safe_output(get_parameter('keywords'))));
|
$config['search_keywords'] = io_safe_input(trim(io_safe_output(get_parameter('keywords'))));
|
||||||
// If not search category providad, we'll use an agent search
|
// If not search category providad, we'll use an agent search.
|
||||||
$config['search_category'] = get_parameter('search_category', 'all');
|
$config['search_category'] = get_parameter('search_category', 'all');
|
||||||
if (($config['search_keywords'] != 'Enter keywords to search') && (strlen($config['search_keywords']) > 0)) {
|
if (($config['search_keywords'] != 'Enter keywords to search') && (strlen($config['search_keywords']) > 0)) {
|
||||||
$searchPage = true;
|
$searchPage = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Login process
|
// Login process.
|
||||||
if (! isset($config['id_user'])) {
|
if (! isset($config['id_user'])) {
|
||||||
// Clear error messages.
|
// Clear error messages.
|
||||||
unset($_COOKIE['errormsg']);
|
unset($_COOKIE['errormsg']);
|
||||||
@ -250,50 +270,53 @@ if (! isset($config['id_user'])) {
|
|||||||
|
|
||||||
if (isset($_GET['login'])) {
|
if (isset($_GET['login'])) {
|
||||||
include_once 'include/functions_db.php';
|
include_once 'include/functions_db.php';
|
||||||
// Include it to use escape_string_sql function
|
// Include it to use escape_string_sql function.
|
||||||
$config['auth_error'] = '';
|
$config['auth_error'] = '';
|
||||||
// Set this to the error message from the authorization mechanism
|
// Set this to the error message from the authorization mechanism.
|
||||||
$nick = get_parameter_post('nick');
|
$nick = get_parameter_post('nick');
|
||||||
// This is the variable with the login
|
// This is the variable with the login.
|
||||||
$pass = get_parameter_post('pass');
|
$pass = get_parameter_post('pass');
|
||||||
// This is the variable with the password
|
// This is the variable with the password.
|
||||||
$nick = db_escape_string_sql($nick);
|
$nick = db_escape_string_sql($nick);
|
||||||
$pass = db_escape_string_sql($pass);
|
$pass = db_escape_string_sql($pass);
|
||||||
|
|
||||||
// Since now, only the $pass variable are needed
|
// Since now, only the $pass variable are needed.
|
||||||
unset($_GET['pass'], $_POST['pass'], $_REQUEST['pass']);
|
unset($_GET['pass'], $_POST['pass'], $_REQUEST['pass']);
|
||||||
|
|
||||||
// If the auth_code exists, we assume the user has come through the double auth page
|
// If the auth_code exists, we assume the user has come from
|
||||||
|
// double authorization page.
|
||||||
if (isset($_POST['auth_code'])) {
|
if (isset($_POST['auth_code'])) {
|
||||||
$double_auth_success = false;
|
$double_auth_success = false;
|
||||||
|
|
||||||
// The double authentication is activated and the user has surpassed the first step (the login).
|
// The double authentication is activated and the user has
|
||||||
|
// surpassed the first step (the login).
|
||||||
// Now the authentication code provided will be checked.
|
// Now the authentication code provided will be checked.
|
||||||
if (isset($_SESSION['prepared_login_da'])) {
|
if (isset($_SESSION['prepared_login_da'])) {
|
||||||
if (isset($_SESSION['prepared_login_da']['id_user'])
|
if (isset($_SESSION['prepared_login_da']['id_user'])
|
||||||
&& isset($_SESSION['prepared_login_da']['timestamp'])
|
&& isset($_SESSION['prepared_login_da']['timestamp'])
|
||||||
) {
|
) {
|
||||||
// The user has a maximum of 5 minutes to introduce the double auth code
|
// The user has a maximum of 5 minutes to introduce
|
||||||
|
// the double auth code.
|
||||||
$dauth_period = SECONDS_2MINUTES;
|
$dauth_period = SECONDS_2MINUTES;
|
||||||
$now = time();
|
$now = time();
|
||||||
$dauth_time = $_SESSION['prepared_login_da']['timestamp'];
|
$dauth_time = $_SESSION['prepared_login_da']['timestamp'];
|
||||||
|
|
||||||
if (($now - $dauth_period) < $dauth_time) {
|
if (($now - $dauth_period) < $dauth_time) {
|
||||||
// Nick
|
// Nick.
|
||||||
$nick = $_SESSION['prepared_login_da']['id_user'];
|
$nick = $_SESSION['prepared_login_da']['id_user'];
|
||||||
// Code
|
// Code.
|
||||||
$code = (string) get_parameter_post('auth_code');
|
$code = (string) get_parameter_post('auth_code');
|
||||||
|
|
||||||
if (!empty($code)) {
|
if (!empty($code)) {
|
||||||
$result = validate_double_auth_code($nick, $code);
|
$result = validate_double_auth_code($nick, $code);
|
||||||
|
|
||||||
if ($result === true) {
|
if ($result === true) {
|
||||||
// Double auth success
|
// Double auth success.
|
||||||
$double_auth_success = true;
|
$double_auth_success = true;
|
||||||
} else {
|
} else {
|
||||||
// Screen
|
// Screen.
|
||||||
$login_screen = 'double_auth';
|
$login_screen = 'double_auth';
|
||||||
// Error message
|
// Error message.
|
||||||
$config['auth_error'] = __('Invalid code');
|
$config['auth_error'] = __('Invalid code');
|
||||||
|
|
||||||
if (!isset($_SESSION['prepared_login_da']['attempts'])) {
|
if (!isset($_SESSION['prepared_login_da']['attempts'])) {
|
||||||
@ -303,9 +326,9 @@ if (! isset($config['id_user'])) {
|
|||||||
$_SESSION['prepared_login_da']['attempts']++;
|
$_SESSION['prepared_login_da']['attempts']++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Screen
|
// Screen.
|
||||||
$login_screen = 'double_auth';
|
$login_screen = 'double_auth';
|
||||||
// Error message
|
// Error message.
|
||||||
$config['auth_error'] = __("The code shouldn't be empty");
|
$config['auth_error'] = __("The code shouldn't be empty");
|
||||||
|
|
||||||
if (!isset($_SESSION['prepared_login_da']['attempts'])) {
|
if (!isset($_SESSION['prepared_login_da']['attempts'])) {
|
||||||
@ -315,27 +338,27 @@ if (! isset($config['id_user'])) {
|
|||||||
$_SESSION['prepared_login_da']['attempts']++;
|
$_SESSION['prepared_login_da']['attempts']++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Expired login
|
// Expired login.
|
||||||
unset($_SESSION['prepared_login_da']);
|
unset($_SESSION['prepared_login_da']);
|
||||||
|
|
||||||
// Error message
|
// Error message.
|
||||||
$config['auth_error'] = __('Expired login');
|
$config['auth_error'] = __('Expired login');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If the code doesn't exist, remove the prepared login
|
// If the code doesn't exist, remove the prepared login.
|
||||||
unset($_SESSION['prepared_login_da']);
|
unset($_SESSION['prepared_login_da']);
|
||||||
|
|
||||||
// Error message
|
// Error message.
|
||||||
$config['auth_error'] = __('Login error');
|
$config['auth_error'] = __('Login error');
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
// If $_SESSION['prepared_login_da'] doesn't exist, the user have to do the login again
|
// If $_SESSION['prepared_login_da'] doesn't exist, the user
|
||||||
else {
|
// must login again.
|
||||||
// Error message
|
// Error message.
|
||||||
$config['auth_error'] = __('Login error');
|
$config['auth_error'] = __('Login error');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the authenticator code
|
// Remove the authenticator code.
|
||||||
unset($_POST['auth_code'], $code);
|
unset($_POST['auth_code'], $code);
|
||||||
|
|
||||||
if (!$double_auth_success) {
|
if (!$double_auth_success) {
|
||||||
@ -347,6 +370,8 @@ if (! isset($config['id_user'])) {
|
|||||||
$_SERVER['REMOTE_ADDR']
|
$_SERVER['REMOTE_ADDR']
|
||||||
);
|
);
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
@ -355,7 +380,8 @@ if (! isset($config['id_user'])) {
|
|||||||
|
|
||||||
$login_button_saml = get_parameter('login_button_saml', false);
|
$login_button_saml = get_parameter('login_button_saml', false);
|
||||||
if (isset($double_auth_success) && $double_auth_success) {
|
if (isset($double_auth_success) && $double_auth_success) {
|
||||||
// This values are true cause there are checked before complete the 2nd auth step
|
// This values are true cause there are checked before complete
|
||||||
|
// the 2nd auth step.
|
||||||
$nick_in_db = $_SESSION['prepared_login_da']['id_user'];
|
$nick_in_db = $_SESSION['prepared_login_da']['id_user'];
|
||||||
$expired_pass = false;
|
$expired_pass = false;
|
||||||
} else if (($config['auth'] == 'saml') && ($login_button_saml)) {
|
} else if (($config['auth'] == 'saml') && ($login_button_saml)) {
|
||||||
@ -400,28 +426,34 @@ if (! isset($config['id_user'])) {
|
|||||||
include_once 'general/login_page.php';
|
include_once 'general/login_page.php';
|
||||||
db_pandora_audit('Password expired', 'Password expired: '.$nick, $nick);
|
db_pandora_audit('Password expired', 'Password expired: '.$nick, $nick);
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks if password has expired
|
// Checks if password has expired.
|
||||||
$check_status = check_pass_status($nick, $pass);
|
$check_status = check_pass_status($nick, $pass);
|
||||||
|
|
||||||
switch ($check_status) {
|
switch ($check_status) {
|
||||||
case PASSSWORD_POLICIES_FIRST_CHANGE:
|
case PASSSWORD_POLICIES_FIRST_CHANGE:
|
||||||
// first change
|
// First change.
|
||||||
case PASSSWORD_POLICIES_EXPIRED:
|
case PASSSWORD_POLICIES_EXPIRED:
|
||||||
// pass expired
|
// Pass expired.
|
||||||
$expired_pass = true;
|
$expired_pass = true;
|
||||||
login_change_password($nick, '', $check_status);
|
login_change_password($nick, '', $check_status);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Ignore.
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($nick_in_db !== false) && $expired_pass) {
|
if (($nick_in_db !== false) && $expired_pass) {
|
||||||
// login ok and password has expired
|
// Login ok and password has expired.
|
||||||
include_once 'general/login_page.php';
|
include_once 'general/login_page.php';
|
||||||
db_pandora_audit(
|
db_pandora_audit(
|
||||||
'Password expired',
|
'Password expired',
|
||||||
@ -429,30 +461,38 @@ if (! isset($config['id_user'])) {
|
|||||||
$nick
|
$nick
|
||||||
);
|
);
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
} else if (($nick_in_db !== false) && (!$expired_pass)) {
|
} else if (($nick_in_db !== false) && (!$expired_pass)) {
|
||||||
// login ok and password has not expired
|
// Login ok and password has not expired.
|
||||||
// Double auth check
|
// Double auth check.
|
||||||
if ((!isset($double_auth_success) || !$double_auth_success) && is_double_auth_enabled($nick_in_db)) {
|
if ((!isset($double_auth_success)
|
||||||
// Store this values in the session to know if the user login was correct
|
|| !$double_auth_success)
|
||||||
|
&& is_double_auth_enabled($nick_in_db)
|
||||||
|
) {
|
||||||
|
// Store this values in the session to know if the user login
|
||||||
|
// was correct.
|
||||||
$_SESSION['prepared_login_da'] = [
|
$_SESSION['prepared_login_da'] = [
|
||||||
'id_user' => $nick_in_db,
|
'id_user' => $nick_in_db,
|
||||||
'timestamp' => time(),
|
'timestamp' => time(),
|
||||||
'attempts' => 0,
|
'attempts' => 0,
|
||||||
];
|
];
|
||||||
|
|
||||||
// Load the page to introduce the double auth code
|
// Load the page to introduce the double auth code.
|
||||||
$login_screen = 'double_auth';
|
$login_screen = 'double_auth';
|
||||||
include_once 'general/login_page.php';
|
include_once 'general/login_page.php';
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
}
|
}
|
||||||
|
|
||||||
// login ok and password has not expired
|
// Login ok and password has not expired.
|
||||||
$process_login = true;
|
$process_login = true;
|
||||||
|
|
||||||
if (is_user_admin($nick)) {
|
if (is_user_admin($nick)) {
|
||||||
@ -464,7 +504,7 @@ if (! isset($config['id_user'])) {
|
|||||||
if (!isset($_GET['sec2']) && !isset($_GET['sec'])) {
|
if (!isset($_GET['sec2']) && !isset($_GET['sec'])) {
|
||||||
// Avoid the show homepage when the user go to
|
// Avoid the show homepage when the user go to
|
||||||
// a specific section of pandora
|
// a specific section of pandora
|
||||||
// for example when timeout the sesion
|
// for example when timeout the sesion.
|
||||||
unset($_GET['sec2']);
|
unset($_GET['sec2']);
|
||||||
$_GET['sec'] = 'general/logon_ok';
|
$_GET['sec'] = 'general/logon_ok';
|
||||||
$home_page = '';
|
$home_page = '';
|
||||||
@ -495,6 +535,7 @@ if (! isset($config['id_user'])) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Default':
|
case 'Default':
|
||||||
|
default:
|
||||||
$_GET['sec'] = 'general/logon_ok';
|
$_GET['sec'] = 'general/logon_ok';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -530,11 +571,14 @@ if (! isset($config['id_user'])) {
|
|||||||
$_SESSION['id_usuario'] = $nick_in_db;
|
$_SESSION['id_usuario'] = $nick_in_db;
|
||||||
$config['id_user'] = $nick_in_db;
|
$config['id_user'] = $nick_in_db;
|
||||||
|
|
||||||
// Check if connection goes through F5 balancer. If it does, then don't call config_prepare_session() or user will be back to login all the time
|
// Check if connection goes through F5 balancer. If it does, then
|
||||||
|
// don't call config_prepare_session() or user will be back to login
|
||||||
|
// all the time.
|
||||||
$prepare_session = true;
|
$prepare_session = true;
|
||||||
foreach ($_COOKIE as $key => $value) {
|
foreach ($_COOKIE as $key => $value) {
|
||||||
if (preg_match('/BIGipServer*/', $key)) {
|
if (preg_match('/BIGipServer*/', $key)) {
|
||||||
$prepare_session = false;
|
$prepare_session = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -543,9 +587,13 @@ if (! isset($config['id_user'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_user_admin($config['id_user'])) {
|
if (is_user_admin($config['id_user'])) {
|
||||||
// PHP configuration values
|
// PHP configuration values.
|
||||||
$PHPupload_max_filesize = config_return_in_bytes(ini_get('upload_max_filesize'));
|
$PHPupload_max_filesize = config_return_in_bytes(
|
||||||
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
|
ini_get('upload_max_filesize')
|
||||||
|
);
|
||||||
|
$PHPmemory_limit = config_return_in_bytes(
|
||||||
|
ini_get('memory_limit')
|
||||||
|
);
|
||||||
$PHPmax_execution_time = ini_get('max_execution_time');
|
$PHPmax_execution_time = ini_get('max_execution_time');
|
||||||
|
|
||||||
if ($PHPmax_execution_time !== '0') {
|
if ($PHPmax_execution_time !== '0') {
|
||||||
@ -580,43 +628,60 @@ if (! isset($config['id_user'])) {
|
|||||||
|
|
||||||
$l10n = null;
|
$l10n = null;
|
||||||
if (file_exists('./include/languages/'.$user_language.'.mo')) {
|
if (file_exists('./include/languages/'.$user_language.'.mo')) {
|
||||||
$l10n = new gettext_reader(new CachedFileReader('./include/languages/'.$user_language.'.mo'));
|
$cacheFileReader = new CachedFileReader(
|
||||||
|
'./include/languages/'.$user_language.'.mo'
|
||||||
|
);
|
||||||
|
$l10n = new gettext_reader($cacheFileReader);
|
||||||
$l10n->load_tables();
|
$l10n->load_tables();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// login wrong
|
// Login wrong.
|
||||||
$blocked = false;
|
$blocked = false;
|
||||||
|
|
||||||
if ((!is_user_admin($nick) || $config['enable_pass_policy_admin']) && file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
if ((!is_user_admin($nick) || $config['enable_pass_policy_admin'])
|
||||||
|
&& file_exists(ENTERPRISE_DIR.'/load_enterprise.php')
|
||||||
|
) {
|
||||||
$blocked = login_check_blocked($nick);
|
$blocked = login_check_blocked($nick);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$blocked) {
|
if (!$blocked) {
|
||||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||||
|
// Checks failed attempts.
|
||||||
login_check_failed($nick);
|
login_check_failed($nick);
|
||||||
// Checks failed attempts
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$login_failed = true;
|
$login_failed = true;
|
||||||
include_once 'general/login_page.php';
|
include_once 'general/login_page.php';
|
||||||
db_pandora_audit('Logon Failed', 'Invalid login: '.$nick, $nick);
|
db_pandora_audit(
|
||||||
|
'Logon Failed',
|
||||||
|
'Invalid login: '.$nick,
|
||||||
|
$nick
|
||||||
|
);
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
} else {
|
} else {
|
||||||
include_once 'general/login_page.php';
|
include_once 'general/login_page.php';
|
||||||
db_pandora_audit('Logon Failed', 'Invalid login: '.$nick, $nick);
|
db_pandora_audit(
|
||||||
|
'Logon Failed',
|
||||||
|
'Invalid login: '.$nick,
|
||||||
|
$nick
|
||||||
|
);
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Form the url
|
// Form the url.
|
||||||
$query_params_redirect = $_GET;
|
$query_params_redirect = $_GET;
|
||||||
// Visual console do not want sec2
|
// Visual console do not want sec2.
|
||||||
if ($home_page == 'Visual console') {
|
if ($home_page == 'Visual console') {
|
||||||
unset($query_params_redirect['sec2']);
|
unset($query_params_redirect['sec2']);
|
||||||
}
|
}
|
||||||
@ -630,15 +695,19 @@ if (! isset($config['id_user'])) {
|
|||||||
$redirect_url .= '&'.safe_url_extraclean($key).'='.safe_url_extraclean($value);
|
$redirect_url .= '&'.safe_url_extraclean($key).'='.safe_url_extraclean($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Location: '.$config['homeurl'].'index.php'.$redirect_url);
|
header('Location: '.ui_get_full_url('index.php'.$redirect_url));
|
||||||
exit;
|
exit;
|
||||||
// Always exit after sending location headers.
|
// Always exit after sending location headers.
|
||||||
} else if (isset($_GET['loginhash'])) {
|
} else if (isset($_GET['loginhash'])) {
|
||||||
// Hash login process
|
// Hash login process.
|
||||||
$loginhash_data = get_parameter('loginhash_data', '');
|
$loginhash_data = get_parameter('loginhash_data', '');
|
||||||
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
|
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
|
||||||
|
|
||||||
if ($config['loginhash_pwd'] != '' && $loginhash_data == md5($loginhash_user.io_output_password($config['loginhash_pwd']))) {
|
if ($config['loginhash_pwd'] != ''
|
||||||
|
&& $loginhash_data == md5(
|
||||||
|
$loginhash_user.io_output_password($config['loginhash_pwd'])
|
||||||
|
)
|
||||||
|
) {
|
||||||
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
||||||
$_SESSION['id_usuario'] = $loginhash_user;
|
$_SESSION['id_usuario'] = $loginhash_user;
|
||||||
$config['id_user'] = $loginhash_user;
|
$config['id_user'] = $loginhash_user;
|
||||||
@ -646,6 +715,8 @@ if (! isset($config['id_user'])) {
|
|||||||
include_once 'general/login_page.php';
|
include_once 'general/login_page.php';
|
||||||
db_pandora_audit('Logon Failed (loginhash', '', 'system');
|
db_pandora_audit('Logon Failed (loginhash', '', 'system');
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
@ -767,7 +838,7 @@ if (! isset($config['id_user'])) {
|
|||||||
$body .= '<p />';
|
$body .= '<p />';
|
||||||
$body .= __('Please click the link below to reset your password');
|
$body .= __('Please click the link below to reset your password');
|
||||||
$body .= '<p />';
|
$body .= '<p />';
|
||||||
$body .= '<a href="'.$config['homeurl'].'index.php?reset_hash='.$cod_hash.'">'.__('Reset your password').'</a>';
|
$body .= '<a href="'.ui_get_full_url('index.php?reset_hash='.$cod_hash).'">'.__('Reset your password').'</a>';
|
||||||
$body .= '<p />';
|
$body .= '<p />';
|
||||||
$body .= get_product_name();
|
$body .= get_product_name();
|
||||||
$body .= '<p />';
|
$body .= '<p />';
|
||||||
@ -790,6 +861,8 @@ if (! isset($config['id_user'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
@ -799,11 +872,20 @@ if (! isset($config['id_user'])) {
|
|||||||
$loginhash_data = get_parameter('loginhash_data', '');
|
$loginhash_data = get_parameter('loginhash_data', '');
|
||||||
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
|
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
|
||||||
$iduser = $_SESSION['id_usuario'];
|
$iduser = $_SESSION['id_usuario'];
|
||||||
// logoff_db ($iduser, $_SERVER["REMOTE_ADDR"]); check why is not available
|
|
||||||
|
/*
|
||||||
|
* Check why is not available.
|
||||||
|
* logoff_db ($iduser, $_SERVER["REMOTE_ADDR"]);
|
||||||
|
*/
|
||||||
|
|
||||||
unset($_SESSION['id_usuario']);
|
unset($_SESSION['id_usuario']);
|
||||||
unset($iduser);
|
unset($iduser);
|
||||||
|
|
||||||
if ($config['loginhash_pwd'] != '' && $loginhash_data == md5($loginhash_user.io_output_password($config['loginhash_pwd']))) {
|
if ($config['loginhash_pwd'] != ''
|
||||||
|
&& $loginhash_data == md5(
|
||||||
|
$loginhash_user.io_output_password($config['loginhash_pwd'])
|
||||||
|
)
|
||||||
|
) {
|
||||||
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
||||||
$_SESSION['id_usuario'] = $loginhash_user;
|
$_SESSION['id_usuario'] = $loginhash_user;
|
||||||
$config['id_user'] = $loginhash_user;
|
$config['id_user'] = $loginhash_user;
|
||||||
@ -811,6 +893,8 @@ if (! isset($config['id_user'])) {
|
|||||||
include_once 'general/login_page.php';
|
include_once 'general/login_page.php';
|
||||||
db_pandora_audit('Logon Failed (loginhash', '', 'system');
|
db_pandora_audit('Logon Failed (loginhash', '', 'system');
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
@ -823,7 +907,7 @@ if (! isset($config['id_user'])) {
|
|||||||
'*'
|
'*'
|
||||||
);
|
);
|
||||||
if ($user_in_db == false) {
|
if ($user_in_db == false) {
|
||||||
// logout
|
// Logout.
|
||||||
$_REQUEST = [];
|
$_REQUEST = [];
|
||||||
$_GET = [];
|
$_GET = [];
|
||||||
$_POST = [];
|
$_POST = [];
|
||||||
@ -834,6 +918,8 @@ if (! isset($config['id_user'])) {
|
|||||||
unset($iduser);
|
unset($iduser);
|
||||||
include_once 'general/login_page.php';
|
include_once 'general/login_page.php';
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
@ -841,7 +927,7 @@ if (! isset($config['id_user'])) {
|
|||||||
if (((bool) $user_in_db['is_admin'] === false)
|
if (((bool) $user_in_db['is_admin'] === false)
|
||||||
&& ((bool) $user_in_db['not_login'] === true)
|
&& ((bool) $user_in_db['not_login'] === true)
|
||||||
) {
|
) {
|
||||||
// logout
|
// Logout.
|
||||||
$_REQUEST = [];
|
$_REQUEST = [];
|
||||||
$_GET = [];
|
$_GET = [];
|
||||||
$_POST = [];
|
$_POST = [];
|
||||||
@ -852,6 +938,8 @@ if (! isset($config['id_user'])) {
|
|||||||
unset($iduser);
|
unset($iduser);
|
||||||
include_once 'general/login_page.php';
|
include_once 'general/login_page.php';
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
@ -859,12 +947,12 @@ if (! isset($config['id_user'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enterprise support
|
// Enterprise support.
|
||||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||||
include_once ENTERPRISE_DIR.'/load_enterprise.php';
|
include_once ENTERPRISE_DIR.'/load_enterprise.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log off
|
// Log off.
|
||||||
if (isset($_GET['bye'])) {
|
if (isset($_GET['bye'])) {
|
||||||
include 'general/logoff.php';
|
include 'general/logoff.php';
|
||||||
$iduser = $_SESSION['id_usuario'];
|
$iduser = $_SESSION['id_usuario'];
|
||||||
@ -877,11 +965,13 @@ if (isset($_GET['bye'])) {
|
|||||||
|
|
||||||
if ($config['auth'] == 'saml') {
|
if ($config['auth'] == 'saml') {
|
||||||
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
|
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
|
||||||
$as = new SimpleSAML_Auth_Simple($config['saml_source']);
|
$as = new SimpleSAML_Auth_Simple('PandoraFMS');
|
||||||
$as->logout();
|
$as->logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('</html>');
|
exit('</html>');
|
||||||
@ -889,10 +979,11 @@ if (isset($_GET['bye'])) {
|
|||||||
|
|
||||||
clear_pandora_error_for_header();
|
clear_pandora_error_for_header();
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
// EXTENSIONS
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
/*
|
/*
|
||||||
|
* ----------------------------------------------------------------------
|
||||||
|
* EXTENSIONS
|
||||||
|
* ----------------------------------------------------------------------
|
||||||
|
*
|
||||||
* Load the basic configurations of extension and add extensions into menu.
|
* Load the basic configurations of extension and add extensions into menu.
|
||||||
* Load here, because if not, some extensions not load well, I don't why.
|
* Load here, because if not, some extensions not load well, I don't why.
|
||||||
*/
|
*/
|
||||||
@ -901,7 +992,7 @@ $config['logged'] = false;
|
|||||||
extensions_load_extensions($process_login);
|
extensions_load_extensions($process_login);
|
||||||
|
|
||||||
if ($process_login) {
|
if ($process_login) {
|
||||||
// Call all extensions login function
|
// Call all extensions login function.
|
||||||
extensions_call_login_function();
|
extensions_call_login_function();
|
||||||
|
|
||||||
unset($_SESSION['new_update']);
|
unset($_SESSION['new_update']);
|
||||||
@ -992,7 +1083,7 @@ if (get_parameter('login', 0) !== 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header
|
// Header.
|
||||||
if ($config['pure'] == 0) {
|
if ($config['pure'] == 0) {
|
||||||
echo '<div id="container"><div id="head">';
|
echo '<div id="container"><div id="head">';
|
||||||
include 'general/header.php';
|
include 'general/header.php';
|
||||||
@ -1008,24 +1099,27 @@ if ($config['pure'] == 0) {
|
|||||||
echo '<button onclick="topFunction()" id="top_btn" title="Go to top"></button>';
|
echo '<button onclick="topFunction()" id="top_btn" title="Go to top"></button>';
|
||||||
} else {
|
} else {
|
||||||
echo '<div id="main_pure">';
|
echo '<div id="main_pure">';
|
||||||
// Require menu only to build structure to use it in ACLs
|
// Require menu only to build structure to use it in ACLs.
|
||||||
include 'operation/menu.php';
|
include 'operation/menu.php';
|
||||||
include 'godmode/menu.php';
|
include 'godmode/menu.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://es2.php.net/manual/en/ref.session.php#64525
|
/*
|
||||||
// Session locking concurrency speedup!
|
* Session locking concurrency speedup!
|
||||||
|
* http://es2.php.net/manual/en/ref.session.php#64525
|
||||||
|
*/
|
||||||
|
|
||||||
session_write_close();
|
session_write_close();
|
||||||
|
|
||||||
|
|
||||||
// Main block of content
|
// Main block of content.
|
||||||
if ($config['pure'] == 0) {
|
if ($config['pure'] == 0) {
|
||||||
echo '<div id="main">';
|
echo '<div id="main">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Page loader / selector
|
// Page loader / selector.
|
||||||
if ($searchPage) {
|
if ($searchPage) {
|
||||||
include 'operation/search_results.php';
|
include 'operation/search_results.php';
|
||||||
} else {
|
} else {
|
||||||
@ -1049,7 +1143,7 @@ if ($searchPage) {
|
|||||||
|
|
||||||
$page .= '.php';
|
$page .= '.php';
|
||||||
|
|
||||||
// Enterprise ACL check
|
// Enterprise ACL check.
|
||||||
if (enterprise_hook(
|
if (enterprise_hook(
|
||||||
'enterprise_acl',
|
'enterprise_acl',
|
||||||
[
|
[
|
||||||
@ -1079,7 +1173,7 @@ if ($searchPage) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// home screen chosen by the user
|
// Home screen chosen by the user.
|
||||||
$home_page = '';
|
$home_page = '';
|
||||||
if (isset($config['id_user'])) {
|
if (isset($config['id_user'])) {
|
||||||
$user_info = users_get_user_by_id($config['id_user']);
|
$user_info = users_get_user_by_id($config['id_user']);
|
||||||
@ -1110,6 +1204,7 @@ if ($searchPage) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Default':
|
case 'Default':
|
||||||
|
default:
|
||||||
$_GET['sec2'] = 'general/logon_ok';
|
$_GET['sec2'] = 'general/logon_ok';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1148,12 +1243,11 @@ if ($searchPage) {
|
|||||||
|
|
||||||
if (isset($_GET['sec2'])) {
|
if (isset($_GET['sec2'])) {
|
||||||
$file = $_GET['sec2'].'.php';
|
$file = $_GET['sec2'].'.php';
|
||||||
// Translate some secs
|
// Translate some secs.
|
||||||
$main_sec = get_sec($_GET['sec']);
|
$main_sec = get_sec($_GET['sec']);
|
||||||
$_GET['sec'] = $main_sec == false ? $_GET['sec'] : $main_sec;
|
$_GET['sec'] = ($main_sec == false) ? $_GET['sec'] : $main_sec;
|
||||||
if (!file_exists($file)
|
if (!file_exists($file)
|
||||||
|| ( $_GET['sec2'] != 'general/logon_ok'
|
|| ($_GET['sec2'] != 'general/logon_ok' && enterprise_hook(
|
||||||
&& enterprise_hook(
|
|
||||||
'enterprise_acl',
|
'enterprise_acl',
|
||||||
[
|
[
|
||||||
$config['id_user'],
|
$config['id_user'],
|
||||||
@ -1181,13 +1275,13 @@ if ($searchPage) {
|
|||||||
if ($config['pure'] == 0) {
|
if ($config['pure'] == 0) {
|
||||||
echo '<div style="clear:both"></div>';
|
echo '<div style="clear:both"></div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
// main
|
// Main.
|
||||||
echo '<div style="clear:both"> </div>';
|
echo '<div style="clear:both"> </div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
// page (id = page)
|
// Page (id = page).
|
||||||
} else {
|
} else {
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
// main_pure
|
// Main pure.
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<div id="wiz_container">';
|
echo '<div id="wiz_container">';
|
||||||
@ -1211,31 +1305,31 @@ require_once 'include/functions_clippy.php';
|
|||||||
clippy_start($sec2);
|
clippy_start($sec2);
|
||||||
|
|
||||||
while (@ob_end_flush()) {
|
while (@ob_end_flush()) {
|
||||||
// Dump.
|
// Dumping...
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
db_print_database_debug();
|
db_print_database_debug();
|
||||||
echo '</html>';
|
echo '</html>';
|
||||||
|
|
||||||
$run_time = format_numeric((microtime(true) - $config['start_time']), 3);
|
$run_time = format_numeric((microtime(true) - $config['start_time']), 3);
|
||||||
echo "\n<!-- Page generated in $run_time seconds -->\n";
|
echo "\n<!-- Page generated in ".$run_time." seconds -->\n";
|
||||||
|
|
||||||
// Values from PHP to be recovered from JAVASCRIPT
|
// Values from PHP to be recovered from JAVASCRIPT.
|
||||||
require 'include/php_to_js_values.php';
|
require 'include/php_to_js_values.php';
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript">
|
||||||
|
|
||||||
// When there are less than 5 rows, all rows must be white
|
// When there are less than 5 rows, all rows must be white.
|
||||||
var theme = "<?php echo $config['style']; ?>";
|
|
||||||
if(theme === 'pandora'){
|
|
||||||
if($('table.info_table tr').length < 5){
|
if($('table.info_table tr').length < 5){
|
||||||
$('table.info_table tbody > tr').css('background-color', '#fff');
|
$('table.info_table tbody > tr').css('background-color', '#fff');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// When the user scrolls down 400px from the top of the document, show the button.
|
// When the user scrolls down 400px from the top of the document, show the
|
||||||
|
// button.
|
||||||
window.onscroll = function() {scrollFunction()};
|
window.onscroll = function() {scrollFunction()};
|
||||||
|
|
||||||
function scrollFunction() {
|
function scrollFunction() {
|
||||||
@ -1248,18 +1342,24 @@ require 'include/php_to_js_values.php';
|
|||||||
|
|
||||||
// When the user clicks on the button, scroll to the top of the document.
|
// When the user clicks on the button, scroll to the top of the document.
|
||||||
function topFunction() {
|
function topFunction() {
|
||||||
//document.body.scrollTop = 0; // For Safari.
|
|
||||||
//document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera.
|
/*
|
||||||
|
* Safari.
|
||||||
|
* document.body.scrollTop = 0;
|
||||||
|
* For Chrome, Firefox, IE and Opera.
|
||||||
|
* document.documentElement.scrollTop = 0;
|
||||||
|
*/
|
||||||
|
|
||||||
$("HTML, BODY").animate({ scrollTop: 0 }, 500);
|
$("HTML, BODY").animate({ scrollTop: 0 }, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Initial load of page
|
// Initial load of page.
|
||||||
$(document).ready(adjustFooter);
|
$(document).ready(adjustFooter);
|
||||||
|
|
||||||
//Every resize of window
|
// Every resize of window.
|
||||||
$(window).resize(adjustFooter);
|
$(window).resize(adjustFooter);
|
||||||
|
|
||||||
//Every show/hide call may need footer re-layout
|
// Every show/hide call may need footer re-layout.
|
||||||
(function() {
|
(function() {
|
||||||
var oShow = jQuery.fn.show;
|
var oShow = jQuery.fn.show;
|
||||||
var oHide = jQuery.fn.hide;
|
var oHide = jQuery.fn.hide;
|
||||||
|
@ -129,7 +129,7 @@
|
|||||||
<div style='height: 10px'>
|
<div style='height: 10px'>
|
||||||
<?php
|
<?php
|
||||||
$version = '7.0NG.736';
|
$version = '7.0NG.736';
|
||||||
$build = '190711';
|
$build = '190717';
|
||||||
$banner = "v$version Build $build";
|
$banner = "v$version Build $build";
|
||||||
|
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
|
@ -461,18 +461,16 @@ if ($fields === false) {
|
|||||||
|
|
||||||
$custom_fields = [];
|
$custom_fields = [];
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$data = [];
|
|
||||||
$data[0] = '<b>'.$field['name'].ui_print_help_tip(__('Custom field'), true).'</b>';
|
|
||||||
$custom_value = db_get_all_rows_sql(
|
$custom_value = db_get_all_rows_sql(
|
||||||
'select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields
|
'select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields
|
||||||
INNER JOIN tagent_custom_data ON tagent_custom_fields.id_field = tagent_custom_data.id_field where tagent_custom_fields.id_field = '.$field['id_field'].' and tagent_custom_data.id_agent = '.$id_agente
|
INNER JOIN tagent_custom_data ON tagent_custom_fields.id_field = tagent_custom_data.id_field where tagent_custom_fields.id_field = '.$field['id_field'].' and tagent_custom_data.id_agent = '.$id_agente
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($custom_value[0]['description'] === false || $custom_value[0]['description'] == '') {
|
if ($custom_value[0]['description'] !== false && $custom_value[0]['description'] != '') {
|
||||||
$custom_value[0]['description'] = '<i>-'.__('empty').'-</i>';
|
$data = [];
|
||||||
} else {
|
|
||||||
|
$data[0] = '<b>'.$field['name'].ui_print_help_tip(__('Custom field'), true).'</b>';
|
||||||
$custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']);
|
$custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']);
|
||||||
}
|
|
||||||
|
|
||||||
if ($custom_value[0]['is_password_type']) {
|
if ($custom_value[0]['is_password_type']) {
|
||||||
$data[1] = '••••••••';
|
$data[1] = '••••••••';
|
||||||
@ -482,6 +480,7 @@ foreach ($fields as $field) {
|
|||||||
|
|
||||||
$custom_fields[] = $data;
|
$custom_fields[] = $data;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$custom_fields_count = count($custom_fields);
|
$custom_fields_count = count($custom_fields);
|
||||||
for ($i = 0; $i < $custom_fields_count; $i++) {
|
for ($i = 0; $i < $custom_fields_count; $i++) {
|
||||||
|
@ -243,9 +243,10 @@ if (empty($export_btn) || $show_form) {
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
// Agent selector
|
// Agent selector.
|
||||||
$table->data[1][0] = '<b>'.__('Source agent').'</b>';
|
$table->data[1][0] = '<b>'.__('Source agent').'</b>';
|
||||||
|
|
||||||
|
$filter = [];
|
||||||
if ($group > 0) {
|
if ($group > 0) {
|
||||||
$filter['id_grupo'] = (array) $group;
|
$filter['id_grupo'] = (array) $group;
|
||||||
} else {
|
} else {
|
||||||
|
@ -383,14 +383,14 @@ if ($not_found) {
|
|||||||
|
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
|
|
||||||
echo "<div style='width: ".$table->width."; text-align: right;'>";
|
echo "<div style='width: ".$table->width."; text-align: right; margin-top:20px;'>";
|
||||||
if ($new_networkmap) {
|
if ($new_networkmap) {
|
||||||
html_print_input_hidden('save_networkmap', 1);
|
html_print_input_hidden('save_networkmap', 1);
|
||||||
html_print_submit_button(
|
html_print_submit_button(
|
||||||
__('Save networkmap'),
|
__('Save networkmap'),
|
||||||
'crt',
|
'crt',
|
||||||
false,
|
false,
|
||||||
'class="sub"'
|
'class="sub next"'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,7 +401,7 @@ if ($not_found) {
|
|||||||
__('Update networkmap'),
|
__('Update networkmap'),
|
||||||
'crt',
|
'crt',
|
||||||
false,
|
false,
|
||||||
'class="sub"'
|
'class="sub upd"'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ echo '</head>';
|
|||||||
echo "<body style='background-color: #494949; max-width: 550px; max-height: 400px; margin-top:40px;'>";
|
echo "<body style='background-color: #494949; max-width: 550px; max-height: 400px; margin-top:40px;'>";
|
||||||
echo "<h1 class='modalheaderh1'>".__('Sound console').'</h1>';
|
echo "<h1 class='modalheaderh1'>".__('Sound console').'</h1>';
|
||||||
|
|
||||||
$table = null;
|
$table = new StdClass;
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->styleTable = 'padding-left:16px; padding-right:16px; padding-top:16px;';
|
$table->styleTable = 'padding-left:16px; padding-right:16px; padding-top:16px;';
|
||||||
$table->class = ' ';
|
$table->class = ' ';
|
||||||
@ -82,7 +82,7 @@ $table->data[1][3] = html_print_textarea('events_fired', 200, 20, '', 'readonly=
|
|||||||
|
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
|
|
||||||
$table = null;
|
$table = new StdClass;
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->rowstyle[0] = 'text-align:center;';
|
$table->rowstyle[0] = 'text-align:center;';
|
||||||
$table->styleTable = 'padding-top:16px;padding-bottom:16px;';
|
$table->styleTable = 'padding-top:16px;padding-bottom:16px;';
|
||||||
@ -196,15 +196,15 @@ function forgetPreviousEvents() {
|
|||||||
var agents = $("#id_agents").val();
|
var agents = $("#id_agents").val();
|
||||||
|
|
||||||
jQuery.post ("../../ajax.php",
|
jQuery.post ("../../ajax.php",
|
||||||
{"page" : "operation/events/events",
|
{"page" : "include/ajax/events",
|
||||||
"get_events_fired": 1,
|
"get_events_fired": 1,
|
||||||
"id_group": group,
|
"id_group": group,
|
||||||
"agents[]" : agents,
|
|
||||||
"alert_fired": alert_fired,
|
"alert_fired": alert_fired,
|
||||||
"critical": critical,
|
"critical": critical,
|
||||||
"warning": warning,
|
"warning": warning,
|
||||||
"unknown": unknown,
|
"unknown": unknown,
|
||||||
"id_row": id_row
|
"id_row": id_row,
|
||||||
|
"agents[]" : agents
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
firedId = parseInt(data['fired']);
|
firedId = parseInt(data['fired']);
|
||||||
@ -219,18 +219,17 @@ function forgetPreviousEvents() {
|
|||||||
|
|
||||||
function check_event() {
|
function check_event() {
|
||||||
var agents = $("#id_agents").val();
|
var agents = $("#id_agents").val();
|
||||||
|
|
||||||
if (running) {
|
if (running) {
|
||||||
jQuery.post ("../../ajax.php",
|
jQuery.post ("../../ajax.php",
|
||||||
{"page" : "operation/events/events",
|
{"page" : "include/ajax/events",
|
||||||
"get_events_fired": 1,
|
"get_events_fired": 1,
|
||||||
"id_group": group,
|
"id_group": group,
|
||||||
"agents[]" : agents,
|
|
||||||
"alert_fired": alert_fired,
|
"alert_fired": alert_fired,
|
||||||
"critical": critical,
|
"critical": critical,
|
||||||
"warning": warning,
|
"warning": warning,
|
||||||
"unknown": unknown,
|
"unknown": unknown,
|
||||||
"id_row": id_row
|
"id_row": id_row,
|
||||||
|
"agents[]" : agents,
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
firedId = parseInt(data['fired']);
|
firedId = parseInt(data['fired']);
|
||||||
@ -247,7 +246,6 @@ function check_event() {
|
|||||||
$('audio').remove();
|
$('audio').remove();
|
||||||
$('body').append("<audio src='../../" + data['sound'] + "' autoplay='true' hidden='true' loop='true'>");
|
$('body').append("<audio src='../../" + data['sound'] + "' autoplay='true' hidden='true' loop='true'>");
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
"json"
|
"json"
|
||||||
);
|
);
|
||||||
|
@ -26,6 +26,7 @@ if ($searchGraphs) {
|
|||||||
$usergraphs_id = array_keys($usergraphs);
|
$usergraphs_id = array_keys($usergraphs);
|
||||||
|
|
||||||
if (empty($usergraphs_id)) {
|
if (empty($usergraphs_id)) {
|
||||||
|
$totalGraphs = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,6 +38,7 @@ if ($searchGraphs) {
|
|||||||
'id_graph',
|
'id_graph',
|
||||||
'name',
|
'name',
|
||||||
'description',
|
'description',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$totalGraphs = (int) db_get_value_filter('COUNT(id_graph) AS count', 'tgraph', $filter);
|
$totalGraphs = (int) db_get_value_filter('COUNT(id_graph) AS count', 'tgraph', $filter);
|
||||||
@ -45,5 +47,7 @@ if ($searchGraphs) {
|
|||||||
$filter['limit'] = $config['block_size'];
|
$filter['limit'] = $config['block_size'];
|
||||||
$filter['offset'] = (int) get_parameter('offset');
|
$filter['offset'] = (int) get_parameter('offset');
|
||||||
$graphs = db_get_all_rows_filter('tgraph', $filter, $columns);
|
$graphs = db_get_all_rows_filter('tgraph', $filter, $columns);
|
||||||
|
} else {
|
||||||
|
$totalGraphs = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ $searchGraphs = check_acl($config['id_user'], 0, 'RR');
|
|||||||
$searchMaps = check_acl($config['id_user'], 0, 'RR');
|
$searchMaps = check_acl($config['id_user'], 0, 'RR');
|
||||||
$searchReports = check_acl($config['id_user'], 0, 'RR');
|
$searchReports = check_acl($config['id_user'], 0, 'RR');
|
||||||
$searchUsers = check_acl($config['id_user'], 0, 'UM');
|
$searchUsers = check_acl($config['id_user'], 0, 'UM');
|
||||||
|
$searchPolicies = check_acl($config['id_user'], 0, 'AW');
|
||||||
$searchHelps = true;
|
$searchHelps = true;
|
||||||
|
|
||||||
echo '<br><div style="margin:auto; width:90%; padding: 10px;">';
|
echo '<br><div style="margin:auto; width:90%; padding: 10px;">';
|
||||||
@ -44,8 +45,12 @@ $table->style[9] = 'font-weight: bold; text-align: center;';
|
|||||||
$table->style[10] = 'font-weight: bold; text-align: center;';
|
$table->style[10] = 'font-weight: bold; text-align: center;';
|
||||||
$table->style[11] = 'font-weight: bold; text-align: center;';
|
$table->style[11] = 'font-weight: bold; text-align: center;';
|
||||||
$table->style[13] = 'font-weight: bold; text-align: center;';
|
$table->style[13] = 'font-weight: bold; text-align: center;';
|
||||||
|
$table->style[14] = 'font-weight: bold; text-align: center;';
|
||||||
$table->style[15] = 'font-weight: bold; text-align: center;';
|
$table->style[15] = 'font-weight: bold; text-align: center;';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$table->data[0][0] = html_print_image('images/agent.png', true, ['title' => __('Agents found')]);
|
$table->data[0][0] = html_print_image('images/agent.png', true, ['title' => __('Agents found')]);
|
||||||
$table->data[0][1] = "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalAgents).'</a>';
|
$table->data[0][1] = "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalAgents).'</a>';
|
||||||
$table->data[0][2] = html_print_image('images/module.png', true, ['title' => __('Modules found')]);
|
$table->data[0][2] = html_print_image('images/module.png', true, ['title' => __('Modules found')]);
|
||||||
@ -64,8 +69,10 @@ $table->data[0][10] = html_print_image('images/reporting.png', true, ['title' =>
|
|||||||
$table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
|
$table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
|
||||||
$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Maps found')]);
|
$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Maps found')]);
|
||||||
$table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
|
$table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
|
||||||
$table->data[0][14] = html_print_image('images/help.png', true, ['title' => __('Helps found')]);
|
if (enterprise_installed()) {
|
||||||
$table->data[0][15] = "<a href='index.php?search_category=helps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalHelps).'</a>';
|
$table->data[0][14] = html_print_image('images/policies.png', true, ['title' => __('Policies')]);
|
||||||
|
$table->data[0][15] = "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalPolicies).'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
|
|
||||||
@ -79,4 +86,5 @@ if ($searchAgents && $totalAgents > 0) {
|
|||||||
).'</a>';
|
).'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
200
pandora_console/operation/search_policies.getdata.php
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Pandora FMS - http://pandorafms.com
|
||||||
|
// ==================================================
|
||||||
|
// Copyright (c) 2005-2011 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.
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
enterprise_include_once('include/functions_policies.php');
|
||||||
|
|
||||||
|
|
||||||
|
$searchpolicies = check_acl($config['id'], 0, 'AW');
|
||||||
|
|
||||||
|
$selectpolicieIDUp = '';
|
||||||
|
$selectpolicieIDDown = '';
|
||||||
|
$selectNameUp = '';
|
||||||
|
$selectNameDown = '';
|
||||||
|
$selectDescriptionUp = '';
|
||||||
|
$selectDescriptionDown = '';
|
||||||
|
$selectId_groupUp = '';
|
||||||
|
$selectId_groupDown = '';
|
||||||
|
$selectStatusUp = '';
|
||||||
|
$selectStatusDown = '';
|
||||||
|
|
||||||
|
switch ($sortField) {
|
||||||
|
case 'id':
|
||||||
|
switch ($sort) {
|
||||||
|
case 'up':
|
||||||
|
$selectpolicieIDUp = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'id',
|
||||||
|
'order' => 'ASC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'down':
|
||||||
|
$selectpolicieIDDown = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'id',
|
||||||
|
'order' => 'DESC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'name':
|
||||||
|
switch ($sort) {
|
||||||
|
case 'up':
|
||||||
|
$selectNameUp = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'name',
|
||||||
|
'order' => 'ASC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'down':
|
||||||
|
$selectNameDown = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'name',
|
||||||
|
'order' => 'DESC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'description':
|
||||||
|
switch ($sort) {
|
||||||
|
case 'up':
|
||||||
|
$selectId_groupUp = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'description',
|
||||||
|
'order' => 'ASC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'down':
|
||||||
|
$selectDescriptionDown = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'description',
|
||||||
|
'order' => 'DESC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'last_contact':
|
||||||
|
switch ($sort) {
|
||||||
|
case 'up':
|
||||||
|
$selectId_groupUp = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'last_connect',
|
||||||
|
'order' => 'ASC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'down':
|
||||||
|
$selectId_groupDown = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'last_connect',
|
||||||
|
'order' => 'DESC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'id_group':
|
||||||
|
switch ($sort) {
|
||||||
|
case 'up':
|
||||||
|
$selectId_groupUp = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'last_connect',
|
||||||
|
'order' => 'ASC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'down':
|
||||||
|
$selectId_groupDown = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'last_connect',
|
||||||
|
'order' => 'DESC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'status':
|
||||||
|
switch ($sort) {
|
||||||
|
case 'up':
|
||||||
|
$selectStatusUp = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'is_admin',
|
||||||
|
'order' => 'ASC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'down':
|
||||||
|
$selectStatusDown = $selected;
|
||||||
|
$order = [
|
||||||
|
'field' => 'is_admin',
|
||||||
|
'order' => 'DESC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$selectpolicieIDUp = $selected;
|
||||||
|
$selectpolicieIDDown = '';
|
||||||
|
$selectNameUp = '';
|
||||||
|
$selectNameDown = '';
|
||||||
|
$selectDescriptionUp = '';
|
||||||
|
$selectDescriptionDown = '';
|
||||||
|
$selectId_groupUp = '';
|
||||||
|
$selectId_groupDown = '';
|
||||||
|
$selectStatusUp = '';
|
||||||
|
$selectStatusDown = '';
|
||||||
|
|
||||||
|
$order = [
|
||||||
|
'field' => 'id',
|
||||||
|
'order' => 'ASC',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($searchpolicies == 0) {
|
||||||
|
/*
|
||||||
|
We take the user groups to get policies that meet the requirements of the search
|
||||||
|
and which the user have permission on this groups
|
||||||
|
*/
|
||||||
|
$user_groups = users_get_groups($config['id_user'], 'AR', false);
|
||||||
|
$id_user_groups = array_keys($user_groups);
|
||||||
|
$id_user_groups_str = implode(',', $id_user_groups);
|
||||||
|
|
||||||
|
$sql = "SELECT id, name, description, id_group, status
|
||||||
|
FROM tpolicies
|
||||||
|
WHERE name LIKE '$stringSearchSQL'
|
||||||
|
AND id_group IN ($id_user_groups_str)";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0);
|
||||||
|
|
||||||
|
$policies = db_process_sql($sql);
|
||||||
|
|
||||||
|
if ($policies !== false) {
|
||||||
|
$totalPolicies = count($policies);
|
||||||
|
|
||||||
|
if ($only_count) {
|
||||||
|
unset($policies);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$totalPolicies = 0;
|
||||||
|
}
|
90
pandora_console/operation/search_policies.php
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Pandora FMS - http://pandorafms.com
|
||||||
|
// ==================================================
|
||||||
|
// Copyright (c) 2005-2011 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.
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
enterprise_include_once('include/functions_policies.php');
|
||||||
|
require_once $config['homedir'].'/enterprise/include/functions_groups.php';
|
||||||
|
|
||||||
|
$searchpolicies = check_acl($config['id_user'], 0, 'AW');
|
||||||
|
|
||||||
|
if (!$policies || !$searchpolicies) {
|
||||||
|
echo "<br><div class='nf'>".__('Zero results found')."</div>\n";
|
||||||
|
} else {
|
||||||
|
$table->cellpadding = 4;
|
||||||
|
$table->cellspacing = 4;
|
||||||
|
$table->width = '98%';
|
||||||
|
$table->class = 'databox';
|
||||||
|
|
||||||
|
$table->align = [];
|
||||||
|
$table->align[4] = 'center';
|
||||||
|
|
||||||
|
$table->head = [];
|
||||||
|
// $table->head[0] = __('ID').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectpolicieIDUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectpolicieIDDown]).'</a>';
|
||||||
|
$table->head[0] = __('Name').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>';
|
||||||
|
$table->head[1] = __('Description').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectDescriptionUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectDescriptionDown]).'</a>';
|
||||||
|
$table->head[2] = __('Id_group').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectId_groupUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectId_groupDown]).'</a>';
|
||||||
|
$table->head[3] = __('Status').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectstatusDown]).'</a>';
|
||||||
|
|
||||||
|
$table->data = [];
|
||||||
|
|
||||||
|
foreach ($policies as $policie) {
|
||||||
|
$policieIDCell = "<a href='?sec=gmodules&sec2=enterprise/godmode/policies/policies&id=".$policies['id']."'>".$policies['id'].'</a>';
|
||||||
|
|
||||||
|
switch ($policie['status']) {
|
||||||
|
case POLICY_UPDATED:
|
||||||
|
$status = html_print_image(
|
||||||
|
'images/policies_ok.png',
|
||||||
|
true,
|
||||||
|
['title' => __('Policy updated')]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case POLICY_PENDING_DATABASE:
|
||||||
|
$status = html_print_image(
|
||||||
|
'images/policies_error_db.png',
|
||||||
|
true,
|
||||||
|
['title' => __('Pending update policy only database')]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case POLICY_PENDING_ALL:
|
||||||
|
$status = html_print_image(
|
||||||
|
'images/policies_error.png',
|
||||||
|
true,
|
||||||
|
['title' => __('Pending update policy')]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$url = $config['homeurl'].'/index.php?'.'sec=gmodules&'.'sec2=enterprise/godmode/policies/policies&id='.$policie['id'].'';
|
||||||
|
|
||||||
|
array_push(
|
||||||
|
$table->data,
|
||||||
|
[
|
||||||
|
// $policie['id'],
|
||||||
|
'<a href= '.$url.'>'.$policie['name'].'',
|
||||||
|
$policie['description'],
|
||||||
|
ui_print_group_icon($policie['id_group'], true),
|
||||||
|
$status,
|
||||||
|
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$totalPolicies = count($policies);
|
||||||
|
echo '<br />';
|
||||||
|
html_print_table($table);
|
||||||
|
unset($table);
|
||||||
|
ui_pagination($totalPolicies);
|
||||||
|
}
|
@ -18,7 +18,7 @@ require_once $config['homedir'].'/include/functions_reporting.php';
|
|||||||
enterprise_include('operation/reporting/custom_reporting.php');
|
enterprise_include('operation/reporting/custom_reporting.php');
|
||||||
|
|
||||||
$searchAgents = $searchAlerts = $searchModules = check_acl($config['id_user'], 0, 'AR');
|
$searchAgents = $searchAlerts = $searchModules = check_acl($config['id_user'], 0, 'AR');
|
||||||
$searchUsers = check_acl($config['id_user'], 0, 'UM');
|
$searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'AW');
|
||||||
$searchMaps = $searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'IR');
|
$searchMaps = $searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'IR');
|
||||||
$searchMain = true;
|
$searchMain = true;
|
||||||
$searchHelps = true;
|
$searchHelps = true;
|
||||||
@ -43,6 +43,7 @@ if ($config['search_category'] == 'all') {
|
|||||||
// INI SECURITY ACL
|
// INI SECURITY ACL
|
||||||
if ((!$searchAgents && !$searchUsers && !$searchMaps)
|
if ((!$searchAgents && !$searchUsers && !$searchMaps)
|
||||||
|| (!$searchUsers && $searchTab == 'users')
|
|| (!$searchUsers && $searchTab == 'users')
|
||||||
|
|| (!$searchPolicies && $searchTab == 'policies')
|
||||||
|| (!$searchAgents && ($searchTab == 'agents' || $searchTab == 'alerts'))
|
|| (!$searchAgents && ($searchTab == 'agents' || $searchTab == 'alerts'))
|
||||||
|| (!$searchGraphs && ($searchTab == 'graphs' || $searchTab == 'maps' || $searchTab == 'reports'))
|
|| (!$searchGraphs && ($searchTab == 'graphs' || $searchTab == 'maps' || $searchTab == 'reports'))
|
||||||
) {
|
) {
|
||||||
@ -161,17 +162,17 @@ if ($searchModules) {
|
|||||||
$modules_tab = '';
|
$modules_tab = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($searchHelps) {
|
if ($searchPolicies) {
|
||||||
$helps_tab = [
|
$policies_tab = [
|
||||||
'text' => "<a href='index.php?search_category=helps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
'text' => "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
||||||
'images/help_w.png',
|
'images/policies.png',
|
||||||
true,
|
true,
|
||||||
['title' => __('Helps')]
|
['title' => __('Policies')]
|
||||||
).'</a>',
|
).'</a>',
|
||||||
'active' => $searchTab == 'helps',
|
'active' => $searchTab == 'policies',
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
$helps_tab = '';
|
$policies_tab = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$onheader = [
|
$onheader = [
|
||||||
@ -183,7 +184,7 @@ $onheader = [
|
|||||||
'graphs' => $graphs_tab,
|
'graphs' => $graphs_tab,
|
||||||
'reports' => $reports_tab,
|
'reports' => $reports_tab,
|
||||||
'maps' => $maps_tab,
|
'maps' => $maps_tab,
|
||||||
'helps' => $helps_tab,
|
'policies' => $policies_tab,
|
||||||
];
|
];
|
||||||
|
|
||||||
ui_print_page_header(
|
ui_print_page_header(
|
||||||
@ -212,6 +213,7 @@ switch ($searchTab) {
|
|||||||
include_once 'search_maps.getdata.php';
|
include_once 'search_maps.getdata.php';
|
||||||
include_once 'search_modules.getdata.php';
|
include_once 'search_modules.getdata.php';
|
||||||
include_once 'search_helps.getdata.php';
|
include_once 'search_helps.getdata.php';
|
||||||
|
include_once 'search_policies.getdata.php';
|
||||||
|
|
||||||
include_once 'search_main.php';
|
include_once 'search_main.php';
|
||||||
break;
|
break;
|
||||||
@ -251,8 +253,9 @@ switch ($searchTab) {
|
|||||||
include_once 'search_modules.php';
|
include_once 'search_modules.php';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'helps':
|
case 'policies':
|
||||||
include_once 'search_helps.getdata.php';
|
include_once 'search_policies.getdata.php';
|
||||||
include_once 'search_helps.php';
|
include_once 'search_policies.php';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.736
|
%define version 7.0NG.736
|
||||||
%define release 190711
|
%define release 190717
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.736
|
%define version 7.0NG.736
|
||||||
%define release 190711
|
%define release 190717
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.736
|
%define version 7.0NG.736
|
||||||
%define release 190711
|
%define release 190717
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name apache2
|
%define httpd_name apache2
|
||||||
|
@ -1437,7 +1437,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
|
|||||||
`type` varchar(30) default 'simple_graph',
|
`type` varchar(30) default 'simple_graph',
|
||||||
`period` int(11) NOT NULL default 0,
|
`period` int(11) NOT NULL default 0,
|
||||||
`order` int (11) NOT NULL default 0,
|
`order` int (11) NOT NULL default 0,
|
||||||
`name` varchar(150) NULL,
|
`name` varchar(300) NULL,
|
||||||
`description` mediumtext,
|
`description` mediumtext,
|
||||||
`id_agent` int(10) unsigned NOT NULL default 0,
|
`id_agent` int(10) unsigned NOT NULL default 0,
|
||||||
`text` TEXT,
|
`text` TEXT,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-server
|
package: pandorafms-server
|
||||||
Version: 7.0NG.736-190711
|
Version: 7.0NG.736-190717
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
pandora_version="7.0NG.736-190711"
|
pandora_version="7.0NG.736-190717"
|
||||||
|
|
||||||
package_cpan=0
|
package_cpan=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -601,6 +601,9 @@ syslog_threads 2
|
|||||||
# Maximum number of lines queued by the Syslog Server's producer on each run (PANDORA FMS ENTERPRISE ONLY).
|
# Maximum number of lines queued by the Syslog Server's producer on each run (PANDORA FMS ENTERPRISE ONLY).
|
||||||
syslog_max 65535
|
syslog_max 65535
|
||||||
|
|
||||||
|
# Sync Server
|
||||||
|
#syncserver
|
||||||
|
|
||||||
# Port tentacle server
|
# Port tentacle server
|
||||||
#sync_port 41121
|
#sync_port 41121
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||||||
|
|
||||||
# version: Defines actual version of Pandora Server for this module only
|
# version: Defines actual version of Pandora Server for this module only
|
||||||
my $pandora_version = "7.0NG.736";
|
my $pandora_version = "7.0NG.736";
|
||||||
my $pandora_build = "190711";
|
my $pandora_build = "190717";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
# Setup hash
|
# Setup hash
|
||||||
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
|||||||
|
|
||||||
# version: Defines actual version of Pandora Server for this module only
|
# version: Defines actual version of Pandora Server for this module only
|
||||||
my $pandora_version = "7.0NG.736";
|
my $pandora_version = "7.0NG.736";
|
||||||
my $pandora_build = "190711";
|
my $pandora_build = "190717";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_server
|
%define name pandorafms_server
|
||||||
%define version 7.0NG.736
|
%define version 7.0NG.736
|
||||||
%define release 190711
|
%define release 190717
|
||||||
|
|
||||||
Summary: Pandora FMS Server
|
Summary: Pandora FMS Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_server
|
%define name pandorafms_server
|
||||||
%define version 7.0NG.736
|
%define version 7.0NG.736
|
||||||
%define release 190711
|
%define release 190717
|
||||||
|
|
||||||
Summary: Pandora FMS Server
|
Summary: Pandora FMS Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.736"
|
PI_VERSION="7.0NG.736"
|
||||||
PI_BUILD="190711"
|
PI_BUILD="190717"
|
||||||
|
|
||||||
MODE=$1
|
MODE=$1
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
|||||||
use PandoraFMS::DB;
|
use PandoraFMS::DB;
|
||||||
|
|
||||||
# version: define current version
|
# version: define current version
|
||||||
my $version = "7.0NG.736 PS190711";
|
my $version = "7.0NG.736 PS190717";
|
||||||
|
|
||||||
# Pandora server configuration
|
# Pandora server configuration
|
||||||
my %conf;
|
my %conf;
|
||||||
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||||||
Encode::Locale::decode_argv;
|
Encode::Locale::decode_argv;
|
||||||
|
|
||||||
# version: define current version
|
# version: define current version
|
||||||
my $version = "7.0NG.736 PS190711";
|
my $version = "7.0NG.736 PS190717";
|
||||||
|
|
||||||
# save program name for logging
|
# save program name for logging
|
||||||
my $progname = basename($0);
|
my $progname = basename($0);
|
||||||
|