Merge remote-tracking branch 'origin/develop' into ent-7074-Command-Center

This commit is contained in:
Daniel Barbero Martin 2021-03-08 08:29:18 +01:00
commit b57be5535d
47 changed files with 834 additions and 421 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.752-210305
Version: 7.0NG.752-210308
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.752-210305"
pandora_version="7.0NG.752-210308"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1016,7 +1016,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.752';
use constant AGENT_BUILD => '210305';
use constant AGENT_BUILD => '210308';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.752"
PI_BUILD="210305"
PI_BUILD="210308"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{210305}
{210308}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.752(Build 210305)")
#define PANDORA_VERSION ("7.0NG.752(Build 210308)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.752(Build 210305))"
VALUE "ProductVersion", "(7.0NG.752(Build 210308))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.752-210305
Version: 7.0NG.752-210308
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.752-210305"
pandora_version="7.0NG.752-210308"
package_pear=0
package_pandora=1

View File

@ -1,17 +1,32 @@
<?php
/**
* View for Add actions alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -195,9 +210,6 @@ $table->data[1][0] .= '</span>';
$table->data[1][1] = html_print_select([], 'id_agents[]', 0, false, __('Any'), '', true, true);
$table->data[2][0] = __('Alert templates');
$table->data[2][0] .= '<span id="template_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true);
$table->data[2][0] .= '</span>';
$table->data[2][1] = html_print_select([], 'id_alert_templates[]', '', '', '', '', true, true, true, '', $alert_templates == 0);
$table->data[2][2] = __('When select agents');
$table->data[2][2] .= '<br>';
@ -251,36 +263,20 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='$agents_with_templates_json'>";
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('add', 1);
html_print_submit_button(__('Add'), 'go', false, 'class="sub add"');
echo '</div>';
attachActionButton('add', 'create', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
ui_require_javascript_file('massive_operations');
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript">
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(document).ready (function () {
$("#form_alerts").submit(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;
}
});
update_alerts();
@ -319,7 +315,7 @@ $(document).ready (function () {
jQuery.each ($("#id_agents option:selected"), function (i, val) {
idAgents.push($(val).val());
});
$("#template_loading").show();
showSpinner();
var $select_template = $("#id_alert_templates").disable ();
@ -340,7 +336,7 @@ $(document).ready (function () {
}
$("#id_alert_templates").append (options);
$("#template_loading").hide ();
hideSpinner();
$select_template.enable ();
},
"json"

View File

@ -278,10 +278,8 @@ $table->data[2][3] = '';
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('add', 1);
html_print_submit_button(__('Add'), 'go', false, 'class="sub add"');
echo '</div>';
attachActionButton('add', 'add', $table->width);
echo '</form>';
// TODO: Change to iu_print_error system.
@ -299,7 +297,7 @@ ui_require_jquery_file('pandora.controls');
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(document).ready (function () {
$("#form_alerts").submit(function() {
/* $("#form_alerts").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_alerts").serializeArray().length;
@ -311,7 +309,7 @@ $(document).ready (function () {
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");
@ -321,7 +319,7 @@ $(document).ready (function () {
$("#id_group").change (function () {
var $select = $("#id_agents").enable ();
$("#agent_loading").show ();
showSpinner();
$("option", $select).remove ();
jQuery.post ("ajax.php",
@ -340,7 +338,7 @@ $(document).ready (function () {
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_agents").append (options);
$("#agent_loading").hide ();
hideSpinner();
$select.enable ();
},
"json"

View File

@ -1,20 +1,34 @@
<?php
/**
* View for Add profiles in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (!check_acl($config['id_user'], 0, 'UM')) {
db_pandora_audit(
'ACL Violation',
@ -219,14 +233,14 @@ $data[2] .= html_print_select(
'width: 100%'
);
// Waiting spinner.
ui_print_spinner(__('Loading'));
array_push($table->data, $data);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('create_profiles', 1);
html_print_submit_button(__('Create'), 'go', false, 'class="sub add"');
echo '</div>';
attachActionButton('create_profiles', 'update', $table->width);
echo '</form>';

View File

@ -1,17 +1,32 @@
<?php
/**
* View for copy modules in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -294,22 +309,17 @@ echo '<legend><span>'.__('To agent(s)').'</span></legend>';
html_print_table($table);
echo '</fieldset>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
attachActionButton('do_operation', 'copy', $table->width);
html_print_input_hidden('do_operation', 1);
html_print_submit_button(__('Copy'), 'go', false, 'class="sub wand"');
echo '</div>';
echo '</form>';
echo '<h3 class="error invisible" id="message">&nbsp;</h3>';
// Load JS files.
ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var module_alerts;
@ -514,7 +524,7 @@ $(document).ready (function () {
});
$("#manage_config_form").submit (function () {
var get_parameters_count = window.location.href.slice(
/* var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#manage_config_form").serializeArray().length;
@ -522,9 +532,13 @@ $(document).ready (function () {
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.'); ?>");
alert("
<?php
// echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.');
?>
");
return false;
}
} */

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete action alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -270,10 +285,8 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='".$agents_with_templates_json."'>";
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete', 'delete', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"></h3>';

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete agents in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -186,11 +201,8 @@ $table->data[2][1] = html_print_select(
echo '<form method="post" id="form_agents" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents">';
html_print_table($table);
if (!is_central_policies_on_node()) {
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
if (is_central_policies_on_node() === false) {
attachActionButton('delete', 'delete', $table->width);
}
echo '</form>';
@ -202,24 +214,8 @@ ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript">
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(document).ready (function () {
$("#form_agents").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_agents").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;
}
});
var recursion;
$("#checkbox-recursion").click(function () {

View File

@ -1,17 +1,32 @@
<?php
/**
* View for Delete alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -321,10 +336,8 @@ $table->data[2][3] = html_print_select([], 'module[]', '', false, '', '', true,
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_alerts" >';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete', 'delete', $table->width);
echo '</form>';
// Hack to translate text "none" in PHP to javascript
@ -371,7 +384,7 @@ $(document).ready (function () {
$("#id_group").change (function () {
var $select = $("#id_agents").disable ();
$("#agent_loading").show ();
showSpinner();
$("option", $select).remove ();
jQuery.post ("ajax.php",
@ -393,7 +406,7 @@ $(document).ready (function () {
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_agents").append (options);
$("#agent_loading").hide ();
hideSpinner();
$select.enable ();
},
"json"

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete modules in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -563,10 +578,8 @@ $table->data['form_agents_3'][3] = html_print_select(
echo '<form method="post" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete', 'delete', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
@ -575,6 +588,9 @@ ui_require_jquery_file('form');
// Hack to translate text "none" in PHP to javascript
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo '<span id ="select_agent_first_text" style="display: none;">'.__('Please, select an agent first').'</span>';
// Load JS files.
ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('pandora.controls');
if ($selection_mode == 'modules') {
@ -586,13 +602,10 @@ if ($selection_mode == 'modules') {
}
?>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(document).ready (function () {
$("#checkbox-select_all_modules").change(function() {
if( $('#checkbox-select_all_modules').prop('checked')) {
$("#module_name option").prop('selected', 'selected');
@ -689,7 +702,7 @@ $(document).ready (function () {
}
}
$("#module_loading").show ();
showSpinner();
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
$("#module_name").attr ("disabled", "disabled")
$("#module_name option[value!=0]").remove ();
@ -702,7 +715,7 @@ $(document).ready (function () {
.html(value["nombre"]);
$("#module_name").append (option);
});
$("#module_loading").hide();
hideSpinner();
$("#module_name").removeAttr ("disabled");
//Filter modules. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
@ -832,21 +845,7 @@ $(document).ready (function () {
selector = $("#form_edit input[name=selection_mode]:checked").val();
$("#id_agents").trigger("change");
});
$("#form_modules").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_modules").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;
}
});
if("<?php echo $delete; ?>"){
if("<?php echo $selection_mode; ?>" == 'agents'){
$("#groups_select").trigger("change");

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete profiles in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'UM')) {
@ -199,16 +214,13 @@ array_push($table->data, $data);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete_profiles', 1);
html_print_submit_button(__('Delete'), 'del', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete_profiles', 'delete', $table->width);
echo '</form>';
unset($table);
// TODO: Change to iu_print_error system
// TODO: Change to iu_print_error system.
echo '<h3 class="error invisible" id="message"> </h3>';
ui_require_jquery_file('form');
@ -224,7 +236,7 @@ $(document).ready (function () {
var $select = $("#users_id").disable ();
$("#users_loading").show ();
$("option", $select).remove ();
console.log($("#groups_id").val());
jQuery.post ("ajax.php",
{"page" : "godmode/massive/massive_delete_profiles",
"get_users" : 1,

View File

@ -1,17 +1,32 @@
<?php
/**
* View for edit agents in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -327,13 +342,16 @@ if ($update_agents) {
// Update Custom Fields
foreach ($fields as $field) {
$info[$field['id_field']] = $field['name'];
if (get_parameter_post('customvalue_'.$field['id_field'], '') != '') {
$value = get_parameter('customvalue_'.$field['id_field']);
if (empty($value) === false) {
$key = $field['id_field'];
$value = get_parameter_post('customvalue_'.$field['id_field'], '');
$old_value = db_get_all_rows_filter('tagent_custom_data', ['id_agent' => $id_agent, 'id_field' => $key]);
$old_value = db_get_all_rows_filter(
'tagent_custom_data',
[
'id_agent' => $id_agent,
'id_field' => $key,
]
);
if ($old_value === false) {
// Create custom field if not exist
@ -346,14 +364,16 @@ if ($update_agents) {
]
);
} else {
$result = db_process_sql_update(
'tagent_custom_data',
['description' => $value],
[
'id_field' => $key,
'id_agent' => $id_agent,
]
);
if ($old_value[0]['description'] !== $value) {
$result = db_process_sql_update(
'tagent_custom_data',
['description' => $value],
[
'id_field' => $key,
'id_agent' => $id_agent,
]
);
}
}
}
}
@ -373,7 +393,7 @@ if ($update_agents) {
ui_print_result_message(
$result !== false,
__('Agents updated successfully').'('.$n_edited.')',
__('Agents updated successfully (%d)', $n_edited),
__('Agents cannot be updated (maybe there was no field to update)')
);
}
@ -830,19 +850,16 @@ if (!empty($fields)) {
echo '<h3 class="error invisible" id="message"> </h3>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"');
html_print_input_hidden('update_agents', 1);
html_print_input_hidden('id_agente', $id_agente);
echo '</div>';
if (is_central_policies_on_node() === false) {
attachActionButton('update_agents', 'update', $table->width);
}
// Shown and hide div
echo '</div></form>';
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('ajaxqueue');

View File

@ -1,17 +1,32 @@
<?php
/**
* View for edit modules in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -280,9 +295,6 @@ $table->data['selection_mode'][1] .= '<span style="width:110px;display:inline-bl
$table->rowclass['form_modules_1'] = 'select_modules_row';
$table->data['form_modules_1'][0] = __('Module type');
$table->data['form_modules_1'][0] .= '<span id="module_loading" class="invisible">';
$table->data['form_modules_1'][0] .= html_print_image('images/spinner.png', true);
$table->data['form_modules_1'][0] .= '</span>';
$types[0] = __('All');
$table->colspan['form_modules_1'][1] = 2;
@ -1161,30 +1173,37 @@ $table->data['edit1'][1] = '<table width="100%">';
''
);
if (!empty($id_plugin)) {
$preload = db_get_sql("SELECT description FROM tplugin WHERE id = $id_plugin");
if (empty($id_plugin) === false) {
$preload = db_get_sql(
sprintf(
'SELECT description FROM tplugin WHERE id = %s',
$id_plugin
)
);
$preload = io_safe_output($preload);
$preload = str_replace("\n", '<br>', $preload);
} else {
$preload = '';
}
$table->data['edit21'][1] = '<span style="font-weight: normal;" id="plugin_description">'.$preload.'</span>';
$table->data['edit21'][1] = sprintf(
'<span style="font-weight: normal;" id="plugin_description">%s</span>',
$preload
);
echo '<form method="post" '.'action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" '.'id="form_edit">';
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('update', 1);
html_print_submit_button(__('Update'), 'go', false, 'class="sub upd"');
echo '</div>';
attachActionButton('update', 'update', $table->width);
echo '</form>';
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>';
echo '<span id ="select_agent_first_text" style="display: none;">'.__('Please, select an agent first').'</span>';
// Load JS files.
ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('pandora.controls');
if ($selection_mode == 'modules') {
@ -1196,27 +1215,11 @@ $table->data['edit1'][1] = '<table width="100%">';
}
?>
<script type="text/javascript">flag_load_plugin_component = false;</script>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
flag_load_plugin_component = false;
$(document).ready (function () {
$("#form_edit").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_edit").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-select_all_modules").change(function() {
if( $('#checkbox-select_all_modules').prop('checked')) {
@ -1340,7 +1343,7 @@ $(document).ready (function () {
}
}
$("#module_loading").show ();
showSpinner();
$("tr#delete_table-edit1, tr#delete_table-edit0, tr#delete_table-edit2").hide ();
$("#module_name").attr ("disabled", "disabled")
$("#module_name option[value!=0]").remove ();
@ -1351,7 +1354,7 @@ $(document).ready (function () {
option = $("<option></option>").attr ("value", value["nombre"]).html (value["nombre"]);
$("#module_name").append (option);
});
$("#module_loading").hide ();
hideSpinner();
$("#module_name").removeAttr ("disabled");
//Filter modules. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
@ -1864,7 +1867,6 @@ function changePluginSelect() {
$('#hidden-macros').val(data['base64']);
jQuery.each (data['array'], function (i, macro) {
console.log(macro);
if (macro['desc'] != '') {
$("#delete_table-edit21").after("<tr class='macro_field' id='delete_table-edit"+(80+parseInt(i))+"'><td style='font-weight:bold;'>"+macro['desc']+"<input type='hidden' name='desc"+macro['macro']+"' value='"+macro['desc']+"'></td><td><input type='text' name='"+macro['macro']+"'></td></tr>");
}

View File

@ -1,17 +1,32 @@
<?php
/**
* View for edit plugins in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
global $config;
check_login();
@ -371,10 +386,7 @@ echo '<form method="POST" id="form-massive_plugin_edition"
html_print_table($table);
echo "<div style='text-align: right; width: ".$table->width."'>";
html_print_input_hidden('update', 1);
html_print_submit_button(__('Update'), 'upd-btn', false, 'class="sub upd"');
echo '</div>';
attachActionButton('update', 'update', $table->width);
echo '</form>';
@ -405,35 +417,6 @@ echo '</form>';
canSubmit = val;
$submitButton.prop('disabled', !val);
}
var showSpinner = function () {
var $loadingSpinner = $pluginsSelect.siblings('img#loading_spinner');
if ($loadingSpinner.length > 0) {
// Display inline instead using the show function
// cause its absolute positioning.
$loadingSpinner.css('display', 'inline');
return;
}
$loadingSpinner = $('<img />');
$loadingSpinner
.prop('id', 'loading_spinner')
.css('padding-left', '5px')
.css('position', 'absolute')
.css('top', $pluginsSelect.position().top + 'px')
.prop('src', "<?php echo $config['homeurl'].'/'; ?>images/spinner.gif");
$pluginsSelect.parent().append($loadingSpinner);
}
var hideSpinner = function () {
var $loadingSpinner = $pluginsSelect.siblings('img#loading_spinner');
if ($loadingSpinner.length > 0)
$loadingSpinner.hide();
}
var clearModulePluginMacrosValues = function () {
$('input.plugin-macro')
@ -864,6 +847,7 @@ echo '</form>';
}
var errorHandler = function (error) {
hideSpinner();
console.log("<?php echo __('Error'); ?>: " + error.message);
// alert("<?php echo __('Error'); ?>: " + err.message);
@ -927,7 +911,10 @@ echo '</form>';
$agentModulesRow.show();
}
else {
alert("<?php echo __('There are no modules using this plugin'); ?>");
var contents = {};
contents.html = '<?php echo __('There are no modules using this plugin'); ?>';
contents.title = '<?php echo __('Massive operations'); ?>';
showMassiveModal(contents);
// Abort the another call
if (typeof pluginXHR !== 'undefined') {

View File

@ -1,17 +1,32 @@
<?php
/**
* View for enable/disable alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {

View File

@ -1,17 +1,32 @@
<?php
/**
* Main view for Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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.
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -26,6 +41,7 @@ if (! check_acl($config['id_user'], 0, 'AW')) {
require_once 'include/functions_agents.php';
require_once 'include/functions_alerts.php';
require_once 'include/functions_modules.php';
require_once 'include/functions_massive_operations.php';
enterprise_include('godmode/massive/massive_operations.php');
@ -316,35 +332,49 @@ $submit_template_enabled = get_parameter('id_alert_template_enabled');
$submit_template_not_standby = get_parameter('id_alert_template_not_standby');
$submit_template_standby = get_parameter('id_alert_template_standby');
$submit_add = get_parameter('crtbutton');
// Waiting spinner.
ui_print_spinner(__('Loading'));
// Modal for show messages.
html_print_div(
[
'id' => 'massive_modal',
'content' => '',
]
);
// Load common JS files.
ui_require_javascript_file('massive_operations');
echo '<div id="loading" display="none">';
echo html_print_image('images/wait.gif', true, ['border' => '0']).'<br />';
echo '<strong>'.__('Please wait...').'</strong>';
echo '</div>';
?>
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
$('#manage_config_form').submit( function() {
confirm_status =
confirm("<?php echo __('Are you sure?'); ?>");
if (confirm_status)
$("#loading").css("display", "");
else
$('#button-go').click( function(e) {
var limitParametersMassive = <?php echo $config['limit_parameters_massive']; ?>;
var thisForm = e.target.form.id;
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $('#'+thisForm).serializeArray().length;
var totalCount = get_parameters_count + post_parameters_count;
var contents = {};
contents.html = '<?php echo __('No changes have been made because they exceed the maximum allowed (%d). Make fewer changes or contact the administrator.', $config['limit_parameters_massive']); ?>';
contents.title = '<?php echo __('Massive operations'); ?>';
contents.question = '<?php echo __('Are you sure?'); ?>';
contents.ok = '<?php echo __('OK'); ?>';
contents.cancel = '<?php echo __('Cancel'); ?>';
var operation = massiveOperationValidation(contents, totalCount, limitParametersMassive, thisForm);
if (operation == false) {
return false;
}
});
$('[id^=form]').submit( function() {
confirm_status =
confirm("<?php echo __('Are you sure?'); ?>");
if (confirm_status)
$("#loading").css("display", "");
else
return false;
});
$("#loading").css("display", "none");
});
/* ]]> */
</script>
<?php

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete action alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -285,7 +300,7 @@ $(document).ready (function () {
jQuery.each ($("#id_agents option:selected"), function (i, val) {
idAgents.push($(val).val());
});
$("#template_loading").show();
showSpinner();
var $select_template = $("#id_alert_templates").disable ();
$("option", $select_template).remove ();
@ -302,7 +317,7 @@ $(document).ready (function () {
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_alert_templates").append (options);
$("#template_loading").hide ();
hideSpinner();
$select_template.enable ();
},
"json"

View File

@ -476,7 +476,22 @@ class DiscoveryTaskList extends HTML
include_once $config['homedir'].'/include/functions_servers.php';
include_once $config['homedir'].'/include/functions_network_profiles.php';
$recon_tasks = db_get_all_rows_sql('SELECT * FROM trecon_task');
if (users_is_admin()) {
$recon_tasks = db_get_all_rows_sql('SELECT * FROM trecon_task');
} else {
$user_groups = implode(
',',
array_keys(users_get_groups())
);
$recon_tasks = db_get_all_rows_sql(
sprintf(
'SELECT * FROM trecon_task
WHERE id_group IN (%s)',
$user_groups
)
);
}
// Show network tasks for Recon Server.
if ($recon_tasks === false) {
$recon_tasks = [];

View File

@ -178,14 +178,19 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$params_combined = json_decode($data_combined, true);
$module_list = json_decode($data_module_list, true);
$type_graph_pdf = $type_graph_pdf;
if (isset($params['vconsole']) === false || $params['vconsole'] === false) {
$params['width'] = (int) $viewport_width;
if ((int) $viewport_width > 0) {
$params['width'] = (int) $viewport_width;
}
if ((isset($params['width']) === false
|| ($params['width'] <= 0))
) {
$params['width'] = 650;
if ((int) $params['width'] <= 0) {
$params['width'] = 650;
}
if ((int) $params['landscape'] === 1) {
$params['width'] = 850;
}

View File

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

View File

@ -13799,18 +13799,30 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
return;
}
$user_defined = false;
if (is_array($other['data']) === true) {
$user_defined = true;
// Parameters received by user call.
$graph_seconds = (!empty($other) && isset($other['data'][0])) ? $other['data'][0] : SECONDS_1HOUR;
// Base64.
$base64 = $other['data'][1];
// 1 hour by default.
$graph_threshold = (!empty($other) && isset($other['data'][2]) && $other['data'][2]) ? $other['data'][2] : 0;
// Graph height when send email by alert
$height = (!empty($other) && isset($other['data'][3]) && $other['data'][3]) ? $other['data'][3] : 225;
// Graph width (optional).
$width = (!empty($other) && isset($other['data'][4]) && $other['data'][4]) ? $other['data'][4] : '';
} else {
// Fixed parameters for _modulegraph_nh_.
$graph_seconds = $other['data'];
$graph_threshold = 0;
$other['data'][1] = 0;
$base64 = 0;
$height = 225;
$width = '90%';
}
if (is_nan($graph_seconds) || $graph_seconds <= 0) {
@ -13845,7 +13857,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
// Format MIME RFC 2045 (line break 76 chars).
$graph_html = chunk_split(grafico_modulo_sparse($params));
if ($other['data'][1]) {
if ((bool) $base64 === false) {
header('Content-type: text/html');
returnData('string', ['type' => 'string', 'data' => '<img src="data:image/jpeg;base64,'.$graph_html.'">']);
} else {

View File

@ -0,0 +1,97 @@
<?php
/**
* Massive Operations Functions
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
/**
* Generate a action button for submit the form.
*
* @param string $action Action to send in form.
* @param string $buttonAction Action of the button: Create, Update or Delete.
* @param string $tableWidth Set the table width for the container.
* @param boolean $return If true, return a formed string.
*
* @return string
*/
function attachActionButton(
string $action,
string $buttonAction,
string $tableWidth,
bool $return=false
) {
switch ($buttonAction) {
case 'add':
$caption = 'Add';
$class = 'add';
break;
case 'copy':
$caption = 'Copy';
$class = 'wand';
break;
case 'create':
$caption = 'Create';
$class = 'upd';
break;
case 'update':
$caption = 'Update';
$class = 'upd';
break;
case 'delete':
$caption = 'Delete';
$class = 'delete';
break;
default:
// Do none.
break;
}
return html_print_div(
[
'class' => 'action-buttons',
'style' => sprintf('width: %s', $tableWidth),
'content' => html_print_input_hidden(
$action,
1
).html_print_button(
__($caption),
'go',
false,
'',
sprintf('class="sub %s"', $class),
true
),
],
$return
);
}

View File

@ -6301,3 +6301,56 @@ function ui_print_reveal_password(string $name, bool $return=false)
echo $output;
}
/**
* Generate a spinner box for waiting times
* TIP: It's made for Massive Operations, but it migth used in entire project.
*
* @param string $text Text for show in spinner. English term Loading for default.
* @param boolean $return If true, return the string with the formed element.
*
* @return string
*/
function ui_print_spinner(string $text='Loading', bool $return=false)
{
$output = '';
$output .= '<center>';
$output .= html_print_div(
[
'id' => 'loading_spinner',
'class' => 'white_box invisible',
'content' => '<span style="font-size:25px;">'.$text.'...</span>'.html_print_image(
'images/spinner.gif',
true,
[
'border' => '0',
'width' => '25px',
'heigth' => '25px',
]
),
],
true
);
$output .= '</center>';
$output .= '
<script type="text/javascript">
function hideSpinner() {
document.getElementById("loading_spinner").classList.add("invisible");
}
function showSpinner() {
document.getElementById("loading_spinner").classList.remove("invisible");
}
</script>
';
if ($return === true) {
return $output;
} else {
echo $output;
}
}

View File

@ -0,0 +1,96 @@
/** global $ */
function massiveOperationValidation(contents, totalCount, limit, thisForm) {
var output = false;
// If the amount of changes exceed the limit, the operation stops.
if (totalCount > limit) {
showMassiveModal(contents);
return false;
} else {
confirmDialog({
title: contents.title,
message: contents.question,
ok: contents.ok,
cancel: contents.cancel,
onAccept: function() {
showSpinner();
output = true;
$("#" + thisForm).submit();
},
onDeny: function() {
hideSpinner();
return false;
}
});
}
return output;
}
function showMassiveModal(contents) {
$("#massive_modal")
.empty()
.html(contents.html);
// Set the title.
$("#massive_modal").prop("title", contents.title);
// Build the dialog for show the mesage.
$("#massive_modal").dialog({
resizable: true,
draggable: true,
modal: true,
width: 800,
buttons: [
{
text: "OK",
click: function() {
hideSpinner();
$(this).dialog("close");
return false;
}
}
],
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
}
});
}
/*
function showMassiveOperationMessage(message) {
$("#massive_modal")
.empty()
.html(message);
$("#massive_modal").prop("title", "Massive operations");
$("#massive_modal").dialog({
resizable: true,
draggable: true,
modal: true,
width: 800,
buttons: [
{
text: "OK",
click: function() {
$(this).dialog("close");
hideSpinner();
}
}
],
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
}
});
}
*/

View File

@ -809,6 +809,7 @@ p.center {
cursor: help;
}
/* Legacy spinner */
#loading {
position: fixed;
width: 200px;
@ -819,6 +820,19 @@ p.center {
padding: 20px;
}
/* New standard spinner */
#loading_spinner {
position: fixed;
margin-left: 30%;
text-align: center;
top: 50%;
background-color: #fff;
border: 2px solid #82b92e;
box-shadow: 2px 2px 2px #9dbba1;
padding: 20px;
z-index: 100;
}
.tactical_set legend {
text-align: left;
color: #3f3f3f;

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.752
%define release 210305
%define release 210308
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.752
%define release 210305
%define release 210308
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.752
%define release 210305
%define release 210308
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.752-210305
Version: 7.0NG.752-210308
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.752-210305"
pandora_version="7.0NG.752-210308"
package_cpan=0
package_pandora=1

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.752";
my $pandora_build = "210305";
my $pandora_build = "210308";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.752";
my $pandora_build = "210305";
my $pandora_build = "210308";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

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

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.752"
PI_BUILD="210305"
PI_BUILD="210308"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.752 PS210305";
my $version = "7.0NG.752 PS210308";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.752 PS210305";
my $version = "7.0NG.752 PS210308";
# save program name for logging
my $progname = basename($0);