Merge branch 'develop' into 'ent-3706-No-se-incluyen-parametros-de-autenticacion-y-privacidad-en-wizard-interfaces-para-modulos-satelite'
# Conflicts: # pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php Former-commit-id: f15c507347700205a081d010a9c6f58c0e2e5720
|
@ -172,8 +172,8 @@ echo "Updating Pandora Console version..."
|
|||
sed -i -e "s/\s*\$pandora_version\s*=.*/\$pandora_version = 'v$VERSION';/" "$CONSOLE_FILE"
|
||||
sed -i -e "s/\s*\$build_version\s*=.*/\$build_version = 'PC$BUILD';/" "$CONSOLE_FILE"
|
||||
echo "Updating Pandora Console installer version..."
|
||||
sed -i -e "s/\s*\$version\s*=.*/\$version = '$VERSION';/" "$CONSOLE_INSTALL_FILE"
|
||||
sed -i -e "s/\s*\$build\s*=.*/\$build = '$BUILD';/" "$CONSOLE_INSTALL_FILE"
|
||||
sed -i -e "s/\(\s*\$version\s*=\s\).*/\1'$VERSION';/" "$CONSOLE_INSTALL_FILE"
|
||||
sed -i -e "s/\(\s*\$build\s*=\s\).*/\1'$BUILD';/" "$CONSOLE_INSTALL_FILE"
|
||||
echo "Setting develop_bypass to 0..."
|
||||
sed -i -e "s/\s*if\s*(\s*[!]\s*isset\s*(\s*$develop_bypass\s*)\s*)\s*$develop_bypass\s*=.*/if ([!]isset($develop_bypass)) $develop_bypass = 0;/" "$CONSOLE_FILE"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.732-190311
|
||||
Version: 7.0NG.732-190319
|
||||
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.732-190311"
|
||||
pandora_version="7.0NG.732-190319"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.732';
|
||||
use constant AGENT_BUILD => '190311';
|
||||
use constant AGENT_BUILD => '190319';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.732
|
||||
%define release 190311
|
||||
%define release 190319
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.732
|
||||
%define release 190311
|
||||
%define release 190319
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.732"
|
||||
PI_BUILD="190311"
|
||||
PI_BUILD="190319"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{190311}
|
||||
{190319}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.732(Build 190311)")
|
||||
#define PANDORA_VERSION ("7.0NG.732(Build 190319)")
|
||||
|
||||
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.732(Build 190311))"
|
||||
VALUE "ProductVersion", "(7.0NG.732(Build 190319))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.732-190311
|
||||
Version: 7.0NG.732-190319
|
||||
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.732-190311"
|
||||
pandora_version="7.0NG.732-190319"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -106,7 +106,9 @@ function get_value_sum($arr)
|
|||
{
|
||||
foreach ($arr as $clave) {
|
||||
foreach ($clave as $valor) {
|
||||
$result += $valor;
|
||||
if (is_numeric($valor) === true) {
|
||||
$result += $valor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,42 +82,30 @@ if (!empty($page) && !empty($sec)) {
|
|||
}
|
||||
|
||||
$login_body_style = '';
|
||||
// Overrides the default background with the defined by the user
|
||||
// Overrides the default background with the defined by the user.
|
||||
if (!empty($config['login_background'])) {
|
||||
$background_url = 'images/backgrounds/'.$config['login_background'];
|
||||
$login_body_style = "style=\"background-image: url('$background_url');\"";
|
||||
$login_body_style = "style=\"background:linear-gradient(74deg, #02020255 36%, transparent 36%), url('".$background_url."');\"";
|
||||
}
|
||||
|
||||
// Get the custom icons
|
||||
// Get the custom icons.
|
||||
$docs_logo = ui_get_docs_logo();
|
||||
$support_logo = ui_get_support_logo();
|
||||
echo '<div id="login_body" '.$login_body_style.'>';
|
||||
echo '<div id="header_login">';
|
||||
echo '<div id="icon_custom_pandora">';
|
||||
|
||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
if (isset($config['custom_logo'])) {
|
||||
echo '<img src="enterprise/images/custom_logo/'.$config['custom_logo'].'" alt="monitoring_console">';
|
||||
} else {
|
||||
echo '<img src="images/custom_logo/pandora_logo_head_4.png" alt="monitoring_console">';
|
||||
}
|
||||
} else {
|
||||
echo '<img src="images/custom_logo/pandora_logo_head_3.png" alt="monitoring_console">';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '<div id="list_icon_docs_support"><ul style="line-height: 36px;">';
|
||||
echo '<div id="list_icon_docs_support"><ul>';
|
||||
if ($docs_logo !== false) {
|
||||
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
|
||||
}
|
||||
|
||||
echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_docs_url'].'" target="_blank">'.__('Docs').'</li>';
|
||||
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank">'.__('Docs').'</li>';
|
||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
if ($support_logo !== false) {
|
||||
echo '<li id="li_margin_left"><a href="'.$config['custom_support_url'].'" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
}
|
||||
|
||||
echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_support_url'].'" target="_blank">'.__('Support').'</li>';
|
||||
echo '<li><a href="'.$config['custom_support_url'].'" target="_blank">'.__('Support').'</li>';
|
||||
} else {
|
||||
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
echo '<li>'.__('Support').'</li>';
|
||||
|
@ -151,7 +139,8 @@ if (defined('METACONSOLE')) {
|
|||
html_print_image('images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
}
|
||||
|
||||
echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";
|
||||
// I comment this in case in the future we put a logo without text.
|
||||
// echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";.
|
||||
}
|
||||
|
||||
echo '</a></div>';
|
||||
|
@ -167,9 +156,6 @@ switch ($login_screen) {
|
|||
|
||||
if ($config['auth'] == 'saml') {
|
||||
echo '<div id="log_nick" class="login_nick" style="display: none;">';
|
||||
echo '<div>';
|
||||
html_print_image('/images/usuario_login.png', false);
|
||||
echo '</div>';
|
||||
html_print_input_text_extended(
|
||||
'nick',
|
||||
'',
|
||||
|
@ -184,9 +170,6 @@ switch ($login_screen) {
|
|||
echo '</div>';
|
||||
|
||||
echo '<div id="log_pass" class="login_pass" style="display: none;">';
|
||||
echo '<div>';
|
||||
html_print_image('/images/candado_login.png', false);
|
||||
echo '</div>';
|
||||
html_print_input_text_extended(
|
||||
'pass',
|
||||
'',
|
||||
|
@ -202,54 +185,48 @@ switch ($login_screen) {
|
|||
);
|
||||
echo '</div>';
|
||||
|
||||
echo '<div id="log_button" class="login_button" style="display: none; margin-bottom: 20px;">';
|
||||
echo '<div id="log_button" class="login_button" style="display: none;">';
|
||||
html_print_submit_button(__('Login as admin'), 'login_button', false, 'class="sub next_login"');
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="login_button" id="remove_button" style="margin-bottom: 20px;">';
|
||||
echo '<div class="login_button" id="remove_button">';
|
||||
echo '<input type="button" id="input_saml" value="Login as admin" onclick="show_normal_menu()">';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="login_button">';
|
||||
echo '<div class="login_button login_button_saml">';
|
||||
html_print_submit_button(__('Login with SAML'), 'login_button_saml', false, '');
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo '<div class="login_nick">';
|
||||
echo '<div>';
|
||||
html_print_image('/images/usuario_login.png', false);
|
||||
echo '</div>';
|
||||
html_print_input_text_extended(
|
||||
'nick',
|
||||
'',
|
||||
'nick',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'autocomplete="off" placeholder="'.__('User').'"'
|
||||
);
|
||||
html_print_input_text_extended(
|
||||
'nick',
|
||||
'',
|
||||
'nick',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'autocomplete="off" placeholder="'.__('User').'"'
|
||||
);
|
||||
echo '</div>';
|
||||
echo '<div class="login_pass">';
|
||||
echo '<div>';
|
||||
html_print_image('/images/candado_login.png', false);
|
||||
echo '</div>';
|
||||
html_print_input_text_extended(
|
||||
'pass',
|
||||
'',
|
||||
'pass',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'autocomplete="off" placeholder="'.__('Password').'"',
|
||||
false,
|
||||
true
|
||||
);
|
||||
html_print_input_text_extended(
|
||||
'pass',
|
||||
'',
|
||||
'pass',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'autocomplete="off" placeholder="'.__('Password').'"',
|
||||
false,
|
||||
true
|
||||
);
|
||||
echo '</div>';
|
||||
echo '<div class="login_button">';
|
||||
html_print_submit_button(__('Login'), 'login_button', false, 'class="sub next_login"');
|
||||
html_print_submit_button(__('Login'), 'login_button', false, 'class="sub next_login"');
|
||||
echo '</div>';
|
||||
}
|
||||
break;
|
||||
|
@ -289,9 +266,9 @@ switch ($login_screen) {
|
|||
if ($config['enterprise_installed']) {
|
||||
if ($config['reset_pass_option']) {
|
||||
$reset_pass_link = 'reset_pass.php';
|
||||
// Reset password link
|
||||
echo '<div style="width:70%; height:40px; margin-right:auto; margin-left:auto; margin-top:20px; text-align:center;">';
|
||||
echo '<a style="color: white !important;" href="index.php?reset=true&first=true">'.__('Forgot your password?');
|
||||
// Reset password link.
|
||||
echo '<div class="reset_password">';
|
||||
echo '<a href="index.php?reset=true&first=true">'.__('Forgot your password?');
|
||||
echo '</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
@ -544,7 +521,7 @@ ui_require_jquery_file('jquery-ui.min');
|
|||
?>
|
||||
|
||||
<?php
|
||||
// Hidden div to forced title
|
||||
// Hidden div to forced title.
|
||||
html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]);
|
||||
|
||||
// html_print_div(array('id' => 'modal_alert', 'hidden' => true));
|
||||
|
|
|
@ -321,6 +321,8 @@ if ($create_modules) {
|
|||
$module_type = 2;
|
||||
} else if (preg_match('/ifAdminStatus/', $name_array[1])) {
|
||||
$module_type = 2;
|
||||
} else if (preg_match('/ifOperStatus/', $name_array[1])) {
|
||||
$module_type = 18;
|
||||
} else {
|
||||
$module_type = 4;
|
||||
}
|
||||
|
|
|
@ -1,17 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-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
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -51,15 +66,22 @@ if (is_ajax()) {
|
|||
}
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
// Header
|
||||
ui_print_page_header(__('Module groups defined in %s', get_product_name()), 'images/module_group.png', false, '', true, '');
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Module groups defined in %s', get_product_name()),
|
||||
'images/module_group.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
''
|
||||
);
|
||||
}
|
||||
|
||||
$create_group = (bool) get_parameter('create_group');
|
||||
$update_group = (bool) get_parameter('update_group');
|
||||
$delete_group = (bool) get_parameter('delete_group');
|
||||
|
||||
// Create group
|
||||
// Create group.
|
||||
if ($create_group) {
|
||||
$name = (string) get_parameter('name');
|
||||
$icon = (string) get_parameter('icon');
|
||||
|
@ -70,22 +92,29 @@ if ($create_group) {
|
|||
|
||||
if ($name) {
|
||||
if (!$check) {
|
||||
$result = db_process_sql_insert('tmodule_group', ['name' => $name]);
|
||||
$result = db_process_sql_insert(
|
||||
'tmodule_group',
|
||||
['name' => $name]
|
||||
);
|
||||
|
||||
if ($result) {
|
||||
ui_print_success_message(__('Group successfully created'));
|
||||
} else {
|
||||
ui_print_error_message(__('There was a problem creating group'));
|
||||
ui_print_error_message(
|
||||
__('There was a problem creating group')
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Each module group must have a different name'));
|
||||
ui_print_error_message(
|
||||
__('Each module group must have a different name')
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Module group must have a name'));
|
||||
}
|
||||
}
|
||||
|
||||
// Update group
|
||||
// Update group.
|
||||
if ($update_group) {
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
$name = (string) get_parameter('name');
|
||||
|
@ -98,38 +127,79 @@ if ($update_group) {
|
|||
|
||||
if ($name) {
|
||||
if (!$check || $subcheck == $name) {
|
||||
$result = db_process_sql_update('tmodule_group', ['name' => $name], ['id_mg' => $id_group]);
|
||||
$result = db_process_sql_update(
|
||||
'tmodule_group',
|
||||
['name' => $name],
|
||||
['id_mg' => $id_group]
|
||||
);
|
||||
|
||||
if ($result !== false) {
|
||||
ui_print_success_message(__('Group successfully updated'));
|
||||
} else {
|
||||
ui_print_error_message(__('There was a problem modifying group'));
|
||||
ui_print_error_message(
|
||||
__('There was a problem modifying group')
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Each module group must have a different name'));
|
||||
ui_print_error_message(
|
||||
__('Each module group must have a different name')
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Module group must have a name'));
|
||||
}
|
||||
}
|
||||
|
||||
// Delete group
|
||||
// Delete group.
|
||||
if ($delete_group) {
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
|
||||
$result = db_process_sql_delete('tmodule_group', ['id_mg' => $id_group]);
|
||||
|
||||
if ($result) {
|
||||
$result = db_process_sql_update('tagente_modulo', ['id_module_group' => 0], ['id_module_group' => $id_group]);
|
||||
db_process_sql_update('tpolicy_modules', ['id_module_group' => 0], ['id_module_group' => $id_group]);
|
||||
db_process_sql_update('tcontainer_item', ['id_module_group' => 0], ['id_module_group' => $id_group]);
|
||||
db_process_sql_update('tnetwork_component', ['id_module_group' => 0], ['id_module_group' => $id_group]);
|
||||
db_process_sql_update('treport_content', ['id_module_group' => 0], ['id_module_group' => $id_group]);
|
||||
db_process_sql_update('tnetwork_map', ['id_module_group' => 0], ['id_module_group' => $id_group]);
|
||||
db_process_sql_update('tlocal_component', ['id_module_group' => 0], ['id_module_group' => $id_group]);
|
||||
db_process_sql_update('treport_content_template', ['id_module_group' => 0], ['id_module_group' => $id_group]);
|
||||
$result = db_process_sql_update(
|
||||
'tagente_modulo',
|
||||
['id_module_group' => 0],
|
||||
['id_module_group' => $id_group]
|
||||
);
|
||||
db_process_sql_update(
|
||||
'tpolicy_modules',
|
||||
['id_module_group' => 0],
|
||||
['id_module_group' => $id_group]
|
||||
);
|
||||
db_process_sql_update(
|
||||
'tcontainer_item',
|
||||
['id_module_group' => 0],
|
||||
['id_module_group' => $id_group]
|
||||
);
|
||||
db_process_sql_update(
|
||||
'tnetwork_component',
|
||||
['id_module_group' => 0],
|
||||
['id_module_group' => $id_group]
|
||||
);
|
||||
db_process_sql_update(
|
||||
'treport_content',
|
||||
['id_module_group' => 0],
|
||||
['id_module_group' => $id_group]
|
||||
);
|
||||
db_process_sql_update(
|
||||
'tnetwork_map',
|
||||
['id_module_group' => 0],
|
||||
['id_module_group' => $id_group]
|
||||
);
|
||||
db_process_sql_update(
|
||||
'tlocal_component',
|
||||
['id_module_group' => 0],
|
||||
['id_module_group' => $id_group]
|
||||
);
|
||||
db_process_sql_update(
|
||||
'treport_content_template',
|
||||
['id_module_group' => 0],
|
||||
['id_module_group' => $id_group]
|
||||
);
|
||||
|
||||
// A group with no modules can be deleted, to avoid a message error then do the follwing
|
||||
// A group with no modules can be deleted,
|
||||
// to avoid a message error then do the follwing.
|
||||
if ($result !== false) {
|
||||
$result = true;
|
||||
}
|
||||
|
@ -150,36 +220,15 @@ $offset = (int) get_parameter('offset', 0);
|
|||
|
||||
ui_pagination($total_groups, $url, $offset);
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$sql = 'SELECT *
|
||||
FROM tmodule_group
|
||||
ORDER BY name ASC
|
||||
LIMIT '.$offset.', '.$config['block_size'];
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$sql = 'SELECT *
|
||||
FROM tmodule_group
|
||||
ORDER BY name ASC
|
||||
LIMIT '.$config['block_size'].' OFFSET '.$offset;
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$set = [];
|
||||
$set['limit'] = $config['block_size'];
|
||||
$set['offset'] = $offset;
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM tmodule_group
|
||||
ORDER BY name ASC';
|
||||
|
||||
$sql = oracle_recode_query($sql, $set);
|
||||
break;
|
||||
}
|
||||
$sql = 'SELECT *
|
||||
FROM tmodule_group
|
||||
ORDER BY name ASC
|
||||
LIMIT '.$offset.', '.$config['block_size'];
|
||||
|
||||
$groups = db_get_all_rows_sql($sql);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
|
||||
|
@ -210,11 +259,21 @@ if (!empty($groups)) {
|
|||
|
||||
html_print_table($table);
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined module groups') ]);
|
||||
ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('There are no defined module groups'),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/groups/configure_modu_group">';
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_submit_button(__('Create module group'), 'crt', false, 'class="sub next"');
|
||||
html_print_submit_button(
|
||||
__('Create module group'),
|
||||
'crt',
|
||||
false,
|
||||
'class="sub next"'
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
|
|
@ -1,17 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2009 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
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
|
@ -34,7 +49,8 @@ if (is_ajax()) {
|
|||
|
||||
if ($get_agents) {
|
||||
$id_group = (int) get_parameter('id_group', 0);
|
||||
// Is is possible add keys prefix to avoid auto sorting in js object conversion
|
||||
// Is is possible add keys prefix to avoid auto
|
||||
// sorting in js object conversion.
|
||||
$keys_prefix = (string) get_parameter('keys_prefix', '');
|
||||
|
||||
if ($id_group == 0) {
|
||||
|
@ -62,7 +78,7 @@ if (is_ajax()) {
|
|||
);
|
||||
}
|
||||
|
||||
// Add keys prefix
|
||||
// Add keys prefix.
|
||||
if ($keys_prefix !== '') {
|
||||
foreach ($agents as $k => $v) {
|
||||
$agents[$keys_prefix.$k] = $v;
|
||||
|
@ -92,8 +108,8 @@ function process_manage_add($id_alert_template, $id_agents, $module_names)
|
|||
|
||||
foreach ($module_names as $module) {
|
||||
foreach ($id_agents as $id_agent) {
|
||||
$module_id = modules_get_agentmodule_id($module, $id_agent);
|
||||
$modules_id[] = $module_id['id_agente_modulo'];
|
||||
$module_id = modules_get_agentmodule_id($module, $id_agent);
|
||||
$modules_id[] = $module_id['id_agente_modulo'];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,6 +164,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) {
|
|||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'add_table';
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
|
@ -251,10 +268,10 @@ html_print_submit_button(__('Add'), 'go', false, 'class="sub add"');
|
|||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
// TODO: Change to iu_print_error system
|
||||
// TODO: Change to iu_print_error system.
|
||||
echo '<h3 class="error invisible" id="message"> </h3>';
|
||||
|
||||
// Hack to translate text "none" in PHP to javascript
|
||||
// Hack to translate text "none" in PHP to javascript.
|
||||
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
|
||||
|
||||
ui_require_jquery_file('form');
|
||||
|
@ -270,42 +287,40 @@ $(document).ready (function () {
|
|||
var get_parameters_count = window.location.href.slice(
|
||||
window.location.href.indexOf('?') + 1).split('&').length;
|
||||
var post_parameters_count = $("#form_alerts").serializeArray().length;
|
||||
|
||||
|
||||
var count_parameters =
|
||||
get_parameters_count + post_parameters_count;
|
||||
|
||||
|
||||
if (count_parameters > limit_parameters_massive) {
|
||||
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#checkbox-recursion").click(function () {
|
||||
$("#id_group").trigger("change");
|
||||
});
|
||||
|
||||
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||
|
||||
|
||||
$("#id_group").change (function () {
|
||||
var $select = $("#id_agents").enable ();
|
||||
$("#agent_loading").show ();
|
||||
$("option", $select).remove ();
|
||||
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "godmode/massive/massive_add_alerts",
|
||||
"get_agents" : 1,
|
||||
"id_group" : this.value,
|
||||
"recursion" : $("#checkbox-recursion").is(":checked") ? 1 : 0,
|
||||
// Add a key prefix to avoid auto sorting in js object conversion
|
||||
// Add a key prefix to avoid auto sorting in js object conversion.
|
||||
"keys_prefix" : "_"
|
||||
},
|
||||
function (data, status) {
|
||||
options = "";
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
// Remove keys_prefix from the index.
|
||||
id = id.substring(1);
|
||||
|
||||
options += "<option value=\""+id+"\">"+value+"</option>";
|
||||
});
|
||||
$("#id_agents").append (options);
|
||||
|
@ -315,40 +330,39 @@ $(document).ready (function () {
|
|||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
$("#id_group").value = "0";
|
||||
|
||||
|
||||
$("#id_group").click (
|
||||
function () {
|
||||
$(this).css ("width", "auto");
|
||||
});
|
||||
|
||||
|
||||
$("#id_group").blur (function () {
|
||||
$(this).css ("width", "180px");
|
||||
});
|
||||
|
||||
|
||||
$("#id_agents").click (
|
||||
function () {
|
||||
$(this).css ("width", "auto");
|
||||
});
|
||||
|
||||
|
||||
$("#id_agents").blur (function () {
|
||||
$(this).css ("width", "180px");
|
||||
});
|
||||
|
||||
|
||||
$("#module").click (
|
||||
function () {
|
||||
$(this).css ("width", "auto");
|
||||
});
|
||||
|
||||
|
||||
$("#module").blur (function () {
|
||||
$(this).css ("width", "180px");
|
||||
});
|
||||
|
||||
|
||||
$("#modules_selection_mode").change (function() {
|
||||
$("#id_agents").trigger('change');
|
||||
});
|
||||
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|
|
@ -1,17 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2012 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU 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
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -37,13 +52,19 @@ $user_groups_w = array_keys($user_groups_w);
|
|||
$user_groups_r = users_get_groups(false, 'AW', true, false, null, 'id_grupo');
|
||||
$user_groups_r = array_keys($user_groups_r);
|
||||
|
||||
// Headers
|
||||
// ui_print_page_header (__('Manage recontask'), "images/gm_servers.png", false, "", true);
|
||||
ui_print_page_header(__('Manage recontask'), 'images/gm_servers.png', false, '', true, $options);
|
||||
// Headers.
|
||||
ui_print_page_header(
|
||||
__('Manage recontask'),
|
||||
'images/gm_servers.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$options
|
||||
);
|
||||
|
||||
|
||||
// --------------------------------
|
||||
// DELETE A RECON TASKs
|
||||
// DELETE A RECON TASKs.
|
||||
// --------------------------------
|
||||
if (isset($_GET['delete'])) {
|
||||
$id = get_parameter_get('delete');
|
||||
|
@ -59,11 +80,15 @@ if (isset($_GET['delete'])) {
|
|||
$id = get_parameter_get('id');
|
||||
$disabled = get_parameter_get('disabled');
|
||||
|
||||
$result = db_process_sql_update('trecon_task', ['disabled' => $disabled], ['id_rt' => $id]);
|
||||
$result = db_process_sql_update(
|
||||
'trecon_task',
|
||||
['disabled' => $disabled],
|
||||
['id_rt' => $id]
|
||||
);
|
||||
|
||||
if ($result !== false) {
|
||||
ui_print_success_message(__('Successfully updated recon task'));
|
||||
// If the action is enabled, we force recon_task to be queued asap
|
||||
// If the action is enabled, we force recon_task to be queued asap.
|
||||
if ($disabled == 0) {
|
||||
servers_force_recon_task($id);
|
||||
}
|
||||
|
@ -73,9 +98,9 @@ if (isset($_GET['delete'])) {
|
|||
}
|
||||
|
||||
// --------------------------------
|
||||
// GET PARAMETERS IF UPDATE OR CREATE
|
||||
// GET PARAMETERS IF UPDATE OR CREATE.
|
||||
// --------------------------------
|
||||
if ((isset($_GET['update'])) or ((isset($_GET['create'])))) {
|
||||
if ((isset($_GET['update'])) || ((isset($_GET['create'])))) {
|
||||
$name = get_parameter_post('name');
|
||||
$network = get_parameter_post('network');
|
||||
$description = get_parameter_post('description');
|
||||
|
@ -115,14 +140,16 @@ if ((isset($_GET['update'])) or ((isset($_GET['create'])))) {
|
|||
$alias_as_name = (int) get_parameter('alias_as_name', 0);
|
||||
$snmp_enabled = (int) get_parameter('snmp_enabled', 0);
|
||||
$vlan_enabled = (int) get_parameter('vlan_enabled', 0);
|
||||
// Get macros
|
||||
// Get macros.
|
||||
$macros = (string) get_parameter('macros');
|
||||
|
||||
if (!empty($macros)) {
|
||||
$macros = json_decode(base64_decode($macros), true);
|
||||
|
||||
foreach ($macros as $k => $m) {
|
||||
$macros[$k]['value'] = get_parameter($m['macro'], '');
|
||||
if (isset($macros) === true && is_array($macros) === true) {
|
||||
foreach ($macros as $k => $m) {
|
||||
$macros[$k]['value'] = get_parameter($m['macro'], '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,7 +157,7 @@ if ((isset($_GET['update'])) or ((isset($_GET['create'])))) {
|
|||
}
|
||||
|
||||
// --------------------------------
|
||||
// UPDATE A RECON TASK
|
||||
// UPDATE A RECON TASK.
|
||||
// --------------------------------
|
||||
if (isset($_GET['update'])) {
|
||||
$id = get_parameter_get('update');
|
||||
|
@ -193,10 +220,18 @@ if (isset($_GET['update'])) {
|
|||
$reason = __('Wrong format in Subnet field');
|
||||
$result = false;
|
||||
} else {
|
||||
$result = db_process_sql_update('trecon_task', $values, $where);
|
||||
$result = db_process_sql_update(
|
||||
'trecon_task',
|
||||
$values,
|
||||
$where
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$result = db_process_sql_update('trecon_task', $values, $where);
|
||||
$result = db_process_sql_update(
|
||||
'trecon_task',
|
||||
$values,
|
||||
$where
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$result = false;
|
||||
|
@ -314,9 +349,9 @@ if (isset($_GET['create'])) {
|
|||
}
|
||||
|
||||
// --------------------------------
|
||||
// SHOW TABLE WITH ALL RECON TASKs
|
||||
// SHOW TABLE WITH ALL RECON TASKs.
|
||||
// --------------------------------
|
||||
// Pandora Admin must see all columns
|
||||
// Pandora Admin must see all columns.
|
||||
if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
$sql = sprintf(
|
||||
'SELECT *
|
||||
|
@ -377,26 +412,26 @@ if ($result !== false) {
|
|||
|
||||
|
||||
if ($row['id_recon_script'] == 0) {
|
||||
// Network recon task
|
||||
// Network recon task.
|
||||
$data[2] = html_print_image('images/network.png', true, ['title' => __('Network recon task')]).' ';
|
||||
$data[2] .= network_profiles_get_name($row['id_network_profile']);
|
||||
$mode_name = '';
|
||||
} else {
|
||||
// APP recon task
|
||||
// APP recon task.
|
||||
$data[2] = html_print_image('images/plugin.png', true).' ';
|
||||
$mode_name = db_get_sql(sprintf('SELECT name FROM trecon_script WHERE id_recon_script = %d', $row['id_recon_script']));
|
||||
$data[2] .= $mode_name;
|
||||
}
|
||||
|
||||
|
||||
// GROUP
|
||||
// GROUP.
|
||||
if ($row['id_recon_script'] == 0) {
|
||||
$data[3] = ui_print_group_icon($row['id_group'], true);
|
||||
} else {
|
||||
$data[3] = '-';
|
||||
}
|
||||
|
||||
// SNMP VERSION
|
||||
// SNMP VERSION.
|
||||
if ($row['snmp_version'] == '1') {
|
||||
$data[4] = 'v. 1';
|
||||
} else if ($row['snmp_version'] == '2') {
|
||||
|
@ -409,31 +444,31 @@ if ($result !== false) {
|
|||
|
||||
|
||||
|
||||
// INCIDENT
|
||||
// INCIDENT.
|
||||
$data[5] = (($row['create_incident'] == 1) ? __('Yes') : __('No'));
|
||||
|
||||
// OS
|
||||
// OS.
|
||||
if ($row['id_recon_script'] == 0) {
|
||||
$data[6] = (($row['id_os'] > 0) ? ui_print_os_icon($row['id_os'], false, true) : __('Any'));
|
||||
} else {
|
||||
$data[6] = '-';
|
||||
}
|
||||
|
||||
// INTERVAL
|
||||
// INTERVAL.
|
||||
if ($row['interval_sweep'] == 0) {
|
||||
$data[7] = __('Manual');
|
||||
} else {
|
||||
$data[7] = human_time_description_raw($row['interval_sweep']);
|
||||
}
|
||||
|
||||
// PORTS
|
||||
// PORTS.
|
||||
if ($row['id_recon_script'] == 0) {
|
||||
$data[8] = substr($row['recon_ports'], 0, 15);
|
||||
} else {
|
||||
$data[8] = '-';
|
||||
}
|
||||
|
||||
// ACTION
|
||||
// ACTION.
|
||||
$task_group = $row['id_group'];
|
||||
|
||||
if (in_array($task_group, $user_groups_w)) {
|
||||
|
|
|
@ -1,17 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-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
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -36,7 +51,12 @@ if (is_ajax()) {
|
|||
if ($get_explanation) {
|
||||
$id = (int) get_parameter('id', 0);
|
||||
|
||||
$explanation = db_get_value('description', 'trecon_script', 'id_recon_script', $id);
|
||||
$explanation = db_get_value(
|
||||
'description',
|
||||
'trecon_script',
|
||||
'id_recon_script',
|
||||
$id
|
||||
);
|
||||
|
||||
echo io_safe_output($explanation);
|
||||
|
||||
|
@ -49,17 +69,42 @@ if (is_ajax()) {
|
|||
$id_recon_task = (int) get_parameter('id_rt');
|
||||
|
||||
if (!empty($id_recon_task) && empty($id_recon_script)) {
|
||||
$recon_script_macros = db_get_value('macros', 'trecon_task', 'id_rt', $id_recon_task);
|
||||
$recon_script_macros = db_get_value(
|
||||
'macros',
|
||||
'trecon_task',
|
||||
'id_rt',
|
||||
$id_recon_task
|
||||
);
|
||||
} else if (!empty($id_recon_task)) {
|
||||
$recon_task_id_rs = (int) db_get_value('id_recon_script', 'trecon_task', 'id_rt', $id_recon_task);
|
||||
$recon_task_id_rs = (int) db_get_value(
|
||||
'id_recon_script',
|
||||
'trecon_task',
|
||||
'id_rt',
|
||||
$id_recon_task
|
||||
);
|
||||
|
||||
if ($id_recon_script == $recon_task_id_rs) {
|
||||
$recon_script_macros = db_get_value('macros', 'trecon_task', 'id_rt', $id_recon_task);
|
||||
$recon_script_macros = db_get_value(
|
||||
'macros',
|
||||
'trecon_task',
|
||||
'id_rt',
|
||||
$id_recon_task
|
||||
);
|
||||
} else {
|
||||
$recon_script_macros = db_get_value('macros', 'trecon_script', 'id_recon_script', $id_recon_script);
|
||||
$recon_script_macros = db_get_value(
|
||||
'macros',
|
||||
'trecon_script',
|
||||
'id_recon_script',
|
||||
$id_recon_script
|
||||
);
|
||||
}
|
||||
} else if (!empty($id_recon_script)) {
|
||||
$recon_script_macros = db_get_value('macros', 'trecon_script', 'id_recon_script', $id_recon_script);
|
||||
$recon_script_macros = db_get_value(
|
||||
'macros',
|
||||
'trecon_script',
|
||||
'id_recon_script',
|
||||
$id_recon_script
|
||||
);
|
||||
} else {
|
||||
$recon_script_macros = [];
|
||||
}
|
||||
|
@ -75,7 +120,7 @@ if (is_ajax()) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Edit mode
|
||||
// Edit mode.
|
||||
if (isset($_GET['update']) || (isset($_GET['upd']))) {
|
||||
$update_recon = true;
|
||||
if (isset($_GET['upd'])) {
|
||||
|
@ -174,9 +219,7 @@ if (isset($_GET['update']) || (isset($_GET['upd']))) {
|
|||
$snmp3_security_level = '';
|
||||
$id_network_profile = 0;
|
||||
$id_os = -1;
|
||||
// Any
|
||||
$recon_ports = '';
|
||||
// Any
|
||||
$field1 = '';
|
||||
$field2 = '';
|
||||
$field3 = '';
|
||||
|
@ -200,7 +243,7 @@ if (isset($_GET['update']) || (isset($_GET['upd']))) {
|
|||
}
|
||||
|
||||
if (!$modify) {
|
||||
// Headers
|
||||
// Headers.
|
||||
ui_print_page_header(__('Manage recontask'), '', false, 'recontask', true);
|
||||
}
|
||||
|
||||
|
@ -244,11 +287,11 @@ $table->rowclass[14] = 'recon_script';
|
|||
$table->rowclass[15] = 'recon_script';
|
||||
$table->rowclass[16] = 'recon_script';
|
||||
$table->rowclass[17] = 'recon_script';
|
||||
// Name
|
||||
// Name.
|
||||
$table->data[0][0] = '<b>'.__('Task name').'</b>';
|
||||
$table->data[0][1] = html_print_input_text('name', $name, '', 25, 0, true);
|
||||
|
||||
// Discovery server
|
||||
// Discovery server.
|
||||
$table->data[1][0] = '<b>'.__('Discovery server').ui_print_help_tip(
|
||||
__('You must select a Discovery Server to run the Task, otherwise the Recon Task will never run'),
|
||||
true
|
||||
|
@ -258,7 +301,15 @@ $sql = 'SELECT id_server, name
|
|||
FROM tserver
|
||||
WHERE server_type = 3
|
||||
ORDER BY name';
|
||||
$table->data[1][1] = html_print_select_from_sql($sql, 'id_recon_server', $id_recon_server, '', '', '', true);
|
||||
$table->data[1][1] = html_print_select_from_sql(
|
||||
$sql,
|
||||
'id_recon_server',
|
||||
$id_recon_server,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$fields['network_sweep'] = __('Network sweep');
|
||||
if (!$is_windows) {
|
||||
|
@ -267,44 +318,94 @@ if (!$is_windows) {
|
|||
|
||||
|
||||
$table->data[2][0] = '<b>'.__('Mode').'</b>';
|
||||
$table->data[2][1] = html_print_select($fields, 'mode', $mode, '', '', 0, true);
|
||||
$table->data[2][1] = html_print_select(
|
||||
$fields,
|
||||
'mode',
|
||||
$mode,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
// Network
|
||||
// Network.
|
||||
$table->data[3][0] = '<b>'.__('Network').'</b>';
|
||||
$table->data[3][0] .= ui_print_help_tip(__('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'), true);
|
||||
$table->data[3][1] = html_print_input_text('network', $network, '', 25, 0, true);
|
||||
$table->data[3][0] .= ui_print_help_tip(
|
||||
__('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'),
|
||||
true
|
||||
);
|
||||
$table->data[3][1] = html_print_input_text(
|
||||
'network',
|
||||
$network,
|
||||
'',
|
||||
25,
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
// Interval
|
||||
// Interval.
|
||||
$interv_manual = 0;
|
||||
if ((int) $interval == 0) {
|
||||
$interv_manual = 1;
|
||||
}
|
||||
|
||||
$table->data[4][0] = '<b>'.__('Interval');
|
||||
$table->data[4][0] .= ui_print_help_tip(__('Manual interval means that it will be executed only On-demand'), true);
|
||||
$table->data[4][0] .= ui_print_help_tip(
|
||||
__('Manual interval means that it will be executed only On-demand'),
|
||||
true
|
||||
);
|
||||
|
||||
$values = [
|
||||
0 => __('Defined'),
|
||||
1 => __('Manual'),
|
||||
];
|
||||
$table->data[4][1] = html_print_select($values, 'interval_manual_defined', $interv_manual, '', '', '', true);
|
||||
$table->data[4][1] = html_print_select(
|
||||
$values,
|
||||
'interval_manual_defined',
|
||||
$interv_manual,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[4][1] .= '<span id="interval_manual_container">';
|
||||
$table->data[4][1] .= html_print_extended_select_for_time('interval', $interval, '', '', '0', false, true, false, false);
|
||||
$table->data[4][1] .= ui_print_help_tip(__('The minimum recomended interval for Recon Task is 5 minutes'), true);
|
||||
$table->data[4][1] .= html_print_extended_select_for_time(
|
||||
'interval',
|
||||
$interval,
|
||||
'',
|
||||
'',
|
||||
'0',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$table->data[4][1] .= ui_print_help_tip(
|
||||
__('The minimum recomended interval for Recon Task is 5 minutes'),
|
||||
true
|
||||
);
|
||||
$table->data[4][1] .= '</span>';
|
||||
|
||||
|
||||
// Module template
|
||||
// Module template.
|
||||
$table->data[5][0] = '<b>'.__('Module template').'</b>';
|
||||
|
||||
$sql = 'SELECT id_np, name
|
||||
FROM tnetwork_profile
|
||||
ORDER BY name';
|
||||
$table->data[5][1] = html_print_select_from_sql($sql, 'id_network_profile', $id_network_profile, '', __('None'), 0, true);
|
||||
$table->data[5][1] = html_print_select_from_sql(
|
||||
$sql,
|
||||
'id_network_profile',
|
||||
$id_network_profile,
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
// Recon script
|
||||
// Recon script.
|
||||
$data[1] = '';
|
||||
$table->data[6][0] = '<b>'.__('Recon script').'</b>';
|
||||
|
||||
|
@ -314,35 +415,72 @@ $sql = "SELECT id_recon_script, name
|
|||
WHERE name <> 'IPAM Recon'
|
||||
ORDER BY name";
|
||||
if ($name_script != 'IPAM Recon') {
|
||||
$table->data[6][1] = html_print_select_from_sql($sql, 'id_recon_script', $id_recon_script, '', '', '', true);
|
||||
$table->data[6][1] = html_print_select_from_sql(
|
||||
$sql,
|
||||
'id_recon_script',
|
||||
$id_recon_script,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[6][1] .= "<span id='spinner_recon_script' style='display: none;'>".html_print_image('images/spinner.gif', true).'</span>';
|
||||
$table->data[6][1] .= $data[1] .= html_print_input_hidden('macros', base64_encode($macros), true);
|
||||
$table->data[6][1] .= $data[1] .= html_print_input_hidden(
|
||||
'macros',
|
||||
base64_encode($macros),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$table->data[6][1] = 'IPAM Recon';
|
||||
}
|
||||
|
||||
// OS
|
||||
// OS.
|
||||
$table->data[7][0] = '<b>'.__('OS').'</b>';
|
||||
|
||||
$sql = 'SELECT id_os, name
|
||||
FROM tconfig_os
|
||||
ORDER BY name';
|
||||
$table->data[7][1] = html_print_select_from_sql($sql, 'id_os', $id_os, '', __('Any'), -1, true);
|
||||
$table->data[7][1] = html_print_select_from_sql(
|
||||
$sql,
|
||||
'id_os',
|
||||
$id_os,
|
||||
'',
|
||||
__('Any'),
|
||||
-1,
|
||||
true
|
||||
);
|
||||
|
||||
// Recon ports
|
||||
// Recon ports.
|
||||
$table->data[8][0] = '<b>'.__('Ports').'</b>';
|
||||
$table->data[8][1] = html_print_input_text('recon_ports', $recon_ports, '', 25, 0, true);
|
||||
$table->data[8][1] = html_print_input_text(
|
||||
'recon_ports',
|
||||
$recon_ports,
|
||||
'',
|
||||
25,
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data[8][1] .= ui_print_help_tip(
|
||||
__('Ports defined like: 80 or 80,443,512 or even 0-1024 (Like Nmap command line format). If dont want to do a sweep using portscan, left it in blank'),
|
||||
true
|
||||
);
|
||||
|
||||
// Group
|
||||
// Group.
|
||||
$table->data[9][0] = '<b>'.__('Group');
|
||||
$groups = users_get_groups(false, 'PM', false);
|
||||
$table->data[9][1] = html_print_select_groups(false, 'PM', false, 'id_group', $id_group, '', '', 0, true);
|
||||
$table->data[9][1] = html_print_select_groups(
|
||||
false,
|
||||
'PM',
|
||||
false,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
// Incident
|
||||
// Incident.
|
||||
$values = [
|
||||
0 => __('No'),
|
||||
1 => __('Yes'),
|
||||
|
@ -356,24 +494,50 @@ $table->data[10][1] = html_print_select(
|
|||
'',
|
||||
'',
|
||||
true
|
||||
).' '.ui_print_help_tip(__('Choose if the discovery of a new system creates an incident or not.'), true);
|
||||
).' '.ui_print_help_tip(
|
||||
__('Choose if the discovery of a new system creates an incident or not.'),
|
||||
true
|
||||
);
|
||||
|
||||
// snmp_enabled
|
||||
// Snmp_enabled.
|
||||
$table->data[11][0] = '<b>'.__('SNMP enabled');
|
||||
$table->data[11][1] = html_print_checkbox('snmp_enabled', 1, $snmp_enabled, true);
|
||||
$table->data[11][1] = html_print_checkbox(
|
||||
'snmp_enabled',
|
||||
1,
|
||||
$snmp_enabled,
|
||||
true
|
||||
);
|
||||
|
||||
// SNMP default community
|
||||
// SNMP default community.
|
||||
$table->data[12][0] = '<b>'.__('SNMP Default community');
|
||||
$table->data[12][0] .= ui_print_help_tip(__('You can specify several values, separated by commas, for example: public,mysecret,1234'), true);
|
||||
$table->data[12][1] = html_print_input_text('snmp_community', $snmp_community, '', 35, 0, true);
|
||||
$table->data[12][0] .= ui_print_help_tip(
|
||||
__('You can specify several values, separated by commas, for example: public,mysecret,1234'),
|
||||
true
|
||||
);
|
||||
$table->data[12][1] = html_print_input_text(
|
||||
'snmp_community',
|
||||
$snmp_community,
|
||||
'',
|
||||
35,
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
// SNMP version
|
||||
// SNMP version.
|
||||
$snmp_versions['1'] = 'v. 1';
|
||||
$snmp_versions['2'] = 'v. 2';
|
||||
$snmp_versions['2c'] = 'v. 2c';
|
||||
$snmp_versions['3'] = 'v. 3';
|
||||
$table->data[24][0] = '<b>'._('SNMP version');
|
||||
$table->data[24][1] = html_print_select($snmp_versions, 'snmp_version', $snmp_version, '', '', 0, true);
|
||||
$table->data[24][1] = html_print_select(
|
||||
$snmp_versions,
|
||||
'snmp_version',
|
||||
$snmp_version,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[25][0] = '<b>'.__('Auth user');
|
||||
$table->data[25][1] = html_print_input_text(
|
||||
|
@ -400,10 +564,30 @@ $table->data[26][1] = html_print_input_password(
|
|||
false,
|
||||
''
|
||||
);
|
||||
$table->data[26][1] .= html_print_input_hidden_extended('active_snmp_v3', 0, 'active_snmp_v3_mmen', true);
|
||||
$table->data[26][1] .= html_print_input_hidden_extended(
|
||||
'active_snmp_v3',
|
||||
0,
|
||||
'active_snmp_v3_mmen',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[27][0] = '<b>'.__('Privacy method');
|
||||
$table->data[27][1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp_privacy_method', $snmp3_privacy_method, '', '', '', true, false, false, '', '');
|
||||
$table->data[27][1] = html_print_select(
|
||||
[
|
||||
'DES' => __('DES'),
|
||||
'AES' => __('AES'),
|
||||
],
|
||||
'snmp_privacy_method',
|
||||
$snmp3_privacy_method,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
''
|
||||
);
|
||||
$table->data[28][0] = '<b>'.__('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
|
||||
$table->data[28][1] = html_print_input_password(
|
||||
'snmp_privacy_pass',
|
||||
|
@ -417,7 +601,22 @@ $table->data[28][1] = html_print_input_password(
|
|||
''
|
||||
);
|
||||
$table->data[29][0] = '<b>'.__('Auth method');
|
||||
$table->data[29][1] = html_print_select(['MD5' => __('MD5'), 'SHA' => __('SHA')], 'snmp_auth_method', $snmp3_auth_method, '', '', '', true, false, false, '', '');
|
||||
$table->data[29][1] = html_print_select(
|
||||
[
|
||||
'MD5' => __('MD5'),
|
||||
'SHA' => __('SHA'),
|
||||
],
|
||||
'snmp_auth_method',
|
||||
$snmp3_auth_method,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
''
|
||||
);
|
||||
$table->data[30][0] = '<b>'.__('Security level');
|
||||
$table->data[30][1] = html_print_select(
|
||||
[
|
||||
|
@ -437,75 +636,139 @@ $table->data[30][1] = html_print_select(
|
|||
''
|
||||
);
|
||||
|
||||
// Explanation
|
||||
$explanation = db_get_value('description', 'trecon_script', 'id_recon_script', $id_recon_script);
|
||||
// Explanation.
|
||||
$explanation = db_get_value(
|
||||
'description',
|
||||
'trecon_script',
|
||||
'id_recon_script',
|
||||
$id_recon_script
|
||||
);
|
||||
|
||||
$table->data[13][0] = '<b>'.__('Explanation').'</b>';
|
||||
$table->data[13][1] = "<span id='spinner_layout' style='display: none;'>".html_print_image('images/spinner.gif', true).'</span>'.html_print_textarea('explanation', 4, 60, $explanation, 'style="width: 388px;"', true);
|
||||
|
||||
// A hidden "model row" to clone it from javascript to add fields dynamicaly
|
||||
// A hidden "model row" to clone it from javascript to add fields dynamicaly.
|
||||
$data = [];
|
||||
$data[0] = 'macro_desc';
|
||||
$data[0] .= ui_print_help_tip('macro_help', true);
|
||||
$data[1] = html_print_input_text('macro_name', 'macro_value', '', 100, 255, true);
|
||||
$data[1] = html_print_input_text(
|
||||
'macro_name',
|
||||
'macro_value',
|
||||
'',
|
||||
100,
|
||||
255,
|
||||
true
|
||||
);
|
||||
$table->colspan['macro_field'][1] = 3;
|
||||
$table->rowstyle['macro_field'] = 'display:none';
|
||||
$table->data['macro_field'] = $data;
|
||||
|
||||
// If there are $macros, we create the form fields
|
||||
// If there are $macros, we create the form fields.
|
||||
if (!empty($macros)) {
|
||||
$macros = json_decode($macros, true);
|
||||
|
||||
foreach ($macros as $k => $m) {
|
||||
$data = [];
|
||||
$data[0] = '<b>'.$m['desc'].'</b>';
|
||||
if (!empty($m['help'])) {
|
||||
$data[0] .= ui_print_help_tip($m['help'], true);
|
||||
if (isset($macros) === true
|
||||
&& is_array($macros) === true
|
||||
) {
|
||||
foreach ($macros as $k => $m) {
|
||||
$data = [];
|
||||
$data[0] = '<b>'.$m['desc'].'</b>';
|
||||
if (!empty($m['help'])) {
|
||||
$data[0] .= ui_print_help_tip($m['help'], true);
|
||||
}
|
||||
|
||||
if ($m['hide']) {
|
||||
$data[1] = html_print_input_password(
|
||||
$m['macro'],
|
||||
$m['value'],
|
||||
'',
|
||||
100,
|
||||
255,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$data[1] = html_print_input_text(
|
||||
$m['macro'],
|
||||
$m['value'],
|
||||
'',
|
||||
100,
|
||||
255,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table->colspan['macro'.$m['macro']][1] = 3;
|
||||
$table->rowclass['macro'.$m['macro']] = 'macro_field';
|
||||
|
||||
$table->data['macro'.$m['macro']] = $data;
|
||||
}
|
||||
|
||||
if ($m['hide']) {
|
||||
$data[1] = html_print_input_password($m['macro'], $m['value'], '', 100, 255, true);
|
||||
} else {
|
||||
$data[1] = html_print_input_text($m['macro'], $m['value'], '', 100, 255, true);
|
||||
}
|
||||
|
||||
$table->colspan['macro'.$m['macro']][1] = 3;
|
||||
$table->rowclass['macro'.$m['macro']] = 'macro_field';
|
||||
|
||||
$table->data['macro'.$m['macro']] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
// Comments
|
||||
// Comments.
|
||||
$table->data[18][0] = '<b>'.__('Comments');
|
||||
$table->data[18][1] = html_print_input_text('description', $description, '', 45, 0, true);
|
||||
$table->data[18][1] = html_print_input_text(
|
||||
'description',
|
||||
$description,
|
||||
'',
|
||||
45,
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
// OS detection
|
||||
// OS detection.
|
||||
$table->data[19][0] = '<b>'.__('OS detection');
|
||||
$table->data[19][1] = html_print_checkbox('os_detect', 1, $os_detect, true);
|
||||
$table->data[19][1] = html_print_checkbox(
|
||||
'os_detect',
|
||||
1,
|
||||
$os_detect,
|
||||
true
|
||||
);
|
||||
|
||||
// Name resolution
|
||||
// Name resolution.
|
||||
$table->data[20][0] = '<b>'.__('Name resolution');
|
||||
$table->data[20][1] = html_print_checkbox('resolve_names', 1, $resolve_names, true);
|
||||
$table->data[20][1] = html_print_checkbox(
|
||||
'resolve_names',
|
||||
1,
|
||||
$resolve_names,
|
||||
true
|
||||
);
|
||||
|
||||
// Parent detection
|
||||
// Parent detection.
|
||||
$table->data[21][0] = '<b>'.__('Parent detection');
|
||||
$table->data[21][1] = html_print_checkbox('parent_detection', 1, $parent_detection, true);
|
||||
$table->data[21][1] = html_print_checkbox(
|
||||
'parent_detection',
|
||||
1,
|
||||
$parent_detection,
|
||||
true
|
||||
);
|
||||
|
||||
// Parent recursion
|
||||
// Parent recursion.
|
||||
$table->data[22][0] = '<b>'.__('Parent recursion');
|
||||
$table->data[22][1] = html_print_input_text('parent_recursion', $parent_recursion, '', 5, 0, true).ui_print_help_tip(__('Maximum number of parent hosts that will be created if parent detection is enabled.'), true);
|
||||
$table->data[22][1] = html_print_input_text(
|
||||
'parent_recursion',
|
||||
$parent_recursion,
|
||||
'',
|
||||
5,
|
||||
0,
|
||||
true
|
||||
).ui_print_help_tip(
|
||||
__('Maximum number of parent hosts that will be created if parent detection is enabled.'),
|
||||
true
|
||||
);
|
||||
|
||||
// vlan_enabled
|
||||
// Vlan_enabled.
|
||||
$table->data[23][0] = '<b>'.__('Vlan enabled');
|
||||
$table->data[23][1] = html_print_checkbox('vlan_enabled', 1, $vlan_enabled, true);
|
||||
$table->data[23][1] = html_print_checkbox(
|
||||
'vlan_enabled',
|
||||
1,
|
||||
$vlan_enabled,
|
||||
true
|
||||
);
|
||||
|
||||
// Alias as name
|
||||
// NOTE: The 7.0NG Recon Server will not generate random names, since IP
|
||||
// address collisions could have other consequences.
|
||||
// $table->data[22][0] = "<b>".__('Alias as Name');
|
||||
// $table->data[22][1] = html_print_checkbox ('alias_as_name', 1, $alias_as_name, true);
|
||||
// Different Form url if it's a create or if it's a update form
|
||||
// Different Form url if it's a create or if it's a update form.
|
||||
echo '<form name="modulo" method="post" action="index.php?sec=gservers&sec2=godmode/servers/manage_recontask&'.(($id_rt != -1) ? 'update='.$id_rt : 'create=1').'">';
|
||||
html_print_table($table);
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
@ -529,23 +792,23 @@ ui_require_javascript_file('pandora_modules');
|
|||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
var xhrManager = function () {
|
||||
var manager = {};
|
||||
|
||||
|
||||
manager.tasks = [];
|
||||
|
||||
|
||||
manager.addTask = function (xhr) {
|
||||
manager.tasks.push(xhr);
|
||||
}
|
||||
|
||||
|
||||
manager.stopTasks = function () {
|
||||
while (manager.tasks.length > 0)
|
||||
manager.tasks.pop().abort();
|
||||
}
|
||||
|
||||
|
||||
return manager;
|
||||
};
|
||||
|
||||
|
@ -591,7 +854,7 @@ $('select#mode').change(function() {
|
|||
if (type == 'recon_script') {
|
||||
$(".recon_script").show();
|
||||
$(".network_sweep").hide();
|
||||
|
||||
|
||||
get_explanation_recon_script($("#id_recon_script").val());
|
||||
}
|
||||
else if (type == 'network_sweep') {
|
||||
|
@ -603,13 +866,13 @@ $('select#mode').change(function() {
|
|||
}).change();
|
||||
|
||||
function get_explanation_recon_script (id) {
|
||||
// Stop old ajax tasks
|
||||
// Stop old ajax tasks.
|
||||
taskManager.stopTasks();
|
||||
|
||||
// Show the spinners
|
||||
|
||||
// Show the spinners.
|
||||
$("#textarea_explanation").hide();
|
||||
$("#spinner_layout").show();
|
||||
|
||||
|
||||
var xhr = jQuery.ajax ({
|
||||
data: {
|
||||
'page': 'godmode/servers/manage_recontask_form',
|
||||
|
@ -632,11 +895,11 @@ function get_explanation_recon_script (id) {
|
|||
}
|
||||
});
|
||||
taskManager.addTask(xhr);
|
||||
|
||||
// Delete all the macro fields
|
||||
|
||||
// Delete all the macro fields.
|
||||
$('.macro_field').remove();
|
||||
$("#spinner_recon_script").show();
|
||||
|
||||
|
||||
var xhr = jQuery.ajax ({
|
||||
data: {
|
||||
'page': 'godmode/servers/manage_recontask_form',
|
||||
|
@ -654,7 +917,7 @@ function get_explanation_recon_script (id) {
|
|||
success: function (data, textStatus, xhr) {
|
||||
if (data.array !== null) {
|
||||
$('#hidden-macros').val(data.base64);
|
||||
|
||||
|
||||
jQuery.each (data.array, function (i, macro) {
|
||||
if (macro.desc != '') {
|
||||
add_macro_field(macro, 'table_recon-macro');
|
||||
|
|
After Width: | Height: | Size: 213 B |
After Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 172 KiB |
After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 690 B After Width: | Height: | Size: 476 B |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 305 B |
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 459 B |
After Width: | Height: | Size: 561 B |
Before Width: | Height: | Size: 669 B After Width: | Height: | Size: 454 B |
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC190311';
|
||||
$build_version = 'PC190319';
|
||||
$pandora_version = 'v7.0NG.732';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -1828,11 +1828,11 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['custom_title1_login'])) {
|
||||
config_update_value('custom_title1_login', __('WELCOME TO PANDORA FMS'));
|
||||
config_update_value('custom_title1_login', __('PANDORA FMS'));
|
||||
}
|
||||
|
||||
if (!isset($config['custom_title2_login'])) {
|
||||
config_update_value('custom_title2_login', __('NEXT GENERATION'));
|
||||
config_update_value('custom_title2_login', __('ONE TOOL TO MONITOR THEM ALL'));
|
||||
}
|
||||
|
||||
if (!isset($config['custom_docs_url'])) {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* ============================================================================
|
||||
*/
|
||||
|
||||
require_once $config['homedir'].'/include/functions_ui.php';
|
||||
require_once $config['homedir'].'/include/functions_ui.php';
|
||||
require_once $config['homedir'].'/include/functions_tags.php';
|
||||
require_once $config['homedir'].'/include/functions.php';
|
||||
enterprise_include_once('meta/include/functions_events_meta.php');
|
||||
|
@ -701,19 +701,20 @@ function events_comment(
|
|||
$first_event = reset($id_event);
|
||||
}
|
||||
|
||||
$event_comments = db_get_value(
|
||||
'user_comment',
|
||||
$event_table,
|
||||
'id_evento',
|
||||
$first_event
|
||||
$event_comments = mysql_db_process_sql(
|
||||
'SELECT user_comment FROM '.$event_table.' WHERE id_evento = '.$first_event,
|
||||
'affected_rows',
|
||||
'',
|
||||
false
|
||||
);
|
||||
|
||||
$event_comments_array = [];
|
||||
|
||||
if ($event_comments == '') {
|
||||
if ($event_comments[0]['user_comment'] == '') {
|
||||
$comments_format = 'new';
|
||||
} else {
|
||||
// If comments are not stored in json, the format is old.
|
||||
$event_comments_array = json_decode($event_comments);
|
||||
$event_comments_array = json_decode($event_comments[0]['user_comment']);
|
||||
|
||||
if (empty($event_comments_array)) {
|
||||
$comments_format = 'old';
|
||||
|
@ -2513,9 +2514,8 @@ function events_page_custom_fields($event)
|
|||
{
|
||||
global $config;
|
||||
|
||||
//
|
||||
// Custom fields.
|
||||
//
|
||||
$table = new stdClass;
|
||||
$table->cellspacing = 2;
|
||||
$table->cellpadding = 2;
|
||||
$table->width = '100%';
|
||||
|
@ -2666,9 +2666,8 @@ function events_page_details($event, $server='')
|
|||
$serverstring = '';
|
||||
}
|
||||
|
||||
//
|
||||
// Details.
|
||||
//
|
||||
$table_details = new stdClass;
|
||||
$table_details->width = '100%';
|
||||
$table_details->data = [];
|
||||
$table_details->head = [];
|
||||
|
@ -3136,9 +3135,8 @@ function events_page_general($event)
|
|||
|
||||
global $group_rep;
|
||||
|
||||
//
|
||||
// General.
|
||||
//
|
||||
$table_general = new stdClass;
|
||||
$table_general->cellspacing = 2;
|
||||
$table_general->cellpadding = 2;
|
||||
$table_general->width = '100%';
|
||||
|
@ -3300,11 +3298,10 @@ function events_page_general($event)
|
|||
*/
|
||||
function events_page_comments($event, $childrens_ids=[])
|
||||
{
|
||||
//
|
||||
// Comments.
|
||||
//
|
||||
global $config;
|
||||
|
||||
$table_comments = new stdClass;
|
||||
$table_comments->width = '100%';
|
||||
$table_comments->data = [];
|
||||
$table_comments->head = [];
|
||||
|
@ -3319,7 +3316,9 @@ function events_page_comments($event, $childrens_ids=[])
|
|||
$event_comments_array = json_decode($event_comments, true);
|
||||
|
||||
// Show the comments more recent first.
|
||||
$event_comments_array = array_reverse($event_comments_array);
|
||||
if (is_array($event_comments_array)) {
|
||||
$event_comments_array = array_reverse($event_comments_array);
|
||||
}
|
||||
|
||||
if (empty($event_comments_array)) {
|
||||
$comments_format = 'old';
|
||||
|
@ -3337,11 +3336,15 @@ function events_page_comments($event, $childrens_ids=[])
|
|||
$table_comments->data[] = $data;
|
||||
}
|
||||
|
||||
foreach ($event_comments_array as $c) {
|
||||
$data[0] = '<b>'.$c['action'].' by '.$c['id_user'].'</b>';
|
||||
$data[0] .= '<br><br><i>'.date($config['date_format'], $c['utimestamp']).'</i>';
|
||||
$data[1] = $c['comment'];
|
||||
$table_comments->data[] = $data;
|
||||
if (isset($event_comments_array) === true
|
||||
&& is_array($event_comments_array) === true
|
||||
) {
|
||||
foreach ($event_comments_array as $c) {
|
||||
$data[0] = '<b>'.$c['action'].' by '.$c['id_user'].'</b>';
|
||||
$data[0] .= '<br><br><i>'.date($config['date_format'], $c['utimestamp']).'</i>';
|
||||
$data[1] = $c['comment'];
|
||||
$table_comments->data[] = $data;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -506,8 +506,6 @@ function menu_add_extras(&$menu)
|
|||
|
||||
$menu_extra['workspace']['sub']['operation/incidents/incident_detail']['text'] = __('Manage incident');
|
||||
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/visual_console_builder']['text'] = __('Manage visual console');
|
||||
|
||||
// Duplicate extensions as sec=extension to check it from url
|
||||
foreach ($menu as $k => $m) {
|
||||
if (!isset($m['sub'])) {
|
||||
|
@ -645,6 +643,7 @@ function menu_get_sec_pages($sec, $menu_hash=false)
|
|||
|
||||
/**
|
||||
* Get the pages in a section2
|
||||
* $menu
|
||||
*
|
||||
* @param string sec code
|
||||
* @param string menu hash. All the menu structure (For example
|
||||
|
|
|
@ -1365,117 +1365,137 @@ function clean_duplicate_links($relations)
|
|||
}
|
||||
|
||||
$final_links = [];
|
||||
/*
|
||||
---------------------------------------------------------------- */
|
||||
/*
|
||||
--------------------- Clean duplicate links -------------------- */
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// --------------------- Clean duplicate links --------------------
|
||||
// ----------------------------------------------------------------
|
||||
$duplicated = false;
|
||||
$index_to_del = 0;
|
||||
$index = 0;
|
||||
foreach ($segregation_links['aa'] as $link) {
|
||||
foreach ($segregation_links['aa'] as $link2) {
|
||||
if ($link['id_parent'] == $link2['id_child'] && $link['id_child'] == $link2['id_parent']) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($segregation_links['aa'][$index_to_del]);
|
||||
if (isset($segregation_links['aa']) === true
|
||||
&& is_array($segregation_links['aa']) === true
|
||||
) {
|
||||
foreach ($segregation_links['aa'] as $link) {
|
||||
foreach ($segregation_links['aa'] as $link2) {
|
||||
if ($link['id_parent'] == $link2['id_child']
|
||||
&& $link['id_child'] == $link2['id_parent']
|
||||
) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($segregation_links['aa'][$index_to_del]);
|
||||
}
|
||||
|
||||
unset($segregation_links['aa'][$index_to_del]);
|
||||
}
|
||||
|
||||
unset($segregation_links['aa'][$index_to_del]);
|
||||
$index_to_del++;
|
||||
}
|
||||
|
||||
$index_to_del++;
|
||||
$final_links['aa'][$index] = $link;
|
||||
$index++;
|
||||
|
||||
$duplicated = false;
|
||||
$index_to_del = 0;
|
||||
}
|
||||
|
||||
$final_links['aa'][$index] = $link;
|
||||
$index++;
|
||||
|
||||
$duplicated = false;
|
||||
$index_to_del = 0;
|
||||
}
|
||||
|
||||
$duplicated = false;
|
||||
$index_to_del = 0;
|
||||
$index2 = 0;
|
||||
foreach ($segregation_links['mm'] as $link) {
|
||||
foreach ($segregation_links['mm'] as $link2) {
|
||||
if ($link['id_parent'] == $link2['id_child'] && $link['id_child'] == $link2['id_parent']) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($segregation_links['mm'][$index_to_del]);
|
||||
if (isset($segregation_links['mm']) === true
|
||||
&& is_array($segregation_links['mm']) === true
|
||||
) {
|
||||
foreach ($segregation_links['mm'] as $link) {
|
||||
foreach ($segregation_links['mm'] as $link2) {
|
||||
if ($link['id_parent'] == $link2['id_child']
|
||||
&& $link['id_child'] == $link2['id_parent']
|
||||
) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($segregation_links['mm'][$index_to_del]);
|
||||
}
|
||||
}
|
||||
|
||||
// unset($segregation_links['mm'][$index_to_del]);
|
||||
$index_to_del++;
|
||||
}
|
||||
|
||||
$index_to_del++;
|
||||
$final_links['mm'][$index2] = $link;
|
||||
$index2++;
|
||||
|
||||
$duplicated = false;
|
||||
$index_to_del = 0;
|
||||
}
|
||||
|
||||
$final_links['mm'][$index2] = $link;
|
||||
$index2++;
|
||||
|
||||
$duplicated = false;
|
||||
$index_to_del = 0;
|
||||
}
|
||||
|
||||
$duplicated = false;
|
||||
$index_to_del = 0;
|
||||
$index3 = 0;
|
||||
foreach ($segregation_links['ff'] as $link) {
|
||||
foreach ($segregation_links['ff'] as $link2) {
|
||||
if ($link['id_parent'] == $link2['id_child'] && $link['id_child'] == $link2['id_parent']) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($segregation_links['ff'][$index_to_del]);
|
||||
|
||||
if (isset($segregation_links['ff']) === true
|
||||
&& is_array($segregation_links['ff']) === true
|
||||
) {
|
||||
foreach ($segregation_links['ff'] as $link) {
|
||||
foreach ($segregation_links['ff'] as $link2) {
|
||||
if ($link['id_parent'] == $link2['id_child']
|
||||
&& $link['id_child'] == $link2['id_parent']
|
||||
) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($segregation_links['ff'][$index_to_del]);
|
||||
}
|
||||
|
||||
unset($segregation_links['ff'][$index_to_del]);
|
||||
}
|
||||
|
||||
unset($segregation_links['ff'][$index_to_del]);
|
||||
$index_to_del++;
|
||||
}
|
||||
|
||||
$index_to_del++;
|
||||
$final_links['ff'][$index3] = $link;
|
||||
$index3++;
|
||||
|
||||
$duplicated = false;
|
||||
$index_to_del = 0;
|
||||
}
|
||||
|
||||
$final_links['ff'][$index3] = $link;
|
||||
$index3++;
|
||||
|
||||
$duplicated = false;
|
||||
$index_to_del = 0;
|
||||
}
|
||||
|
||||
$final_links['am'] = $segregation_links['am'];
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------- */
|
||||
/*
|
||||
----------------- AA, AM and MM links management --------------- */
|
||||
/*
|
||||
------------------ Priority: ----------------------------------- */
|
||||
/*
|
||||
-------------------- 1 -> MM (module - module) ----------------- */
|
||||
/*
|
||||
-------------------- 2 -> AM (agent - module) ------------------ */
|
||||
/*
|
||||
-------------------- 3 -> AA (agent - agent) ------------------- */
|
||||
// ----------------------------------------------------------------
|
||||
----------------------------------------------------------------
|
||||
----------------- AA, AM and MM links management ---------------
|
||||
------------------ Priority: -----------------------------------
|
||||
-------------------- 1 -> MM (module - module) -----------------
|
||||
-------------------- 2 -> AM (agent - module) ------------------
|
||||
-------------------- 3 -> AA (agent - agent) -------------------
|
||||
----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
$final_links2 = [];
|
||||
$index = 0;
|
||||
$l3_link = [];
|
||||
$agent1 = 0;
|
||||
$agent2 = 0;
|
||||
foreach ($final_links['mm'] as $rel_mm) {
|
||||
$module_parent = $rel_mm['id_parent_source_data'];
|
||||
$module_children = $rel_mm['id_child_source_data'];
|
||||
$agent1 = (int) agents_get_agent_id_by_module_id($module_parent);
|
||||
$agent2 = (int) agents_get_agent_id_by_module_id($module_children);
|
||||
foreach ($final_links['aa'] as $key => $rel_aa) {
|
||||
$l3_link = $rel_aa;
|
||||
$id_p_source_data = (int) $rel_aa['id_parent_source_data'];
|
||||
$id_c_source_data = (int) $rel_aa['id_child_source_data'];
|
||||
if ((($id_p_source_data == $agent1) && ($id_c_source_data == $agent2))
|
||||
|| (($id_p_source_data == $agent2) && ($id_c_source_data == $agent1))
|
||||
) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($final_links['aa'][$key]);
|
||||
}
|
||||
|
||||
unset($final_links['aa'][$key]);
|
||||
if (isset($final_links['mm']) === true
|
||||
&& is_array($final_links['mm']) === true
|
||||
) {
|
||||
foreach ($final_links['mm'] as $rel_mm) {
|
||||
$module_parent = $rel_mm['id_parent_source_data'];
|
||||
$module_children = $rel_mm['id_child_source_data'];
|
||||
$agent1 = (int) agents_get_agent_id_by_module_id($module_parent);
|
||||
$agent2 = (int) agents_get_agent_id_by_module_id($module_children);
|
||||
foreach ($final_links['aa'] as $key => $rel_aa) {
|
||||
$l3_link = $rel_aa;
|
||||
$id_p_source_data = (int) $rel_aa['id_parent_source_data'];
|
||||
$id_c_source_data = (int) $rel_aa['id_child_source_data'];
|
||||
if ((($id_p_source_data == $agent1)
|
||||
&& ($id_c_source_data == $agent2))
|
||||
|| (($id_p_source_data == $agent2)
|
||||
&& ($id_c_source_data == $agent1))
|
||||
) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($final_links['aa'][$key]);
|
||||
}
|
||||
|
||||
unset($final_links['aa'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1487,14 +1507,18 @@ function clean_duplicate_links($relations)
|
|||
|
||||
$same_m = [];
|
||||
$index = 0;
|
||||
foreach ($final_links2['am'] as $rel_am) {
|
||||
foreach ($final_links2['am'] as $rel_am2) {
|
||||
if (($rel_am['id_child_source_data'] == $rel_am2['id_child_source_data'])
|
||||
&& ($rel_am['id_parent_source_data'] != $rel_am2['id_parent_source_data'])
|
||||
) {
|
||||
$same_m[$index]['rel'] = $rel_am2;
|
||||
$same_m[$index]['agent_parent'] = $rel_am['id_parent_source_data'];
|
||||
$index++;
|
||||
if (isset($final_links2['am']) === true
|
||||
&& is_array($final_links2['am']) === true
|
||||
) {
|
||||
foreach ($final_links2['am'] as $rel_am) {
|
||||
foreach ($final_links2['am'] as $rel_am2) {
|
||||
if (($rel_am['id_child_source_data'] == $rel_am2['id_child_source_data'])
|
||||
&& ($rel_am['id_parent_source_data'] != $rel_am2['id_parent_source_data'])
|
||||
) {
|
||||
$same_m[$index]['rel'] = $rel_am2;
|
||||
$same_m[$index]['agent_parent'] = $rel_am['id_parent_source_data'];
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1503,19 +1527,23 @@ function clean_duplicate_links($relations)
|
|||
$index = 0;
|
||||
$l3_link = [];
|
||||
$have_l3 = false;
|
||||
foreach ($final_links2['aa'] as $key => $rel_aa) {
|
||||
$l3_link = $rel_aa;
|
||||
foreach ($same_m as $rel_am) {
|
||||
if ((($rel_aa['id_parent_source_data'] == $rel_am['parent']['id_parent_source_data'])
|
||||
&& ($rel_aa['id_child_source_data'] == $rel_am['rel']['id_parent_source_data']))
|
||||
|| (($rel_aa['id_child_source_data'] == $rel_am['parent']['id_parent_source_data'])
|
||||
&& ($rel_aa['id_parent_source_data'] == $rel_am['rel']['id_parent_source_data']))
|
||||
) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($final_links2['aa'][$key]);
|
||||
}
|
||||
if (isset($final_links2['aa']) === true
|
||||
&& is_array($final_links2['aa']) === true
|
||||
) {
|
||||
foreach ($final_links2['aa'] as $key => $rel_aa) {
|
||||
$l3_link = $rel_aa;
|
||||
foreach ($same_m as $rel_am) {
|
||||
if ((($rel_aa['id_parent_source_data'] == $rel_am['parent']['id_parent_source_data'])
|
||||
&& ($rel_aa['id_child_source_data'] == $rel_am['rel']['id_parent_source_data']))
|
||||
|| (($rel_aa['id_child_source_data'] == $rel_am['parent']['id_parent_source_data'])
|
||||
&& ($rel_aa['id_parent_source_data'] == $rel_am['rel']['id_parent_source_data']))
|
||||
) {
|
||||
if (enterprise_installed()) {
|
||||
delete_link($final_links2['aa'][$key]);
|
||||
}
|
||||
|
||||
unset($final_links2['aa'][$key]);
|
||||
unset($final_links2['aa'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1526,20 +1554,36 @@ function clean_duplicate_links($relations)
|
|||
$final_links3['ff'] = $final_links2['ff'];
|
||||
|
||||
$cleaned_links = [];
|
||||
foreach ($final_links3['aa'] as $link) {
|
||||
$cleaned_links[] = $link;
|
||||
if (isset($final_links3['aa']) === true
|
||||
&& is_array($final_links3['aa']) === true
|
||||
) {
|
||||
foreach ($final_links3['aa'] as $link) {
|
||||
$cleaned_links[] = $link;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($final_links3['am'] as $link) {
|
||||
$cleaned_links[] = $link;
|
||||
if (isset($final_links3['am']) === true
|
||||
&& is_array($final_links3['am']) === true
|
||||
) {
|
||||
foreach ($final_links3['am'] as $link) {
|
||||
$cleaned_links[] = $link;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($final_links3['mm'] as $link) {
|
||||
$cleaned_links[] = $link;
|
||||
if (isset($final_links3['mm']) === true
|
||||
&& is_array($final_links3['mm']) === true
|
||||
) {
|
||||
foreach ($final_links3['mm'] as $link) {
|
||||
$cleaned_links[] = $link;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($final_links3['ff'] as $link) {
|
||||
$cleaned_links[] = $link;
|
||||
if (isset($final_links3['ff']) === true
|
||||
&& is_array($final_links3['ff']) === true
|
||||
) {
|
||||
foreach ($final_links3['ff'] as $link) {
|
||||
$cleaned_links[] = $link;
|
||||
}
|
||||
}
|
||||
|
||||
return $cleaned_links;
|
||||
|
@ -1677,34 +1721,34 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
stroke: #fff;
|
||||
stroke-width: 1px;
|
||||
}
|
||||
|
||||
|
||||
.node_over {
|
||||
stroke: #999;
|
||||
}
|
||||
|
||||
|
||||
.node_selected {
|
||||
stroke:#343434;
|
||||
stroke-width:5;
|
||||
}
|
||||
|
||||
|
||||
.node_children {
|
||||
stroke: #00f;
|
||||
}
|
||||
|
||||
|
||||
.link {
|
||||
stroke-opacity: .6;
|
||||
}
|
||||
|
||||
|
||||
.link_over {
|
||||
stroke: #000;
|
||||
stroke-opacity: .6;
|
||||
}
|
||||
|
||||
|
||||
.holding_area {
|
||||
stroke: #0f0;
|
||||
stroke-dasharray: 12,3;
|
||||
}
|
||||
|
||||
|
||||
.holding_area_link {
|
||||
stroke-dasharray: 12,3;
|
||||
}
|
||||
|
@ -1730,7 +1774,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
init_drag_and_drop();
|
||||
init_minimap();
|
||||
function_open_minimap();
|
||||
|
||||
|
||||
$(document.body).on("mouseleave",
|
||||
".context-menu-list",
|
||||
function(e) {
|
||||
|
@ -1757,7 +1801,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
<div id="dialog_node_edit" style="display: none;" title="<?php echo __('Edit node'); ?>">
|
||||
<div style="text-align: left; width: 100%;">
|
||||
<?php
|
||||
$table = null;
|
||||
$table = new stdClass();
|
||||
$table->id = 'node_details';
|
||||
$table->width = '100%';
|
||||
|
||||
|
@ -1778,7 +1822,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
false
|
||||
);
|
||||
|
||||
$table = null;
|
||||
$table = new stdClass();
|
||||
$table->id = 'interface_information';
|
||||
$table->width = '100%';
|
||||
|
||||
|
@ -1802,7 +1846,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
true
|
||||
);
|
||||
|
||||
$table = null;
|
||||
$table = new stdClass();
|
||||
$table->id = 'node_options';
|
||||
$table->width = '100%';
|
||||
|
||||
|
@ -1820,7 +1864,24 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
'',
|
||||
0,
|
||||
true
|
||||
).' '.'<span id="shape_icon_in_progress" style="display: none;">'.html_print_image('images/spinner.gif', true).'</span>'.'<span id="shape_icon_correct" style="display: none;">'.html_print_image('images/dot_green.png', true).'</span>'.'<span id="shape_icon_fail" style="display: none;">'.html_print_image('images/dot_red.png', true).'</span>';
|
||||
);
|
||||
$table->data[0][1] .= ' <span id="shape_icon_in_progress" style="display: none;">';
|
||||
$table->data[0][1] .= html_print_image(
|
||||
'images/spinner.gif',
|
||||
true
|
||||
);
|
||||
$table->data[0][1] .= '</span><span id="shape_icon_correct" style="display: none;">';
|
||||
$table->data[0][1] .= html_print_image(
|
||||
'images/dot_green.png',
|
||||
true
|
||||
);
|
||||
$table->data[0][1] .= '</span><span id="shape_icon_fail" style="display: none;">';
|
||||
$table->data[0][1] .= html_print_image(
|
||||
'images/dot_red.png',
|
||||
true
|
||||
);
|
||||
$table->data[0][1] .= '</span>';
|
||||
|
||||
$table->data['node_name'][0] = __('Name');
|
||||
$table->data['node_name'][1] = html_print_input_text(
|
||||
'edit_name_node',
|
||||
|
@ -1875,7 +1936,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
true
|
||||
);
|
||||
|
||||
$table = null;
|
||||
$table = new stdClass();
|
||||
$table->id = 'relations_table';
|
||||
$table->width = '100%';
|
||||
|
||||
|
@ -1990,7 +2051,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
<div id="dialog_node_add" style="display: none;" title="<?php echo __('Add node'); ?>">
|
||||
<div style="text-align: left; width: 100%;">
|
||||
<?php
|
||||
$table = null;
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
|
||||
|
@ -2033,7 +2094,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
false
|
||||
);
|
||||
|
||||
$table = null;
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('Group');
|
||||
|
@ -2083,7 +2144,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
true
|
||||
);
|
||||
|
||||
$table = null;
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('Name');
|
||||
|
@ -2126,5 +2187,3 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
|
|||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -476,7 +476,7 @@ function visual_map_print_item(
|
|||
}
|
||||
} else if ($is_a_link_to_other_visualconsole) {
|
||||
if (!is_metaconsole()) {
|
||||
$url = $config['homeurl'].'index.php?sec=reporting&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
$url = $config['homeurl'].'index.php?sec=network&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
} else {
|
||||
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$layoutData['id_layout_linked'].'&refr=0';
|
||||
}
|
||||
|
@ -567,7 +567,7 @@ function visual_map_print_item(
|
|||
if (METACONSOLE == 1) {
|
||||
$url = $config['homeurl'].'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$layoutData['id_layout_linked'].'&refr=300';
|
||||
} else {
|
||||
$url = $config['homeurl'].'index.php?sec=reporting&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
$url = $config['homeurl'].'index.php?sec=network&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
}
|
||||
} else {
|
||||
if (METACONSOLE == 1) {
|
||||
|
@ -581,7 +581,7 @@ function visual_map_print_item(
|
|||
case LABEL:
|
||||
if ($layoutData['id_layout_linked'] != 0) {
|
||||
// Link to a map
|
||||
$url = $config['homeurl'].'index.php?sec=reporting&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
$url = $config['homeurl'].'index.php?sec=network&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -590,7 +590,7 @@ function visual_map_print_item(
|
|||
if ($layoutData['id_layout_linked'] != 0) {
|
||||
// Link to a map
|
||||
if (empty($layoutData['id_metaconsole'])) {
|
||||
$url = 'index.php?sec=reporting&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
$url = 'index.php?sec=network&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
} else {
|
||||
$pure = get_parameter('pure', 0);
|
||||
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_visualmap='.$layoutData['id_layout_linked'].'&refr=0';
|
||||
|
@ -638,7 +638,7 @@ function visual_map_print_item(
|
|||
} else if ($layoutData['id_layout_linked'] > 0) {
|
||||
// Link to a map
|
||||
if (empty($layoutData['id_metaconsole'])) {
|
||||
$url = 'index.php?sec=reporting&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
$url = 'index.php?sec=network&sec2=operation/visual_console/render_view&pure='.$config['pure'].'&id='.$layoutData['id_layout_linked'];
|
||||
} else {
|
||||
$pure = get_parameter('pure', 0);
|
||||
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_visualmap='.$layoutData['id_layout_linked'].'&refr=0';
|
||||
|
|
|
@ -52,6 +52,7 @@ Apart from the defined module macros, the following macros are also available:
|
|||
<li>_event_extra_id_ : (Only event alerts) Extra id.</li>
|
||||
<li>_event_id_: (Only event alerts) ID of the event that triggered the alert.</li>
|
||||
<li>_event_text_severity_: (Only event alerts) Event text severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
|
||||
<li>_eventTimestamp_: Timestamp in which the event was created.</li>
|
||||
<li>_field1_: User defined field 1.</li>
|
||||
<li>_field2_: User defined field 2.</li>
|
||||
<li>_field3_: User defined field 3.</li>
|
||||
|
|
|
@ -37,6 +37,7 @@ Besides the defined module macros, the following macros are available:
|
|||
<li>_event_extra_id_: (Only event alerts) Extra id.</li>
|
||||
<li>_event_id_: (Only event alerts) ID of the event that triggered the alert.</li>
|
||||
<li>_event_text_severity_: (Only event alerts) Event text severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
|
||||
<li>_eventTimestamp_: Timestamp in which the event was created.</li>
|
||||
<li>_field1_: User defined field 1.</li>
|
||||
<li>_field2_: User defined field 2.</li>
|
||||
<li>_field3_: User defined field 3.</li>
|
||||
|
|
|
@ -54,6 +54,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
|
|||
<li>_event_extra_id_ : (Solo alertas de evento) Id extra.</li>
|
||||
<li>_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.</li>
|
||||
<li>_event_text_severity_: (Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
|
||||
<li>_eventTimestamp_: Timestamp en el que se creo el evento.</li>
|
||||
<li>_field1_: Campo 1 definido por el usuario.</li>
|
||||
<li>_field2_: Campo 2 definido por el usuario.</li>
|
||||
<li>_field3_: Campo 3 definido por el usuario.</li>
|
||||
|
|
|
@ -37,6 +37,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
|
|||
<li>_event_extra_id_ : (Solo alertas de evento) Id extra.</li>
|
||||
<li>_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.</li>
|
||||
<li>_event_text_severity_:(Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
|
||||
<li>_eventTimestamp_: Timestamp en el que se creo el evento.</li>
|
||||
<li>_field1_: Campo 1 definido por el usuario.</li>
|
||||
<li>_field2_: Campo 2 definido por el usuario.</li>
|
||||
<li>_field3_: Campo 3 definido por el usuario.</li>
|
||||
|
|
|
@ -53,6 +53,7 @@ email アクションを設定するには、_field1_ (送信先アドレス)、
|
|||
<li>_event_extra_id_: (イベントアラートのみ) 拡張 ID</li>
|
||||
<li>_event_id_ : (イベントアラートのみ) アラート発生元のイベントID</li>
|
||||
<li>_event_text_severity_ : (イベントアラートのみ) イベント(アラートの発生元)のテキストでの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)</li>
|
||||
<li>_eventTimestamp_: Timestamp in which the event was created.</li>
|
||||
<li>_field1_ : ユーザ定義フィールド1</li>
|
||||
<li>_field2_ : ユーザ定義フィールド2</li>
|
||||
<li>_field3_ : ユーザ定義フィールド3</li>
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
<li>_event_extra_id_: (Only event alerts) Extra id.</li>
|
||||
<li>_event_id_ : (イベントアラートのみ) アラート発生元のイベントID</li>
|
||||
<li>_event_text_severity_ : (イベントアラートのみ) イベント(アラートの発生元)のテキストでの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)</li>
|
||||
<li>_eventTimestamp_: Timestamp in which the event was created.</li>
|
||||
<li>_field1_ : ユーザ定義フィールド1</li>
|
||||
<li>_field2_ : ユーザ定義フィールド2</li>
|
||||
<li>_field3_ : ユーザ定義フィールド3</li>
|
||||
|
|
|
@ -29,41 +29,11 @@ div#error_buttons a {
|
|||
width: 100%;
|
||||
z-index: -9999;
|
||||
position: absolute;
|
||||
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
|
||||
background: linear-gradient(74deg, #02020255 36%, transparent 36%),
|
||||
url("../../images/backgrounds/background_pandora_console_keys.jpg");
|
||||
background-repeat: repeat;
|
||||
}
|
||||
|
||||
/*@media screen and (max-width: 1024px) { /* Specific to this particular image */
|
||||
/* #login_body {
|
||||
left: 50%;
|
||||
margin-left: -512px; /* 50% */
|
||||
/* }
|
||||
}
|
||||
@media screen and (max-width: 1100px) { /* Specific to this particular image */
|
||||
/* #login_body {
|
||||
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
|
||||
background-repeat: repeat;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1400px) { /* Specific to this particular image */
|
||||
/* #login_body {
|
||||
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
|
||||
background-repeat: repeat;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 2000px) { /* Specific to this particular image */
|
||||
/* #login_body {
|
||||
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
|
||||
background-repeat: repeat;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 2000px) { /* Specific to this particular image */
|
||||
/* #login_body {
|
||||
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
|
||||
background-repeat: repeat;
|
||||
}
|
||||
}*/
|
||||
|
||||
p.log_in {
|
||||
color: #fff !important;
|
||||
padding: 0px 10px;
|
||||
|
@ -77,7 +47,6 @@ h1#log_f {
|
|||
}
|
||||
|
||||
div#error_login {
|
||||
text-align: center;
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
width: 75%;
|
||||
|
@ -104,8 +73,11 @@ div#login_f {
|
|||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
color: #fff;
|
||||
color: #878787;
|
||||
text-align: center;
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-weight: 700;
|
||||
font-size: 8.5pt;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -118,23 +90,17 @@ div#login_f {
|
|||
div#header_login {
|
||||
width: 100%;
|
||||
height: 65px;
|
||||
background-color: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
div#icon_custom_pandora {
|
||||
float: left;
|
||||
margin-top: 5px;
|
||||
margin-left: 4%;
|
||||
}
|
||||
|
||||
div#list_icon_docs_support {
|
||||
float: right;
|
||||
margin-top: 8px;
|
||||
margin-right: 4%;
|
||||
float: left;
|
||||
margin-top: 25px;
|
||||
margin-left: 5%;
|
||||
}
|
||||
|
||||
div#list_icon_docs_support ul {
|
||||
margin-top: 5px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
div#list_icon_docs_support ul li {
|
||||
|
@ -145,6 +111,11 @@ div#list_icon_docs_support ul li {
|
|||
font-size: 10pt;
|
||||
}
|
||||
|
||||
div#list_icon_docs_support ul li a {
|
||||
color: #979797;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
li#li_margin_left {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
@ -162,14 +133,6 @@ div.login_page {
|
|||
float: left;
|
||||
}
|
||||
|
||||
div.login_page form {
|
||||
border-right: 1px solid #868686;
|
||||
padding-top: 30px;
|
||||
padding-bottom: 50px;
|
||||
min-width: 400px;
|
||||
max-height: 600px;
|
||||
}
|
||||
|
||||
div.login_logo_icon {
|
||||
margin-bottom: 40px;
|
||||
text-align: center;
|
||||
|
@ -177,7 +140,7 @@ div.login_logo_icon {
|
|||
|
||||
div.login_logo_icon img {
|
||||
margin: 0 auto;
|
||||
width: 150px;
|
||||
max-width: 70%;
|
||||
}
|
||||
|
||||
div.login_double_auth_code,
|
||||
|
@ -186,27 +149,36 @@ div.login_pass {
|
|||
margin: 0 auto;
|
||||
width: 70%;
|
||||
height: 40px;
|
||||
background-color: rgba(255, 255, 255, 0.2) !important;
|
||||
margin-bottom: 25px;
|
||||
min-width: 260px;
|
||||
background-color: #fff;
|
||||
opacity: 0.77;
|
||||
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
div.login_nick img,
|
||||
div.login_pass img {
|
||||
vertical-align: middle;
|
||||
margin: 3px;
|
||||
div.login_nick input {
|
||||
background-image: url("../../images/usuario_login.png");
|
||||
}
|
||||
|
||||
div.login_pass input {
|
||||
background-image: url("../../images/candado_login.png");
|
||||
}
|
||||
|
||||
div.login_nick input,
|
||||
div.login_pass input {
|
||||
background-color: rgba(255, 255, 255, 0) !important;
|
||||
border: 0px !important;
|
||||
color: white !important;
|
||||
border-radius: 0px;
|
||||
width: 89%;
|
||||
color: #343434;
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
font-size: 9pt;
|
||||
padding: 0px !important;
|
||||
font-size: 10pt;
|
||||
padding: 0px 0px 0px 35px !important;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 27px;
|
||||
background-position: left center;
|
||||
font-family: "Open Sans", sans-serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.login_nick input:focus,
|
||||
|
@ -224,46 +196,76 @@ div.login_pass input:-webkit-autofill:focus,
|
|||
div.login_pass input:-webkit-autofill:active {
|
||||
transition: background-color 10000s ease-in-out 0s;
|
||||
-webkit-box-shadow: 0 0 0px 0px transparent inset !important;
|
||||
-webkit-text-fill-color: white !important;
|
||||
-webkit-text-fill-color: #343434 !important;
|
||||
border: 0px;
|
||||
width: 89%;
|
||||
}
|
||||
|
||||
div.login_nick input::-webkit-input-placeholder,
|
||||
div.login_pass input::-webkit-input-placeholder {
|
||||
color: white;
|
||||
color: #343434;
|
||||
}
|
||||
|
||||
div.login_pass img,
|
||||
div.login_nick img {
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
div.login_pass div,
|
||||
div.login_nick div {
|
||||
float: left;
|
||||
width: 11%;
|
||||
}
|
||||
|
||||
div.login_button {
|
||||
div.login_button,
|
||||
div.login_button_saml {
|
||||
margin: 0 auto;
|
||||
width: 70%;
|
||||
width: 40%;
|
||||
height: 40px;
|
||||
background-color: rgb(25, 25, 25);
|
||||
border: 1px solid white;
|
||||
min-width: 260px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
div.login_button input {
|
||||
width: 100%;
|
||||
background-color: rgb(25, 25, 25) !important;
|
||||
background-color: #82b92e !important;
|
||||
text-align: center;
|
||||
border: 0px;
|
||||
border-radius: 0px;
|
||||
height: 40px;
|
||||
padding: 0px;
|
||||
font-size: 9pt;
|
||||
color: white;
|
||||
font-size: 11pt;
|
||||
color: #fff !important;
|
||||
border: 1px solid #82b92e;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
div.login_button_saml input {
|
||||
border: 1px solid #fff;
|
||||
background-color: #fff !important;
|
||||
color: #000 !important;
|
||||
background-image: url("../../images/saml_login.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 5% center;
|
||||
}
|
||||
|
||||
div.login_button input:hover {
|
||||
background-color: #fff !important;
|
||||
color: #000 !important;
|
||||
border: 1px solid #fff !important;
|
||||
}
|
||||
|
||||
div.login_button_saml input:hover {
|
||||
background-image: url("../../images/saml_login_hover.png");
|
||||
background-color: transparent !important;
|
||||
color: #fff !important;
|
||||
border: 1px solid #fff !important;
|
||||
}
|
||||
|
||||
#remove_button input {
|
||||
background-image: url("../../images/user_login.png") !important;
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 5% center;
|
||||
}
|
||||
|
||||
#remove_button input:hover {
|
||||
background-image: url("../../images/user_login_hover.png") !important;
|
||||
}
|
||||
|
||||
.login_back input {
|
||||
background-image: url("../../images/back_login.png") !important;
|
||||
background-position: left 5% center !important;
|
||||
}
|
||||
|
||||
.login_back input:hover {
|
||||
background-image: url("../../images/back_login_hover.png") !important;
|
||||
}
|
||||
|
||||
div.login_data {
|
||||
|
@ -307,6 +309,21 @@ div.img_banner_login img {
|
|||
min-height: 50%;
|
||||
}
|
||||
|
||||
.reset_password {
|
||||
width: 70%;
|
||||
height: 40px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.reset_password a {
|
||||
color: #ddd !important;
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-size: 8.5pt;
|
||||
}
|
||||
|
||||
@media all and (max-width: 1200px) {
|
||||
span.span1 {
|
||||
font-size: 30pt;
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.732';
|
||||
$build = '190311';
|
||||
$build = '190319';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -1,18 +1,35 @@
|
|||
<?php
|
||||
// ______ __ _______ _______ _______
|
||||
// | __ \.---.-.-----.--| |.-----.----.---.-. | ___| | | __|
|
||||
// | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
// |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
//
|
||||
// ============================================================================
|
||||
// Copyright (c) 2007-2010 Artica Soluciones Tecnologicas, http://www.artica.es
|
||||
// This code is NOT free software. This code is NOT licenced under GPL2 licence
|
||||
// You cannnot redistribute it without written permission of copyright holder.
|
||||
// ============================================================================
|
||||
// Load global variables
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @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 user credentials
|
||||
// Check user credentials.
|
||||
check_login();
|
||||
|
||||
$id = (int) get_parameter('id_networkmap', 0);
|
||||
|
@ -63,8 +80,7 @@ if ($edit_networkmap) {
|
|||
} else {
|
||||
$id_group = $values['id_group'];
|
||||
|
||||
// ACL for the network map
|
||||
// $networkmap_read = check_acl ($config['id_user'], $id_group, "MR");
|
||||
// ACL for the network map.
|
||||
$networkmap_write = check_acl($config['id_user'], $id_group, 'MW');
|
||||
$networkmap_manage = check_acl($config['id_user'], $id_group, 'MM');
|
||||
|
||||
|
@ -221,7 +237,7 @@ if (!empty($result)) {
|
|||
if ($not_found) {
|
||||
ui_print_error_message(__('Not found networkmap.'));
|
||||
} else {
|
||||
$table = null;
|
||||
$table = new stdClass();
|
||||
$table->id = 'form_editor';
|
||||
|
||||
$table->width = '98%';
|
||||
|
|
|
@ -1,15 +1,32 @@
|
|||
<?php
|
||||
// ______ __ _______ _______ _______
|
||||
// | __ \.---.-.-----.--| |.-----.----.---.-. | ___| | | __|
|
||||
// | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
// |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
//
|
||||
// ============================================================================
|
||||
// Copyright (c) 2007-2010 Artica Soluciones Tecnologicas, http://www.artica.es
|
||||
// This code is NOT free software. This code is NOT licenced under GPL2 licence
|
||||
// You cannnot redistribute it without written permission of copyright holder.
|
||||
// ============================================================================
|
||||
// Load global variables
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @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;
|
||||
|
||||
require_once 'include/functions_pandora_networkmap.php';
|
||||
|
@ -19,9 +36,9 @@ require_once 'include/functions_modules.php';
|
|||
|
||||
$public_hash = get_parameter('hash', false);
|
||||
|
||||
// Try to authenticate by hash on public dashboards
|
||||
// Try to authenticate by hash on public dashboards.
|
||||
if ($public_hash === false) {
|
||||
// Login check
|
||||
// Login check.
|
||||
check_login();
|
||||
} else {
|
||||
$validate_hash = enterprise_hook(
|
||||
|
@ -33,7 +50,10 @@ if ($public_hash === false) {
|
|||
]
|
||||
);
|
||||
if ($validate_hash === false || $validate_hash === ENTERPRISE_NOT_HOOK) {
|
||||
db_pandora_audit('Invalid public hash', 'Trying to access report builder');
|
||||
db_pandora_audit(
|
||||
'Invalid public hash',
|
||||
'Trying to access report builder'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
|
@ -117,7 +137,7 @@ if (is_ajax()) {
|
|||
);
|
||||
$row['style'] = json_decode($row['style'], true);
|
||||
$row['style']['shape'] = $shape;
|
||||
// WORK AROUND FOR THE JSON ENCODE WITH FOR EXAMPLE Ñ OR Á
|
||||
// WORK AROUND FOR THE JSON ENCODE WITH FOR EXAMPLE Ñ OR Á.
|
||||
$row['style']['label'] = 'json_encode_crash_with_ut8_chars';
|
||||
$row['style']['color'] = $color;
|
||||
$row['style']['networkmap'] = $networkmap;
|
||||
|
@ -215,52 +235,17 @@ if (is_ajax()) {
|
|||
if ($get_tooltip_content) {
|
||||
$id = (int) get_parameter('id', 0);
|
||||
|
||||
// Get all module from agent
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
$sql = sprintf(
|
||||
'
|
||||
SELECT *
|
||||
FROM tagente_estado, tagente_modulo
|
||||
LEFT JOIN tmodule_group
|
||||
ON tmodule_group.id_mg = tagente_modulo.id_module_group
|
||||
WHERE tagente_modulo.id_agente_modulo = '.$id.'
|
||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||
AND tagente_modulo.disabled = 0
|
||||
AND tagente_modulo.delete_pending = 0
|
||||
AND tagente_estado.utimestamp != 0'
|
||||
);
|
||||
break;
|
||||
|
||||
// If Dbms is Oracle then field_list in sql statement has to be recoded. See oracle_list_all_field_table()
|
||||
case 'oracle':
|
||||
$fields_tagente_estado = oracle_list_all_field_table(
|
||||
'tagente_estado',
|
||||
'string'
|
||||
);
|
||||
$fields_tagente_modulo = oracle_list_all_field_table(
|
||||
'tagente_modulo',
|
||||
'string'
|
||||
);
|
||||
$fields_tmodule_group = oracle_list_all_field_table(
|
||||
'tmodule_group',
|
||||
'string'
|
||||
);
|
||||
|
||||
$sql = sprintf(
|
||||
'
|
||||
SELECT '.$fields_tagente_estado.', '.$fields_tagente_modulo.', '.$fields_tmodule_group.' FROM tagente_estado, tagente_modulo
|
||||
LEFT JOIN tmodule_group
|
||||
ON tmodule_group.id_mg = tagente_modulo.id_module_group
|
||||
WHERE tagente_modulo.id_agente_modulo = '.$id.'
|
||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||
AND tagente_modulo.disabled = 0
|
||||
AND tagente_modulo.delete_pending = 0
|
||||
AND tagente_estado.utimestamp != 0'
|
||||
);
|
||||
break;
|
||||
}
|
||||
$sql = sprintf(
|
||||
'SELECT *
|
||||
FROM tagente_estado, tagente_modulo
|
||||
LEFT JOIN tmodule_group
|
||||
ON tmodule_group.id_mg = tagente_modulo.id_module_group
|
||||
WHERE tagente_modulo.id_agente_modulo = '.$id.'
|
||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||
AND tagente_modulo.disabled = 0
|
||||
AND tagente_modulo.delete_pending = 0
|
||||
AND tagente_estado.utimestamp != 0'
|
||||
);
|
||||
|
||||
$modules = db_get_all_rows_sql($sql);
|
||||
if (empty($modules)) {
|
||||
|
@ -377,7 +362,7 @@ if (is_ajax()) {
|
|||
$return['content'] .= '<b>'.__('Status: ').'</b>'.ui_print_status_image($status, $title, true).'<br />';
|
||||
|
||||
if ($module['id_tipo_modulo'] == 24) {
|
||||
// log4x
|
||||
// Log4x.
|
||||
switch ($module['datos']) {
|
||||
case 10:
|
||||
$salida = 'TRACE';
|
||||
|
@ -410,7 +395,7 @@ if (is_ajax()) {
|
|||
break;
|
||||
}
|
||||
|
||||
$salida = "<span style='$style'>$salida</span>";
|
||||
$salida = "<span style='".$style."'>".$salida.'</span>';
|
||||
} else {
|
||||
if (is_numeric($module['datos'])) {
|
||||
$salida = format_numeric($module['datos']);
|
||||
|
@ -513,7 +498,7 @@ if (is_ajax()) {
|
|||
include_once 'include/functions_agents.php';
|
||||
|
||||
$id = (int) get_parameter('id', 0);
|
||||
// q is what autocomplete plugin gives
|
||||
// Q is what autocomplete plugin gives.
|
||||
$string = (string) get_parameter('q');
|
||||
|
||||
$agents = db_get_all_rows_filter(
|
||||
|
@ -586,8 +571,7 @@ if (is_ajax()) {
|
|||
|
||||
$filter = json_encode($array_filter);
|
||||
|
||||
// ACL for the network map
|
||||
// $networkmap_read = check_acl ($config['id_user'], $networkmap['id_group'], "MR");
|
||||
// ACL for the network map.
|
||||
$networkmap_write = check_acl($config['id_user'], $networkmap['id_group'], 'MW');
|
||||
$networkmap_manage = check_acl($config['id_user'], $networkmap['id_group'], 'MM');
|
||||
|
||||
|
@ -641,7 +625,7 @@ if (is_ajax()) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Popup
|
||||
// Popup.
|
||||
$get_status_node = (bool) get_parameter('get_status_node', false);
|
||||
$get_status_module = (bool) get_parameter(
|
||||
'get_status_module',
|
||||
|
@ -763,13 +747,9 @@ if (is_ajax()) {
|
|||
}
|
||||
|
||||
// --------------END AJAX------------------------------------------------
|
||||
if (_id_ != '_id_') {
|
||||
$id = _id_;
|
||||
} else {
|
||||
$id = (int) get_parameter('id_networkmap', 0);
|
||||
}
|
||||
$id = (int) get_parameter('id_networkmap', 0);
|
||||
|
||||
// Print some params to handle it in js
|
||||
// Print some params to handle it in js.
|
||||
html_print_input_hidden('product_name', get_product_name());
|
||||
html_print_input_hidden('center_logo', ui_get_full_url(ui_get_logo_to_center_networkmap()));
|
||||
|
||||
|
@ -823,7 +803,7 @@ if ($networkmap === false) {
|
|||
|
||||
return;
|
||||
} else {
|
||||
// ACL for the network map
|
||||
// ACL for the network map.
|
||||
$networkmap_read = check_acl($config['id_user'], $networkmap['id_group'], 'MR');
|
||||
$networkmap_write = check_acl($config['id_user'], $networkmap['id_group'], 'MW');
|
||||
$networkmap_manage = check_acl($config['id_user'], $networkmap['id_group'], 'MM');
|
||||
|
@ -841,11 +821,11 @@ if ($networkmap === false) {
|
|||
|
||||
$pure = (int) get_parameter('pure', 0);
|
||||
|
||||
// Main code
|
||||
// Main code.
|
||||
if ($pure == 1) {
|
||||
$buttons['screen'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=networkmapconsole&'.'sec2=operation/agentes/pandora_networkmap&'.'tab=view&id_networkmap='.$id.'">'.html_print_image(
|
||||
'text' => '<a href="index.php?sec=networkmapconsole&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap='.$id.'">'.html_print_image(
|
||||
'images/normal_screen.png',
|
||||
true,
|
||||
['title' => __('Normal screen')]
|
||||
|
@ -855,7 +835,7 @@ if ($networkmap === false) {
|
|||
if (!$dash_mode) {
|
||||
$buttons['screen'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=networkmapconsole&'.'sec2=operation/agentes/pandora_networkmap&'.'pure=1&tab=view&id_networkmap='.$id.'">'.html_print_image(
|
||||
'text' => '<a href="index.php?sec=networkmapconsole&sec2=operation/agentes/pandora_networkmap&pure=1&tab=view&id_networkmap='.$id.'">'.html_print_image(
|
||||
'images/full_screen.png',
|
||||
true,
|
||||
['title' => __('Full screen')]
|
||||
|
@ -863,7 +843,7 @@ if ($networkmap === false) {
|
|||
];
|
||||
$buttons['list'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=networkmapconsole&'.'sec2=operation/agentes/pandora_networkmap">'.html_print_image(
|
||||
'text' => '<a href="index.php?sec=networkmapconsole&sec2=operation/agentes/pandora_networkmap">'.html_print_image(
|
||||
'images/list.png',
|
||||
true,
|
||||
['title' => __('List of networkmap')]
|
||||
|
@ -895,23 +875,18 @@ if ($networkmap === false) {
|
|||
<script>
|
||||
$(document).ready(function() {
|
||||
$("*").on("click", function(){
|
||||
if($("[aria-describedby=dialog_node_edit]").css('display') == 'block'){
|
||||
$('#foot').css({'top':parseInt($("[aria-describedby=dialog_node_edit]").css('height')+$("[aria-describedby=dialog_node_edit]").css('top')),'position':'relative'});
|
||||
|
||||
}
|
||||
else{
|
||||
$('#foot').css({'position':'','top':'0'});
|
||||
}
|
||||
|
||||
|
||||
if($("[aria-describedby=dialog_node_edit]").css('display') == 'block'){
|
||||
$('#foot').css({'top':parseInt($("[aria-describedby=dialog_node_edit]").css('height')+$("[aria-describedby=dialog_node_edit]").css('top')),'position':'relative'});
|
||||
}
|
||||
else{
|
||||
$('#foot').css({'position':'','top':'0'});
|
||||
}
|
||||
});
|
||||
|
||||
$("[aria-describedby=dialog_node_edit]").on('dialogclose', function(event) {
|
||||
|
||||
$('#foot').css({'position':'','top':'0'});
|
||||
|
||||
$('#foot').css({'position':'','top':'0'});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -88,6 +88,16 @@ $sort = get_parameter('sort', 'none');
|
|||
$id_module = (int) get_parameter('id_module', 0);
|
||||
$ag_custom_fields = (array) get_parameter('ag_custom_fields', []);
|
||||
$module_option = (int) get_parameter('module_option', 1);
|
||||
$autosearch = false;
|
||||
|
||||
// It is validated if it receives parameters different from those it has by default
|
||||
if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
|
||||
|| $ag_modulename !== '' || $refr !== 0 || $offset !== 0 || $status !== 4
|
||||
|| $modulegroup !== -1 || $tag_filter !== 0 || $sortField !== ''
|
||||
|| $sort !== 'none' || $id_module !== 0 || $module_option !== 1
|
||||
) {
|
||||
$autosearch = true;
|
||||
}
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
$ag_group = (int) get_parameter('ag_group', 0);
|
||||
|
@ -969,10 +979,8 @@ $sql = 'SELECT
|
|||
ORDER BY '.$order['field'].' '.$order['order'].'
|
||||
LIMIT '.$offset.','.$limit_sql;
|
||||
|
||||
// When you enter for the first time you have less than 4 query params in the url
|
||||
$first_interaction = count($_GET) > 4;
|
||||
// We do not show the modules until the user searches with the filter
|
||||
if ($first_interaction) {
|
||||
if ($autosearch) {
|
||||
if (! defined('METACONSOLE')) {
|
||||
$result = db_get_all_rows_sql($sql);
|
||||
|
||||
|
@ -1057,6 +1065,7 @@ if (($config['dbtype'] == 'oracle') && ($result !== false)) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Start Build List Result
|
||||
//
|
||||
if (!empty($result)) {
|
||||
|
|
|
@ -1068,9 +1068,6 @@ function validate_event_advanced(id, new_status) {
|
|||
next_row_id = row_id_name + '-' + row_id_number_next;
|
||||
|
||||
$("#"+previous_row_id).css('display', 'none');
|
||||
$("#"+current_row_id).css('display', 'none');
|
||||
$("#"+selected_row_id).css('display', 'none');
|
||||
$("#"+next_row_id).css('display', 'none');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.732
|
||||
%define release 190311
|
||||
%define release 190319
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.732
|
||||
%define release 190311
|
||||
%define release 190319
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.732-190311
|
||||
Version: 7.0NG.732-190319
|
||||
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.732-190311"
|
||||
pandora_version="7.0NG.732-190319"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.732";
|
||||
my $pandora_build = "190311";
|
||||
my $pandora_build = "190319";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.732";
|
||||
my $pandora_build = "190311";
|
||||
my $pandora_build = "190319";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
@ -2018,6 +2018,12 @@ sub snmp_walk {
|
|||
$timeout = $snmp->{timeout};
|
||||
}
|
||||
|
||||
if ($^O =~ /lin/i && "`which snmpwalk`" eq "") {
|
||||
return {
|
||||
'error' => 'snmpwalk not found'
|
||||
};
|
||||
}
|
||||
|
||||
$snmp->{extra} = '' unless defined $snmp->{extra};
|
||||
|
||||
if ( defined ($snmp->{version} )
|
||||
|
@ -2131,6 +2137,12 @@ sub snmp_get {
|
|||
$timeout = $snmp->{timeout};
|
||||
}
|
||||
|
||||
if ($^O =~ /lin/i && "`which snmpwalk`" eq "") {
|
||||
return {
|
||||
'error' => 'snmpwalk not found'
|
||||
};
|
||||
}
|
||||
|
||||
$snmp->{extra} = '' unless defined $snmp->{extra};
|
||||
|
||||
if ( defined ($snmp->{version} )
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.732
|
||||
%define release 190311
|
||||
%define release 190319
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.732
|
||||
%define release 190311
|
||||
%define release 190319
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.732"
|
||||
PI_BUILD="190311"
|
||||
PI_BUILD="190319"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.732 PS190311";
|
||||
my $version = "7.0NG.732 PS190319";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.732 PS190311";
|
||||
my $version = "7.0NG.732 PS190319";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|