mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Merge
This commit is contained in:
commit
4c874e152c
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, AIX version
|
||||
# Version 7.0NG.735, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, FreeBSD Version
|
||||
# Version 7.0NG.735, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, HP-UX Version
|
||||
# Version 7.0NG.735, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, GNU/Linux
|
||||
# Version 7.0NG.735, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, GNU/Linux
|
||||
# Version 7.0NG.735, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, Solaris Version
|
||||
# Version 7.0NG.735, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2010 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.734
|
||||
# Version 7.0NG.735
|
||||
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.734, AIX version
|
||||
# Version 7.0NG.735, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.734
|
||||
# Version 7.0NG.735
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.734, HPUX Version
|
||||
# Version 7.0NG.735, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734
|
||||
# Version 7.0NG.735
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734
|
||||
# Version 7.0NG.735
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734
|
||||
# Version 7.0NG.735
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.734, Solaris version
|
||||
# Version 7.0NG.735, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, AIX version
|
||||
# Version 7.0NG.735, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.734-190509
|
||||
Version: 7.0NG.735-190523
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.734-190509"
|
||||
pandora_version="7.0NG.735-190523"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, GNU/Linux
|
||||
# Version 7.0NG.735, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, FreeBSD Version
|
||||
# Version 7.0NG.735, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, HP-UX Version
|
||||
# Version 7.0NG.735, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, GNU/Linux
|
||||
# Version 7.0NG.735, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, GNU/Linux
|
||||
# Version 7.0NG.735, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, NetBSD Version
|
||||
# Version 7.0NG.735, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.734, Solaris Version
|
||||
# Version 7.0NG.735, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -41,8 +41,8 @@ my $Sem = undef;
|
||||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.734';
|
||||
use constant AGENT_BUILD => '190509';
|
||||
use constant AGENT_VERSION => '7.0NG.735';
|
||||
use constant AGENT_BUILD => '190523';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.734
|
||||
%define release 190509
|
||||
%define version 7.0NG.735
|
||||
%define release 190523
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -2,8 +2,8 @@
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.734
|
||||
%define release 190509
|
||||
%define version 7.0NG.735
|
||||
%define release 190523
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -9,8 +9,8 @@
|
||||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.734"
|
||||
PI_BUILD="190509"
|
||||
PI_VERSION="7.0NG.735"
|
||||
PI_BUILD="190523"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2017 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.734
|
||||
# Version 7.0NG.735
|
||||
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
||||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.734}
|
||||
{Pandora FMS Windows Agent v7.0NG.735}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{190509}
|
||||
{190523}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.734(Build 190509)")
|
||||
#define PANDORA_VERSION ("7.0NG.735(Build 190523)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -11,7 +11,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.734(Build 190509))"
|
||||
VALUE "ProductVersion", "(7.0NG.735(Build 190523))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.734-190509
|
||||
Version: 7.0NG.735-190523
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.734-190509"
|
||||
pandora_version="7.0NG.735-190523"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -138,8 +138,15 @@ function mainAgentsAlerts()
|
||||
$onheader['combo_refr'] = $comborefr;
|
||||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header(__('Agents/Alerts'), 'images/op_alerts.png', false, '', false, $updated_time);
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Agents/Alerts'),
|
||||
'images/op_alerts.png',
|
||||
false,
|
||||
'agents_alerts_view',
|
||||
false,
|
||||
$updated_time
|
||||
);
|
||||
|
||||
// Old style table, we need a lot of special formatting,don't use table function
|
||||
// Prepare old-style table
|
||||
|
@ -181,8 +181,15 @@ function mainAgentsModules()
|
||||
// Old style table, we need a lot of special formatting,don't use table function
|
||||
// Prepare old-style table
|
||||
if ($config['pure'] == 0) {
|
||||
// Header
|
||||
ui_print_page_header(__('Agents/Modules'), 'images/module_mc.png', false, '', false, $updated_time);
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Agents/Modules'),
|
||||
'images/module_mc.png',
|
||||
false,
|
||||
'agents_module_view',
|
||||
false,
|
||||
$updated_time
|
||||
);
|
||||
echo '<table style="width:100%;">';
|
||||
echo '<tr>';
|
||||
echo "<td> <span style='float: right;'>".$fullscreen['text'].'</span> </td>';
|
||||
@ -826,4 +833,4 @@ $ignored_params['refresh'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
@ -25,7 +25,7 @@ function extension_db_status()
|
||||
__('DB Schema check'),
|
||||
'images/extensions.png',
|
||||
false,
|
||||
'',
|
||||
'db_status_tab',
|
||||
true,
|
||||
''
|
||||
);
|
||||
|
@ -192,7 +192,14 @@ function mainModuleGroups()
|
||||
$array_data[$value['id_grupo']][$value['id_mg']] = $value;
|
||||
}
|
||||
|
||||
ui_print_page_header(__('Combined table of agent group and module group'), 'images/module_group.png', false, '', false, '');
|
||||
ui_print_page_header(
|
||||
__('Combined table of agent group and module group'),
|
||||
'images/module_group.png',
|
||||
false,
|
||||
'module_groups_view',
|
||||
false,
|
||||
''
|
||||
);
|
||||
|
||||
echo "<table cellpadding='4' cellspacing='4' class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'>
|
||||
<tr>";
|
||||
|
@ -29,7 +29,14 @@ function pandora_realtime_graphs()
|
||||
|
||||
$hide_header = get_parameter('hide_header', 0);
|
||||
if (!$hide_header) {
|
||||
ui_print_page_header(__('Realtime graphs'), 'images/extensions.png', false, '', false, $onheader);
|
||||
ui_print_page_header(
|
||||
__('Realtime graphs'),
|
||||
'images/extensions.png',
|
||||
false,
|
||||
'real_time_view',
|
||||
false,
|
||||
$onheader
|
||||
);
|
||||
}
|
||||
|
||||
$chart[time()]['graph'] = '0';
|
||||
|
@ -998,20 +998,23 @@ function process_upload_xml($xml)
|
||||
{
|
||||
$hook_enterprise = enterprise_include('extensions/resource_registration/functions.php');
|
||||
|
||||
// Extract component
|
||||
// Extract component.
|
||||
process_upload_xml_component($xml);
|
||||
|
||||
$group_filter = get_parameter('group');
|
||||
|
||||
// Extract visual map
|
||||
// Extract visual map.
|
||||
process_upload_xml_visualmap($xml, $group_filter);
|
||||
|
||||
// Extract policies
|
||||
// Extract policies.
|
||||
if ($hook_enterprise === true) {
|
||||
process_upload_xml_policy($xml, $group_filter);
|
||||
$centralized_management = !is_central_policies_on_node();
|
||||
if ($centralized_management) {
|
||||
process_upload_xml_policy($xml, $group_filter);
|
||||
}
|
||||
}
|
||||
|
||||
// Extract reports
|
||||
// Extract reports.
|
||||
process_upload_xml_report($xml, $group_filter);
|
||||
}
|
||||
|
||||
@ -1038,6 +1041,11 @@ function resource_registration_extension_main()
|
||||
return;
|
||||
}
|
||||
|
||||
$centralized_management = !is_central_policies_on_node();
|
||||
if (!$centralized_management) {
|
||||
ui_print_warning_message(__('This node is configured with centralized mode. Go to metaconsole to create a policy.'));
|
||||
}
|
||||
|
||||
echo '<div class=notify>';
|
||||
echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'<br> <br>'.__("You can get more resurces in our <a href='http://pandorafms.com/Library/Library/'>Public Resource Library</a>");
|
||||
echo '</div>';
|
||||
|
@ -1,3 +1,3 @@
|
||||
/godmode/servers/recon_script.php
|
||||
/godmode/servers/manage_recontask_form.php
|
||||
/godmode/servers/manage_recontask.php
|
||||
/general/login_identification_wizard.php
|
||||
/general/login_required.php
|
||||
/godmode/update_manager/update_manager.messages.php
|
@ -1,6 +1,20 @@
|
||||
START TRANSACTION;
|
||||
|
||||
DELETE FROM 'tevent_response' WHERE 'name' LIKE 'Create Integria IMS incident from event';
|
||||
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
|
||||
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
|
||||
|
||||
ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
|
||||
|
||||
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
|
||||
|
||||
DELETE FROM `tevent_response` WHERE `name` LIKE 'Create Integria IMS incident from event';
|
||||
INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (1,'admin','Welcome to Pandora FMS Console', '&lt;p style="text-align: center; font-size: 13px;"&gt;Hello, congratulations, if you've arrived here you already have an operational monitoring console. Remember that our forums and online documentation are available 24x7 to get you out of any trouble. You can replace this message with a personalized one at Admin tools -&amp;gt; Site news.&lt;/p&gt; ',NOW());
|
||||
|
||||
|
||||
INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="Official communication"), "admin", 1, 0);
|
||||
UPDATE `tnotification_source` SET `enabled`=1 WHERE `description` = 'System status' OR `description` = 'Official communication';
|
||||
UPDATE `tnotification_source` SET `icon`="icono_logo_pandora.png" WHERE `description` = 'Official communication';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tvisual_console_items_cache`
|
||||
@ -25,4 +39,4 @@ CREATE TABLE IF NOT EXISTS `tvisual_console_elements_cache` (
|
||||
|
||||
ALTER TABLE `tlayout_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
|
||||
|
||||
COMMIT;
|
||||
COMMIT;
|
||||
|
@ -122,7 +122,7 @@ function execution_time()
|
||||
if ($times[0]['datos'] > ($times[1]['datos'] * 1.2)) {
|
||||
return "<a class= 'content' style= 'color: red;'>Warning Status</a><a>   The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph</a>";
|
||||
} else {
|
||||
return "<a style ='color: green;'>Normal Status</a><a>   The execution time is correct. For a more extensive information of this data consult the Execution Time graph</a>";
|
||||
return "<a style ='color: green;'>Normal Status</a><a>   The execution time is correct. For more information about this data, check the Execution Time graph</a>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,9 +173,9 @@ function license_capacity()
|
||||
$status_license_capacity = '';
|
||||
$current_count = db_get_value_sql('SELECT count(*) FROM tagente');
|
||||
if ($current_count > ($license_limit * 90 / 100)) {
|
||||
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   The license capacity is more than 90 percent</a>";
|
||||
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   License capacity exceeds 90 percent</a>";
|
||||
} else {
|
||||
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The license capacity is less than 90 percent</a>";
|
||||
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   License capacity is less than 90 percent</a>";
|
||||
}
|
||||
|
||||
return $status_license_capacity;
|
||||
@ -202,9 +202,9 @@ function interval_average_of_network_modules()
|
||||
$average_time = ((int) $total_module_interval_time / $total_network_modules);
|
||||
|
||||
if ($average_time < 180) {
|
||||
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   The system has a lot of load (average time $average_time) and a very fine configuration is required</a>";
|
||||
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   The system is overloaded (average time $average_time) and a very fine configuration is required</a>";
|
||||
} else {
|
||||
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The system has an acceptable charge (average time $average_time) </a>";
|
||||
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The system is not overloaded (average time $average_time) </a>";
|
||||
}
|
||||
|
||||
if ($average_time == 0) {
|
||||
@ -221,9 +221,9 @@ $attachment_total_files = count(glob($config['homedir'].'/attachment/{*.*}', GLO
|
||||
function files_attachment_folder($total_files)
|
||||
{
|
||||
if ($total_files <= 700) {
|
||||
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The attachment folder has less than 700 files.</a>";
|
||||
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The attached folder contains less than 700 files.</a>";
|
||||
} else {
|
||||
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   The attachment folder has more than 700 files.</a>";
|
||||
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   The attached folder contains more than 700 files.</a>";
|
||||
}
|
||||
|
||||
return $status_total_files;
|
||||
@ -236,9 +236,9 @@ $tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
|
||||
function status_tagente_datos($tagente_datos_size)
|
||||
{
|
||||
if ($tagente_datos_size <= 3000000) {
|
||||
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The tagente_datos table has an acceptable amount of data.</a>";
|
||||
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The tagente_datos table contains an acceptable amount of data.</a>";
|
||||
} else {
|
||||
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>   The tagente_datos table has too much data. A historical database is recommended.</a>";
|
||||
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>   The tagente_datos table contains too much data. A historical database is recommended.</a>";
|
||||
}
|
||||
|
||||
return $tagente_datos_size;
|
||||
@ -295,16 +295,16 @@ $key_buffer_size_min_rec_value = 256;
|
||||
$read_buffer_size_min_rec_value = 32;
|
||||
$read_rnd_buffer_size_min_rec_value = 32;
|
||||
$query_cache_min_res_unit_min_rec_value = 2;
|
||||
$innodb_file_per_table_min_rec_value = 0;
|
||||
$innodb_file_per_table_min_rec_value = 1;
|
||||
|
||||
|
||||
function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation)
|
||||
{
|
||||
$status_tables_frag = '';
|
||||
if ($tables_fragmentation > $tables_fragmentation_max_rec_value) {
|
||||
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   The fragmentation tables is higher than recommended. You should defragment them.</a>";
|
||||
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   Table fragmentation is higher than recommended. They should be defragmented.</a>";
|
||||
} else {
|
||||
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The fragmentation tables is correct.</a>";
|
||||
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   Table fragmentation is correct.</a>";
|
||||
}
|
||||
|
||||
return $status_tables_frag;
|
||||
@ -320,9 +320,9 @@ if ($console_mode == 1) {
|
||||
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
|
||||
|
||||
if ($argc == 1 || in_array($argv[1], ['--help', '-help', '-h', '-?'])) {
|
||||
echo "\nThis command line script gives information about Pandora FMS database.
|
||||
This program only can be executed from console, and need a parameter, the
|
||||
full path to Pandora FMS 'config.php' file.
|
||||
echo "\nThis command line script contains information about Pandora FMS database.
|
||||
This program can only be executed from the console, and it needs a parameter, the
|
||||
full path to Pandora FMS 'config.php' file.
|
||||
|
||||
Usage:
|
||||
php pandora_diag.php path_to_pandora_console
|
||||
@ -345,15 +345,21 @@ full path to Pandora FMS 'config.php' file.
|
||||
include '../include/config.php';
|
||||
}
|
||||
|
||||
// Not from console, this is a web session
|
||||
if ((!isset($config['id_user'])) or (!check_acl($config['id_user'], 0, 'PM'))) {
|
||||
// Not from console, this is a web session.
|
||||
if ((!isset($config['id_user'])) || (!check_acl($config['id_user'], 0, 'PM'))) {
|
||||
echo "<h2>You don't have privileges to use diagnostic tool</h2>";
|
||||
echo '<p>Please login with an administrator account before try to use this tool</p>';
|
||||
exit;
|
||||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header(__('Pandora FMS Diagnostic tool'), '', false, '', true);
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Pandora FMS Diagnostic tool'),
|
||||
'',
|
||||
false,
|
||||
'diagnostic_tool_tab',
|
||||
true
|
||||
);
|
||||
|
||||
echo "<table width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Pandora status info').'</th></tr>';
|
||||
@ -678,7 +684,7 @@ render_info_data(
|
||||
$read_rnd_buffer_size = (db_get_value_sql('SELECT @@read_rnd_buffer_size') / 1024);
|
||||
$query_cache_min_res_unit = (db_get_value_sql('SELECT @@query_cache_min_res_unit') / 1024);
|
||||
$innodb_file_per_table = db_get_value_sql('SELECT @@innodb_file_per_table');
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('MySQL Performance metrics').'</th></tr>';
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('MySQL Performance metrics').' '.ui_print_help_icon('performance_metrics_tab', true).'</th></tr>';
|
||||
|
||||
render_row(status_values($innodb_log_file_size_min_rec_value, $innodb_log_file_size), 'InnoDB log file size ', 'InnoDB log file size ');
|
||||
render_row(status_values($innodb_log_buffer_size_min_rec_value, $innodb_log_buffer_size), 'InnoDB log buffer size ', 'InnoDB log buffer size ');
|
||||
@ -705,7 +711,7 @@ render_info_data(
|
||||
|
||||
render_row($tables_fragmentation_max_rec_value.'%', 'Tables fragmentation (maximum recommended value)');
|
||||
render_row(number_format($tables_fragmentation, 2).'%', 'Tables fragmentation (current value)');
|
||||
render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Status fragmentation tables');
|
||||
render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Table fragmentation status');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS logs dates').'</th></tr>';
|
||||
|
||||
@ -734,14 +740,14 @@ render_info_data(
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Status of the attachment folder').'</th></tr>';
|
||||
|
||||
render_row($attachment_total_files, 'Total files in the attachment folder');
|
||||
render_row($attachment_total_files, 'Total files in the attached folder');
|
||||
render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Information from the tagente_datos table').'</th></tr>';
|
||||
|
||||
render_row($tagente_datos_size, 'Total data in the tagente_datos table');
|
||||
render_row(status_tagente_datos($tagente_datos_size), 'Status of the tagente_datos table');
|
||||
render_row(execution_time(), 'Degradation of the execution time when executing a count');
|
||||
render_row($tagente_datos_size, 'Total data in tagente_datos table');
|
||||
render_row(status_tagente_datos($tagente_datos_size), 'Tangente_datos table status');
|
||||
render_row(execution_time(), 'Execution time degradation when executing a count');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS server threads').'</th></tr>';
|
||||
|
||||
@ -784,6 +790,6 @@ render_info_data(
|
||||
echo "<hr color='#b1b1b1' size=1 width=1000 align=left>";
|
||||
|
||||
echo '<span>'.__(
|
||||
'(*) Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\' very important to
|
||||
keep up-to-date database to get the best performance and results in Pandora'
|
||||
'(*) Please check your Pandora Server setup and make sure that the database maintenance daemon is running. It\' is very important to
|
||||
keep the database up-to-date to get the best performance and results in Pandora'
|
||||
).'</span><br><br><br>';
|
||||
|
@ -761,6 +761,23 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
|
||||
PRIMARY KEY(`id_rc`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tnews`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tnews` (
|
||||
`id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`author` varchar(255) NOT NULL DEFAULT '',
|
||||
`subject` varchar(255) NOT NULL DEFAULT '',
|
||||
`text` TEXT NOT NULL,
|
||||
`timestamp` DATETIME NOT NULL DEFAULT 0,
|
||||
`id_group` int(10) NOT NULL default 0,
|
||||
`modal` tinyint(1) DEFAULT 0,
|
||||
`expire` tinyint(1) DEFAULT 0,
|
||||
`expire_timestamp` DATETIME NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY(`id_news`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
ALTER TABLE treport_content_template ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE treport_content_template ADD COLUMN `lapse_calc` tinyint(1) default '0';
|
||||
ALTER TABLE treport_content_template ADD COLUMN `lapse` int(11) default '300';
|
||||
@ -778,6 +795,7 @@ ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_ok_status` TINYINT(
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
|
||||
@ -1197,6 +1215,7 @@ ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "
|
||||
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria IMS Ticket';
|
||||
UPDATE `talert_commands` SET `description` = 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:
_field1_ as destination email address, and
_field2_ as subject for message. 
_field3_ as text of message. 
_field4_ as content type (text/plain or html/text).', `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"Content Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id=1;
|
||||
ALTER TABLE `talert_commands` ADD COLUMN `id_group` mediumint(8) unsigned NULL default 0;
|
||||
ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
|
||||
|
||||
UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1;
|
||||
|
||||
@ -1216,13 +1235,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 27);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 28);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
|
||||
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
|
||||
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '734');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '735');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
@ -1393,7 +1412,6 @@ UPDATE treport_custom_sql SET `sql` = 'select t1.alias as agent_n
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `treport_content`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
ALTER TABLE treport_content ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE treport_content ADD COLUMN `lapse_calc` tinyint(1) default '0';
|
||||
ALTER TABLE treport_content ADD COLUMN `lapse` int(11) default '300';
|
||||
@ -1414,6 +1432,7 @@ ALTER TABLE `treport_content` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAUL
|
||||
ALTER TABLE `treport_content` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
|
||||
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';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmodule_relationship`
|
||||
@ -1987,7 +2006,7 @@ INSERT INTO `tnotification_source`(`description`, `icon`, `max_postpone_time`, `
|
||||
("Message", "icono_info_mr.png", 86400, 1, 1, 0),
|
||||
("Pending task", "icono_info_mr.png", 86400, 1, 1, 0),
|
||||
("Advertisement", "icono_info_mr.png", 86400, 1, 1, 0),
|
||||
("Official communication", "icono_info_mr.png", 86400, 1, 1, 0),
|
||||
("Official communication", "icono_logo_pandora.png", 86400, 1, 1, 0),
|
||||
("Sugerence", "icono_info_mr.png", 86400, 1, 1, 0);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
@ -2084,6 +2103,9 @@ INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fi
|
||||
INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="System status"), "admin", 1, 0);
|
||||
INSERT INTO `tnotification_source_group` SELECT `id`,0 FROM `tnotification_source` WHERE `description`="Message";
|
||||
INSERT INTO `tnotification_user` (`id_mensaje`, `id_user`) SELECT `id_mensaje`, `id_usuario_destino` FROM `tmensajes` WHERE `id_usuario_destino` != '';
|
||||
INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="Official communication"), "admin", 1, 0);
|
||||
UPDATE `tnotification_source` SET `enabled`=1 WHERE `description` = 'System status' OR `description` = 'Official communication';
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Add custom internal recon scripts
|
||||
-- ----------------------------------------------------------------------
|
||||
@ -2105,6 +2127,18 @@ ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
|
||||
-- ----------------------------------------------------------------------
|
||||
UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
|
||||
|
||||
------------------------------------------------------------------------
|
||||
------ ADD message in table 'tnews'
|
||||
------------------------------------------------------------------------
|
||||
|
||||
INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (1,'admin','Welcome to Pandora FMS Console', '&lt;p style="text-align: center; font-size: 13px;"&gt;Hello, congratulations, if you've arrived here you already have an operational monitoring console. Remember that our forums and online documentation are available 24x7 to get you out of any trouble. You can replace this message with a personalized one at Admin tools -&amp;gt; Site news.&lt;/p&gt; ',NOW());
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Alter table `talert_templates`
|
||||
-- ----------------------------------------------------------------------
|
||||
|
||||
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tvisual_console_items_cache`
|
||||
-- ---------------------------------------------------------------------
|
||||
@ -2124,4 +2158,5 @@ CREATE TABLE `tvisual_console_elements_cache` (
|
||||
FOREIGN KEY (`user_id`) REFERENCES `tusuario`(`id_user`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
@ -143,6 +143,57 @@ if ($config['menu_type'] == 'classic') {
|
||||
$_GET['sec2'] = '';
|
||||
}
|
||||
|
||||
if ($_GET['sec'] == 'main' || !isset($_GET['sec'])) {
|
||||
// home screen chosen by the user
|
||||
$home_page = '';
|
||||
if (isset($config['id_user'])) {
|
||||
$user_info = users_get_user_by_id($config['id_user']);
|
||||
$home_page = io_safe_output($user_info['section']);
|
||||
$home_url = $user_info['data_section'];
|
||||
}
|
||||
|
||||
if ($home_page != '') {
|
||||
switch ($home_page) {
|
||||
case 'Event list':
|
||||
$_GET['sec2'] = 'operation/events/events';
|
||||
break;
|
||||
|
||||
case 'Group view':
|
||||
$_GET['sec2'] = 'operation/agentes/group_view';
|
||||
break;
|
||||
|
||||
case 'Alert detail':
|
||||
$_GET['sec2'] = 'operation/agentes/alerts_status';
|
||||
break;
|
||||
|
||||
case 'Tactical view':
|
||||
$_GET['sec2'] = 'operation/agentes/tactical';
|
||||
break;
|
||||
|
||||
case 'Default':
|
||||
$_GET['sec2'] = 'general/logon_ok';
|
||||
break;
|
||||
|
||||
case 'Dashboard':
|
||||
$_GET['sec2'] = 'enterprise/dashboard/main_dashboard';
|
||||
break;
|
||||
|
||||
case 'Visual console':
|
||||
$_GET['sec2'] = 'operation/visual_console/render_view';
|
||||
break;
|
||||
|
||||
case 'Other':
|
||||
$home_url = io_safe_output($home_url);
|
||||
$url_array = parse_url($home_url);
|
||||
parse_str($url_array['query'], $res);
|
||||
foreach ($res as $key => $param) {
|
||||
$_GET[$key] = $param;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_GET['refr'])) {
|
||||
$_GET['refr'] = null;
|
||||
}
|
||||
@ -212,14 +263,21 @@ if ($config['menu_type'] == 'classic') {
|
||||
);
|
||||
$autorefresh_additional .= '</span>';
|
||||
unset($values);
|
||||
|
||||
$autorefresh_link_open_img = '<a class="white autorefresh" href="'.ui_get_url_refresh($ignored_params).'">';
|
||||
if ($home_page != '') {
|
||||
$autorefresh_link_open_img = '<a class="white autorefresh" href="index.php?refr=">';
|
||||
} else {
|
||||
$autorefresh_link_open_img = '<a class="white autorefresh" href="'.ui_get_url_refresh($ignored_params).'">';
|
||||
}
|
||||
|
||||
if ($_GET['refr']
|
||||
|| ((isset($select[0]['time_autorefresh']) === true)
|
||||
&& $select[0]['time_autorefresh'] !== 0)
|
||||
) {
|
||||
$autorefresh_link_open_txt = '<a class="autorefresh autorefresh_txt" href="'.ui_get_url_refresh($ignored_params).'">';
|
||||
if ($home_page != '') {
|
||||
$autorefresh_link_open_txt = '<a class="autorefresh autorefresh_txt" href="index.php?refr=">';
|
||||
} else {
|
||||
$autorefresh_link_open_txt = '<a class="autorefresh autorefresh_txt" href="'.ui_get_url_refresh($ignored_params).'">';
|
||||
}
|
||||
} else {
|
||||
$autorefresh_link_open_txt = '<a>';
|
||||
}
|
||||
@ -614,7 +672,7 @@ if ($config['menu_type'] == 'classic') {
|
||||
if ($_GET['refr'] || $do_refresh === true) {
|
||||
?>
|
||||
$("#header_autorefresh").css('padding-right', '5px');
|
||||
var refr_time = <?php echo (int) get_parameter('refr', 0); ?>;
|
||||
var refr_time = <?php echo (int) get_parameter('refr', $config['refr']); ?>;
|
||||
var t = new Date();
|
||||
t.setTime (t.getTime () + parseInt(<?php echo ($config['refr'] * 1000); ?>));
|
||||
$("#refrcounter").countdown ({
|
||||
|
@ -1,455 +0,0 @@
|
||||
<?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.
|
||||
|
||||
/**
|
||||
* @package General
|
||||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
|
||||
function display_register($data)
|
||||
{
|
||||
if ($data['instance_registered'] == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($data['force_register'] == 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($data['force_register'] == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($data['identification_reminder'] == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isset($data['identification_reminder_timestamp'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($data['identification_reminder_timestamp'] < time()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function display_newsletter($data)
|
||||
{
|
||||
if ($data['newsletter_subscribed'] == 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($data['force_newsletter'] == 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($data['force_newsletter'] == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($data['newsletter_reminder'] === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isset($data['newsletter_reminder_timestamp'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!is_numeric($data['newsletter_reminder_timestamp'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($data['newsletter_reminder_timestamp'] < time()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (is_ajax()) {
|
||||
include_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
|
||||
$open_wizard = get_parameter('open_wizard', 0);
|
||||
$not_return = get_parameter('not_return', 0);
|
||||
$reset_initial_wizard = get_parameter('reset_initial_wizard', 0);
|
||||
|
||||
if ($reset_initial_wizard) {
|
||||
config_update_value('initial_wizard', 0);
|
||||
}
|
||||
|
||||
if ($open_wizard) {
|
||||
$register_pandora = get_parameter('register_pandora', 0);
|
||||
$newsletter = get_parameter('newsletter', 0);
|
||||
$forced = get_parameter('forced', 0);
|
||||
$future_8_days = (time() + 8 * SECONDS_1DAY);
|
||||
$ui_feedback = [
|
||||
'status' => true,
|
||||
'message' => '',
|
||||
];
|
||||
|
||||
if ($register_pandora) {
|
||||
// Pandora register update
|
||||
$um_message = update_manager_register_instance();
|
||||
$ui_feedback['message'] .= $um_message['message'].'<br><br>';
|
||||
if ($um_message['success']) {
|
||||
config_update_value('instance_registered', 1);
|
||||
$ui_feedback['status'] = true && $ui_feedback['status'];
|
||||
} else {
|
||||
$ui_feedback['status'] = false;
|
||||
}
|
||||
} else if (!$forced) {
|
||||
config_update_value('identification_reminder_timestamp', $future_8_days);
|
||||
}
|
||||
|
||||
if ($newsletter) {
|
||||
// Pandora newsletter update
|
||||
$email = get_parameter('email', '');
|
||||
$um_message = update_manager_insert_newsletter($email);
|
||||
$ui_feedback['message'] .= $um_message['message'];
|
||||
if ($um_message['success']) {
|
||||
db_process_sql_update('tusuario', ['middlename' => 1], ['id_user' => $config['id_user']]);
|
||||
$ui_feedback['status'] = true && $ui_feedback['status'];
|
||||
} else {
|
||||
$ui_feedback['status'] = false;
|
||||
}
|
||||
} else if (!$forced) {
|
||||
db_process_sql_update('tusuario', ['lastname' => $future_8_days], ['id_user' => $config['id_user']]);
|
||||
}
|
||||
|
||||
// Form answer JSON
|
||||
$ui_feedback['status'] = $ui_feedback['status'] ? 1 : 0;
|
||||
echo io_json_mb_encode($ui_feedback);
|
||||
}
|
||||
|
||||
if (!$not_return) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if user is admin
|
||||
if (!license_free()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!users_is_admin($config['id_user'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get data to display properly the wizard
|
||||
$wizard_data = [];
|
||||
|
||||
$wizard_data['newsletter_subscribed'] = db_get_value('middlename', 'tusuario', 'id_user', $config['id_user']);
|
||||
// force_* = 1 -> force show
|
||||
// force_* = 0 -> force hide
|
||||
// force_* = -1 -> show or hide depends reminder and timestamp
|
||||
$wizard_data['force_newsletter'] = get_parameter('force_newsletter', -1);
|
||||
$wizard_data['newsletter_reminder'] = db_get_value('firstname', 'tusuario', 'id_user', $config['id_user']);
|
||||
$wizard_data['newsletter_reminder_timestamp'] = db_get_value('lastname', 'tusuario', 'id_user', $config['id_user']);
|
||||
|
||||
|
||||
$wizard_data['instance_registered'] = $config['instance_registered'];
|
||||
$wizard_data['force_register'] = get_parameter('force_register', -1);
|
||||
$wizard_data['identification_reminder'] = $config['identification_reminder'];
|
||||
$wizard_data['identification_reminder_timestamp'] = $config['identification_reminder_timestamp'];
|
||||
|
||||
$display_newsletter = display_newsletter($wizard_data);
|
||||
$display_register = display_register($wizard_data);
|
||||
$display_forced = ($wizard_data['force_newsletter'] != -1) || ($wizard_data['force_register'] != -1);
|
||||
|
||||
// Return if it is fully completed
|
||||
if ((!$display_register) && (!$display_newsletter)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$return_button = get_parameter('return_button', 0) == 1;
|
||||
|
||||
$email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']);
|
||||
// Avoid to show default email
|
||||
if ($email == 'admin@example.com') {
|
||||
$email = '';
|
||||
}
|
||||
|
||||
// Prints accept register license
|
||||
echo '<div id="login_accept_register" title="'.__('The %s community wizard', get_product_name()).'" style="">';
|
||||
echo '<div style="margin: 5px 0 10px; float: left; padding-left: 15px;">';
|
||||
echo html_print_image('images/pandora_circle_big.png', true);
|
||||
echo '</div>';
|
||||
echo '<div style="font-size: 12pt; margin: 5px 20px; float: left; padding-top: 23px;">';
|
||||
echo __('Stay up to date with the %s community', get_product_name()).'.';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div id="license_newsletter">';
|
||||
echo '<p>'.__('When you subscribe to the %s Update Manager service, you accept that we register your %s instance as an identifier on the database owned by Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the Update Manager options.', get_product_name(), get_product_name(), get_product_name()).'</p>';
|
||||
echo '<p>'.__('In the same fashion, when subscribed to the newsletter you accept that your email will pass on to a database property of Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the newsletter subscription options.', get_product_name()).'</p>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; padding-top:10px; position:relative; border: 1px solid #FFF;">';
|
||||
echo '<div style="float: right;">';
|
||||
html_print_submit_button(__('Finish'), 'finish_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
|
||||
echo '</div>';
|
||||
$display_status_return = $return_button ? 'block' : 'none';
|
||||
echo '<div style="float: right; width: 20%; display: '.$display_status_return.';">';
|
||||
html_print_submit_button(__('Return'), 'return_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '<div style="float: left; margin-left: 0px; width: 50%; text-align: left;">';
|
||||
html_print_checkbox('register', 1, false, false, false, 'cursor: \'pointer\'');
|
||||
echo ' <span style="font-size: 12px;" id="label-register">'.__('Join the %s community!', get_product_name()).'!</span><br>';
|
||||
html_print_checkbox('newsletter', 1, false, false, false, 'cursor: \'pointer\'');
|
||||
echo ' <span style="font-size: 12px;" id="label-newsletter">'.__('Subscribe to our newsletter').'</span>';
|
||||
echo '<br>';
|
||||
echo '<div id="email_container">';
|
||||
echo ' <span id="label-email-newsletter"style="font-size: 12px; display: none">'.__('Email').': </span>';
|
||||
html_print_input_text_extended('email-newsletter', $email, 'text-email-newsletter', '', 30, 255, false, '', ['style' => 'display:none; width: 200px;']);
|
||||
echo ' <span id="label-email-newsletter"style="font-size: 12px; display: none">'.__('Email').': </span>';
|
||||
echo ' <span id="required-email-newsletter">*'.__('Required').' </span>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
// Print yes or not dialog
|
||||
echo '<div id="login_registration_yesno" title="'.__('%s instance identification wizard', get_product_name()).'" style="">';
|
||||
echo '<div style="font-size: 12pt; margin: 20px;">';
|
||||
echo __('Do you want to continue without any registration').'?';
|
||||
echo '</div>';
|
||||
echo '<div style="float: left; padding-left: 15px; padding-top: 20px;">';
|
||||
html_print_submit_button(__('No'), 'no_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub cancel" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '<div style="float: right; padding-right: 15px; padding-top: 20px;">';
|
||||
html_print_submit_button(__('Yes'), 'yes_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
// Print feedback user dialog
|
||||
echo '<div id="ui_messages_feedback" style="">';
|
||||
echo '<div style="float: left; margin: 15px; margin-left: 5px;">';
|
||||
echo html_print_image('images/success_circle_big.png', true);
|
||||
echo '</div>';
|
||||
echo '<div id="feedback_message" style="font-size: 13pt; margin: 15px 20px; padding-left:80px;"></div>';
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
//Show newsletter and register checkboxes
|
||||
var display_register = <?php echo json_encode($display_register); ?>;
|
||||
var display_newsletter = <?php echo json_encode($display_newsletter); ?>;
|
||||
var display_forced = <?php echo json_encode($display_forced); ?>;
|
||||
var return_button = <?php echo json_encode($return_button); ?>;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//HELPER FUNCTIONS
|
||||
|
||||
function submit_open_wizard (register, newsletter, email, forced) {
|
||||
|
||||
register = register;
|
||||
newsletter = newsletter ? 1 : 0;
|
||||
forced = forced ? 1 : 0;
|
||||
|
||||
var feedback_message = '';
|
||||
var feedback_status = 1;
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page": "general/login_identification_wizard",
|
||||
"open_wizard": 1,
|
||||
"register_pandora": register,
|
||||
"newsletter": newsletter,
|
||||
"email": email,
|
||||
"forced": forced},
|
||||
function (data) {
|
||||
var feedback_message = '';
|
||||
var feedback_status = 1;
|
||||
|
||||
jQuery.each (data, function (i, val) {
|
||||
if (i == 'message') feedback_message = val;
|
||||
if (i == 'status') feedback_status = val;
|
||||
});
|
||||
if (feedback_status == 0) {
|
||||
$("#ui_messages_feedback img").attr("src", "images/fail_circle_big.png");
|
||||
} else {
|
||||
$("#ui_messages_feedback img").attr("src", "images/success_circle_big.png");
|
||||
}
|
||||
$("#feedback_message").html(feedback_message);
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//EVENT FUNCTIONS
|
||||
$("#submit-return_dialog_button").click (function () {
|
||||
$("#login_accept_register" ).dialog('close');
|
||||
$("#all-required").hide();
|
||||
$("#login_id_dialog" ).dialog('open');
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page": "general/login_identification_wizard",
|
||||
"reset_initial_wizard": 1},
|
||||
function (data) {}
|
||||
);
|
||||
});
|
||||
|
||||
$("#submit-finish_dialog_button").click (function () {
|
||||
|
||||
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
|
||||
var register = $("#checkbox-register").is(':checked');
|
||||
var email = $("#text-email-newsletter").val();
|
||||
|
||||
if (email == '' && newsletter) {
|
||||
$("#label-email-newsletter").show();
|
||||
$("#text-email-newsletter").show();
|
||||
$("#required-email-newsletter").show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!register && display_register && !display_forced) {
|
||||
$("#login_registration_yesno").dialog('open');
|
||||
} else {
|
||||
var register_forced = register ? 1 : 0;
|
||||
submit_open_wizard (register_forced, newsletter, email, display_forced);
|
||||
$("#login_accept_register" ).dialog('close');
|
||||
if (register || newsletter) {
|
||||
$("#ui_messages_feedback").dialog('open');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#submit-no_registration").click (function () {
|
||||
$("#login_registration_yesno").dialog('close');
|
||||
});
|
||||
|
||||
$("#submit-yes_registration").click (function () {
|
||||
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
|
||||
var email = $("#text-email-newsletter").val();
|
||||
submit_open_wizard (0, newsletter, email, display_forced);
|
||||
|
||||
$("#login_registration_yesno").dialog('close');
|
||||
$("#login_accept_register" ).dialog('close');
|
||||
});
|
||||
|
||||
$("#checkbox-newsletter").click (function () {
|
||||
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
|
||||
if (!return_button && newsletter) {
|
||||
$("#label-email-newsletter").show();
|
||||
$("#text-email-newsletter").show();
|
||||
}
|
||||
|
||||
if (!newsletter) {
|
||||
$("#label-email-newsletter").hide();
|
||||
$("#text-email-newsletter").hide();
|
||||
$("#required-email-newsletter").hide();
|
||||
}
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//DISPLAY
|
||||
$(document).ready (function () {
|
||||
|
||||
$("#login_accept_register").dialog({
|
||||
resizable: false,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 320,
|
||||
width: 750
|
||||
});
|
||||
|
||||
$("#login_registration_yesno").dialog({
|
||||
resizable: false,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
width: 320,
|
||||
overlay: {
|
||||
opacity: 1,
|
||||
background: "black"
|
||||
},
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
|
||||
$("#ui_messages_feedback").dialog({
|
||||
resizable: false,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
width: 300,
|
||||
overlay: {
|
||||
opacity: 1,
|
||||
background: "black"
|
||||
},
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
//Display return button if required
|
||||
if (return_button) {
|
||||
$("#submit-return_dialog_button").show ();
|
||||
}
|
||||
// Remove the completed parts
|
||||
if (!display_register) {
|
||||
$("#checkbox-register").attr ('style', 'display: none !important');
|
||||
$("#label-register").hide ();
|
||||
}
|
||||
if (!display_newsletter) {
|
||||
$("#checkbox-newsletter").attr ('style', 'display: none !important');
|
||||
$("#label-newsletter").hide ();
|
||||
}
|
||||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
#required-email-newsletter{
|
||||
font-size : 9px;
|
||||
color: red;
|
||||
margin-left: -2px;
|
||||
margin-top: 3px;
|
||||
position: absolute;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#email_container{
|
||||
margin-top: 3px;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
#license_newsletter {
|
||||
height: 100px;
|
||||
width: 100%;
|
||||
overflow-y: scroll;
|
||||
border: 1px solid #E4E4E4;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#license_newsletter p{
|
||||
padding: 0 3px;
|
||||
}
|
||||
|
||||
.ui-widget-overlay {
|
||||
background: #000;
|
||||
opacity: .6;
|
||||
}
|
||||
|
||||
.ui-draggable {
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
@ -1,273 +0,0 @@
|
||||
<?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.
|
||||
|
||||
/**
|
||||
* @package General
|
||||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
if (is_ajax()) {
|
||||
$save_identification = get_parameter('save_required_wizard', 0);
|
||||
$change_language = get_parameter('change_language', 0);
|
||||
$cancel_wizard = get_parameter('cancel_wizard', 0);
|
||||
|
||||
// Updates the values get on the identification wizard
|
||||
if ($save_identification) {
|
||||
$email = get_parameter('email', false);
|
||||
$timezone = get_parameter('timezone', false);
|
||||
$language = get_parameter('language', false);
|
||||
|
||||
if ($email !== false) {
|
||||
config_update_value('language', $language);
|
||||
}
|
||||
|
||||
if ($timezone !== false) {
|
||||
config_update_value('timezone', $timezone);
|
||||
}
|
||||
|
||||
if ($email !== false) {
|
||||
db_process_sql_update(
|
||||
'tusuario',
|
||||
['email' => $email],
|
||||
['id_user' => $config['id_user']]
|
||||
);
|
||||
}
|
||||
|
||||
// Update the alert action Mail to XXX/Administrator if it is set to default
|
||||
$mail_check = 'yourmail@domain.es';
|
||||
$mail_alert = alerts_get_alert_action_field1(1);
|
||||
if ($mail_check === $mail_alert && $email !== false) {
|
||||
alerts_update_alert_action(
|
||||
1,
|
||||
[
|
||||
'field1' => $email,
|
||||
'field1_recovery' => $email,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
config_update_value('initial_wizard', 1);
|
||||
}
|
||||
|
||||
// Change the language if is change in checkbox
|
||||
if ($change_language !== 0) {
|
||||
config_update_value('language', $change_language);
|
||||
}
|
||||
|
||||
if ($cancel_wizard !== 0) {
|
||||
config_update_value('initial_wizard', 1);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']);
|
||||
// Avoid to show default email
|
||||
if ($email == 'admin@example.com') {
|
||||
$email = '';
|
||||
}
|
||||
|
||||
// Prints first step pandora registration
|
||||
echo '<div id="login_id_dialog" title="'.__('%s instance identification wizard', get_product_name()).'" style="display: none;">';
|
||||
|
||||
echo '<div style="font-size: 10pt; margin: 20px;">';
|
||||
echo __('Please fill the following information in order to configure your %s instance successfully', get_product_name()).'.';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="">';
|
||||
$table = new StdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->size = [];
|
||||
$table->size[0] = '40%';
|
||||
$table->style[0] = 'font-weight:bold';
|
||||
$table->size[1] = '60%';
|
||||
$table->border = '5px solid';
|
||||
|
||||
$table->data[0][0] = __('Language code');
|
||||
$table->data[0][1] = html_print_select_from_sql(
|
||||
'SELECT id_language, name FROM tlanguage',
|
||||
'language',
|
||||
$config['language'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$zone_name = [
|
||||
'Africa' => __('Africa'),
|
||||
'America' => __('America'),
|
||||
'Antarctica' => __('Antarctica'),
|
||||
'Arctic' => __('Arctic'),
|
||||
'Asia' => __('Asia'),
|
||||
'Atlantic' => __('Atlantic'),
|
||||
'Australia' => __('Australia'),
|
||||
'Europe' => __('Europe'),
|
||||
'Indian' => __('Indian'),
|
||||
'Pacific' => __('Pacific'),
|
||||
'UTC' => __('UTC'),
|
||||
];
|
||||
|
||||
if ($zone_selected == '') {
|
||||
if ($config['timezone'] != '') {
|
||||
$zone_array = explode('/', $config['timezone']);
|
||||
$zone_selected = $zone_array[0];
|
||||
} else {
|
||||
$zone_selected = 'Europe';
|
||||
}
|
||||
}
|
||||
|
||||
$timezones = timezone_identifiers_list();
|
||||
foreach ($timezones as $timezone) {
|
||||
if (strpos($timezone, $zone_selected) !== false) {
|
||||
$timezone_country = preg_replace('/^.*\//', '', $timezone);
|
||||
$timezone_n[$timezone] = $timezone_country;
|
||||
}
|
||||
}
|
||||
|
||||
$table->data[2][0] = __('Timezone setup').' '.ui_print_help_tip(
|
||||
__('Must have the same time zone as the system or database to avoid mismatches of time.'),
|
||||
true
|
||||
);
|
||||
$table->data[2][1] = html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone()', '', '', true);
|
||||
$table->data[2][1] .= ' '.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
|
||||
|
||||
$table->data[4][0] = __('E-mail for receiving alerts');
|
||||
$table->data[4][1] = html_print_input_text('email', $email, '', 50, 255, true);
|
||||
|
||||
html_print_table($table);
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; right: 10px; border: 1px solid #FFF; width: 570px">';
|
||||
echo '<div style="float: right; width: 20%;">';
|
||||
html_print_submit_button(__('Register'), 'id_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '<div style="float: right; width: 20%;">';
|
||||
html_print_button(__('Cancel'), 'cancel', false, '', 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
|
||||
echo '</div>';
|
||||
echo '<div id="all-required" style="float: right; margin-right: 30px; display: none; color: red;">';
|
||||
echo __('All fields required');
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
var default_language_displayed;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//HELPER FUNCTIONS
|
||||
function show_timezone () {
|
||||
zone = $("#zone").val();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: "page=godmode/setup/setup&select_timezone=1&zone=" + zone,
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#timezone").empty();
|
||||
jQuery.each (data, function (id, value) {
|
||||
timezone = value;
|
||||
var timezone_country = timezone.replace (/^.*\//g, "");
|
||||
$("select[name='timezone']").append($("<option>").val(timezone).html(timezone_country));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//EVENT FUNCTIONS
|
||||
$("#submit-id_dialog_button").click (function () {
|
||||
|
||||
//All fields required
|
||||
if ($("#text-email").val() == '') {
|
||||
$("#all-required").show();
|
||||
} else {
|
||||
var timezone = $("#timezone").val();
|
||||
var language = $("#language").val();
|
||||
var email_identification = $("#text-email").val();
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page": "general/login_required",
|
||||
"save_required_wizard": 1,
|
||||
"email": email_identification,
|
||||
"language": language,
|
||||
"timezone": timezone},
|
||||
function (data) {}
|
||||
);
|
||||
|
||||
$("#login_id_dialog").dialog('close');
|
||||
first_time_identification ();
|
||||
}
|
||||
});
|
||||
|
||||
$("#language").click(function () {
|
||||
var change_language = $("#language").val();
|
||||
|
||||
if (change_language === default_language_displayed) return;
|
||||
jQuery.post ("ajax.php",
|
||||
{"page": "general/login_required",
|
||||
"change_language": change_language},
|
||||
function (data) {}
|
||||
).done(function () {
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//DISPLAY
|
||||
$(document).ready (function () {
|
||||
|
||||
$("#login_id_dialog").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 280,
|
||||
width: 630,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
closeOnEscape: false,
|
||||
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
|
||||
});
|
||||
|
||||
default_language_displayed = $("#language").val();
|
||||
|
||||
$(".ui-widget-overlay").css("background", "#000");
|
||||
$(".ui-widget-overlay").css("opacity", 0.6);
|
||||
$(".ui-draggable").css("cursor", "inherit");
|
||||
|
||||
$("#button-cancel").click (function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page": "general/login_required",
|
||||
"cancel_wizard": 1},
|
||||
function (data) {}
|
||||
);
|
||||
|
||||
$("#login_id_dialog" ).dialog('close');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
@ -197,12 +197,15 @@ if (!empty($all_data)) {
|
||||
}
|
||||
|
||||
foreach ($news as $article) {
|
||||
$text = io_safe_output($article['text']);
|
||||
|
||||
|
||||
$text_bbdd = io_safe_output($article['text']);
|
||||
$text = html_entity_decode($text_bbdd);
|
||||
echo '<tr><th class="green_title">'.$article['subject'].'</th></tr>';
|
||||
echo '<tr><td>'.__('by').' <b>'.$article['author'].'</b> <i>'.ui_print_timestamp($article['timestamp'], true).'</i> '.$comparation_suffix.'</td></tr>';
|
||||
echo '<tr><td class="datos">';
|
||||
if ($article['id_news'] == 1) {
|
||||
echo '<center><img src="./images/welcome_image.png" alt="img colabora con nosotros - Support" width="191" height="207"></center>';
|
||||
}
|
||||
|
||||
echo nl2br($text);
|
||||
echo '</td></tr>';
|
||||
}
|
||||
@ -215,58 +218,6 @@ if (!empty($all_data)) {
|
||||
// END OF NEWS BOARD.
|
||||
}
|
||||
|
||||
$nots = messages_get_overview('utimestamp', 'DESC', false);
|
||||
if (!empty($nots)) {
|
||||
// Notifications board.
|
||||
echo '<div id="notifications_board">';
|
||||
|
||||
echo '<table cellpadding="0" width=100% cellspacing="0" class="databox filters">';
|
||||
echo '<tr><th style="text-align:center;"><span >'.__('Pending notifications').'</span></th></tr>';
|
||||
if ($config['prominent_time'] == 'timestamp') {
|
||||
$comparation_suffix = '';
|
||||
} else {
|
||||
$comparation_suffix = __('ago');
|
||||
}
|
||||
|
||||
foreach ($nots as $msg) {
|
||||
$conversation = io_safe_output(
|
||||
messages_get_conversation($msg)
|
||||
);
|
||||
|
||||
if (is_array($conversation)) {
|
||||
$text = array_pop($conversation)['message'];
|
||||
} else {
|
||||
// Skip empty message.
|
||||
continue;
|
||||
}
|
||||
|
||||
$url = ui_get_full_url(
|
||||
'index.php?sec=message_list&sec2=operation/messages/message_edit&read_message=1&id_message='.$msg['id_mensaje']
|
||||
);
|
||||
if ($msg['url'] != '') {
|
||||
$url = $msg['url'];
|
||||
}
|
||||
|
||||
echo '<tr><th class="green_title">'.$msg['subject'].'</th></tr>';
|
||||
echo '<tr><td><a href="'.$url.'">';
|
||||
if ($msg['id_usuario_origen'] != '') {
|
||||
echo '<b>'.get_user_fullname($msg['id_usuario_origen']).'</b> ';
|
||||
}
|
||||
|
||||
echo '<i>'.ui_print_timestamp($msg['timestamp'], true).'</i> '.$comparation_suffix.'</a></td></tr>';
|
||||
echo '<tr><td class="datos">';
|
||||
echo nl2br($text);
|
||||
echo '</td></tr>';
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<br><br>';
|
||||
|
||||
// EO Notifications board.
|
||||
}
|
||||
|
||||
// LAST ACTIVITY.
|
||||
// Show last activity from this user.
|
||||
echo '<div id="activity">';
|
||||
|
181
pandora_console/general/register.php
Normal file
181
pandora_console/general/register.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
/**
|
||||
* Update Manager registration process client controller.
|
||||
*
|
||||
* @category Client controller
|
||||
* @package Pandora FMS
|
||||
* @subpackage Update manager
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
|
||||
|
||||
if (is_ajax()) {
|
||||
// Parse responses, flow control.
|
||||
$configuration_wizard = get_parameter('save_required_wizard', 0);
|
||||
$change_language = get_parameter('change_language', 0);
|
||||
$cancel_wizard = get_parameter('cancel_wizard', 0);
|
||||
|
||||
// Console registration.
|
||||
$cancel_registration = get_parameter('cancel_registration', 0);
|
||||
$register_console = get_parameter('register_console', 0);
|
||||
|
||||
// Newsletter.
|
||||
$cancel_newsletter = get_parameter('cancel_newsletter', 0);
|
||||
$register_newsletter = get_parameter('register_newsletter', 0);
|
||||
|
||||
// Load wizards.
|
||||
$load_wizards = get_parameter('load_wizards', '');
|
||||
|
||||
$feedback = [];
|
||||
|
||||
// Load wizards.
|
||||
if ($load_wizards != '') {
|
||||
switch ($load_wizards) {
|
||||
case 'initial':
|
||||
return config_wiz_modal(false, false);
|
||||
|
||||
case 'registration':
|
||||
return registration_wiz_modal(false, false);
|
||||
|
||||
case 'newsletter':
|
||||
return newsletter_wiz_modal(false, false);
|
||||
|
||||
case 'all':
|
||||
config_wiz_modal(false, false);
|
||||
registration_wiz_modal(false, false);
|
||||
newsletter_wiz_modal(false, false);
|
||||
return;
|
||||
|
||||
default:
|
||||
// Ignore.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Configuration wizard process.
|
||||
if ($configuration_wizard) {
|
||||
$feedback = config_wiz_process();
|
||||
}
|
||||
|
||||
if ($change_language) {
|
||||
// Change the language if is change in checkbox.
|
||||
config_update_value('language', $change_language);
|
||||
}
|
||||
|
||||
if ($cancel_wizard) {
|
||||
config_update_value('initial_wizard', 1);
|
||||
}
|
||||
|
||||
// Update Manager registration.
|
||||
if ($cancel_registration) {
|
||||
config_update_value('pandora_uid', 'OFFLINE');
|
||||
}
|
||||
|
||||
if ($register_console) {
|
||||
$feedback = registration_wiz_process();
|
||||
}
|
||||
|
||||
// Newsletter.
|
||||
if ($cancel_newsletter) {
|
||||
db_process_sql_update(
|
||||
'tusuario',
|
||||
['middlename' => -1],
|
||||
['id_user' => $config['id_user']]
|
||||
);
|
||||
|
||||
// XXX: Also notify UpdateManager.
|
||||
}
|
||||
|
||||
if ($register_newsletter) {
|
||||
$feedback = newsletter_wiz_process();
|
||||
}
|
||||
|
||||
if (is_array($feedback)) {
|
||||
echo json_encode($feedback);
|
||||
}
|
||||
|
||||
|
||||
// Ajax calls finish here.
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
ui_require_css_file('register');
|
||||
|
||||
$initial = isset($config['initial_wizard']) !== true
|
||||
|| $config['initial_wizard'] != '1';
|
||||
|
||||
$newsletter = db_get_value(
|
||||
'middlename',
|
||||
'tusuario',
|
||||
'id_user',
|
||||
$config['id_user']
|
||||
);
|
||||
$show_newsletter = $newsletter == '0' || $newsletter == '';
|
||||
|
||||
$registration = isset($config['pandora_uid']) !== true
|
||||
|| $config['pandora_uid'] == '';
|
||||
|
||||
|
||||
if ($initial) {
|
||||
// Show all forms in order.
|
||||
// 1- Ask for email, timezone, etc. Fullfill alerts and user mail.
|
||||
config_wiz_modal(
|
||||
false,
|
||||
true,
|
||||
(($registration === true) ? 'show_registration_wizard()' : null)
|
||||
);
|
||||
}
|
||||
|
||||
if ($registration) {
|
||||
// Prepare registration wizard, not launch. leave control to flow.
|
||||
registration_wiz_modal(
|
||||
false,
|
||||
// Launch only if not being launch from 'initial'.
|
||||
!$initial,
|
||||
(($show_newsletter === true) ? 'force_run_newsletter()' : null)
|
||||
);
|
||||
} else {
|
||||
if ($show_newsletter) {
|
||||
// Show newsletter wizard for current user.
|
||||
newsletter_wiz_modal(
|
||||
false,
|
||||
// Launch only if not being call from 'registration'.
|
||||
!$registration && !$initial
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
@ -167,27 +167,18 @@ if ($disk_conf_delete) {
|
||||
|
||||
echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
||||
$table->head = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; width: 150px;';
|
||||
$table->data = [];
|
||||
|
||||
$table->align[2] = 'center';
|
||||
|
||||
if (!$new_agent && $alias != '') {
|
||||
$table->data[0][0] = __('Agent name').ui_print_help_tip(__("The agent's name must be the same as the one defined at the console"), true);
|
||||
$table->data[0][1] = html_print_input_text('agente', $nombre_agente, '', 50, 100, true);
|
||||
$table_agent_name = '<div class="label_select"><p class="input_label">'.__('Agent name').': '.ui_print_help_tip(__("The agent's name must be the same as the one defined at the console"), true).'</p>';
|
||||
$table_agent_name .= '<div class="label_select_parent">';
|
||||
$table_agent_name .= '<div class="label_select_child_left">'.html_print_input_text('agente', $nombre_agente, '', 50, 100, true).'</div>';
|
||||
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name">';
|
||||
|
||||
$table->data[0][2] = __('QR Code Agent view');
|
||||
$table_qr_code = '<div class="agent_qr white_box"><p class="input_label">'.__('QR Code Agent view').': </p>';
|
||||
|
||||
if ($id_agente) {
|
||||
$table->data[0][1] .= ' <b>'.__('ID')."</b> $id_agente ";
|
||||
$table->data[0][1] .= ' <a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
||||
$table->data[0][1] .= html_print_image(
|
||||
$table_agent_name .= '<span>'.__('ID').' '.$id_agente.'</span>';
|
||||
$table_agent_name .= '<a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
||||
$table_agent_name .= html_print_image(
|
||||
'images/zoom.png',
|
||||
true,
|
||||
[
|
||||
@ -195,20 +186,23 @@ if (!$new_agent && $alias != '') {
|
||||
'title' => __('Agent detail'),
|
||||
]
|
||||
);
|
||||
$table->data[0][1] .= '</a>';
|
||||
$table_agent_name .= '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Remote configuration available
|
||||
if (!$new_agent) {
|
||||
$agent_options_update = 'agent_options_update';
|
||||
|
||||
// Delete link from here.
|
||||
$table_agent_name .= "<a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
|
||||
|
||||
// Remote configuration available.
|
||||
if (isset($filename)) {
|
||||
if (file_exists($filename['md5'])) {
|
||||
$agent_name = agents_get_name($id_agente);
|
||||
$agent_name = io_safe_output($agent_name);
|
||||
$agent_md5 = md5($agent_name, false);
|
||||
|
||||
$table->data[0][1] .= ' '.'<a href="index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=remote_configuration&'.'id_agente='.$id_agente.'&'.'disk_conf='.$agent_md5.'">';
|
||||
$table->data[0][1] .= html_print_image(
|
||||
$table_agent_name .= '<a href="index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=remote_configuration&'.'id_agente='.$id_agente.'&'.'disk_conf='.$agent_md5.'">';
|
||||
$table_agent_name .= html_print_image(
|
||||
'images/application_edit.png',
|
||||
true,
|
||||
[
|
||||
@ -216,35 +210,44 @@ if (!$new_agent) {
|
||||
'title' => __('This agent can be remotely configured'),
|
||||
]
|
||||
);
|
||||
$table->data[0][1] .= '</a>'.ui_print_help_tip(
|
||||
$table_agent_name .= '</a>'.ui_print_help_tip(
|
||||
__('You can remotely edit this agent configuration'),
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$table_agent_name .= '</div></div></div>';
|
||||
}
|
||||
|
||||
// Delete link from here
|
||||
if (!$new_agent) {
|
||||
$table->data[0][1] .= " <span align='right'><a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=$id_agente&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Alias').ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).'</span>';
|
||||
$table->data[1][1] = html_print_input_text('alias', $alias, '', 50, 100, true);
|
||||
if ($new_agent) {
|
||||
$table->data[1][1] .= html_print_checkbox('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name');
|
||||
$label_select_child_left = 'label_select_child_left';
|
||||
$label_select_parent = 'label_select_parent';
|
||||
}
|
||||
|
||||
$table->data[2][0] = __('IP Address');
|
||||
$table->data[2][1] = html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).html_print_checkbox('unique_ip', 1, $config['unique_ip'], true).__('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_alias = '<div class="label_select"><p class="input_label">'.__('Alias').': '.ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).'</p>';
|
||||
$table_alias .= '<div class='.$label_select_parent.'>';
|
||||
$table_alias .= '<div class='.$label_select_child_left.'>'.html_print_input_text('alias', $alias, '', 50, 100, true).'</div>';
|
||||
if ($new_agent) {
|
||||
$table_alias .= '<div class="label_select_child_right">'.html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name').'</div>';
|
||||
}
|
||||
|
||||
$table_alias .= '</div></div>';
|
||||
|
||||
$table_ip = '<div class="label_select"><p class="input_label">'.__('IP Address').': </p>';
|
||||
$table_ip .= '<div class="label_select_parent">';
|
||||
$table_ip .= '<div class="label_select_child_left">'.html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).'</div>';
|
||||
$table_ip .= '<div class="label_select_child_right">'.html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true).__('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).'</div>';
|
||||
$table_ip .= '</div></div>';
|
||||
|
||||
if ($id_agente) {
|
||||
$table->data[2][1] .= ' ';
|
||||
|
||||
$ip_all = agents_get_addresses($id_agente);
|
||||
|
||||
$table->data[2][1] .= html_print_select($ip_all, 'address_list', $direccion_agente, '', '', 0, true);
|
||||
$table->data[2][1] .= ' '.html_print_checkbox('delete_ip', 1, false, true).__('Delete selected');
|
||||
$table_ip .= '<div class="label_select">';
|
||||
$table_ip .= '<div class="label_select_parent">';
|
||||
$table_ip .= '<div class="label_select_child_left">'.html_print_select($ip_all, 'address_list', $direccion_agente, '', '', 0, true).'</div>';
|
||||
$table_ip .= '<div class="label_select_child_right">'.html_print_checkbox_switch('delete_ip', 1, false, true).__('Delete selected').'</div>';
|
||||
$table_ip .= '</div></div>';
|
||||
}
|
||||
|
||||
?>
|
||||
@ -254,13 +257,12 @@ if ($id_agente) {
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
if (!$new_agent) {
|
||||
$table->rowspan[2][2] = 3;
|
||||
if (!$new_agent && $alias != '') {
|
||||
if ($id_agente) {
|
||||
$table->data[2][2] = "<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"".ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente)."\" );'></a>";
|
||||
} else {
|
||||
$table->data[2][2] = __('Only it is show when<br />the agent is saved.');
|
||||
$table_qr_code .= "<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"".ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente)."\" );'></a>";
|
||||
}
|
||||
|
||||
$table_qr_code .= '</div>';
|
||||
}
|
||||
|
||||
$groups = users_get_groups($config['id_user'], 'AR', false);
|
||||
@ -277,28 +279,32 @@ if (is_array($modules)) {
|
||||
}
|
||||
}
|
||||
|
||||
$table->data[4][0] = __('Primary group');
|
||||
// Cannot change primary group if user have not permission for that group
|
||||
$table_primary_group = '<div class="label_select"><p class="input_label">'.__('Primary group').': </p>';
|
||||
$table_primary_group .= '<div class="label_select_parent">';
|
||||
// Cannot change primary group if user have not permission for that group.
|
||||
if (isset($groups[$grupo]) || $new_agent) {
|
||||
$table->data[4][1] = html_print_select_groups(false, 'AR', false, 'grupo', $grupo, '', '', 0, true);
|
||||
$table_primary_group .= html_print_select_groups(false, 'AR', false, 'grupo', $grupo, '', '', 0, true);
|
||||
} else {
|
||||
$table->data[4][1] = groups_get_name($grupo);
|
||||
$table->data[4][1] .= html_print_input_hidden('grupo', $grupo, true);
|
||||
$table_primary_group .= groups_get_name($grupo);
|
||||
$table_primary_group .= html_print_input_hidden('grupo', $grupo, true);
|
||||
}
|
||||
|
||||
$table->data[4][1] .= ' <span id="group_preview">';
|
||||
$table->data[4][1] .= ui_print_group_icon($grupo, true);
|
||||
$table->data[4][1] .= '</span>';
|
||||
$table_primary_group .= '<div class="label_select_child_icons"><span id="group_preview">';
|
||||
$table_primary_group .= ui_print_group_icon($grupo, true);
|
||||
$table_primary_group .= '</span></div></div></div>';
|
||||
|
||||
$table->data[5][0] = __('Interval');
|
||||
|
||||
$table->data[5][1] = html_print_extended_select_for_time('intervalo', $intervalo, '', '', '0', 10, true);
|
||||
$table_interval = '<div class="label_select"><p class="input_label">'.__('Interval').': </p>';
|
||||
$table_interval .= '<div class="label_select_parent">';
|
||||
$table_interval .= html_print_extended_select_for_time('intervalo', $intervalo, '', '', '0', 10, true);
|
||||
if ($intervalo < SECONDS_5MINUTES) {
|
||||
$table->data[5][1] .= clippy_context_help('interval_agent_min');
|
||||
$table_interval .= clippy_context_help('interval_agent_min');
|
||||
}
|
||||
|
||||
$table->data[6][0] = __('OS');
|
||||
$table->data[6][1] = html_print_select_from_sql(
|
||||
$table_interval .= '</div></div>';
|
||||
|
||||
$table_os = '<div class="label_select"><p class="input_label">'.__('OS').': </p>';
|
||||
$table_os .= '<div class="label_select_parent">';
|
||||
$table_os .= html_print_select_from_sql(
|
||||
'SELECT id_os, name FROM tconfig_os',
|
||||
'id_os',
|
||||
$id_os,
|
||||
@ -307,18 +313,19 @@ $table->data[6][1] = html_print_select_from_sql(
|
||||
'0',
|
||||
true
|
||||
);
|
||||
$table->data[6][1] .= ' <span id="os_preview">';
|
||||
$table->data[6][1] .= ui_print_os_icon($id_os, false, true);
|
||||
$table->data[6][1] .= '</span>';
|
||||
$table_os .= '<div class="label_select_child_icons"> <span id="os_preview">';
|
||||
$table_os .= ui_print_os_icon($id_os, false, true);
|
||||
$table_os .= '</span></div></div></div>';
|
||||
|
||||
// Network server
|
||||
// Network server.
|
||||
$servers = servers_get_names();
|
||||
if (!array_key_exists($server_name, $servers)) {
|
||||
$server_Name = 0;
|
||||
// Set the agent have not server.
|
||||
}
|
||||
|
||||
$table->data[7][0] = __('Server');
|
||||
$table_server = '<div class="label_select"><p class="input_label">'.__('Server').': </p>';
|
||||
$table_server .= '<div class="label_select_parent">';
|
||||
if ($new_agent) {
|
||||
// Set first server by default.
|
||||
$servers_get_names = servers_get_names();
|
||||
@ -326,7 +333,7 @@ if ($new_agent) {
|
||||
$server_name = reset($array_keys_servers_get_names);
|
||||
}
|
||||
|
||||
$table->data[7][1] = html_print_select(
|
||||
$table_server .= html_print_select(
|
||||
servers_get_names(),
|
||||
'server_name',
|
||||
$server_name,
|
||||
@ -334,36 +341,35 @@ $table->data[7][1] = html_print_select(
|
||||
__('None'),
|
||||
0,
|
||||
true
|
||||
).' '.ui_print_help_icon('agent_server', true);
|
||||
).'<div class="label_select_child_icons">'.ui_print_help_icon('agent_server', true).'</div></div></div>';
|
||||
|
||||
// Description
|
||||
$table->data[8][0] = __('Description');
|
||||
$table->data[8][1] = html_print_input_text(
|
||||
// Description.
|
||||
$table_description = '<div class="label_select"><p class="input_label">'.__('Description').': </p>';
|
||||
$table_description .= html_print_input_text(
|
||||
'comentarios',
|
||||
$comentarios,
|
||||
'',
|
||||
45,
|
||||
200,
|
||||
true
|
||||
);
|
||||
).'</div>';
|
||||
|
||||
html_print_table($table);
|
||||
unset($table);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
echo '<div class="first_row">
|
||||
<div class="agent_options '.$agent_options_update.' white_box">
|
||||
<div class="agent_options_column_left">'.$table_agent_name.$table_alias.$table_ip.$table_primary_group.'</div>
|
||||
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_description.'</div>
|
||||
</div>';
|
||||
if (!$new_agent && $alias != '') {
|
||||
echo $table_qr_code;
|
||||
}
|
||||
|
||||
$table->head = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; ';
|
||||
$table->style[4] = 'font-weight: bold;';
|
||||
$table->data = [];
|
||||
echo '</div>';
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$secondary_groups_selected = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
|
||||
$table->data['secondary_groups'][0] = __('Secondary groups').ui_print_help_icon('secondary_groups', true);
|
||||
$table->data['secondary_groups'][1] = html_print_select_groups(
|
||||
$table_adv_secondary_groups = '<div class="label_select"><p class="input_label">'.__('Secondary groups').': '.ui_print_help_icon('secondary_groups', true).'</p></div>';
|
||||
$table_adv_secondary_groups_left = html_print_select_groups(
|
||||
false,
|
||||
// Use the current user to select the groups
|
||||
'AR',
|
||||
@ -390,7 +396,7 @@ if (enterprise_installed()) {
|
||||
// CSS classnames (default)
|
||||
false,
|
||||
// Not disabled (default)
|
||||
false,
|
||||
'width:50%; min-width:170px; text-align:center',
|
||||
// Inline styles (default)
|
||||
false,
|
||||
// Option style select (default)
|
||||
@ -404,29 +410,31 @@ if (enterprise_installed()) {
|
||||
// Do not show the primary group in this selection
|
||||
);
|
||||
|
||||
$table->data['secondary_groups'][2] = html_print_input_image(
|
||||
$table_adv_secondary_groups_arrows = html_print_input_image(
|
||||
'add_secondary',
|
||||
'images/darrowright.png',
|
||||
'images/darrowright_green.png',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
[
|
||||
'id' => 'right_autorefreshlist',
|
||||
'title' => __('Add secondary groups'),
|
||||
'onclick' => 'agent_manager_add_secondary_groups(event, '.$id_agente.');',
|
||||
]
|
||||
).'<br /><br /><br /><br />'.html_print_input_image(
|
||||
).html_print_input_image(
|
||||
'remove_secondary',
|
||||
'images/darrowleft.png',
|
||||
'images/darrowleft_green.png',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
[
|
||||
'id' => 'left_autorefreshlist',
|
||||
'title' => __('Remove secondary groups'),
|
||||
'onclick' => 'agent_manager_remove_secondary_groups(event, '.$id_agente.');',
|
||||
]
|
||||
);
|
||||
|
||||
$table->data['secondary_groups'][3] = html_print_select(
|
||||
$table_adv_secondary_groups_right .= html_print_select(
|
||||
$secondary_groups_selected['for_select'],
|
||||
// Values
|
||||
'secondary_groups_selected',
|
||||
@ -441,8 +449,16 @@ if (enterprise_installed()) {
|
||||
// Nothing selected
|
||||
true,
|
||||
// Return HTML (not echo)
|
||||
true
|
||||
true,
|
||||
// Multiple selection
|
||||
true,
|
||||
// Sort
|
||||
'',
|
||||
// Class
|
||||
false,
|
||||
// Disabled
|
||||
'width:50%; min-width:170px; text-align:center'
|
||||
// Style
|
||||
);
|
||||
|
||||
// safe operation mode
|
||||
@ -457,47 +473,42 @@ if (enterprise_installed()) {
|
||||
$safe_mode_modules[$m['id_module']] = $m['name'];
|
||||
}
|
||||
|
||||
$table->data[2][0] = __('Safe operation mode').ui_print_help_tip(
|
||||
$table_adv_safe = '<div class="label_select_simple label_simple_items"><p class="input_label input_label_simple">'.__('Safe operation mode').': '.ui_print_help_tip(
|
||||
__(
|
||||
'This mode allow %s to disable all modules
|
||||
of this agent while the selected module is on CRITICAL status',
|
||||
get_product_name()
|
||||
),
|
||||
true
|
||||
);
|
||||
$table->data[2][1] = html_print_checkbox('safe_mode', 1, $safe_mode, true);
|
||||
$table->data[2][1] .= ' '.__('Module').' '.html_print_select($safe_mode_modules, 'safe_mode_module', $safe_mode_module, '', '', 0, true);
|
||||
).'</p>';
|
||||
$table_adv_safe .= html_print_checkbox_switch('safe_mode', 1, $safe_mode, true);
|
||||
$table_adv_safe .= __('Module').' '.html_print_select($safe_mode_modules, 'safe_mode_module', $safe_mode_module, '', '', 0, true).'</div>';
|
||||
}
|
||||
|
||||
// Remote configuration
|
||||
$table->data[5][0] = __('Remote configuration');
|
||||
$table_adv_remote = '<div class="label_select"><p class="input_label">'.__('Remote configuration').': </p>';
|
||||
|
||||
if (!$new_agent) {
|
||||
$table->data[5][1] = '<em>'.__('Not available').'</em>';
|
||||
if (isset($filename)) {
|
||||
if (file_exists($filename['md5'])) {
|
||||
$table->data[5][1] = date('F d Y H:i:s', fileatime($filename['md5']));
|
||||
// Delete remote configuration
|
||||
$table->data[5][1] .= '<a href="index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=main&'.'disk_conf_delete=1&'.'id_agente='.$id_agente.'">';
|
||||
$table->data[5][1] .= html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete remote configuration file'),
|
||||
'style' => 'vertical-align: middle;',
|
||||
]
|
||||
).'</a>';
|
||||
$table->data[5][1] .= '</a>'.ui_print_help_tip(
|
||||
__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'),
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!$new_agent && isset($filename) && file_exists($filename['md5'])) {
|
||||
$table_adv_remote .= date('F d Y H:i:s', fileatime($filename['md5']));
|
||||
// Delete remote configuration
|
||||
$table_adv_remote .= '<a href="index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=main&'.'disk_conf_delete=1&'.'id_agente='.$id_agente.'">';
|
||||
$table_adv_remote .= html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete remote configuration file'),
|
||||
'style' => 'vertical-align: middle;',
|
||||
]
|
||||
).'</a>';
|
||||
$table_adv_remote .= '</a>'.ui_print_help_tip(
|
||||
__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$table->data[5][1] = '<em>'.__('Not available').'</em>';
|
||||
$table_adv_remote .= '<em>'.__('Not available').'</em>';
|
||||
}
|
||||
|
||||
|
||||
$table_adv_remote .= '</div>';
|
||||
|
||||
$cps_array[-1] = __('Disabled');
|
||||
if ($cps > 0) {
|
||||
@ -511,16 +522,16 @@ if (enterprise_installed()) {
|
||||
$cps_array[$cps_inc] = __('Enabled');
|
||||
}
|
||||
|
||||
$table->data[6][0] = __('Cascade protection services');
|
||||
$table->data[6][0] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
|
||||
$table->data[6][1] = html_print_select($cps_array, 'cps', $cps, '', '', 0, true);
|
||||
$table_adv_cascade = '<div class="label_select"><p class="input_label">'.__('Cascade protection services').': ';
|
||||
$table_adv_cascade .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true).'</p>';
|
||||
$table_adv_cascade .= html_print_select($cps_array, 'cps', $cps, '', '', 0, true).'</div>';
|
||||
}
|
||||
|
||||
// Custom ID
|
||||
$table->data[0][0] = __('Custom ID');
|
||||
$table->data[0][1] = html_print_input_text('custom_id', $custom_id, '', 16, 255, true);
|
||||
$table_adv_custom_id = '<div class="label_select"><p class="input_label">'.__('Custom ID').': </p>';
|
||||
$table_adv_custom_id .= html_print_input_text('custom_id', $custom_id, '', 16, 255, true).'</div>';
|
||||
|
||||
$table->data[1][0] = __('Parent');
|
||||
$table_adv_parent = '<div class="label_select"><p class="input_label">'.__('Parent').': </p>';
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
@ -532,75 +543,79 @@ $params['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
|
||||
$params['selectbox_id'] = 'cascade_protection_module';
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$params['cascade_protection'] = true;
|
||||
|
||||
$table->data[1][1] = ui_print_agent_autocomplete_input($params);
|
||||
$table_adv_parent .= '<div class="label_simple_items">';
|
||||
$table_adv_parent .= ui_print_agent_autocomplete_input($params);
|
||||
if (enterprise_installed()) {
|
||||
$table->data[1][1] .= html_print_checkbox('cascade_protection', 1, $cascade_protection, true).__('Cascade protection').' '.ui_print_help_icon('cascade_protection', true);
|
||||
$table_adv_parent .= html_print_checkbox_switch('cascade_protection', 1, $cascade_protection, true).__('Cascade protection').' '.ui_print_help_icon('cascade_protection', true);
|
||||
}
|
||||
|
||||
$table->data[1][1] .= ' '.__('Module').' '.html_print_select($modules_values, 'cascade_protection_module', $cascade_protection_module, '', '', 0, true);
|
||||
$table_adv_parent .= __('Module').' '.html_print_select($modules_values, 'cascade_protection_module', $cascade_protection_module, '', '', 0, true).'</div></div>';
|
||||
|
||||
// Learn mode / Normal mode
|
||||
$table->data[3][0] = __('Module definition').ui_print_help_icon('module_definition', true);
|
||||
$table->data[3][1] = __('Learning mode').' '.html_print_radio_button_extended(
|
||||
$table_adv_module_mode = '<div class="label_select"><p class="input_label">'.__('Module definition').': '.ui_print_help_icon('module_definition', true).'</p>';
|
||||
$table_adv_module_mode .= '<div class="switch_radio_button">';
|
||||
$table_adv_module_mode .= html_print_radio_button_extended(
|
||||
'modo',
|
||||
1,
|
||||
'',
|
||||
__('Learning mode'),
|
||||
$modo,
|
||||
false,
|
||||
'show_modules_not_learning_mode_context_help();',
|
||||
'style="margin-right: 40px;"',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[3][1] .= __('Normal mode').' '.html_print_radio_button_extended(
|
||||
$table_adv_module_mode .= html_print_radio_button_extended(
|
||||
'modo',
|
||||
0,
|
||||
'',
|
||||
__('Normal mode'),
|
||||
$modo,
|
||||
false,
|
||||
'show_modules_not_learning_mode_context_help();',
|
||||
'style="margin-right: 40px;"',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[3][1] .= __('Autodisable mode').' '.html_print_radio_button_extended(
|
||||
$table_adv_module_mode .= html_print_radio_button_extended(
|
||||
'modo',
|
||||
2,
|
||||
'',
|
||||
__('Autodisable mode'),
|
||||
$modo,
|
||||
false,
|
||||
'show_modules_not_learning_mode_context_help();',
|
||||
'style="margin-right: 40px;"',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table_adv_module_mode .= '</div></div>';
|
||||
|
||||
// Status (Disabled / Enabled)
|
||||
$table->data[4][0] = __('Status');
|
||||
$table->data[4][1] = __('Disabled').' '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).' '.html_print_radio_button_extended('disabled', 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[4][1] .= __('Enabled').' '.html_print_radio_button_extended('disabled', 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table_adv_status = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Disabled').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'</p>';
|
||||
$table_adv_status .= html_print_checkbox_switch('disabled', 1, $disabled, true).'</div>';
|
||||
|
||||
// Url address.
|
||||
if (enterprise_installed()) {
|
||||
$table->data[4][2] = __('Url address').ui_print_help_tip(__('URL address must be complete, for example: https://pandorafms.com/'), true);
|
||||
$table->data[4][3] = html_print_input_text(
|
||||
$table_adv_url = '<div class="label_select"><p class="input_label">'.__('Url address').': '.ui_print_help_tip(__('URL address must be complete, for example: https://pandorafms.com/'), true).'</p>';
|
||||
$table_adv_url .= html_print_input_text(
|
||||
'url_description',
|
||||
$url_description,
|
||||
'',
|
||||
45,
|
||||
255,
|
||||
true
|
||||
);
|
||||
).'</div>';
|
||||
} else {
|
||||
$table->data[5][0] = __('Url address');
|
||||
$table->data[5][1] = html_print_input_text(
|
||||
$table_adv_url = '<div class="label_select"><p class="input_label">'.__('Url address').': </p></div>';
|
||||
$table_adv_url .= html_print_input_text(
|
||||
'url_description',
|
||||
$url_description,
|
||||
'',
|
||||
45,
|
||||
255,
|
||||
true
|
||||
);
|
||||
).'</div>';
|
||||
}
|
||||
|
||||
$table->data[5][2] = __('Quiet');
|
||||
$table->data[5][3] .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true);
|
||||
$table->data[5][3] = html_print_checkbox('quiet', 1, $quiet, true);
|
||||
$table_adv_quiet = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Quiet').': ';
|
||||
$table_adv_quiet .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true).'</p>';
|
||||
$table_adv_quiet .= html_print_checkbox_switch('quiet', 1, $quiet, true).'</div>';
|
||||
|
||||
$listIcons = gis_get_array_list_icons();
|
||||
|
||||
@ -611,7 +626,7 @@ foreach ($listIcons as $index => $value) {
|
||||
|
||||
$path = 'images/gis_map/icons/';
|
||||
// TODO set better method the path
|
||||
$table->data[0][2] = __('Agent icon').ui_print_help_tip(__('Agent icon for GIS Maps.'), true);
|
||||
$table_adv_agent_icon = '<div class="label_select"><p class="input_label">'.__('Agent icon').': '.ui_print_help_tip(__('Agent icon for GIS Maps.'), true).'</p>';
|
||||
if ($icon_path == '') {
|
||||
$display_icons = 'none';
|
||||
// Hack to show no icon. Use any given image to fix not found image errors
|
||||
@ -629,7 +644,7 @@ if ($icon_path == '') {
|
||||
$path_warning = $path.$icon_path.'.warning.png';
|
||||
}
|
||||
|
||||
$table->data[0][3] = html_print_select(
|
||||
$table_adv_agent_icon .= html_print_select(
|
||||
$arraySelectIcon,
|
||||
'icon_path',
|
||||
$icon_path,
|
||||
@ -637,63 +652,68 @@ $table->data[0][3] = html_print_select(
|
||||
__('None'),
|
||||
'',
|
||||
true
|
||||
).' '.html_print_image(
|
||||
).html_print_image(
|
||||
$path_ok,
|
||||
true,
|
||||
[
|
||||
'id' => 'icon_ok',
|
||||
'style' => 'display:'.$display_icons.';',
|
||||
]
|
||||
).' '.html_print_image(
|
||||
).html_print_image(
|
||||
$path_bad,
|
||||
true,
|
||||
[
|
||||
'id' => 'icon_bad',
|
||||
'style' => 'display:'.$display_icons.';',
|
||||
]
|
||||
).' '.html_print_image(
|
||||
).html_print_image(
|
||||
$path_warning,
|
||||
true,
|
||||
[
|
||||
'id' => 'icon_warning',
|
||||
'style' => 'display:'.$display_icons.';',
|
||||
]
|
||||
);
|
||||
).'</div>';
|
||||
|
||||
if ($config['activate_gis']) {
|
||||
$table->data[3][2] = __('Ignore new GIS data:');
|
||||
$table->data[3][3] = __('Yes').' '.html_print_radio_button_extended(
|
||||
'update_gis_data',
|
||||
0,
|
||||
'',
|
||||
$update_gis_data,
|
||||
false,
|
||||
'',
|
||||
'style="margin-right: 40px;"',
|
||||
true
|
||||
);
|
||||
$table->data[3][3] .= __('No').' '.html_print_radio_button_extended(
|
||||
'update_gis_data',
|
||||
1,
|
||||
'',
|
||||
$update_gis_data,
|
||||
false,
|
||||
'',
|
||||
'style="margin-right: 40px;"',
|
||||
true
|
||||
);
|
||||
$table_adv_gis = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Ignore new GIS data:').'</p>';
|
||||
if ($new_agent) {
|
||||
$update_gis_data = true;
|
||||
}
|
||||
|
||||
$table_adv_gis .= html_print_checkbox_switch('update_gis_data', 1, $update_gis_data, true).'No / Yes</div>';
|
||||
}
|
||||
|
||||
ui_toggle(html_print_table($table, true), __('Advanced options'));
|
||||
unset($table);
|
||||
|
||||
|
||||
$table_adv_options = $table_adv_secondary_groups.'<div class="secondary_groups_select" style="margin-bottom:30px;">
|
||||
<div class="secondary_groups_list_left">
|
||||
'.$table_adv_secondary_groups_left.'
|
||||
</div>
|
||||
<div class="secondary_groups_select_arrows">
|
||||
'.$table_adv_secondary_groups_arrows.'
|
||||
</div>
|
||||
<div class="secondary_groups_list_right">
|
||||
'.$table_adv_secondary_groups_right.'
|
||||
</div>
|
||||
</div>
|
||||
<div class="agent_options agent_options_adv">
|
||||
<div class="agent_options_column_left" >'.$table_adv_parent.$table_adv_custom_id.$table_adv_module_mode.$table_adv_cascade.$table_adv_gis.'</div>
|
||||
<div class="agent_options_column_right" >'.$table_adv_agent_icon.$table_adv_url.$table_adv_quiet.$table_adv_status.$table_adv_remote.$table_adv_safe.'</div>
|
||||
</div>';
|
||||
|
||||
echo '<div class="ui_toggle">';
|
||||
ui_toggle($table_adv_options, __('Advanced options'), '', true, false, 'white_box white_box_opened');
|
||||
echo '</div>';
|
||||
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'custom_fields_table';
|
||||
|
||||
$table->head = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; width: 100px;';
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
$table->data = [];
|
||||
|
||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||
@ -703,11 +723,15 @@ if ($fields === false) {
|
||||
}
|
||||
|
||||
foreach ($fields as $field) {
|
||||
$data[0] = '<b>'.$field['name'].'</b>';
|
||||
$id_custom_field = $field['id_field'];
|
||||
|
||||
$data[0] = '<div class="field_title" onclick="show_custom_field_row('.$id_custom_field.')">';
|
||||
$data[0] .= '<b>'.$field['name'].'</b>';
|
||||
$data[0] .= ui_print_help_tip(
|
||||
__('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url]'),
|
||||
true
|
||||
);
|
||||
$data[0] .= '</div>';
|
||||
$combo = [];
|
||||
$combo = $field['combo_values'];
|
||||
$combo = explode(',', $combo);
|
||||
@ -730,7 +754,7 @@ foreach ($fields as $field) {
|
||||
}
|
||||
|
||||
if ($field['is_password_type']) {
|
||||
$data[1] = html_print_input_text_extended(
|
||||
$data_field[1] = html_print_input_text_extended(
|
||||
'customvalue_'.$field['id_field'],
|
||||
$custom_value,
|
||||
'customvalue_'.$field['id_field'],
|
||||
@ -744,18 +768,18 @@ foreach ($fields as $field) {
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$data[1] = html_print_textarea(
|
||||
$data_field[1] = html_print_textarea(
|
||||
'customvalue_'.$field['id_field'],
|
||||
2,
|
||||
65,
|
||||
$custom_value,
|
||||
'style="min-height: 30px; width:96%;"',
|
||||
'style="min-height: 30px;"',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if ($field['combo_values'] !== '') {
|
||||
$data[1] = html_print_select(
|
||||
$data_field[1] = html_print_select(
|
||||
$combo_values,
|
||||
'customvalue_'.$field['id_field'],
|
||||
$custom_value,
|
||||
@ -776,19 +800,25 @@ foreach ($fields as $field) {
|
||||
);
|
||||
};
|
||||
|
||||
$table->rowid[] = 'name_field-'.$id_custom_field;
|
||||
array_push($table->data, $data);
|
||||
|
||||
$table->rowid[] = 'field-'.$id_custom_field;
|
||||
array_push($table->data, $data_field);
|
||||
}
|
||||
|
||||
if (!empty($fields)) {
|
||||
ui_toggle(html_print_table($table, true), __('Custom fields'));
|
||||
echo '<div class="ui_toggle">';
|
||||
ui_toggle(html_print_table($table, true), __('Custom fields'), '', true, false, 'white_box white_box_opened');
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<div class="action-buttons" style="display: flex; justify-content: flex-end; align-items: center; width: '.$table->width.'">';
|
||||
|
||||
|
||||
// The context help about the learning mode.
|
||||
if ($modo == 0) {
|
||||
echo "<span id='modules_not_learning_mode_context_help' style=''>";
|
||||
echo "<span id='modules_not_learning_mode_context_help' style='padding-right:8px;'>";
|
||||
} else {
|
||||
echo "<span id='modules_not_learning_mode_context_help' style='display: none;'>";
|
||||
}
|
||||
@ -798,7 +828,7 @@ echo '</span>';
|
||||
|
||||
|
||||
if ($id_agente) {
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<div class="action-buttons">';
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'updbutton',
|
||||
@ -825,6 +855,19 @@ ui_require_jquery_file('bgiframe');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Show/Hide custom field row.
|
||||
function show_custom_field_row(id){
|
||||
if( $('#field-'+id).css('display') == 'none'){
|
||||
$('#field-'+id).css('display','table-row');
|
||||
$('#name_field-'+id).addClass('custom_field_row_opened');
|
||||
}
|
||||
else{
|
||||
$('#field-'+id).css('display','none');
|
||||
$('#name_field-'+id).removeClass('custom_field_row_opened');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Use this function for change 3 icons when change the selectbox
|
||||
function changeIcons() {
|
||||
var icon = $("#icon_path :selected").val();
|
||||
@ -863,7 +906,7 @@ ui_require_jquery_file('bgiframe');
|
||||
|
||||
function show_modules_not_learning_mode_context_help() {
|
||||
if ($("input[name='modo'][value=0]").is(':checked')) {
|
||||
$("#modules_not_learning_mode_context_help").show();
|
||||
$("#modules_not_learning_mode_context_help").show().css('padding-right','8px');
|
||||
}
|
||||
else {
|
||||
$("#modules_not_learning_mode_context_help").hide();
|
||||
|
@ -1062,7 +1062,7 @@ $(document).ready (function () {
|
||||
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('Repeated'); ?>');
|
||||
alert("<?php echo __('Repeated'); ?>");
|
||||
}
|
||||
$("#module").find("option[value='0']").remove();
|
||||
}
|
||||
@ -1078,7 +1078,7 @@ $(document).ready (function () {
|
||||
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('Repeated'); ?>');
|
||||
alert("<?php echo __('Repeated'); ?>");
|
||||
}
|
||||
$("#module").find("option[value='0']").remove();
|
||||
}
|
||||
@ -1094,7 +1094,7 @@ $(document).ready (function () {
|
||||
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('Repeated'); ?>');
|
||||
alert("<?php echo __('Repeated'); ?>");
|
||||
}
|
||||
$("#module").find("option[value='0']").remove();
|
||||
}
|
||||
@ -1110,7 +1110,7 @@ $(document).ready (function () {
|
||||
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('Repeated'); ?>');
|
||||
alert("<?php echo __('Repeated'); ?>");
|
||||
}
|
||||
$("#module").find("option[value='0']").remove();
|
||||
}
|
||||
@ -1126,7 +1126,7 @@ $(document).ready (function () {
|
||||
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('Repeated'); ?>');
|
||||
alert("<?php echo __('Repeated'); ?>");
|
||||
}
|
||||
$("#module").find("option[value='0']").remove();
|
||||
}
|
||||
@ -1151,7 +1151,7 @@ $(document).ready (function () {
|
||||
|| ($("#module option").length == 1
|
||||
&& $("#module option").eq(0).val() == 0)) {
|
||||
|
||||
alert('<?php echo __('Modules list is empty'); ?>');
|
||||
alert("<?php echo __('Modules list is empty'); ?>");
|
||||
return false;
|
||||
}
|
||||
$('#module option').map(function() {
|
||||
|
@ -317,7 +317,6 @@ $table->data[0][0] = '<b>'.__('Target IP').'</b>';
|
||||
$table->data[0][1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true);
|
||||
|
||||
$table->data[0][2] = '<b>'.__('Namespace').'</b>';
|
||||
$table->data[0][2] .= ui_print_help_icon('wminamespace', true);
|
||||
$table->data[0][3] = html_print_input_text('tcp_send', $tcp_send, '', 15, 60, true);
|
||||
|
||||
$table->data[1][0] = '<b>'.__('Username').'</b>';
|
||||
@ -571,7 +570,7 @@ $(document).ready (function () {
|
||||
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('Repeated'); ?>');
|
||||
alert("<?php echo __('Repeated'); ?>");
|
||||
}
|
||||
$("#module").find("option[value='0']").remove();
|
||||
}
|
||||
@ -587,7 +586,7 @@ $(document).ready (function () {
|
||||
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('Repeated'); ?>');
|
||||
alert("<?php echo __('Repeated'); ?>");
|
||||
}
|
||||
$("#module").find("option[value='0']").remove();
|
||||
}
|
||||
@ -603,7 +602,7 @@ $(document).ready (function () {
|
||||
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('Repeated'); ?>');
|
||||
alert("<?php echo __('Repeated'); ?>");
|
||||
}
|
||||
$("#module").find("option[value='0']").remove();
|
||||
}
|
||||
@ -619,7 +618,7 @@ $(document).ready (function () {
|
||||
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('Repeated'); ?>');
|
||||
alert("<?php echo __('Repeated'); ?>");
|
||||
}
|
||||
$("#module").find("option[value='0']").remove();
|
||||
}
|
||||
@ -641,7 +640,7 @@ $(document).ready (function () {
|
||||
|
||||
$("#submit-create_modules_btn").click(function () {
|
||||
if($("#module option").length == 0 || ($("#module option").length == 1 && $("#module option").eq(0).val() == 0)) {
|
||||
alert('<?php echo __('Modules list is empty'); ?>');
|
||||
alert("<?php echo __('Modules list is empty'); ?>");
|
||||
return false;
|
||||
}
|
||||
$('#module option').map(function() {
|
||||
|
@ -579,11 +579,11 @@ if ($id_agente) {
|
||||
switch ($tab) {
|
||||
case 'main':
|
||||
$tab_description = '- '.__('Setup');
|
||||
$help_header = 'main_tab';
|
||||
break;
|
||||
|
||||
case 'collection':
|
||||
$tab_description = '- '.__('Collection');
|
||||
$help_header = 'collection_tab';
|
||||
break;
|
||||
|
||||
case 'inventory':
|
||||
@ -601,6 +601,8 @@ if ($id_agente) {
|
||||
$tab_description = '- '.__('Modules');
|
||||
if ($type_module_t == 'webux') {
|
||||
$help_header = 'wux_console';
|
||||
} else {
|
||||
$help_header = 'local_module_tab';
|
||||
}
|
||||
break;
|
||||
|
||||
@ -611,7 +613,6 @@ if ($id_agente) {
|
||||
|
||||
case 'template':
|
||||
$tab_description = '- '.__('Templates');
|
||||
$help_header = 'template_tab';
|
||||
break;
|
||||
|
||||
case 'gis':
|
||||
@ -631,14 +632,17 @@ if ($id_agente) {
|
||||
switch (get_parameter('wizard_section')) {
|
||||
case 'snmp_explorer':
|
||||
$tab_description = '- '.__('SNMP Wizard');
|
||||
$help_header = 'agent_snmp_explorer_tab';
|
||||
break;
|
||||
|
||||
case 'snmp_interfaces_explorer':
|
||||
$tab_description = '- '.__('SNMP Interfaces wizard');
|
||||
$help_header = 'agent_snmp_interfaces_explorer_tab';
|
||||
break;
|
||||
|
||||
case 'wmi_explorer':
|
||||
$tab_description = '- '.__('WMI Wizard');
|
||||
$help_header = 'agent_snmp_wmi_explorer_tab';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -591,7 +591,7 @@ ui_toggle(
|
||||
);
|
||||
ui_toggle(
|
||||
html_print_table($table_macros, true),
|
||||
__('Custom macros').ui_print_help_icon('module_macros', true)
|
||||
__('Custom macros')
|
||||
);
|
||||
|
||||
if ($moduletype != 13) {
|
||||
|
@ -159,6 +159,7 @@ if ($disabledBecauseInPolicy) {
|
||||
}
|
||||
|
||||
$update_module_id = (int) get_parameter_get('update_module');
|
||||
$edit_module = (bool) get_parameter_get('edit_module');
|
||||
$table_simple = new stdClass();
|
||||
$table_simple->id = 'simple';
|
||||
$table_simple->width = '100%';
|
||||
@ -270,7 +271,7 @@ if (!$in_policy) {
|
||||
}
|
||||
}
|
||||
|
||||
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon('module_type', true);
|
||||
$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);
|
||||
|
||||
if (isset($id_agent_module)) {
|
||||
@ -350,6 +351,35 @@ if (!$edit) {
|
||||
$table_simple->data[2][1] .= html_print_input_hidden('type_names', base64_encode(io_json_mb_encode($type_names_hash)), true);
|
||||
}
|
||||
|
||||
if ($edit_module) {
|
||||
$id_module_type = (int) $id_module_type;
|
||||
if (($id_module_type >= 1 && $id_module_type <= 5)
|
||||
|| ($id_module_type >= 21 && $id_module_type <= 23)
|
||||
|| ($id_module_type == 100)
|
||||
) {
|
||||
$help_header = 'local_module';
|
||||
}
|
||||
|
||||
if ($id_module_type === 6 || $id_module_type === 7
|
||||
) {
|
||||
$help_header = 'icmp_module_tab';
|
||||
}
|
||||
|
||||
if ($id_module_type >= 15 && $id_module_type <= 18) {
|
||||
$help_header = 'snmp_module_tab';
|
||||
}
|
||||
|
||||
if ($id_module_type >= 8 && $id_module_type <= 11) {
|
||||
$help_header = 'tcp_module_tab';
|
||||
}
|
||||
|
||||
if ($id_module_type >= 30 && $id_module_type <= 33) {
|
||||
$help_header = 'webserver_module_tab';
|
||||
}
|
||||
|
||||
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_header, true);
|
||||
}
|
||||
|
||||
if ($disabledBecauseInPolicy) {
|
||||
$table_simple->data[2][3] .= html_print_input_hidden('id_module_group', $id_module_group, true);
|
||||
}
|
||||
@ -1170,6 +1200,7 @@ html_print_input_hidden('module_relations_count', $relations_count);
|
||||
|
||||
ui_require_jquery_file('json');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
@ -1223,7 +1254,124 @@ $(document).ready (function () {
|
||||
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
|
||||
|
||||
var type_name_selected = type_names[type_selected];
|
||||
|
||||
var element = document.getElementById("module_type_help");
|
||||
var language = "<?php echo $config['language']; ?>" ;
|
||||
element.onclick = function (event) {
|
||||
if(type_name_selected == 'async_data' ||
|
||||
type_name_selected == 'async_proc' ||
|
||||
type_name_selected == 'async_string' ||
|
||||
type_name_selected == 'generic_proc'||
|
||||
type_name_selected == 'generic_data' ||
|
||||
type_name_selected == 'generic_data_inc' ||
|
||||
type_name_selected == 'generic_data_inc_abs'||
|
||||
type_name_selected == 'generic_data_string' ||
|
||||
type_name_selected == 'keep_alive'
|
||||
){
|
||||
if (language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Operacion&printable=yes#Tipos_de_m.C3.B3dulos',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Operations&printable=yes#Types_of_Modules',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(type_name_selected == 'remote_icmp' ||
|
||||
type_name_selected == 'remote_icmp_proc'
|
||||
){
|
||||
if(language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_ICMP',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#ICMP_Monitoring',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(type_name_selected == 'remote_snmp_string' ||
|
||||
type_name_selected == 'remote_snmp_proc' ||
|
||||
type_name_selected == 'remote_snmp_inc' ||
|
||||
type_name_selected == 'remote_snmp'
|
||||
){
|
||||
if(language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizando_con_m.C3.B3dulos_de_red_tipo_SNMP',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#Monitoring_by_Network_Modules_with_SNMP',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(type_name_selected == 'remote_tcp_string' ||
|
||||
type_name_selected == 'remote_tcp_proc' ||
|
||||
type_name_selected == 'remote_tcp_inc' ||
|
||||
type_name_selected == 'remote_tcp'
|
||||
){
|
||||
if(language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_TCP',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#TCP_Monitoring',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(type_name_selected == 'web_data' ||
|
||||
type_name_selected == 'web_proc' ||
|
||||
type_name_selected == 'web_content_data' ||
|
||||
type_name_selected == 'web_content_string'
|
||||
){
|
||||
if(language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_web&printable=yes#Creaci.C3.B3n_de_m.C3.B3dulos_web',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Web_Monitoring&printable=yes#Creating_Web_Modules',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (type_name_selected.match(/_string$/) == null) {
|
||||
// Numeric types
|
||||
$('#string_critical').hide();
|
||||
@ -1363,7 +1511,7 @@ function disabled_two_tailed (disabledBecauseInPolicy) {
|
||||
function advanced_option_dynamic() {
|
||||
if($('.hide_dinamic').is(":visible")){
|
||||
$('.hide_dinamic').hide();
|
||||
|
||||
|
||||
} else {
|
||||
$('.hide_dinamic').show();
|
||||
|
||||
|
@ -42,7 +42,7 @@ if (empty($update_module_id)) {
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Target IP');
|
||||
$data[0] = __('Target IP').' '.ui_print_help_icon('wmi_module_tab', true);
|
||||
$data[1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true);
|
||||
$data[2] = __('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true);
|
||||
$data[3] = html_print_input_text(
|
||||
|
@ -1,16 +1,32 @@
|
||||
<?php
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 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.
|
||||
// Load global vars
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Planned Donwtimes
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
@ -27,82 +43,119 @@ if (!$agent_d && !$agent_w) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Default
|
||||
// Default.
|
||||
set_unless_defined($config['past_planned_downtimes'], 1);
|
||||
|
||||
require_once 'include/functions_users.php';
|
||||
|
||||
// Buttons
|
||||
// Buttons.
|
||||
$buttons = [
|
||||
'text' => "<a href='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>".html_print_image('images/list.png', true, ['title' => __('List')]).'</a>',
|
||||
'text' => "<a href='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>".html_print_image(
|
||||
'images/list.png',
|
||||
true,
|
||||
['title' => __('List')]
|
||||
).'</a>',
|
||||
];
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Planned Downtime'),
|
||||
'images/gm_monitoring.png',
|
||||
false,
|
||||
'planned_downtime',
|
||||
'planned_downtime_editor',
|
||||
true,
|
||||
$buttons
|
||||
);
|
||||
|
||||
// recursion group filter
|
||||
// Recursion group filter.
|
||||
$recursion = get_parameter('recursion', $_POST['recursion']);
|
||||
|
||||
|
||||
// Initialize data
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
$name = (string) get_parameter('name');
|
||||
$description = (string) get_parameter('description');
|
||||
// Initialize data.
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
$name = (string) get_parameter('name');
|
||||
$description = (string) get_parameter('description');
|
||||
|
||||
$type_downtime = (string) get_parameter('type_downtime', 'quiet');
|
||||
$type_execution = (string) get_parameter('type_execution', 'once');
|
||||
$type_periodicity = (string) get_parameter('type_periodicity', 'weekly');
|
||||
$type_downtime = (string) get_parameter('type_downtime', 'quiet');
|
||||
$type_execution = (string) get_parameter('type_execution', 'once');
|
||||
$type_periodicity = (string) get_parameter('type_periodicity', 'weekly');
|
||||
|
||||
$utimestamp = get_system_time();
|
||||
// Fake utimestamp to retrieve the string date of the system
|
||||
// Fake utimestamp to retrieve the string date of the system.
|
||||
$system_time = ($utimestamp - get_fixed_offset());
|
||||
|
||||
$once_date_from = (string) get_parameter('once_date_from', date(DATE_FORMAT, $utimestamp));
|
||||
$once_time_from = (string) get_parameter('once_time_from', date(TIME_FORMAT, $utimestamp));
|
||||
$once_date_to = (string) get_parameter('once_date_to', date(DATE_FORMAT, $utimestamp));
|
||||
$once_time_to = (string) get_parameter('once_time_to', date(TIME_FORMAT, ($utimestamp + SECONDS_1HOUR)));
|
||||
$once_date_from = (string) get_parameter(
|
||||
'once_date_from',
|
||||
date(DATE_FORMAT, $utimestamp)
|
||||
);
|
||||
$once_time_from = (string) get_parameter(
|
||||
'once_time_from',
|
||||
date(TIME_FORMAT, $utimestamp)
|
||||
);
|
||||
$once_date_to = (string) get_parameter(
|
||||
'once_date_to',
|
||||
date(DATE_FORMAT, $utimestamp)
|
||||
);
|
||||
$once_time_to = (string) get_parameter(
|
||||
'once_time_to',
|
||||
date(TIME_FORMAT, ($utimestamp + SECONDS_1HOUR))
|
||||
);
|
||||
|
||||
$periodically_day_from = (int) get_parameter('periodically_day_from', 1);
|
||||
$periodically_day_to = (int) get_parameter('periodically_day_to', 31);
|
||||
$periodically_time_from = (string) get_parameter('periodically_time_from', date(TIME_FORMAT, $system_time));
|
||||
$periodically_time_to = (string) get_parameter('periodically_time_to', date(TIME_FORMAT, ($system_time + SECONDS_1HOUR)));
|
||||
$periodically_day_from = (int) get_parameter(
|
||||
'periodically_day_from',
|
||||
1
|
||||
);
|
||||
$periodically_day_to = (int) get_parameter(
|
||||
'periodically_day_to',
|
||||
31
|
||||
);
|
||||
$periodically_time_from = (string) get_parameter(
|
||||
'periodically_time_from',
|
||||
date(TIME_FORMAT, $system_time)
|
||||
);
|
||||
$periodically_time_to = (string) get_parameter(
|
||||
'periodically_time_to',
|
||||
date(TIME_FORMAT, ($system_time + SECONDS_1HOUR))
|
||||
);
|
||||
|
||||
$monday = (bool) get_parameter('monday');
|
||||
$tuesday = (bool) get_parameter('tuesday');
|
||||
$wednesday = (bool) get_parameter('wednesday');
|
||||
$thursday = (bool) get_parameter('thursday');
|
||||
$friday = (bool) get_parameter('friday');
|
||||
$saturday = (bool) get_parameter('saturday');
|
||||
$sunday = (bool) get_parameter('sunday');
|
||||
$monday = (bool) get_parameter('monday');
|
||||
$tuesday = (bool) get_parameter('tuesday');
|
||||
$wednesday = (bool) get_parameter('wednesday');
|
||||
$thursday = (bool) get_parameter('thursday');
|
||||
$friday = (bool) get_parameter('friday');
|
||||
$saturday = (bool) get_parameter('saturday');
|
||||
$sunday = (bool) get_parameter('sunday');
|
||||
|
||||
$first_create = (int) get_parameter('first_create');
|
||||
$create_downtime = (int) get_parameter('create_downtime');
|
||||
$update_downtime = (int) get_parameter('update_downtime');
|
||||
$edit_downtime = (int) get_parameter('edit_downtime');
|
||||
$id_downtime = (int) get_parameter('id_downtime');
|
||||
$first_create = (int) get_parameter('first_create');
|
||||
$create_downtime = (int) get_parameter('create_downtime');
|
||||
$update_downtime = (int) get_parameter('update_downtime');
|
||||
$edit_downtime = (int) get_parameter('edit_downtime');
|
||||
$id_downtime = (int) get_parameter('id_downtime');
|
||||
|
||||
$id_agent = (int) get_parameter('id_agent');
|
||||
$insert_downtime_agent = (int) get_parameter('insert_downtime_agent');
|
||||
$delete_downtime_agent = (int) get_parameter('delete_downtime_agent');
|
||||
$id_agent = (int) get_parameter('id_agent');
|
||||
$insert_downtime_agent = (int) get_parameter('insert_downtime_agent');
|
||||
$delete_downtime_agent = (int) get_parameter('delete_downtime_agent');
|
||||
|
||||
$modules_selection_mode = (string) get_parameter('modules_selection_mode');
|
||||
|
||||
// User groups with AD or AW permission for ACL checks
|
||||
$user_groups_ad = array_keys(users_get_groups($config['id_user'], $access));
|
||||
// User groups with AD or AW permission for ACL checks.
|
||||
$user_groups_ad = array_keys(
|
||||
users_get_groups($config['id_user'], $access)
|
||||
);
|
||||
|
||||
// INSERT A NEW DOWNTIME_AGENT ASSOCIATION
|
||||
// INSERT A NEW DOWNTIME_AGENT ASSOCIATION.
|
||||
if ($insert_downtime_agent === 1) {
|
||||
// Check AD permission on downtime
|
||||
$downtime_group = db_get_value('id_group', 'tplanned_downtime', 'id', $id_downtime);
|
||||
// Check AD permission on downtime.
|
||||
$downtime_group = db_get_value(
|
||||
'id_group',
|
||||
'tplanned_downtime',
|
||||
'id',
|
||||
$id_downtime
|
||||
);
|
||||
|
||||
if ($downtime_group === false || !in_array($downtime_group, $user_groups_ad)) {
|
||||
if ($downtime_group === false
|
||||
|| !in_array($downtime_group, $user_groups_ad)
|
||||
) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access downtime scheduler'
|
||||
@ -116,17 +169,27 @@ if ($insert_downtime_agent === 1) {
|
||||
|
||||
$all_modules = (empty($module_names) || ($module_names[0] === '0'));
|
||||
|
||||
// 'Is running' check
|
||||
$is_running = (bool) db_get_value('executed', 'tplanned_downtime', 'id', $id_downtime);
|
||||
// 'Is running' check.
|
||||
$is_running = (bool) db_get_value(
|
||||
'executed',
|
||||
'tplanned_downtime',
|
||||
'id',
|
||||
$id_downtime
|
||||
);
|
||||
if ($is_running) {
|
||||
ui_print_error_message(__('This elements cannot be modified while the downtime is being executed'));
|
||||
ui_print_error_message(
|
||||
__('This elements cannot be modified while the downtime is being executed')
|
||||
);
|
||||
} else {
|
||||
foreach ($agents as $agent_id) {
|
||||
// check module belongs to the agent
|
||||
// Check module belongs to the agent.
|
||||
if ($modules_selection_mode == 'all') {
|
||||
$check = false;
|
||||
foreach ($module_names as $module_name) {
|
||||
$check_module = modules_get_agentmodule_id($module_name, $agent_id);
|
||||
$check_module = modules_get_agentmodule_id(
|
||||
$module_name,
|
||||
$agent_id
|
||||
);
|
||||
if (!empty($check_module)) {
|
||||
$check = true;
|
||||
}
|
||||
@ -137,10 +200,17 @@ if ($insert_downtime_agent === 1) {
|
||||
}
|
||||
}
|
||||
|
||||
// Check AD permission on agent
|
||||
$agent_group = db_get_value('id_grupo', 'tagente', 'id_agente', $agent_id);
|
||||
// Check AD permission on agent.
|
||||
$agent_group = db_get_value(
|
||||
'id_grupo',
|
||||
'tagente',
|
||||
'id_agente',
|
||||
$agent_id
|
||||
);
|
||||
|
||||
if ($agent_group === false || !in_array($agent_group, $user_groups_ad)) {
|
||||
if ($agent_group === false
|
||||
|| !in_array($agent_group, $user_groups_ad)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -149,11 +219,17 @@ if ($insert_downtime_agent === 1) {
|
||||
'id_agent' => $agent_id,
|
||||
'all_modules' => $all_modules,
|
||||
];
|
||||
$result = db_process_sql_insert('tplanned_downtime_agents', $values);
|
||||
$result = db_process_sql_insert(
|
||||
'tplanned_downtime_agents',
|
||||
$values
|
||||
);
|
||||
|
||||
if ($result && !$all_modules) {
|
||||
foreach ($module_names as $module_name) {
|
||||
$module = modules_get_agentmodule_id($module_name, $agent_id);
|
||||
$module = modules_get_agentmodule_id(
|
||||
$module_name,
|
||||
$agent_id
|
||||
);
|
||||
|
||||
if (empty($module)) {
|
||||
continue;
|
||||
@ -164,7 +240,10 @@ if ($insert_downtime_agent === 1) {
|
||||
'id_agent' => $agent_id,
|
||||
'id_agent_module' => $module['id_agente_modulo'],
|
||||
];
|
||||
$result = db_process_sql_insert('tplanned_downtime_modules', $values);
|
||||
$result = db_process_sql_insert(
|
||||
'tplanned_downtime_modules',
|
||||
$values
|
||||
);
|
||||
|
||||
if ($result) {
|
||||
$values = ['id_user' => $config['id_user']];
|
||||
@ -180,14 +259,21 @@ if ($insert_downtime_agent === 1) {
|
||||
}
|
||||
}
|
||||
|
||||
// DELETE A DOWNTIME_AGENT ASSOCIATION
|
||||
// DELETE A DOWNTIME_AGENT ASSOCIATION.
|
||||
if ($delete_downtime_agent === 1) {
|
||||
$id_da = (int) get_parameter('id_downtime_agent');
|
||||
|
||||
// Check AD permission on downtime
|
||||
$downtime_group = db_get_value('id_group', 'tplanned_downtime', 'id', $id_downtime);
|
||||
// Check AD permission on downtime.
|
||||
$downtime_group = db_get_value(
|
||||
'id_group',
|
||||
'tplanned_downtime',
|
||||
'id',
|
||||
$id_downtime
|
||||
);
|
||||
|
||||
if ($downtime_group === false || !in_array($downtime_group, $user_groups_ad)) {
|
||||
if ($downtime_group === false
|
||||
|| !in_array($downtime_group, $user_groups_ad)
|
||||
) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access downtime scheduler'
|
||||
@ -196,10 +282,17 @@ if ($delete_downtime_agent === 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check AD permission on agent
|
||||
$agent_group = db_get_value('id_grupo', 'tagente', 'id_agente', $id_agent);
|
||||
// Check AD permission on agent.
|
||||
$agent_group = db_get_value(
|
||||
'id_grupo',
|
||||
'tagente',
|
||||
'id_agente',
|
||||
$id_agent
|
||||
);
|
||||
|
||||
if ($agent_group === false || !in_array($agent_group, $user_groups_ad)) {
|
||||
if ($agent_group === false
|
||||
|| !in_array($agent_group, $user_groups_ad)
|
||||
) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access downtime scheduler'
|
||||
@ -208,17 +301,27 @@ if ($delete_downtime_agent === 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 'Is running' check
|
||||
$is_running = (bool) db_get_value('executed', 'tplanned_downtime', 'id', $id_downtime);
|
||||
// 'Is running' check.
|
||||
$is_running = (bool) db_get_value(
|
||||
'executed',
|
||||
'tplanned_downtime',
|
||||
'id',
|
||||
$id_downtime
|
||||
);
|
||||
if ($is_running) {
|
||||
ui_print_error_message(__('This elements cannot be modified while the downtime is being executed'));
|
||||
ui_print_error_message(
|
||||
__('This elements cannot be modified while the downtime is being executed')
|
||||
);
|
||||
} else {
|
||||
$row_to_delete = db_get_row('tplanned_downtime_agents', 'id', $id_da);
|
||||
|
||||
$result = db_process_sql_delete('tplanned_downtime_agents', ['id' => $id_da]);
|
||||
$result = db_process_sql_delete(
|
||||
'tplanned_downtime_agents',
|
||||
['id' => $id_da]
|
||||
);
|
||||
|
||||
if ($result) {
|
||||
// Delete modules in downtime
|
||||
// Delete modules in downtime.
|
||||
db_process_sql_delete(
|
||||
'tplanned_downtime_modules',
|
||||
[
|
||||
@ -230,7 +333,7 @@ if ($delete_downtime_agent === 1) {
|
||||
}
|
||||
}
|
||||
|
||||
// UPDATE OR CREATE A DOWNTIME (MAIN DATA, NOT AGENT ASSOCIATION)
|
||||
// UPDATE OR CREATE A DOWNTIME (MAIN DATA, NOT AGENT ASSOCIATION).
|
||||
if ($create_downtime || $update_downtime) {
|
||||
$check = (bool) db_get_value('name', 'tplanned_downtime', 'name', $name);
|
||||
|
||||
@ -239,22 +342,32 @@ if ($create_downtime || $update_downtime) {
|
||||
$now = time();
|
||||
|
||||
if ($type_execution == 'once' && !$config['past_planned_downtimes'] && $datetime_from < $now) {
|
||||
ui_print_error_message(__('Not created. Error inserting data. Start time must be higher than the current time'));
|
||||
ui_print_error_message(
|
||||
__('Not created. Error inserting data. Start time must be higher than the current time')
|
||||
);
|
||||
} else if ($type_execution == 'once' && $datetime_from >= $datetime_to) {
|
||||
ui_print_error_message(__('Not created. Error inserting data').'. '.__('The end date must be higher than the start date'));
|
||||
ui_print_error_message(
|
||||
__('Not created. Error inserting data').'. '.__('The end date must be higher than the start date')
|
||||
);
|
||||
} else if ($type_execution == 'once' && $datetime_to <= $now && !$config['past_planned_downtimes']) {
|
||||
ui_print_error_message(__('Not created. Error inserting data').'. '.__('The end date must be higher than the current time'));
|
||||
ui_print_error_message(
|
||||
__('Not created. Error inserting data').'. '.__('The end date must be higher than the current time')
|
||||
);
|
||||
} else if ($type_execution == 'periodically'
|
||||
&& (($type_periodicity == 'weekly' && $periodically_time_from >= $periodically_time_to)
|
||||
|| ($type_periodicity == 'monthly' && $periodically_day_from == $periodically_day_to && $periodically_time_from >= $periodically_time_to))
|
||||
) {
|
||||
ui_print_error_message(__('Not created. Error inserting data').'. '.__('The end time must be higher than the start time'));
|
||||
ui_print_error_message(
|
||||
__('Not created. Error inserting data').'. '.__('The end time must be higher than the start time')
|
||||
);
|
||||
} else if ($type_execution == 'periodically' && $type_periodicity == 'monthly' && $periodically_day_from > $periodically_day_to) {
|
||||
ui_print_error_message(__('Not created. Error inserting data').'. '.__('The end day must be higher than the start day'));
|
||||
ui_print_error_message(
|
||||
__('Not created. Error inserting data').'. '.__('The end day must be higher than the start day')
|
||||
);
|
||||
} else {
|
||||
$sql = '';
|
||||
if ($create_downtime) {
|
||||
// Check AD permission on new downtime
|
||||
// Check AD permission on new downtime.
|
||||
if (!in_array($id_group, $user_groups_ad)) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
@ -295,7 +408,10 @@ if ($create_downtime || $update_downtime) {
|
||||
$values['periodically_time_to'] = '1970/01/01 '.$values['periodically_time_to'];
|
||||
}
|
||||
|
||||
$result = db_process_sql_insert('tplanned_downtime', $values);
|
||||
$result = db_process_sql_insert(
|
||||
'tplanned_downtime',
|
||||
$values
|
||||
);
|
||||
} else {
|
||||
ui_print_error_message(
|
||||
__('Each planned downtime must have a different name')
|
||||
@ -309,7 +425,7 @@ if ($create_downtime || $update_downtime) {
|
||||
} else if ($update_downtime) {
|
||||
$old_downtime = db_get_row('tplanned_downtime', 'id', $id_downtime);
|
||||
|
||||
// Check AD permission on OLD downtime
|
||||
// Check AD permission on OLD downtime.
|
||||
if (empty($old_downtime) || !in_array($old_downtime['id_group'], $user_groups_ad)) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
@ -319,7 +435,7 @@ if ($create_downtime || $update_downtime) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check AD permission on NEW downtime group
|
||||
// Check AD permission on NEW downtime group.
|
||||
if (!in_array($id_group, $user_groups_ad)) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
@ -329,14 +445,17 @@ if ($create_downtime || $update_downtime) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 'Is running' check
|
||||
// 'Is running' check.
|
||||
$is_running = (bool) $old_downtime['executed'];
|
||||
|
||||
$values = [];
|
||||
if (trim(io_safe_output($name)) == '') {
|
||||
ui_print_error_message(__('Planned downtime must have a name'));
|
||||
ui_print_error_message(
|
||||
__('Planned downtime must have a name')
|
||||
);
|
||||
}
|
||||
// When running only certain items can be modified for the 'once' type
|
||||
|
||||
// When running only certain items can be modified for the 'once' type.
|
||||
else if ($is_running && $type_execution == 'once') {
|
||||
$values = [
|
||||
'description' => $description,
|
||||
@ -344,7 +463,9 @@ if ($create_downtime || $update_downtime) {
|
||||
'id_user' => $config['id_user'],
|
||||
];
|
||||
} else if ($is_running) {
|
||||
ui_print_error_message(__('Cannot be modified while the downtime is being executed'));
|
||||
ui_print_error_message(
|
||||
__('Cannot be modified while the downtime is being executed')
|
||||
);
|
||||
} else {
|
||||
$values = [
|
||||
'name' => $name,
|
||||
@ -376,7 +497,11 @@ if ($create_downtime || $update_downtime) {
|
||||
}
|
||||
|
||||
if (!empty($values)) {
|
||||
$result = db_process_sql_update('tplanned_downtime', $values, ['id' => $id_downtime]);
|
||||
$result = db_process_sql_update(
|
||||
'tplanned_downtime',
|
||||
$values,
|
||||
['id' => $id_downtime]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -399,7 +524,7 @@ if ($create_downtime || $update_downtime) {
|
||||
|
||||
// Have any data to show ?
|
||||
if ($id_downtime > 0) {
|
||||
// Columns of the table tplanned_downtime
|
||||
// Columns of the table tplanned_downtime.
|
||||
$columns = [
|
||||
'id',
|
||||
'name',
|
||||
@ -436,7 +561,8 @@ if ($id_downtime > 0) {
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
// Oracle doesn't have TIME type, so we should transform the DATE value
|
||||
// Oracle doesn't have TIME type,
|
||||
// so we should transform the DATE value.
|
||||
$new_time_from = "TO_CHAR(periodically_time_from, 'HH24:MI:SS') AS periodically_time_from";
|
||||
$new_time_to = "TO_CHAR(periodically_time_to, 'HH24:MI:SS') AS periodically_time_to";
|
||||
|
||||
@ -500,7 +626,8 @@ if ($id_downtime > 0) {
|
||||
$running = (bool) $result['executed'];
|
||||
}
|
||||
|
||||
// when the planned downtime is in execution, only action to postpone on once type is enabled and the other are disabled.
|
||||
// When the planned downtime is in execution,
|
||||
// only action to postpone on once type is enabled and the other are disabled.
|
||||
$disabled_in_execution = (int) $running;
|
||||
|
||||
$table = new StdClass();
|
||||
@ -508,11 +635,40 @@ $table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text('name', $name, '', 25, 40, true, $disabled_in_execution);
|
||||
$table->data[0][1] = html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
25,
|
||||
40,
|
||||
true,
|
||||
$disabled_in_execution
|
||||
);
|
||||
$table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', 0, true, false, true, '', $disabled_in_execution);
|
||||
$table->data[1][1] = html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
true,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
);
|
||||
$table->data[2][0] = __('Description');
|
||||
$table->data[2][1] = html_print_textarea('description', 3, 35, $description, '', true);
|
||||
$table->data[2][1] = html_print_textarea(
|
||||
'description',
|
||||
3,
|
||||
35,
|
||||
$description,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[3][0] = __('Type').ui_print_help_tip(
|
||||
__('Quiet: Modules will not generate events or fire alerts.').'<br>'.__('Disable Agents: Disables the selected agents.').'<br>'.__('Disable Alerts: Disable alerts for the selected agents.'),
|
||||
@ -554,7 +710,7 @@ $table->data[4][1] = html_print_select(
|
||||
);
|
||||
|
||||
$days = array_combine(range(1, 31), range(1, 31));
|
||||
$table->data[5][0] = __('Configure the time').' '.ui_print_help_icon('planned_downtime_time', true);
|
||||
$table->data[5][0] = __('Configure the time').' ';
|
||||
;
|
||||
$table->data[5][1] = "
|
||||
<div id='once_time' style='display: none;'>
|
||||
@ -678,7 +834,7 @@ if ($id_downtime > 0) {
|
||||
echo "<tr><td width=75% valign='top'>";
|
||||
}
|
||||
|
||||
// Editor form
|
||||
// Editor form.
|
||||
html_print_table($table);
|
||||
|
||||
html_print_input_hidden('id_agent', $id_agent);
|
||||
@ -686,10 +842,20 @@ echo '<div class="action-buttons" style="width: 100%">';
|
||||
if ($id_downtime > 0) {
|
||||
html_print_input_hidden('update_downtime', 1);
|
||||
html_print_input_hidden('id_downtime', $id_downtime);
|
||||
html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'updbutton',
|
||||
false,
|
||||
'class="sub upd"'
|
||||
);
|
||||
} else {
|
||||
html_print_input_hidden('create_downtime', 1);
|
||||
html_print_submit_button(__('Add'), 'crtbutton', false, 'class="sub wand"');
|
||||
html_print_submit_button(
|
||||
__('Add'),
|
||||
'crtbutton',
|
||||
false,
|
||||
'class="sub wand"'
|
||||
);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
@ -700,11 +866,11 @@ if ($id_downtime > 0) {
|
||||
|
||||
$filter_group = (int) get_parameter('filter_group', 0);
|
||||
|
||||
// User AD groups to str for the filter
|
||||
// User AD groups to str for the filter.
|
||||
$id_groups_str = implode(',', $user_groups_ad);
|
||||
|
||||
if (empty($id_groups_str)) {
|
||||
// Restrictive filter on error. This will filter all the downtimes
|
||||
// Restrictive filter on error. This will filter all the downtimes.
|
||||
$id_groups_str = '-1';
|
||||
}
|
||||
|
||||
@ -752,7 +918,7 @@ if ($id_downtime > 0) {
|
||||
|
||||
$agent_ids = extract_column($agents, 'id_agente');
|
||||
$agent_names = extract_column($agents, 'alias');
|
||||
// item[<id>] = <name>;
|
||||
|
||||
$agents = array_combine($agent_ids, $agent_names);
|
||||
if ($agents === false) {
|
||||
$agents = [];
|
||||
@ -763,7 +929,6 @@ if ($id_downtime > 0) {
|
||||
$disabled_add_button = true;
|
||||
}
|
||||
|
||||
|
||||
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
|
||||
html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'min-width:180px;margin-right:15px;');
|
||||
|
||||
@ -803,7 +968,10 @@ if ($id_downtime > 0) {
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
echo '<h4>'.__('Available modules:').ui_print_help_tip(__('Only for type Quiet for downtimes.'), true).'</h4>';
|
||||
echo '<h4>'.__('Available modules:').ui_print_help_tip(
|
||||
__('Only for type Quiet for downtimes.'),
|
||||
true
|
||||
).'</h4>';
|
||||
|
||||
if ($type_downtime != 'quiet') {
|
||||
echo '<div id="available_modules" style="display: none;">';
|
||||
@ -811,17 +979,36 @@ if ($id_downtime > 0) {
|
||||
echo '<div id="available_modules" style="">';
|
||||
}
|
||||
|
||||
echo html_print_select([], 'module[]', '', '', '', 0, false, true, true, '', false, 'width: 180px;');
|
||||
echo html_print_select(
|
||||
[],
|
||||
'module[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 180px;'
|
||||
);
|
||||
echo '</div>';
|
||||
echo '<br /><br /><br />';
|
||||
html_print_submit_button(__('Add'), 'add_item', $disabled_add_button, 'class="sub next"', false);
|
||||
html_print_submit_button(
|
||||
__('Add'),
|
||||
'add_item',
|
||||
$disabled_add_button,
|
||||
'class="sub next"',
|
||||
false
|
||||
);
|
||||
echo '</form>';
|
||||
echo '</table>';
|
||||
|
||||
// Start Overview of existing planned downtime
|
||||
// Start Overview of existing planned downtime.
|
||||
echo '<h4>'.__('Agents planned for this downtime').':</h4>';
|
||||
|
||||
// User the $id_groups_str built before
|
||||
// User the $id_groups_str built before.
|
||||
$sql = sprintf(
|
||||
'SELECT ta.nombre, tpda.id,
|
||||
ta.id_os, ta.id_agente, ta.id_grupo,
|
||||
@ -860,13 +1047,18 @@ if ($id_downtime > 0) {
|
||||
foreach ($downtimes_agents as $downtime_agent) {
|
||||
$data = [];
|
||||
|
||||
$alias = db_get_value('alias', 'tagente', 'id_agente', $downtime_agent['id_agente']);
|
||||
$alias = db_get_value(
|
||||
'alias',
|
||||
'tagente',
|
||||
'id_agente',
|
||||
$downtime_agent['id_agente']
|
||||
);
|
||||
$data[0] = $alias;
|
||||
|
||||
$data[1] = db_get_sql(
|
||||
'SELECT nombre
|
||||
FROM tgrupo
|
||||
WHERE id_grupo = '.$downtime_agent['id_grupo']
|
||||
FROM tgrupo
|
||||
WHERE id_grupo = '.$downtime_agent['id_grupo']
|
||||
);
|
||||
|
||||
$data[2] = ui_print_os_icon($downtime_agent['id_os'], true, true);
|
||||
@ -887,7 +1079,9 @@ if ($id_downtime > 0) {
|
||||
|
||||
if (!$running) {
|
||||
$data[5] = '';
|
||||
if ($type_downtime != 'disable_agents_alerts' && $type_downtime != 'disable_agents') {
|
||||
if ($type_downtime != 'disable_agents_alerts'
|
||||
&& $type_downtime != 'disable_agents'
|
||||
) {
|
||||
$data[5] = '<a href="javascript:show_editor_module('.$downtime_agent['id_agente'].');">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a>';
|
||||
}
|
||||
|
||||
@ -1038,7 +1232,7 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript
|
||||
}
|
||||
|
||||
function show_executing_alert () {
|
||||
alert('<?php echo __('This elements cannot be modified while the downtime is being executed'); ?>');
|
||||
alert("<?php echo __('This elements cannot be modified while the downtime is being executed'); ?>");
|
||||
}
|
||||
|
||||
function show_editor_module(id_agent) {
|
||||
@ -1168,7 +1362,7 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript
|
||||
var module_sel = $("#modules", $('#module_editor_' + id_agent)).val();
|
||||
|
||||
if (module_sel == 0) {
|
||||
alert('<?php echo __('Please select a module.'); ?>');
|
||||
alert("<?php echo __('Please select a module.'); ?>");
|
||||
}
|
||||
else {
|
||||
action_in_progress = true;
|
||||
|
@ -50,7 +50,7 @@ if ($migrate_malformed) {
|
||||
}
|
||||
}
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Planned Downtime'),
|
||||
'images/gm_monitoring.png',
|
||||
@ -115,7 +115,7 @@ if ($delete_downtime) {
|
||||
}
|
||||
}
|
||||
|
||||
// Filter parameters
|
||||
// Filter parameters.
|
||||
$offset = (int) get_parameter('offset');
|
||||
$filter_params = [];
|
||||
|
||||
@ -131,7 +131,7 @@ $module_name = $filter_params['module_name'] = (string) (!empty($module_
|
||||
|
||||
$filter_params_str = http_build_query($filter_params);
|
||||
|
||||
// Table filter
|
||||
// Table filter.
|
||||
$table_form = new StdClass();
|
||||
$table_form->class = 'databox filters';
|
||||
$table_form->width = '100%';
|
||||
@ -143,9 +143,9 @@ $table_form->data = [];
|
||||
|
||||
$row = [];
|
||||
|
||||
// Search text
|
||||
// Search text.
|
||||
$row[] = __('Search').' '.html_print_input_text('search_text', $search_text, '', 50, 250, true);
|
||||
// Dates
|
||||
// Dates.
|
||||
$date_inputs = __('From').' '.html_print_input_text('date_from', $date_from, '', 10, 10, true);
|
||||
$date_inputs .= ' ';
|
||||
$date_inputs .= __('To').' '.html_print_input_text('date_to', $date_to, '', 10, 10, true);
|
||||
@ -155,20 +155,20 @@ $table_form->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
|
||||
// Execution type
|
||||
// Execution type.
|
||||
$execution_type_fields = [
|
||||
'once' => __('Once'),
|
||||
'periodically' => __('Periodically'),
|
||||
];
|
||||
$row[] = __('Execution type').' '.html_print_select($execution_type_fields, 'execution_type', $execution_type, '', __('Any'), '', true, false, false);
|
||||
// Show past downtimes
|
||||
// Show past downtimes.
|
||||
$row[] = __('Show past downtimes').' '.html_print_checkbox('archived', 1, $show_archived, true);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
|
||||
// Agent
|
||||
// Agent.
|
||||
$params = [];
|
||||
$params['show_helptip'] = true;
|
||||
$params['input_name'] = 'agent_name';
|
||||
@ -180,14 +180,14 @@ $params['hidden_input_idagent_value'] = $agent_id;
|
||||
$agent_input = __('Agent').' '.ui_print_agent_autocomplete_input($params);
|
||||
$row[] = $agent_input;
|
||||
|
||||
// Module
|
||||
// Module.
|
||||
$row[] = __('Module').' '.html_print_autocomplete_modules('module_name', $module_name, false, true, '', [], true);
|
||||
|
||||
$row[] = html_print_submit_button(__('Search'), 'search', false, 'class="sub search"', true);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
// End of table filter
|
||||
// Useful to know if the user has done a form filtering
|
||||
// End of table filter.
|
||||
// Useful to know if the user has done a form filtering.
|
||||
$filter_performed = false;
|
||||
|
||||
$groups = users_get_groups(false, $access);
|
||||
@ -197,7 +197,7 @@ if (!empty($groups)) {
|
||||
$groups_string = implode(',', array_keys($groups));
|
||||
$where_values .= " AND id_group IN ($groups_string)";
|
||||
|
||||
// WARNING: add $filter_performed = true; to any future filter
|
||||
// WARNING: add $filter_performed = true; to any future filter.
|
||||
if (!empty($search_text)) {
|
||||
$filter_performed = true;
|
||||
|
||||
@ -272,7 +272,7 @@ if (!empty($groups)) {
|
||||
AND tpda.all_modules = 1))";
|
||||
}
|
||||
|
||||
// Columns of the table tplanned_downtime
|
||||
// Columns of the table tplanned_downtime.
|
||||
$columns = [
|
||||
'id',
|
||||
'name',
|
||||
@ -353,23 +353,23 @@ if (!empty($groups)) {
|
||||
$downtimes = [];
|
||||
}
|
||||
|
||||
// No downtimes cause the user has not anyone
|
||||
// No downtimes cause the user has not anyone.
|
||||
if (!$downtimes && !$filter_performed) {
|
||||
include_once $config['homedir'].'/general/firts_task/planned_downtime.php';
|
||||
}
|
||||
// No downtimes cause the user performed a search
|
||||
// No downtimes cause the user performed a search.
|
||||
else if (!$downtimes) {
|
||||
// Filter form
|
||||
// Filter form.
|
||||
echo "<form method='post' action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list'>";
|
||||
html_print_table($table_form);
|
||||
echo '</form>';
|
||||
|
||||
// Info message
|
||||
// Info message.
|
||||
echo '<div class="nf">'.__('No planned downtime').'</div>';
|
||||
|
||||
echo '<div class="action-buttons" style="width: 100%">';
|
||||
|
||||
// Create button
|
||||
// Create button.
|
||||
if ($write_permisson) {
|
||||
echo ' ';
|
||||
echo '<form method="post" action="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
|
||||
@ -379,7 +379,7 @@ else if (!$downtimes) {
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
// Has downtimes
|
||||
// Has downtimes.
|
||||
else {
|
||||
echo "<form method='post' action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list'>";
|
||||
html_print_table($table_form);
|
||||
@ -387,11 +387,11 @@ else {
|
||||
|
||||
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset);
|
||||
|
||||
// User groups with AR, AD or AW permission
|
||||
// User groups with AR, AD or AW permission.
|
||||
$groupsAD = users_get_groups($config['id_user'], $access);
|
||||
$groupsAD = array_keys($groupsAD);
|
||||
|
||||
// View available downtimes present in database (if any of them)
|
||||
// View available downtimes present in database (if any of them).
|
||||
$table = new StdClass();
|
||||
$table->class = 'info_table';
|
||||
$table->width = '100%';
|
||||
@ -475,7 +475,7 @@ else {
|
||||
);
|
||||
}
|
||||
|
||||
// If user have writting permissions
|
||||
// If user have writting permissions.
|
||||
if (in_array($downtime['id_group'], $groupsAD)) {
|
||||
// Stop button
|
||||
if ($downtime['type_execution'] == 'once' && $downtime['executed'] == 1) {
|
||||
@ -484,16 +484,16 @@ else {
|
||||
$data['stop'] = '';
|
||||
}
|
||||
|
||||
// Edit & delete buttons
|
||||
// Edit & delete buttons.
|
||||
if ($downtime['executed'] == 0) {
|
||||
// Edit
|
||||
// Edit.
|
||||
$data['edit'] = '<a href="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
|
||||
// Delete
|
||||
// Delete.
|
||||
$data['delete'] = '<a id="delete_downtime" href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list'.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]);
|
||||
} else if ($downtime['executed'] == 1 && $downtime['type_execution'] == 'once') {
|
||||
// Edit
|
||||
// Edit.
|
||||
$data['edit'] = '<a href="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
|
||||
// Delete
|
||||
// Delete.
|
||||
$data['delete'] = __('N/A');
|
||||
} else {
|
||||
$data['edit'] = '';
|
||||
@ -521,7 +521,7 @@ else {
|
||||
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
||||
// CSV export button
|
||||
// CSV export button.
|
||||
echo '<div style="display: inline;">';
|
||||
html_print_button(
|
||||
__('Export to CSV'),
|
||||
@ -532,7 +532,7 @@ else {
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
// Create button
|
||||
// Create button.
|
||||
if ($write_permisson) {
|
||||
echo ' ';
|
||||
echo '<form method="post" action="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
|
||||
|
@ -62,7 +62,7 @@ if ((!$copy_action) && (!$delete_action)) {
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_config', true);
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert actions'), 'images/gm_alerts.png', false, 'alerts_action', true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_alerts.php';
|
||||
@ -46,7 +46,7 @@ if (is_ajax()) {
|
||||
$id = (int) get_parameter('id', 0);
|
||||
$get_recovery_fields = (int) get_parameter('get_recovery_fields', 1);
|
||||
|
||||
// If command ID is not provided, check for action id
|
||||
// If command ID is not provided, check for action id.
|
||||
if ($id == 0) {
|
||||
$id_action = (int) get_parameter('id_action');
|
||||
$id = alerts_get_alert_action_alert_command_id($id_action);
|
||||
@ -59,31 +59,31 @@ if (is_ajax()) {
|
||||
$command['description'] = io_safe_input(str_replace("\r\n", '<br>', io_safe_output($command['description'])));
|
||||
}
|
||||
|
||||
// Descriptions are stored in json
|
||||
// Descriptions are stored in json.
|
||||
$fields_descriptions = empty($command['fields_descriptions']) ? '' : json_decode(io_safe_output($command['fields_descriptions']), true);
|
||||
// Fields values are stored in json
|
||||
// Fields values are stored in json.
|
||||
$fields_values = empty($command['fields_values']) ? '' : io_safe_output(json_decode($command['fields_values'], true));
|
||||
// Fields hidden conditions are stored in json.
|
||||
$fields_hidden_checked = empty($command['fields_hidden']) ? '' : io_safe_output(json_decode($command['fields_hidden'], true));
|
||||
|
||||
$fields_rows = [];
|
||||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
if (($i == 5) && ($command['id'] == 3)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$field_description = $fields_descriptions[($i - 1)];
|
||||
$field_value = $fields_values[($i - 1)];
|
||||
$field_hidden = $fields_hidden_checked[($i - 1)];
|
||||
|
||||
|
||||
if (!empty($field_description)) {
|
||||
// If the value is 5, this because severity in snmp alerts is not permit to show
|
||||
// If the value is 5, this because severity in snmp alerts is not permit to show.
|
||||
if (($i > 5) && ($command['id'] == 3)) {
|
||||
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), ($i - 1)).'</span>';
|
||||
} else {
|
||||
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), $i).'</span>';
|
||||
}
|
||||
|
||||
// If the field is the number one, print the help message
|
||||
// If the field is the number one, print the help message.
|
||||
if ($i == 1) {
|
||||
// If our context is snmpconsole, show snmp_alert helps
|
||||
// If our context is snmpconsole, show snmp_alert helps.
|
||||
if ((isset($_SERVER['HTTP_REFERER'])) && ( preg_match('/snmp_alert/', $_SERVER['HTTP_REFERER']) > 0 )) {
|
||||
$fdesc .= ui_print_help_icon('snmp_alert_field1', true);
|
||||
} else {
|
||||
@ -91,7 +91,7 @@ if (is_ajax()) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it
|
||||
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it.
|
||||
if (($i > 5) && ($command['id'] == 3)) {
|
||||
if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) {
|
||||
$fdesc = sprintf(__('Field %s'), ($i - 1));
|
||||
@ -107,9 +107,11 @@ if (is_ajax()) {
|
||||
}
|
||||
}
|
||||
|
||||
$style = ((int) $field_hidden === 1) ? '-webkit-text-security: disc;' : '';
|
||||
|
||||
if (!empty($field_value)) {
|
||||
$field_value = io_safe_output($field_value);
|
||||
// HTML type
|
||||
// HTML type.
|
||||
if (preg_match('/^_html_editor_$/i', $field_value)) {
|
||||
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
|
||||
$editor_type_chkbx .= __('Basic').ui_print_help_tip(__('For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels: <pre></pre>'), true);
|
||||
@ -148,7 +150,7 @@ if (is_ajax()) {
|
||||
$editor_type_chkbx .= html_print_radio_button_extended('field'.$i.'_recovery_value', 'text/html', '', 'text/html', false, '', '', true);
|
||||
$editor_type_chkbx .= '</small></b></div>';
|
||||
$rfield = $editor_type_chkbx;
|
||||
// Select type
|
||||
// Select type.
|
||||
} else {
|
||||
$fields_value_select = [];
|
||||
$fv = explode(';', $field_value);
|
||||
@ -200,7 +202,7 @@ if (is_ajax()) {
|
||||
1,
|
||||
1,
|
||||
$fv[0],
|
||||
'style="min-height:40px" class="fields"',
|
||||
'style="min-height:40px; '.$style.'" class="fields"',
|
||||
true
|
||||
);
|
||||
$rfield = html_print_textarea(
|
||||
@ -208,7 +210,7 @@ if (is_ajax()) {
|
||||
1,
|
||||
1,
|
||||
$fv[0],
|
||||
'style="min-height:40px" class="fields_recovery"',
|
||||
'style="min-height:40px; '.$style.'" class="fields_recovery',
|
||||
true
|
||||
);
|
||||
}
|
||||
@ -219,7 +221,7 @@ if (is_ajax()) {
|
||||
1,
|
||||
1,
|
||||
'',
|
||||
'style="min-height:40px" class="fields"',
|
||||
'style="min-height:40px; '.$style.'" class="fields"',
|
||||
true
|
||||
);
|
||||
$rfield = html_print_textarea(
|
||||
@ -227,13 +229,13 @@ if (is_ajax()) {
|
||||
1,
|
||||
1,
|
||||
'',
|
||||
'style="min-height:40px" class="fields_recovery"',
|
||||
'style="min-height:40px; '.$style.'" class="fields_recovery"',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// The empty descriptions will be ignored
|
||||
// The empty descriptions will be ignored.
|
||||
if ($fdesc == '') {
|
||||
$fields_rows[$i] = '';
|
||||
} else {
|
||||
@ -248,11 +250,7 @@ if (is_ajax()) {
|
||||
}
|
||||
}
|
||||
|
||||
// If command is PandoraFMS event, field 5 must be empty because "severity" must be set by the alert
|
||||
if ($command['id'] == 3) {
|
||||
$fields_rows[5] = '';
|
||||
}
|
||||
|
||||
// If command is PandoraFMS event, field 5 must be empty because "severity" must be set by the alert.
|
||||
$command['fields_rows'] = $fields_rows;
|
||||
|
||||
echo json_encode($command);
|
||||
@ -268,11 +266,17 @@ if ($update_command) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert commands'), 'images/gm_alerts.png', false, 'alerts_config', true);
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Alert commands'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'alerts_command_tab',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if ($create_command) {
|
||||
@ -283,16 +287,19 @@ if ($create_command) {
|
||||
|
||||
$fields_descriptions = [];
|
||||
$fields_values = [];
|
||||
$fields_hidden = [];
|
||||
$info_fields = '';
|
||||
$values = [];
|
||||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
$fields_descriptions[] = (string) get_parameter('field'.$i.'_description');
|
||||
$fields_values[] = (string) get_parameter('field'.$i.'_values');
|
||||
$fields_hidden[] = get_parameter('field'.$i.'_hide');
|
||||
$info_fields .= ' Field'.$i.': '.$fields_values[($i - 1)];
|
||||
}
|
||||
|
||||
$values['fields_values'] = io_json_mb_encode($fields_values);
|
||||
$values['fields_descriptions'] = io_json_mb_encode($fields_descriptions);
|
||||
$values['fields_hidden'] = io_json_mb_encode($fields_hidden);
|
||||
$values['description'] = $description;
|
||||
$values['id_group'] = $id_group;
|
||||
|
||||
@ -316,7 +323,7 @@ if ($create_command) {
|
||||
db_pandora_audit('Command management', 'Fail try to create alert command', false, false);
|
||||
}
|
||||
|
||||
// Show errors
|
||||
// Show errors.
|
||||
if (!isset($messageAction)) {
|
||||
$messageAction = __('Could not be created');
|
||||
}
|
||||
@ -340,7 +347,7 @@ if ($create_command) {
|
||||
if ($delete_command) {
|
||||
$id = (int) get_parameter('id');
|
||||
|
||||
// Internal commands cannot be deleted
|
||||
// Internal commands cannot be deleted.
|
||||
if (alerts_get_alert_command_internal($id)) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
@ -368,17 +375,17 @@ if ($delete_command) {
|
||||
if ($copy_command) {
|
||||
$id = (int) get_parameter('id');
|
||||
|
||||
// Get the info from the source command
|
||||
// Get the info from the source command.
|
||||
$command_to_copy = db_get_row('talert_commands', 'id', $id);
|
||||
if ($command_to_copy === false) {
|
||||
ui_print_error_message(__("Command with id $id does not found."));
|
||||
} else {
|
||||
// Prepare to insert the copy with same values
|
||||
// Prepare to insert the copy with same values.
|
||||
unset($command_to_copy['id']);
|
||||
$command_to_copy['name'] .= __(' (copy)');
|
||||
$result = db_process_sql_insert('talert_commands', $command_to_copy);
|
||||
|
||||
// Print the result
|
||||
// Print the result.
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Successfully copied'),
|
||||
|
@ -124,11 +124,7 @@ $table->data[1][1] .= __('Number of alerts match from').' ';
|
||||
$table->data[1][1] .= html_print_input_text('fires_min', '', '', 4, 10, true);
|
||||
$table->data[1][1] .= ' '.__('to').' ';
|
||||
$table->data[1][1] .= html_print_input_text('fires_max', '', '', 4, 10, true);
|
||||
$table->data[1][1] .= ui_print_help_icon(
|
||||
'alert-matches',
|
||||
true,
|
||||
ui_get_full_url(false, false, false, false)
|
||||
);
|
||||
|
||||
$table->data[1][1] .= '</span>';
|
||||
if (check_acl($config['id_user'], 0, 'LM')) {
|
||||
$table->data[1][1] .= '<a style="margin-left:5px;" href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
||||
@ -172,8 +168,7 @@ if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
||||
|
||||
$table->data[3][0] = __('Threshold');
|
||||
$table->data[3][1] = html_print_input_text('module_action_threshold', '0', '', 5, 7, true);
|
||||
$table->data[3][1] .= ' '.__('seconds').ui_print_help_icon('action_threshold', true);
|
||||
|
||||
$table->data[3][1] .= ' '.__('seconds');
|
||||
|
||||
if (!isset($step)) {
|
||||
echo '<form class="add_alert_form" method="post">';
|
||||
|
@ -700,20 +700,41 @@ foreach ($simple_alerts as $alert) {
|
||||
$data[2] .= '</tr>';
|
||||
$data[2] .= '<tr class="datos">';
|
||||
$data[2] .= '<td class="datos" style="font-weight:bold;padding:6px;">';
|
||||
$data[2] .= __('Number of alerts match from').' '.ui_print_help_icon('alert-matches', true, ui_get_full_url(false, false, false, false));
|
||||
$data[2] .= __('Number of alerts match from');
|
||||
$data[2] .= '</td>';
|
||||
$data[2] .= '<td class="datos">';
|
||||
$data[2] .= html_print_input_text('fires_min', 0, '', 4, 10, true);
|
||||
$data[2] .= html_print_input_text(
|
||||
'fires_min',
|
||||
0,
|
||||
'',
|
||||
4,
|
||||
10,
|
||||
true
|
||||
);
|
||||
$data[2] .= ' '.__('to').' ';
|
||||
$data[2] .= html_print_input_text('fires_max', 0, '', 4, 10, true);
|
||||
$data[2] .= html_print_input_text(
|
||||
'fires_max',
|
||||
0,
|
||||
'',
|
||||
4,
|
||||
10,
|
||||
true
|
||||
);
|
||||
$data[2] .= '</td>';
|
||||
$data[2] .= '</tr>';
|
||||
$data[2] .= '<tr class="datos2">';
|
||||
$data[2] .= '<td class="datos2" style="font-weight:bold;padding:6px;">';
|
||||
$data[2] .= __('Threshold').' '.ui_print_help_icon('action_threshold', true, ui_get_full_url(false, false, false, false));
|
||||
$data[2] .= __('Threshold');
|
||||
$data[2] .= '</td>';
|
||||
$data[2] .= '<td class="datos2">';
|
||||
$data[2] .= html_print_input_text('module_action_threshold', '', '', 4, 10, true);
|
||||
$data[2] .= html_print_input_text(
|
||||
'module_action_threshold',
|
||||
'',
|
||||
'',
|
||||
4,
|
||||
10,
|
||||
true
|
||||
);
|
||||
$data[2] .= '</td>';
|
||||
$data[2] .= '</tr>';
|
||||
$data[2] .= '</table>';
|
||||
|
@ -41,7 +41,13 @@ if (is_ajax()) {
|
||||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header(__('Alerts').' » '.__('Special days list'), 'images/gm_alerts.png', false, 'alert_special_days', true);
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Special days list'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'alert_special_days',
|
||||
true
|
||||
);
|
||||
|
||||
$update_special_day = (bool) get_parameter('update_special_day');
|
||||
$create_special_day = (bool) get_parameter('create_special_day');
|
||||
|
@ -132,7 +132,13 @@ if (!$delete_template) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
// ~ ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/gm_alerts.png", false, "alerts_config", true);
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert templates'), 'images/gm_alerts.png', false, '', true);
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Alert templates'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'alert_templates_tab',
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,7 +207,13 @@ if ($delete_template) {
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert templates'), 'images/gm_alerts.png', false, 'alerts_config', true);
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Alert templates'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'alerts_config',
|
||||
true
|
||||
);
|
||||
}
|
||||
} else {
|
||||
db_pandora_audit(
|
||||
@ -216,7 +228,13 @@ if ($delete_template) {
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Alert templates'), 'images/gm_alerts.png', false, 'alerts_config', true);
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Alert templates'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'alerts_config',
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,6 +186,10 @@ switch ($template['type']) {
|
||||
$condition = __('The alert would fire when the module is in critical status');
|
||||
break;
|
||||
|
||||
case 'not_normal':
|
||||
$condition = __('The alert would fire when the module is in not normal status');
|
||||
break;
|
||||
|
||||
case 'unknown':
|
||||
$condition = __('The alert would fire when the module is in unknown status');
|
||||
break;
|
||||
|
@ -184,7 +184,6 @@ $table->colspan[2][1] = 2;
|
||||
|
||||
$table->data[3][0] = __('Threshold');
|
||||
$table->data[3][1] = html_print_input_text('action_threshold', $action_threshold, '', 5, 7, true);
|
||||
$table->data[3][1] .= ' '.__('seconds').ui_print_help_icon('action_threshold', true);
|
||||
$table->colspan[3][1] = 2;
|
||||
|
||||
$table->data[4][0] = '';
|
||||
|
@ -11,7 +11,7 @@
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_alerts.php';
|
||||
@ -33,8 +33,9 @@ if (! check_acl($config['id_user'], 0, 'LM')) {
|
||||
$update_command = (bool) get_parameter('update_command');
|
||||
$id = (int) get_parameter('id');
|
||||
$pure = get_parameter('pure', 0);
|
||||
$alert = [];
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
@ -42,7 +43,7 @@ if (defined('METACONSOLE')) {
|
||||
__('Alerts').' » '.__('Configure alert command'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'alerts_config',
|
||||
'alerts_config_command_tab',
|
||||
true
|
||||
);
|
||||
}
|
||||
@ -64,16 +65,19 @@ if ($update_command) {
|
||||
|
||||
$fields_descriptions = [];
|
||||
$fields_values = [];
|
||||
$fields_hidden = [];
|
||||
$info_fields = '';
|
||||
$values = [];
|
||||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
$fields_descriptions[] = (string) get_parameter('field'.$i.'_description');
|
||||
$fields_values[] = (string) get_parameter('field'.$i.'_values');
|
||||
$fields_hidden[] = get_parameter('field'.$i.'_hide');
|
||||
$info_fields .= ' Field'.$i.': '.$fields_values[($i - 1)];
|
||||
}
|
||||
|
||||
$values['fields_values'] = io_json_mb_encode($fields_values);
|
||||
$values['fields_descriptions'] = io_json_mb_encode($fields_descriptions);
|
||||
$values['fields_hidden'] = io_json_mb_encode($fields_hidden);
|
||||
|
||||
$values['name'] = $name;
|
||||
$values['command'] = $command;
|
||||
@ -86,7 +90,15 @@ if ($update_command) {
|
||||
$result = '';
|
||||
} else {
|
||||
$result = alerts_update_alert_command($id, $values);
|
||||
$info = '{"Name":"'.$name.'","Command":"'.$command.'","Description":"'.$description.' '.$info_fields.'"}';
|
||||
if ($result) {
|
||||
$info = '{"Name":"'.$name.'","Command":"'.$command.'","Description":"'.$description.' '.$info_fields.'"}';
|
||||
$alert['fields_values'] = io_json_mb_encode($fields_values);
|
||||
$alert['fields_descriptions'] = io_json_mb_encode($fields_descriptions);
|
||||
$alert['name'] = $name;
|
||||
$alert['command'] = $command;
|
||||
$alert['description'] = $description;
|
||||
$alert['id_group'] = $id_group;
|
||||
}
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
@ -110,13 +122,17 @@ $fields_descriptions = '';
|
||||
$fields_values = '';
|
||||
$id_group = 0;
|
||||
if ($id) {
|
||||
$alert = alerts_get_alert_command($id);
|
||||
if (!$result) {
|
||||
$alert = alerts_get_alert_command($id);
|
||||
}
|
||||
|
||||
$name = $alert['name'];
|
||||
$command = $alert['command'];
|
||||
$description = $alert['description'];
|
||||
$id_group = $alert['id_group'];
|
||||
$fields_descriptions = $alert['fields_descriptions'];
|
||||
$fields_values = $alert['fields_values'];
|
||||
$fields_hidden = $alert['fields_hidden'];
|
||||
}
|
||||
|
||||
if (!empty($fields_descriptions)) {
|
||||
@ -127,6 +143,10 @@ if (!empty($fields_values)) {
|
||||
$fields_values = json_decode($fields_values, true);
|
||||
}
|
||||
|
||||
if (!empty($fields_hidden)) {
|
||||
$fields_hidden = json_decode($fields_hidden, true);
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
@ -141,6 +161,7 @@ $table->style = [];
|
||||
if (!defined('METACONSOLE')) {
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
$table->style[4] = 'font-weight: bold';
|
||||
}
|
||||
|
||||
$table->size = [];
|
||||
@ -153,7 +174,6 @@ $table->data['name'][2] = html_print_input_text('name', $name, '', 35, 255, true
|
||||
|
||||
$table->colspan['command'][1] = 3;
|
||||
$table->data['command'][0] = __('Command');
|
||||
$table->data['command'][0] .= ui_print_help_icon('alert_macros', true);
|
||||
$table->data['command'][1] = html_print_textarea('command', 8, 30, $command, '', true);
|
||||
|
||||
$table->colspan['group'][1] = 3;
|
||||
@ -178,33 +198,33 @@ $table->data['description'][1] = html_print_textarea('description', 10, 30, $des
|
||||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
$table->data['field'.$i][0] = sprintf(__('Field %s description'), $i);
|
||||
|
||||
// Only show help on first row
|
||||
if ($i == 1) {
|
||||
$table->data['field'.$i][0] .= ui_print_help_icon('alert_fields_description', true);
|
||||
}
|
||||
|
||||
if (!empty($fields_descriptions)) {
|
||||
$field_description = $fields_descriptions[($i - 1)];
|
||||
} else {
|
||||
$field_description = '';
|
||||
}
|
||||
|
||||
$table->data['field'.$i][1] = html_print_input_text('field'.$i.'_description', $field_description, '', 35, 255, true);
|
||||
$table->data['field'.$i][1] = html_print_input_text('field'.$i.'_description', $field_description, '', 30, 255, true);
|
||||
|
||||
$table->data['field'.$i][2] = sprintf(__('Field %s values'), $i);
|
||||
|
||||
// Only show help on first row
|
||||
if ($i == 1) {
|
||||
$table->data['field'.$i][2] .= ui_print_help_icon('alert_fields_values', true);
|
||||
}
|
||||
|
||||
if (!empty($fields_values)) {
|
||||
$field_values = $fields_values[($i - 1)];
|
||||
} else {
|
||||
$field_values = '';
|
||||
}
|
||||
|
||||
$table->data['field'.$i][3] = html_print_input_text('field'.$i.'_values', $field_values, '', 65, 255, true);
|
||||
if (!empty($fields_hidden)) {
|
||||
$selected = (bool) $fields_hidden[($i - 1)];
|
||||
} else {
|
||||
$selected = false;
|
||||
}
|
||||
|
||||
$table->data['field'.$i][3] = html_print_input_text('field'.$i.'_values', $field_values, '', 55, 255, true, false, false, '', 'field_value');
|
||||
|
||||
$table->data['field'.$i][4] = __('Hide');
|
||||
|
||||
$table->data['field'.$i][5] = html_print_checkbox_extended('field'.$i.'_hide', 1, $selected, false, 'cursor: \'pointer\'', 'class="hide_inputs"', true);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_commands&pure='.$pure.'">';
|
||||
@ -224,3 +244,27 @@ echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
|
||||
$(".hide_inputs").each(function(index) {
|
||||
var $input_in_row = $(this).closest('tr').find('.field_value');
|
||||
if($(this).is(':checked')) {
|
||||
$input_in_row.prop('style', '-webkit-text-security: disc;');
|
||||
} else {
|
||||
$input_in_row.prop('style', '');
|
||||
}
|
||||
});
|
||||
|
||||
$(".hide_inputs").click(function() {
|
||||
var $input_in_row = $(this).closest('tr').find('.field_value');
|
||||
if($(this).is(':checked')) {
|
||||
$input_in_row.prop('style', '-webkit-text-security: disc;');
|
||||
} else {
|
||||
$input_in_row.prop('style', '');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@ -56,14 +56,20 @@ if ($a_template !== false) {
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
// ~ ui_print_page_header (__('Alerts') .
|
||||
// ~ ' » ' . __('Configure alert template'), "",
|
||||
// ~ false, "alerts_config", true);
|
||||
$step = (int) get_parameter('step', 1);
|
||||
if ($step == 1) {
|
||||
$help_header = 'configure_alert_template_step_1';
|
||||
} else if ($step == 2) {
|
||||
$help_header = 'configure_alert_template_step_2';
|
||||
} else if ($step == 3) {
|
||||
$help_header = 'configure_alert_template_step_3';
|
||||
}
|
||||
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Configure alert template'),
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
$help_header,
|
||||
true
|
||||
);
|
||||
}
|
||||
@ -83,7 +89,13 @@ if ($a_template !== false) {
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Configure alert template'), 'images/gm_alerts.png', false, 'conf_alert_template', true);
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Configure alert template'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'conf_alert_template',
|
||||
true
|
||||
);
|
||||
}
|
||||
} else {
|
||||
db_pandora_audit(
|
||||
@ -101,7 +113,22 @@ if ($a_template !== false) {
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Configure alert template'), 'images/gm_alerts.png', false, 'conf_alert_template', true);
|
||||
$step = (int) get_parameter('step', 1);
|
||||
if ($step == 1) {
|
||||
$help_header = 'configure_alert_template_step_1';
|
||||
} else if ($step == 2) {
|
||||
$help_header = 'configure_alert_template_step_2';
|
||||
} else if ($step == 3) {
|
||||
$help_header = 'configure_alert_template_step_3';
|
||||
}
|
||||
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Configure alert template'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
$help_header,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -679,7 +706,7 @@ if ($step == 2) {
|
||||
'type',
|
||||
$type,
|
||||
'',
|
||||
__('Select'),
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
@ -1018,6 +1045,7 @@ var onchange_msg = <?php echo '"'.__('The alert would fire when the module value
|
||||
var onchange_not = <?php echo '"'.__('The alert would fire when the module value does not change').'"'; ?>;
|
||||
var unknown = <?php echo "'".__('The alert would fire when the module is in unknown status')."'"; ?>;
|
||||
var error_message_min_max_zero = <?php echo "'".__('The alert template cannot have the same value for min and max thresholds.')."'"; ?>;
|
||||
var not_normal = <?php echo "'".__('The alert would fire when the module is in not normal status')."'"; ?>;
|
||||
|
||||
function check_fields_step2() {
|
||||
var correct = true;
|
||||
@ -1174,6 +1202,13 @@ if ($step == 2) {
|
||||
/* Show example */
|
||||
$("span#example").empty ().append (critical);
|
||||
break;
|
||||
case "not_normal":
|
||||
$("#template-value, #template-max, span#matches_value, #template-min").hide ();
|
||||
$("#template-example").show ();
|
||||
|
||||
/* Show example */
|
||||
$("span#example").empty ().append (not_normal);
|
||||
break;
|
||||
case "onchange":
|
||||
$("#template-value, #template-max, #template-min").hide ();
|
||||
$("#template-example, span#matches_value").show ();
|
||||
|
@ -124,7 +124,7 @@ $data[3] .= '<span class="size">'.html_print_input_text('modal_height', $event_r
|
||||
$table->data[2] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Parameters').ui_print_help_icon('response_parameters', true);
|
||||
$data[0] = __('Parameters');
|
||||
$data[1] = html_print_input_text(
|
||||
'params',
|
||||
$event_response['params'],
|
||||
|
@ -77,6 +77,7 @@ switch ($section) {
|
||||
case 'responses':
|
||||
$buttons['responses']['active'] = true;
|
||||
$subpage = ' - '.__('Responses');
|
||||
$help_header = 'events_responses_tab';
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
@ -90,7 +91,14 @@ switch ($section) {
|
||||
}
|
||||
|
||||
if (! defined('METACONSOLE')) {
|
||||
ui_print_page_header(__('Manage events').$subpage, 'images/gm_events.png', false, '', true, $buttons);
|
||||
ui_print_page_header(
|
||||
__('Manage events').$subpage,
|
||||
'images/gm_events.png',
|
||||
false,
|
||||
$help_header,
|
||||
true,
|
||||
$buttons
|
||||
);
|
||||
} else {
|
||||
ui_meta_print_header(__('Manage events').$subpage, '', $buttons);
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ ui_print_page_header(
|
||||
__('GIS Maps builder'),
|
||||
'images/gm_gis.png',
|
||||
false,
|
||||
'configure_gis_map',
|
||||
'configure_gis_map_edit',
|
||||
true,
|
||||
$buttons
|
||||
);
|
||||
@ -357,7 +357,7 @@ function addConnectionMap() {
|
||||
for (var index in connectionMaps) {
|
||||
if (isInt(index)) {
|
||||
if (connectionMaps[index] == idConnectionMap) {
|
||||
alert('<?php echo __('The connection'); ?> "' + connectionMapName + '" <?php echo __('just added previously.'); ?>');
|
||||
alert("<?php echo __('The connection'); ?> "' + connectionMapName + '" <?php echo __('just added previously.'); ?>");
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -87,7 +87,14 @@ if (defined('METACONSOLE')) {
|
||||
$title_in_header = __('Create group');
|
||||
}
|
||||
|
||||
ui_print_page_header($title_in_header, 'images/group.png', false, '', true, '');
|
||||
ui_print_page_header(
|
||||
$title_in_header,
|
||||
'images/group.png',
|
||||
false,
|
||||
'create_group_tab',
|
||||
true,
|
||||
''
|
||||
);
|
||||
$sec = 'gagente';
|
||||
}
|
||||
|
||||
@ -175,11 +182,11 @@ if ($config['enterprise_installed']) {
|
||||
}
|
||||
|
||||
$table->data[$i][0] = __('Alerts');
|
||||
$table->data[$i][1] = html_print_checkbox('alerts_enabled', 1, ! $alerts_disabled, true);
|
||||
$table->data[$i][1] = html_print_checkbox_switch('alerts_enabled', 1, ! $alerts_disabled, true);
|
||||
$i++;
|
||||
|
||||
$table->data[$i][0] = __('Propagate ACL').ui_print_help_tip(__('Propagate the same ACL security into the child subgroups.'), true);
|
||||
$table->data[$i][1] = html_print_checkbox('propagate', 1, $propagate, true).ui_print_help_icon('propagate_acl', true);
|
||||
$table->data[$i][1] = html_print_checkbox_switch('propagate', 1, $propagate, true);
|
||||
$i++;
|
||||
|
||||
$table->data[$i][0] = __('Custom ID');
|
||||
|
@ -275,7 +275,7 @@ if (defined('METACONSOLE')) {
|
||||
__('Groups defined in %s', get_product_name()),
|
||||
'images/group.png',
|
||||
false,
|
||||
'',
|
||||
'group_list_tab',
|
||||
true,
|
||||
$buttons
|
||||
);
|
||||
|
@ -489,7 +489,7 @@ $params['selectbox_id'] = 'cascade_protection_module';
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$table->data[0][1] = ui_print_agent_autocomplete_input($params);
|
||||
|
||||
$table->data[0][1] .= '<b>'.__('Cascade protection').'</b> '.ui_print_help_icon('cascade_protection', true).html_print_select(
|
||||
$table->data[0][1] .= '<b>'.__('Cascade protection').'</b>'.html_print_select(
|
||||
[
|
||||
1 => __('Yes'),
|
||||
0 => __('No'),
|
||||
@ -587,7 +587,7 @@ $table->data[0][0] = __('Custom ID');
|
||||
$table->data[0][1] = html_print_input_text('custom_id', $custom_id, '', 16, 255, true);
|
||||
|
||||
// Learn mode / Normal mode
|
||||
$table->data[1][0] = __('Module definition').ui_print_help_icon('module_definition', true);
|
||||
$table->data[1][0] = __('Module definition');
|
||||
$table->data[1][1] = __('No change').' '.html_print_radio_button_extended('mode', -1, '', $mode, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[1][1] .= __('Learning mode').' '.html_print_radio_button_extended('mode', 1, '', $mode, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[1][1] .= __('Normal mode').' '.html_print_radio_button_extended('mode', 0, '', $mode, false, '', 'style="margin-right: 40px;"', true);
|
||||
|
@ -11,7 +11,7 @@
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
@ -118,10 +118,12 @@ switch ($tab) {
|
||||
|
||||
case 'massive_agents':
|
||||
$options = $options_agents;
|
||||
$help_header = 'massive_agents_tab';
|
||||
break;
|
||||
|
||||
case 'massive_modules':
|
||||
$options = $options_modules;
|
||||
$help_header = 'massive_modules_tab';
|
||||
break;
|
||||
|
||||
case 'massive_users':
|
||||
@ -130,6 +132,7 @@ switch ($tab) {
|
||||
|
||||
case 'massive_policies':
|
||||
$options = $options_policies;
|
||||
$help_header = 'massive_policies_tab';
|
||||
break;
|
||||
|
||||
case 'massive_snmp':
|
||||
@ -143,9 +146,13 @@ switch ($tab) {
|
||||
case 'massive_plugins':
|
||||
$options = $options_plugins;
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
// Set the default option of the category
|
||||
// Set the default option of the category.
|
||||
if ($option == '') {
|
||||
$option = array_shift(array_keys($options));
|
||||
}
|
||||
@ -235,16 +242,16 @@ ui_print_page_header(
|
||||
__('Bulk operations').' » '.$options[$option],
|
||||
'images/gm_massive_operations.png',
|
||||
false,
|
||||
'',
|
||||
$help_header,
|
||||
true,
|
||||
$onheader,
|
||||
true,
|
||||
'massivemodal'
|
||||
);
|
||||
|
||||
// Checks if the PHP configuration is correctly
|
||||
// Checks if the PHP configuration is correctly.
|
||||
if ((get_cfg_var('max_execution_time') != 0)
|
||||
or (get_cfg_var('max_input_time') != -1)
|
||||
|| (get_cfg_var('max_input_time') != -1)
|
||||
) {
|
||||
echo '<div id="notify_conf" class="notify">';
|
||||
echo __('In order to perform massive operations, PHP needs a correct configuration in timeout parameters. Please, open your PHP configuration file (php.ini) for example: <i>sudo vi /etc/php5/apache2/php.ini;</i><br> And set your timeout parameters to a correct value: <br><i> max_execution_time = 0</i> and <i>max_input_time = -1</i>');
|
||||
@ -256,7 +263,7 @@ if ($tab == 'massive_policies' && is_central_policies_on_node()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Catch all submit operations in this view to display Wait banner
|
||||
// Catch all submit operations in this view to display Wait banner.
|
||||
$submit_action = get_parameter('go');
|
||||
$submit_update = get_parameter('updbutton');
|
||||
$submit_del = get_parameter('del');
|
||||
|
@ -457,19 +457,6 @@ if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager'])
|
||||
$sub['godmode/update_manager/update_manager&tab=setup']['text'] = __('Update Manager options');
|
||||
$sub['godmode/update_manager/update_manager&tab=setup']['id'] = 'Options';
|
||||
|
||||
if (license_free() && is_user_admin($config['id_user'])) {
|
||||
include_once 'include/functions_update_manager.php';
|
||||
// If there are unread messages, display the notification icon
|
||||
$number_total_messages;
|
||||
$number_unread_messages = update_manager_get_unread_messages();
|
||||
if ($number_unread_messages > 0) {
|
||||
$menu_godmode['messages']['notification'] = $number_unread_messages;
|
||||
}
|
||||
|
||||
$sub['godmode/update_manager/update_manager&tab=messages']['text'] = __('Messages');
|
||||
$sub['godmode/update_manager/update_manager&tab=messages']['id'] = 'Messages';
|
||||
}
|
||||
|
||||
$menu_godmode['messages']['sub'] = $sub;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,13 @@ if (defined('METACONSOLE')) {
|
||||
components_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
} else {
|
||||
ui_print_page_header(__('Module management').' » '.__('Component group management'), '', false, 'component_groups', true);
|
||||
ui_print_page_header(
|
||||
__('Module management').' » '.__('Component group management'),
|
||||
'',
|
||||
false,
|
||||
'component_groups',
|
||||
true
|
||||
);
|
||||
$sec = 'gmodules';
|
||||
}
|
||||
|
||||
|
@ -46,11 +46,22 @@ if (defined('METACONSOLE')) {
|
||||
|
||||
*/
|
||||
|
||||
$id_modulo = (int) get_parameter('id_component_type');
|
||||
$new_component = (bool) get_parameter('new_component');
|
||||
if ($id_modulo == 2 || $id_modulo == 4 || $id_modulo == 6) {
|
||||
$help_header = 'local_module_tab';
|
||||
} else if (!$new_component) {
|
||||
$help_header = 'network_component_tab';
|
||||
} else {
|
||||
$help_header = 'network_component_tab';
|
||||
}
|
||||
|
||||
|
||||
ui_print_page_header(
|
||||
__('Module management').' » '.__('Network component management'),
|
||||
'',
|
||||
false,
|
||||
'network_component',
|
||||
$help_header,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
@ -90,7 +101,6 @@ if (!empty($macros)) {
|
||||
|
||||
$max_timeout = (int) get_parameter('max_timeout');
|
||||
$max_retries = (int) get_parameter('max_retries');
|
||||
$id_modulo = (int) get_parameter('id_component_type');
|
||||
$id_plugin = (int) get_parameter('id_plugin');
|
||||
$dynamic_interval = (int) get_parameter('dynamic_interval');
|
||||
$dynamic_max = (int) get_parameter('dynamic_max');
|
||||
@ -150,7 +160,6 @@ $disabled_types_event = json_encode($disabled_types_event);
|
||||
$create_component = (bool) get_parameter('create_component');
|
||||
$update_component = (bool) get_parameter('update_component');
|
||||
$delete_component = (bool) get_parameter('delete_component');
|
||||
$new_component = (bool) get_parameter('new_component');
|
||||
$duplicate_network_component = (bool) get_parameter('duplicate_network_component');
|
||||
$delete_multiple = (bool) get_parameter('delete_multiple');
|
||||
$multiple_delete = (bool) get_parameter('multiple_delete', 0);
|
||||
|
@ -72,7 +72,7 @@ if (enterprise_installed()) {
|
||||
}
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Type').' '.ui_print_help_icon('module_type', true);
|
||||
$table->data[1][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
|
||||
$sql = sprintf(
|
||||
'SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo
|
||||
@ -396,6 +396,124 @@ $next_row++;
|
||||
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
|
||||
|
||||
var type_name_selected = type_names[type_selected];
|
||||
console.log(type_name_selected);
|
||||
var element = document.getElementById("module_type_help");
|
||||
var language = "<?php echo $config['language']; ?>" ;
|
||||
element.onclick = function (event) {
|
||||
if(type_name_selected == 'async_data' ||
|
||||
type_name_selected == 'async_proc' ||
|
||||
type_name_selected == 'async_string' ||
|
||||
type_name_selected == 'generic_proc'||
|
||||
type_name_selected == 'generic_data' ||
|
||||
type_name_selected == 'generic_data_inc' ||
|
||||
type_name_selected == 'generic_data_inc_abs'||
|
||||
type_name_selected == 'generic_data_string' ||
|
||||
type_name_selected == 'keep_alive'
|
||||
){
|
||||
if (language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Operacion&printable=yes#Tipos_de_m.C3.B3dulos',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Operations&printable=yes#Types_of_Modules',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(type_name_selected == 'remote_icmp' ||
|
||||
type_name_selected == 'remote_icmp_proc'
|
||||
){
|
||||
if(language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_ICMP',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#ICMP_Monitoring',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(type_name_selected == 'remote_snmp_string' ||
|
||||
type_name_selected == 'remote_snmp_proc' ||
|
||||
type_name_selected == 'remote_snmp_inc' ||
|
||||
type_name_selected == 'remote_snmp'
|
||||
){
|
||||
if(language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizando_con_m.C3.B3dulos_de_red_tipo_SNMP',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#Monitoring_by_Network_Modules_with_SNMP',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(type_name_selected == 'remote_tcp_string' ||
|
||||
type_name_selected == 'remote_tcp_proc' ||
|
||||
type_name_selected == 'remote_tcp_inc' ||
|
||||
type_name_selected == 'remote_tcp'
|
||||
){
|
||||
if(language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_TCP',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#TCP_Monitoring',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(type_name_selected == 'web_data' ||
|
||||
type_name_selected == 'web_proc' ||
|
||||
type_name_selected == 'web_content_data' ||
|
||||
type_name_selected == 'web_content_string'
|
||||
){
|
||||
if(language == 'es'){
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_web&printable=yes#Creaci.C3.B3n_de_m.C3.B3dulos_web',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
else{
|
||||
window.open(
|
||||
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Web_Monitoring&printable=yes#Creating_Web_Modules',
|
||||
'_blank',
|
||||
'width=800,height=600'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (type_name_selected.match(/_string$/) == null) {
|
||||
// Numeric types
|
||||
|
@ -28,7 +28,7 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
require_once $config['homedir'].'/include/functions_modules.php';
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('WMI query');
|
||||
$data[0] = __('WMI query').' '.ui_print_help_icon('wmi_query_tab', true);
|
||||
$data[1] = html_print_input_text('snmp_oid', $snmp_oid, '', 25, 255, true);
|
||||
$data[2] = __('Key string').' '.ui_print_help_icon('wmikey', true, ui_get_full_url(false, false, false, false));
|
||||
$data[3] = html_print_input_text('snmp_community', $snmp_community, '', 25, 255, true);
|
||||
|
@ -35,7 +35,16 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
|
||||
*/
|
||||
|
||||
ui_print_page_header(__('Module management').' » '.__('Module template management'), 'images/gm_modules.png', false, 'template_tab', true, '', true, 'modulemodal');
|
||||
ui_print_page_header(
|
||||
__('Module management').' » '.__('Module template management'),
|
||||
'images/gm_modules.png',
|
||||
false,
|
||||
'module_template_tab',
|
||||
true,
|
||||
'',
|
||||
true,
|
||||
'modulemodal'
|
||||
);
|
||||
|
||||
|
||||
require_once 'include/functions_network_profiles.php';
|
||||
|
@ -34,7 +34,13 @@ $pure = get_parameter('pure', 0);
|
||||
|
||||
// Header
|
||||
if (! defined('METACONSOLE')) {
|
||||
ui_print_page_header(__('Manage Netflow Filter'), 'images/gm_netflow.png', false, '', true);
|
||||
ui_print_page_header(
|
||||
__('Manage Netflow Filter'),
|
||||
'images/gm_netflow.png',
|
||||
false,
|
||||
'pcap_filter',
|
||||
true
|
||||
);
|
||||
|
||||
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
|
||||
if ($is_windows) {
|
||||
|
@ -54,7 +54,14 @@ if (! defined('METACONSOLE')) {
|
||||
|
||||
$buttons['add']['text'] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit_form">'.html_print_image('images/add_mc.png', true, ['title' => __('Add filter')]).'</a>';
|
||||
|
||||
ui_print_page_header(__('Netflow Filter'), 'images/gm_netflow.png', false, '', true, $buttons);
|
||||
ui_print_page_header(
|
||||
__('Netflow Filter'),
|
||||
'images/gm_netflow.png',
|
||||
false,
|
||||
'pcap_filter',
|
||||
true,
|
||||
$buttons
|
||||
);
|
||||
} else {
|
||||
$nav_bar = [
|
||||
[
|
||||
@ -230,10 +237,9 @@ $table->data[5][1] = html_print_input_text('dst_port', $dst_port, false, 40, 80,
|
||||
$table->data[6][0] = __('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true);
|
||||
$table->data[6][1] = html_print_input_text('src_port', $src_port, false, 40, 80, true);
|
||||
|
||||
$table->data[7][0] = ui_print_help_icon('pcap_filter', true);
|
||||
$table->data[7][1] = html_print_textarea('advanced_filter', 4, 40, $advanced_filter, '', true);
|
||||
|
||||
$table->data[8][0] = '<b>'.__('Aggregate by').'</b>'.ui_print_help_icon('aggregate_by', true);
|
||||
$table->data[8][0] = '<b>'.__('Aggregate by').'</b>';
|
||||
$aggregate_list = [
|
||||
'srcip' => __('Src Ip Address'),
|
||||
'dstip' => __('Dst Ip Address'),
|
||||
|
@ -391,7 +391,7 @@ $(document).ready (function () {
|
||||
});
|
||||
|
||||
if($('#module')[0].childElementCount == 1 && ($('#module')[0].value == "" || $('#module')[0].value == "0")) {
|
||||
alert('<?php echo __('Please, select a module'); ?>');
|
||||
alert("<?php echo __('Please, select a module'); ?>");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
@ -276,19 +276,30 @@ if (isset($name)) {
|
||||
$head .= ' - '.$name;
|
||||
}
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
$tab = get_parameter('tab', '');
|
||||
switch ($tab) {
|
||||
default:
|
||||
case 'main':
|
||||
ui_print_page_header($head, 'images/chart.png', false, 'graph_builder', false, $buttons);
|
||||
ui_print_page_header(
|
||||
$head,
|
||||
'images/chart.png',
|
||||
false,
|
||||
'graph_builder',
|
||||
false,
|
||||
$buttons
|
||||
);
|
||||
break;
|
||||
|
||||
case 'graph_editor':
|
||||
ui_print_page_header($head, 'images/chart.png', false, 'graph_editor', false, $buttons);
|
||||
break;
|
||||
|
||||
default:
|
||||
ui_print_page_header($head, 'images/chart.png', false, 'graph_builder', false, $buttons);
|
||||
ui_print_page_header(
|
||||
$head,
|
||||
'images/chart.png',
|
||||
false,
|
||||
'graph_editor',
|
||||
false,
|
||||
$buttons
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -151,100 +151,193 @@ if ($multiple_delete) {
|
||||
}
|
||||
|
||||
|
||||
$id_group = (int) get_parameter('id_group', 0);
|
||||
$search = trim(get_parameter('search', ''));
|
||||
$graphs = custom_graphs_get_user($config['id_user'], false, true, $access);
|
||||
$offset = (int) get_parameter('offset');
|
||||
$table_aux = new stdClass();
|
||||
|
||||
ui_pagination(count($graphs));
|
||||
$table_aux->width = '100%';
|
||||
$table_aux->class = 'databox filters';
|
||||
$table_aux->cellpadding = 0;
|
||||
$table_aux->cellspacing = 0;
|
||||
|
||||
if (!empty($graphs)) {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->align = [];
|
||||
$table->head = [];
|
||||
if ($report_w || $report_m) {
|
||||
$table->align[5] = 'left';
|
||||
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
|
||||
$table->size[5] = '20px';
|
||||
}
|
||||
$table_aux->colspan[0][0] = 4;
|
||||
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
|
||||
|
||||
$table->head[0] = __('Graph name');
|
||||
$table->head[1] = __('Description');
|
||||
$table->head[2] = __('Number of Graphs');
|
||||
$table->head[3] = __('Group');
|
||||
$table->size[0] = '30%';
|
||||
$table->size[2] = '200px';
|
||||
$table->size[3] = '200px';
|
||||
$table->align[2] = 'left';
|
||||
$table->align[3] = 'left';
|
||||
$op_column = false;
|
||||
if ($report_w || $report_m) {
|
||||
$op_column = true;
|
||||
$table->align[4] = 'left';
|
||||
$table->head[4] = __('Op.');
|
||||
$table->size[4] = '90px';
|
||||
}
|
||||
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, '', false, false, 'id_grupo', $strict_user).'<br>';
|
||||
|
||||
$table->data = [];
|
||||
$table_aux->data[0][2] = '<b>'.__('Free text for search: ').ui_print_help_tip(
|
||||
__('Search by report name or description, list matches.'),
|
||||
true
|
||||
).'</b>';
|
||||
$table_aux->data[0][3] = html_print_input_text('search', $search, '', 30, '', true);
|
||||
|
||||
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
|
||||
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
|
||||
|
||||
foreach ($result_graphs as $graph) {
|
||||
$data = [];
|
||||
|
||||
if ($report_m) {
|
||||
$data[5] .= html_print_checkbox_extended('delete_multiple[]', $graph['id_graph'], false, false, '', 'class="check_delete" style="margin-left:2px;"', true);
|
||||
if (is_metaconsole()) {
|
||||
$filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
|
||||
method='post'>";
|
||||
$filter .= html_print_table($table_aux, true);
|
||||
$filter .= '</form>';
|
||||
ui_toggle($filter, __('Show Option'));
|
||||
} else {
|
||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
|
||||
method='post'>";
|
||||
html_print_table($table_aux);
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text($graph['name'], 70).'</a>';
|
||||
|
||||
$data[1] = ui_print_truncate_text($graph['description'], 70);
|
||||
|
||||
$data[2] = $graph['graphs_count'];
|
||||
$data[3] = ui_print_group_icon($graph['id_group'], true);
|
||||
|
||||
$data[4] = '';
|
||||
$table->cellclass[][4] = 'action_buttons';
|
||||
if (($report_w || $report_m)) {
|
||||
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image('images/config.png', true).'</a>';
|
||||
// Show only selected groups.
|
||||
if ($id_group > 0) {
|
||||
$group = ["$id_group" => $id_group];
|
||||
} else {
|
||||
$group = false;
|
||||
}
|
||||
|
||||
if ($report_m) {
|
||||
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) {
|
||||
$return_all_group = true;
|
||||
} else {
|
||||
$return_all_group = false;
|
||||
}
|
||||
|
||||
if ($search != '') {
|
||||
$filter = [
|
||||
'name' => $search_name,
|
||||
'order' => 'name',
|
||||
];
|
||||
} else {
|
||||
$filter = ['order' => 'name'];
|
||||
}
|
||||
|
||||
// Fix : group filter was not working
|
||||
// Show only selected groups.
|
||||
if ($id_group > 0) {
|
||||
$group = ["$id_group" => $id_group];
|
||||
$filter['id_group'] = $id_group;
|
||||
} else {
|
||||
$group = false;
|
||||
}
|
||||
|
||||
// Filter normal and metaconsole reports.
|
||||
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||
$filter['metaconsole'] = 1;
|
||||
} else {
|
||||
$filter['metaconsole'] = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
$reports = reports_get_reports(
|
||||
$filter,
|
||||
[
|
||||
'name',
|
||||
'description',
|
||||
'id_graph',
|
||||
'id_group',
|
||||
],
|
||||
$return_all_group,
|
||||
$access,
|
||||
$group,
|
||||
false
|
||||
);*/
|
||||
|
||||
if ($id_group != null || $search != null) {
|
||||
$graphs = custom_graphs_search($id_group, $search);
|
||||
}
|
||||
|
||||
ui_pagination(count($graphs));
|
||||
|
||||
if (!empty($graphs)) {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->align = [];
|
||||
$table->head = [];
|
||||
if ($report_w || $report_m) {
|
||||
$table->align[5] = 'left';
|
||||
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
|
||||
$table->size[5] = '20px';
|
||||
}
|
||||
|
||||
$table->head[0] = __('Graph name');
|
||||
$table->head[1] = __('Description');
|
||||
$table->head[2] = __('Number of Graphs');
|
||||
$table->head[3] = __('Group');
|
||||
$table->size[0] = '30%';
|
||||
$table->size[2] = '200px';
|
||||
$table->size[3] = '200px';
|
||||
$table->align[2] = 'left';
|
||||
$table->align[3] = 'left';
|
||||
$op_column = false;
|
||||
if ($report_w || $report_m) {
|
||||
$op_column = true;
|
||||
$table->align[4] = 'left';
|
||||
$table->head[4] = __('Op.');
|
||||
$table->size[4] = '90px';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
|
||||
|
||||
foreach ($result_graphs as $graph) {
|
||||
$data = [];
|
||||
|
||||
if ($report_m) {
|
||||
$data[5] .= html_print_checkbox_extended('delete_multiple[]', $graph['id_graph'], false, false, '', 'class="check_delete" style="margin-left:2px;"', true);
|
||||
}
|
||||
|
||||
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text($graph['name'], 70).'</a>';
|
||||
|
||||
$data[1] = ui_print_truncate_text($graph['description'], 70);
|
||||
|
||||
$data[2] = $graph['graphs_count'];
|
||||
$data[3] = ui_print_group_icon($graph['id_group'], true);
|
||||
|
||||
$data[4] = '';
|
||||
$table->cellclass[][4] = 'action_buttons';
|
||||
if (($report_w || $report_m)) {
|
||||
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image('images/config.png', true).'</a>';
|
||||
}
|
||||
|
||||
if ($report_m) {
|
||||
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
|
||||
return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete')]).'</a>';
|
||||
}
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($result_graphs)) {
|
||||
echo "<form method='post' style='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table($table);
|
||||
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
|
||||
echo "<div style='float: right;'>";
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
|
||||
echo "<div style='float: right;'>";
|
||||
if ($report_w || $report_m) {
|
||||
echo '<form method="post" style="float:right;" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
|
||||
html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next" style="margin-right:5px;"');
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
} else {
|
||||
include_once $config['homedir'].'/general/firts_task/custom_graphs.php';
|
||||
}
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($result_graphs)) {
|
||||
echo "<form method='post' style='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table($table);
|
||||
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
|
||||
echo "<div style='float: right;'>";
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
|
||||
echo "<div style='float: right;'>";
|
||||
if ($report_w || $report_m) {
|
||||
echo '<form method="post" style="float:right;" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
|
||||
html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next" style="margin-right:5px;"');
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
} else {
|
||||
include_once $config['homedir'].'/general/firts_task/custom_graphs.php';
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
@ -15,7 +15,7 @@ global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_visual_map.php';
|
||||
|
||||
// ACL for the general permission
|
||||
// ACL for the general permission.
|
||||
$vconsoles_read = check_acl($config['id_user'], 0, 'VR');
|
||||
$vconsoles_write = check_acl($config['id_user'], 0, 'VW');
|
||||
$vconsoles_manage = check_acl($config['id_user'], 0, 'VM');
|
||||
@ -84,7 +84,7 @@ if (!$is_metaconsole) {
|
||||
__('Reporting').' » '.__('Visual Console'),
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
'map_builder',
|
||||
'map_builder_intro',
|
||||
false,
|
||||
$buttons
|
||||
);
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -674,12 +674,17 @@ function update_button_palette_callback() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (values["module"] == 0) {
|
||||
var radio_value = $("input[name='radio_choice']:checked").val();
|
||||
if (values["agent"] == "" && radio_value == "module_graph") {
|
||||
dialog_message("#message_alert_no_agent");
|
||||
return false;
|
||||
}
|
||||
if (values["module"] == 0 && radio_value == "module_graph") {
|
||||
dialog_message("#message_alert_no_module");
|
||||
return false;
|
||||
}
|
||||
if (values["agent"] == "") {
|
||||
dialog_message("#message_alert_no_agent");
|
||||
if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") {
|
||||
dialog_message("#message_alert_no_custom_graph");
|
||||
return false;
|
||||
}
|
||||
if ($("input[name=width_module_graph]").val() == "") {
|
||||
@ -1425,11 +1430,12 @@ function create_button_palette_callback() {
|
||||
|
||||
break;
|
||||
case "module_graph":
|
||||
if (values["module"] == 0) {
|
||||
var radio_value = $("input[name='radio_choice']:checked").val();
|
||||
if (values["module"] == 0 && radio_value == "module_graph") {
|
||||
dialog_message("#message_alert_no_module");
|
||||
validate = false;
|
||||
}
|
||||
if (values["id_custom_graph"] == 0) {
|
||||
if (values["id_custom_graph"] == 0 && radio_value == "module_graph") {
|
||||
if (values["agent"] == "") {
|
||||
dialog_message("#message_alert_no_agent");
|
||||
validate = false;
|
||||
@ -1439,6 +1445,10 @@ function create_button_palette_callback() {
|
||||
validate = false;
|
||||
}
|
||||
}
|
||||
if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") {
|
||||
dialog_message("#message_alert_no_custom_graph");
|
||||
validate = false;
|
||||
}
|
||||
if (
|
||||
values["height_module_graph"] == "" ||
|
||||
values["height_module_graph"] == 0
|
||||
|
@ -78,7 +78,7 @@ if (!$is_metaconsole) {
|
||||
__('Reporting').' » '.__('Visual Favourite Console'),
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
'map_builder',
|
||||
'map_builder_favorite',
|
||||
false,
|
||||
$buttons
|
||||
);
|
||||
|
@ -403,7 +403,7 @@ if (($create != '') || ($view != '')) {
|
||||
$table->data['plugin_command'] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Plug-in parameters').ui_print_help_icon('plugin_parameters', true);
|
||||
$data[0] = __('Plug-in parameters');
|
||||
$data[1] = '<input type="text" name="form_parameters" id="form_parameters" class="command_component command_advanced_conf" size=100 value="'.$parameters.'" '.$disabled.'>';
|
||||
if ($locked) {
|
||||
$data[1] .= html_print_image('images/lock.png', true, ['class' => 'command_advanced_conf lock']);
|
||||
@ -549,7 +549,7 @@ if (($create != '') || ($view != '')) {
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
html_print_table($table);
|
||||
} else {
|
||||
echo '<fieldset>'.'<legend>'.__('Parameters macros').ui_print_help_icon('macros', true).'</legend>';
|
||||
echo '<fieldset>'.'<legend>'.__('Parameters macros').'</legend>';
|
||||
html_print_table($table);
|
||||
echo '</fieldset>';
|
||||
}
|
||||
@ -612,7 +612,16 @@ if (($create != '') || ($view != '')) {
|
||||
config_update_value('metaconsole_deploy_plugin_server', 1);
|
||||
}
|
||||
} else {
|
||||
ui_print_page_header(__('Plug-ins registered on %s', get_product_name()), 'images/gm_servers.png', false, '', true);
|
||||
ui_print_page_header(
|
||||
__(
|
||||
'Plug-ins registered on %s',
|
||||
get_product_name()
|
||||
),
|
||||
'images/gm_servers.png',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$management_allowed = !is_central_policies_on_node();
|
||||
if (!$management_allowed) {
|
||||
@ -1189,13 +1198,13 @@ ui_require_javascript_file('pandora_modules');
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('<?php echo __('The plugin command cannot be updated because some modules or components are using the plugin.'); ?>');
|
||||
alert("<?php echo __('The plugin command cannot be updated because some modules or components are using the plugin.'); ?>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var macros_click_locked_event = function (event) {
|
||||
alert('<?php echo __('The plugin macros cannot be updated because some modules or components are using the plugin'); ?>');
|
||||
alert("<?php echo __('The plugin macros cannot be updated because some modules or components are using the plugin'); ?>");
|
||||
}
|
||||
|
||||
if (locked) {
|
||||
|
@ -28,8 +28,14 @@ require_once 'include/functions_gis.php';
|
||||
|
||||
ui_require_javascript_file('openlayers.pandora');
|
||||
|
||||
// Header
|
||||
ui_print_page_header(__('Map conections GIS'), '', false, 'setup_gis_index', true);
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Map conections GIS'),
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$action = get_parameter('action');
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
@ -35,8 +35,14 @@ echo '<form action="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2" method="
|
||||
|
||||
switch ($action) {
|
||||
case 'create_connection_map':
|
||||
// Header
|
||||
ui_print_page_header(__('Create new map connection'), '', false, 'gis_setup_map_connection', true);
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Create new map connection'),
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$mapConnection_name = '';
|
||||
$mapConnection_group = '';
|
||||
@ -55,8 +61,14 @@ switch ($action) {
|
||||
break;
|
||||
|
||||
case 'edit_connection_map':
|
||||
// Header
|
||||
ui_print_page_header(__('Edit map connection'), '', false, 'gis_setup_map_connection', true);
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Edit map connection'),
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$idConnectionMap = get_parameter('id_connection_map');
|
||||
$mapConnection = db_get_row_sql('SELECT * FROM tgis_map_connection WHERE id_tmap_connection = '.$idConnectionMap);
|
||||
@ -142,9 +154,13 @@ switch ($action) {
|
||||
'layers' => $layers,
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO VALIDATE PARAMETERS
|
||||
// TODO VALIDATE PARAMETERS.
|
||||
if ($mapConnection_name != '' && $mapConnection_type != '') {
|
||||
gis_save_map_connection(
|
||||
$mapConnection_name,
|
||||
@ -170,6 +186,9 @@ switch ($action) {
|
||||
return;
|
||||
|
||||
break;
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
$table->width = '90%';
|
||||
@ -188,7 +207,7 @@ $table->data[2][1] = html_print_input_text('num_levels_zoom', $mapConnection_num
|
||||
$table->data[3][0] = __('Default zoom level').ui_print_help_tip(__('Zoom level used when the map is opened'), true).':';
|
||||
$table->data[3][1] = html_print_input_text('initial_zoom', $mapConnection_defaultZoom, '', 4, 10, true);
|
||||
|
||||
echo '<h4>'.__('Basic configuration').'</h4>';
|
||||
echo '<h4>'.__('Basic configuration').' '.ui_print_help_icon('gis_basic_configurations_tab', true).'</h4>';
|
||||
html_print_table($table);
|
||||
|
||||
$table->width = '60%';
|
||||
@ -200,7 +219,7 @@ $types['WMS'] = __('WMS Server');
|
||||
$table->data[0][0] = __('Type').':';
|
||||
$table->data[0][1] = html_print_select($types, 'sel_type', $mapConnection_type, 'selMapConnectionType();', __('Please select the connection type'), 0, true);
|
||||
|
||||
echo '<h4>'.__('Map connection type').'</h4>';
|
||||
echo '<h4>'.__('Map connection type').' '.ui_print_help_icon('gis_map_connection_tab', true).'</h4>';
|
||||
html_print_table($table);
|
||||
|
||||
$optionsConnectionTypeTable = '';
|
||||
@ -239,22 +258,26 @@ if ($mapConnectionData != null) {
|
||||
$mapConnectionDataUrl = $mapConnectionData['url'];
|
||||
$layers = $mapConnectionData['layers'];
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Open Street Map Connection
|
||||
// Open Street Map Connection.
|
||||
$optionsConnectionOSMTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">'.'<tr class="row_0">'.'<td>'.htmlentities(__('Tile Server URL'), ENT_QUOTES, 'UTF-8').':</td>'.'<td><input id="type" type="hidden" name="type" value="OSM" />'.html_print_input_text('url', $mapConnectionDataUrl, '', 45, 90, true).'</td>'.'</tr>'.'</table>';
|
||||
|
||||
// Google Maps Connection
|
||||
// Google Maps Connection.
|
||||
$gmaps_types['G_PHYSICAL_MAP'] = __('Google Physical');
|
||||
$gmaps_types['G_HYBRID_MAP'] = __('Google Hybrid');
|
||||
$gmaps_types['G_SATELITE_MAP'] = __('Google Satelite');
|
||||
// TODO: Use label tags for the forms.
|
||||
$optionsConnectionGmapTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="90%">'.'<tr class="row_0">'.'<td>'.__('Google Map Type').':</td>'.'<td><input id="type" type="hidden" name="type" value="Gmap" />'.trim(html_print_select($gmaps_types, 'gmap_type', $gmap_type, '', '', 0, true)).'</td>'.'</tr>'.'<tr class="row_2">'.'<td>'.__('Google Maps Key').':</td>'.'</tr>'.'<tr class="row_3">'.'<td colspan="2">'.html_print_input_text('gmap_key', $gmap_key, '', 90, 128, true).'</td>'.'</tr>'.'</table>';
|
||||
// Image Map Connection
|
||||
// Image Map Connection.
|
||||
$optionsConnectionImageTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">'.'<tr class="row_0">'.'<td>'.__('Image URL').':</td>'.'<td colspan="3"><input id="type" type="hidden" name="type" value="Static_Image" />'.html_print_input_text('url', $mapConnectionDataUrl, '', 45, 90, true).'</td>'.'</tr>'.'<tr class="row_1">'.'<td colspan="4"><strong>'.__('Corners of the area of the image').':</strong></td>'.'</tr>'.'<tr class="row_2">'.'<td>'.__('Left').':</td>'.'<td>'.html_print_input_text('bb_left', $bb_left, '', 25, 25, true).'</td>'.'<td>'.__('Bottom').':</td>'.'<td>'.html_print_input_text('bb_bottom', $bb_bottom, '', 25, 25, true).'</td>'.'</tr>'.'<tr class="row_3">'.'<td>'.__('Right').':</td>'.'<td>'.html_print_input_text('bb_right', $bb_right, '', 25, 25, true).'</td>'.'<td>'.__('Top').':</td>'.'<td>'.html_print_input_text('bb_top', $bb_top, '', 25, 25, true).'</td>'.'</tr>'.'<tr class="row_4">'.'<td colspan="4"><strong>'.__('Image Size').':</strong></td>'.'</tr>'.'<tr class="row_5">'.'<td>'.__('Width').':</td>'.'<td>'.html_print_input_text('image_width', $image_width, '', 25, 25, true).'</td>'.'<td>'.__('Height').':</td>'.'<td>'.html_print_input_text('image_height', $image_height, '', 25, 25, true).'</td>'.'</tr>'.'</table>';
|
||||
|
||||
// WMS Server Connection
|
||||
// WMS Server Connection.
|
||||
$optionsConnectionWMSTable = '<table class="databox" border="0" cellpadding="4" cellspacing="4" width="50%">'.'<tr class="row_0">'.'<td>'.__('WMS Server URL').'</td>'.'<td>'.'<input id="type" type="hidden" name="type" value="WMS" />'.html_print_input_text('url', $mapConnectionDataUrl, '', 90, 255, true).'</td>'.'</tr>'.'<tr class="row_1">'.'<td>'.__('Layers').ui_print_help_tip(__('Enter a single element or a comma separated list'), true).'</td>'.'<td>'.html_print_input_text('layers', $layers, '', 90, 255, true).'</td>'.'</tr>'.'</table>';
|
||||
|
||||
if ($mapConnectionData != null) {
|
||||
@ -274,6 +297,10 @@ if ($mapConnectionData != null) {
|
||||
case 'WMS':
|
||||
$optionsConnectionTypeTable = $optionsConnectionWMSTable;
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,15 +1,32 @@
|
||||
<?php
|
||||
// Pandora FMS- http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
// 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.
|
||||
// Load global vars
|
||||
/**
|
||||
* License form.
|
||||
*
|
||||
* @category Form
|
||||
* @package Pandora FMS
|
||||
* @subpackage Enterprise
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// File begin.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
@ -22,22 +39,38 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
|
||||
$update_settings = (bool) get_parameter_post('update_settings');
|
||||
|
||||
ui_print_page_header(__('License management'), 'images/extensions.png', false, '', true);
|
||||
if (is_metaconsole()) {
|
||||
// Metaconsole.
|
||||
ui_require_javascript_file_enterprise('load_enterprise', true);
|
||||
enterprise_include_once('include/functions_license.php');
|
||||
} else {
|
||||
ui_print_page_header(
|
||||
__('License management'),
|
||||
'images/extensions.png',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
if ($update_settings) {
|
||||
foreach ($_POST['keys'] as $key => $value) {
|
||||
db_process_sql_update(
|
||||
'tupdate_settings',
|
||||
[db_escape_key_identifier('value') => $value],
|
||||
[db_escape_key_identifier('key') => $key]
|
||||
);
|
||||
}
|
||||
|
||||
ui_print_success_message(__('License updated'));
|
||||
ui_require_javascript_file_enterprise('load_enterprise');
|
||||
enterprise_include_once('include/functions_license.php');
|
||||
}
|
||||
|
||||
if ($update_settings) {
|
||||
if (!is_metaconsole()) {
|
||||
// Node.
|
||||
foreach ($_POST['keys'] as $key => $value) {
|
||||
db_process_sql_update(
|
||||
'tupdate_settings',
|
||||
[db_escape_key_identifier('value') => $value],
|
||||
[db_escape_key_identifier('key') => $key]
|
||||
);
|
||||
}
|
||||
|
||||
ui_print_success_message(__('License updated'));
|
||||
}
|
||||
}
|
||||
|
||||
ui_require_javascript_file_enterprise('load_enterprise');
|
||||
enterprise_include_once('include/functions_license.php');
|
||||
$license = enterprise_hook('license_get_info');
|
||||
|
||||
$rows = db_get_all_rows_in_table('tupdate_settings');
|
||||
@ -55,11 +88,20 @@ if (enterprise_installed()) {
|
||||
echo '</script>';
|
||||
|
||||
echo '<form method="post">';
|
||||
// Retrieve UM url configured (or default).
|
||||
$url = get_um_url();
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$table->head[0] = __('Licence');
|
||||
$table->head_colspan[0] = 3;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = '<strong>'.__('Customer key').'</strong>';
|
||||
@ -98,34 +140,45 @@ if (enterprise_installed()) {
|
||||
html_print_input_hidden('update_settings', 1);
|
||||
html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"');
|
||||
echo ' ';
|
||||
html_print_button(__('Request new license'), '', false, 'generate_request_code()', 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub next"');
|
||||
html_print_button(__('Request new license'), '', false, 'generate_request_code()', 'class="sub next"');
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</form>';
|
||||
echo '<div id="code_license_dialog" style="display: none; text-align: left;" title="'.__('Request new license').'">';
|
||||
echo '<div id="logo">';
|
||||
html_print_image(ui_get_custom_header_logo(true));
|
||||
echo '</div>';
|
||||
echo ''.__('To get your <b>%s Enterprise License</b>:', get_product_name()).'<br />';
|
||||
echo '<ul>';
|
||||
echo '<li>';
|
||||
echo ''.sprintf(__('Go to %s'), '<a target="_blank" href="https://licensing.artica.es/pandoraupdate7/index.php?section=generate_key_client">https://licensing.artica.es/pandoraupdate7/index.php?section=generate_key_client</a>');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo ''.__('Enter the <b>auth key</b> and the following <b>request key</b>:');
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
echo '<div id="code"></div>';
|
||||
echo '<ul>';
|
||||
echo '<li>';
|
||||
echo ''.__('Enter your name (or a company name) and a contact email address.');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo ''.__('Click on <b>Generate</b>.');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo ''.__('Click <a href="javascript: close_code_license_dialog();">here</a>, enter the generated license key and click on <b>Validate</b>.');
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
if (is_metaconsole()) {
|
||||
ui_require_css_file('pandora_enterprise', '../../'.ENTERPRISE_DIR.'/include/styles/');
|
||||
ui_require_css_file('register', '../../include/styles/');
|
||||
} else {
|
||||
ui_require_css_file('pandora');
|
||||
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/');
|
||||
ui_require_css_file('register');
|
||||
}
|
||||
|
||||
if (enterprise_hook('print_activate_licence_dialog') == ENTERPRISE_NOT_HOOK) {
|
||||
echo '</form>';
|
||||
echo '<div id="code_license_dialog" style="display: none; text-align: left;" title="'.__('Request new license').'">';
|
||||
echo '<div id="logo">';
|
||||
html_print_image(ui_get_custom_header_logo(true));
|
||||
echo '</div>';
|
||||
echo ''.__('To get your <b>%s Enterprise License</b>:', get_product_name()).'<br />';
|
||||
echo '<ul>';
|
||||
echo '<li>';
|
||||
echo ''.sprintf(__('Go to %s'), '<a target="_blank" href="'.$url.'/index.php?section=generate_key_client">'.$url.'index.php?section=generate_key_client</a>');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo ''.__('Enter the <b>auth key</b> and the following <b>request key</b>:');
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
echo '<div id="code"></div>';
|
||||
echo '<ul>';
|
||||
echo '<li>';
|
||||
echo ''.__('Enter your name (or a company name) and a contact email address.');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo ''.__('Click on <b>Generate</b>.');
|
||||
echo '</li>';
|
||||
echo '<li>';
|
||||
echo ''.__('Click <a href="javascript: close_code_license_dialog();">here</a>, enter the generated license key and click on <b>Validate</b>.');
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
||||
theme : "advanced",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_buttons1 : "bold,italic, |, image, link, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright",
|
||||
theme_advanced_buttons1 : "bold,italic, |, image, link, |, cut, copy, paste, |, undo, redo, |, forecolor, |, fontsizeselect, |, justifyleft, justifycenter, justifyright, | ,code",
|
||||
theme_advanced_buttons2 : "",
|
||||
theme_advanced_buttons3 : "",
|
||||
convert_urls : false,
|
||||
|
@ -628,7 +628,7 @@ $table_other->data[6][1] = html_print_input_text(
|
||||
true
|
||||
);
|
||||
|
||||
$table_other->data[7][0] = __('Use agent access graph').ui_print_help_icon('agent_access', true);
|
||||
$table_other->data[7][0] = __('Use agent access graph');
|
||||
$table_other->data[7][1] = html_print_checkbox_switch('agentaccess', 1, $config['agentaccess'], true);
|
||||
|
||||
$table_other->data[8][0] = __('Max. recommended number of files in attachment directory');
|
||||
@ -707,24 +707,24 @@ $table_other->data[13][1] = html_print_input_text(
|
||||
echo '<form id="form_setup" method="post">';
|
||||
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('Database maintenance status').'</legend>';
|
||||
echo '<legend>'.__('Database maintenance status').' '.ui_print_help_icon('database_maintenance_status_tab', true).'</legend>';
|
||||
html_print_table($table_status);
|
||||
echo '</fieldset>';
|
||||
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('Database maintenance options').'</legend>';
|
||||
echo '<legend>'.__('Database maintenance options').' '.ui_print_help_icon('database_maintenance_options_tab', true).'</legend>';
|
||||
html_print_table($table);
|
||||
echo '</fieldset>';
|
||||
|
||||
if ($config['history_db_enabled'] == 1) {
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('Historical database maintenance options').'</legend>';
|
||||
echo '<legend>'.__('Historical database maintenance options').' '.ui_print_help_icon('historical_database_maintenance_options_tab', true).'</legend>';
|
||||
html_print_table($table_historical);
|
||||
echo '</fieldset>';
|
||||
}
|
||||
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('Others').'</legend>';
|
||||
echo '<legend>'.__('Others').' '.ui_print_help_icon('others_database_maintenance_options_tab', true).'</legend>';
|
||||
html_print_table($table_other);
|
||||
echo '</fieldset>';
|
||||
|
||||
|
@ -135,9 +135,9 @@ if (enterprise_installed()) {
|
||||
|
||||
switch ($section) {
|
||||
case 'general':
|
||||
default:
|
||||
$buttons['general']['active'] = true;
|
||||
$subpage = ' » '.__('General');
|
||||
$help_header = 'setup_general_tab';
|
||||
break;
|
||||
|
||||
case 'auth':
|
||||
@ -148,7 +148,7 @@ switch ($section) {
|
||||
case 'perf':
|
||||
$buttons['perf']['active'] = true;
|
||||
$subpage = ' » '.__('Performance');
|
||||
$help_header = 'performance';
|
||||
$help_header = '';
|
||||
break;
|
||||
|
||||
case 'vis':
|
||||
@ -164,16 +164,34 @@ switch ($section) {
|
||||
case 'ehorus':
|
||||
$buttons['ehorus']['active'] = true;
|
||||
$subpage = ' » '.__('eHorus');
|
||||
$help_header = 'setup_ehorus_tab';
|
||||
break;
|
||||
|
||||
case 'notifications':
|
||||
$buttons['notifications']['active'] = true;
|
||||
$subpage = ' » '.__('Notifications');
|
||||
break;
|
||||
|
||||
case 'enterprise':
|
||||
$buttons['enterprise']['active'] = true;
|
||||
$subpage = ' » '.__('Enterprise');
|
||||
$help_header = 'setup_enterprise_tab';
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(__('Configuration').$subpage, '', false, $help_header, true, $buttons);
|
||||
ui_print_page_header(
|
||||
__('Configuration').$subpage,
|
||||
'',
|
||||
false,
|
||||
$help_header,
|
||||
true,
|
||||
$buttons
|
||||
);
|
||||
|
||||
if (isset($config['error_config_update_config'])) {
|
||||
if ($config['error_config_update_config']['correct'] == false) {
|
||||
|
@ -139,47 +139,49 @@ if ($config['ehorus_enabled'] && !$custom_field_exists) {
|
||||
ui_print_error_message($error_message);
|
||||
}
|
||||
|
||||
echo "<form method='post'>";
|
||||
// Form enable.
|
||||
echo '<form id="form_enable" method="post">';
|
||||
echo '<div id="form_enable">';
|
||||
html_print_input_hidden('update_config', 1);
|
||||
html_print_table($table_enable);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
||||
// Form remote.
|
||||
if ($config['ehorus_enabled']) {
|
||||
echo '<form id="form_remote" method="post">';
|
||||
echo '<div id="form_remote">';
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('eHorus API').'</legend>';
|
||||
html_print_input_hidden('update_config', 1);
|
||||
html_print_table($table_remote);
|
||||
echo '<div class="action-buttons" style="width: '.$table_remote->width.'">';
|
||||
|
||||
echo '</fieldset>';
|
||||
echo '</div>';
|
||||
echo '<div class="action-buttons" style="width: '.$table_remote->width.'">';
|
||||
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');
|
||||
echo '</div>';
|
||||
echo '</fieldset>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('input:checkbox[name="ehorus_enabled"]').attr('checked', false);
|
||||
$('form#form_remote').hide();
|
||||
$('form#form_enable').css('margin-bottom','20px');
|
||||
if(!$('input:checkbox[name="ehorus_enabled"]').is(':checked')){
|
||||
$('#form_remote').hide();
|
||||
}
|
||||
$('#form_enable').css('margin-bottom','20px');
|
||||
var showFields = function () {
|
||||
$('form#form_remote').show();
|
||||
$('#form_remote').show();
|
||||
}
|
||||
var hideFields = function () {
|
||||
$('form#form_remote').hide();
|
||||
$('#form_remote').hide();
|
||||
}
|
||||
var handleEnable = function (event) {
|
||||
var is_checked = $('input:checkbox[name="ehorus_enabled"]').is(':checked');
|
||||
if (event.target.value == '1' && is_checked) {
|
||||
showFields();
|
||||
$('input:checkbox[name="ehorus_enabled"]').attr('checked', false);
|
||||
$('input:checkbox[name="ehorus_enabled"]').attr('checked', true);
|
||||
}
|
||||
else {
|
||||
hideFields();
|
||||
$('input:checkbox[name="ehorus_enabled"]').attr('checked', true);
|
||||
$('input:checkbox[name="ehorus_enabled"]').attr('checked', false);
|
||||
};
|
||||
}
|
||||
$('input:checkbox[name="ehorus_enabled"]').change(handleEnable);
|
||||
|
@ -82,7 +82,7 @@ $table->data[2][1] = html_print_input_text('phantomjs_bin', io_safe_output($conf
|
||||
$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').ui_print_help_icon('timesource', true);
|
||||
$table->data[9][0] = __('Time source');
|
||||
$sources['system'] = __('System');
|
||||
$sources['sql'] = __('Database');
|
||||
$table->data[9][1] = html_print_select($sources, 'timesource', $config['timesource'], '', '', '', true);
|
||||
@ -107,7 +107,7 @@ $table->data[13][1] = html_print_input_text('cert_path', io_safe_output($config[
|
||||
$table->data[14][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[15][0] = __('IP list with API access').ui_print_help_icon('ip_api_list', true);
|
||||
$table->data[15][0] = __('IP list with API access');
|
||||
if (isset($_POST['list_ACL_IPs_for_API'])) {
|
||||
$list_ACL_IPs_for_API = get_parameter_post('list_ACL_IPs_for_API');
|
||||
} else {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user