Merge remote-tracking branch 'origin/develop' into ent-8621-copiando-a-grafana-4-color-tabs-como-widget-en-dashboard

This commit is contained in:
Daniel Barbero Martin 2022-06-30 12:52:49 +02:00
commit 95fca17fa9
46 changed files with 492 additions and 367 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.763-220629 Version: 7.0NG.763-220630
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.763" PI_VERSION="7.0NG.763"
PI_BUILD="220629" PI_BUILD="220630"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{220629} {220630}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.763-220629 Version: 7.0NG.763-220630
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -1,25 +1,35 @@
<?php <?php
/**
* List view for Alerts.
*
* @category Alerts
* @package Community
* @subpackage Software agents repository
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ==========================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnológicas S.L
* This code is NOT free software. This code is NOT licenced under GPL2 licence
* You cannot redistribute it without written permission of copyright holder.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com // Begin.
// ==================================================
// 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.
global $config; global $config;
// Login check // Login check.
check_login(); check_login();
// Check if this page is included from a agent edition // Check if this page is included from a agent edition.
if (! check_acl($config['id_user'], 0, 'LW') if ((bool) check_acl($config['id_user'], 0, 'LW') === false
&& ! check_acl($config['id_user'], 0, 'AD') && (bool) check_acl($config['id_user'], 0, 'AD') === false
&& ! check_acl($config['id_user'], 0, 'LM') && (bool) check_acl($config['id_user'], 0, 'LM') === false
) { ) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -36,7 +46,7 @@ require_once $config['homedir'].'/include/functions_users.php';
$pure = get_parameter('pure', 0); $pure = get_parameter('pure', 0);
$agent_id = get_parameter('agent_id', 0); $agent_id = get_parameter('agent_id', 0);
if (defined('METACONSOLE')) { if (is_metaconsole() === true) {
$sec = 'advanced'; $sec = 'advanced';
} else { } else {
$sec = 'galertas'; $sec = 'galertas';
@ -48,7 +58,7 @@ if ($id_agente) {
$sec2 = 'godmode/alerts/alert_list'; $sec2 = 'godmode/alerts/alert_list';
} }
// Table for filter controls // Table for filter controls.
$form_filter = '<form method="post" action="index.php?sec='.$sec.'&amp;sec2='.$sec2.'&amp;refr='.((int) get_parameter('refr', 0)).'&amp;pure='.$config['pure'].'">'; $form_filter = '<form method="post" action="index.php?sec='.$sec.'&amp;sec2='.$sec2.'&amp;refr='.((int) get_parameter('refr', 0)).'&amp;pure='.$config['pure'].'">';
$form_filter .= "<input type='hidden' name='search' value='1' />"; $form_filter .= "<input type='hidden' name='search' value='1' />";
$form_filter .= '<table cellpadding="0" cellspacing="0" class="databox filters w100p">'; $form_filter .= '<table cellpadding="0" cellspacing="0" class="databox filters w100p">';
@ -60,7 +70,7 @@ $temp = agents_get_agents();
$arrayAgents = []; $arrayAgents = [];
// Avoid empty arrays, warning messages are UGLY ! // Avoid empty arrays, warning messages are UGLY !
if ($temp) { if ($temp !== false) {
foreach ($temp as $agentElement) { foreach ($temp as $agentElement) {
$arrayAgents[$agentElement['id_agente']] = $agentElement['nombre']; $arrayAgents[$agentElement['id_agente']] = $agentElement['nombre'];
} }
@ -93,11 +103,11 @@ $form_filter .= '</tr>';
$all_groups = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']); $all_groups = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
if (check_acl($config['id_user'], 0, 'AD')) { if ((bool) check_acl($config['id_user'], 0, 'AD') === true) {
$groups_user = users_get_groups($config['id_user'], 'AD', $all_groups); $groups_user = users_get_groups($config['id_user'], 'AD', $all_groups);
} else if (check_acl($config['id_user'], 0, 'LW')) { } else if ((bool) check_acl($config['id_user'], 0, 'LW') === true) {
$groups_user = users_get_groups($config['id_user'], 'LW', $all_groups); $groups_user = users_get_groups($config['id_user'], 'LW', $all_groups);
} else if (check_acl($config['id_user'], 0, 'LM')) { } else if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
$groups_user = users_get_groups($config['id_user'], 'LM', $all_groups); $groups_user = users_get_groups($config['id_user'], 'LM', $all_groups);
} }
@ -109,16 +119,16 @@ $groups_id = implode(',', array_keys($groups_user));
$form_filter .= '<tr>'; $form_filter .= '<tr>';
$temp = db_get_all_rows_sql("SELECT id, name FROM talert_actions WHERE id_group IN ($groups_id);"); $temp = db_get_all_rows_sql('SELECT id, name FROM talert_actions WHERE id_group IN ('.$groups_id.');');
$arrayActions = []; $arrayActions = [];
if (is_array($temp)) { if (is_array($temp) === true) {
foreach ($temp as $actionElement) { foreach ($temp as $actionElement) {
$arrayActions[$actionElement['id']] = $actionElement['name']; $arrayActions[$actionElement['id']] = $actionElement['name'];
} }
} }
$form_filter .= "<td class='bolder''>".__('Actions').'</td><td>'; $form_filter .= "<td class='bolder''>".__('Actions').'</td><td>';
$form_filter .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true); $form_filter .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true, false, true, '', false, 'width:95%');
$form_filter .= '</td>'; $form_filter .= '</td>';
$form_filter .= "<td class='bolder''>".__('Field content').'</td><td>'; $form_filter .= "<td class='bolder''>".__('Field content').'</td><td>';
$form_filter .= html_print_input_text('field_content', $fieldContent, '', 12, 255, true); $form_filter .= html_print_input_text('field_content', $fieldContent, '', 12, 255, true);
@ -155,7 +165,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_
$form_filter .= html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false); $form_filter .= html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false);
$form_filter .= '</td></tr>'; $form_filter .= '</td></tr>';
if (defined('METACONSOLE')) { if (is_metaconsole() === true) {
$form_filter .= '<tr>'; $form_filter .= '<tr>';
$form_filter .= "<td colspan='6' align='right'>"; $form_filter .= "<td colspan='6' align='right'>";
$form_filter .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true); $form_filter .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true);
@ -170,7 +180,7 @@ if (defined('METACONSOLE')) {
} }
$form_filter .= '</form>'; $form_filter .= '</form>';
if (defined('METACONSOLE')) { if (is_metaconsole() === true) {
echo '<br>'; echo '<br>';
} }
@ -253,7 +263,7 @@ $total = agents_get_alerts_simple(
true true
); );
if (empty($total)) { if (empty($total) === true) {
$total = 0; $total = 0;
} }
@ -277,14 +287,6 @@ $selectTemplateDown = false;
switch ($sortField) { switch ($sortField) {
case 'disabled': case 'disabled':
switch ($sort) { switch ($sort) {
case 'up':
$selectDisabledUp = $selected;
$order = [
'field' => 'disabled',
'order' => 'ASC',
];
break;
case 'down': case 'down':
$selectDisabledDown = $selected; $selectDisabledDown = $selected;
$order = [ $order = [
@ -292,19 +294,20 @@ switch ($sortField) {
'order' => 'DESC', 'order' => 'DESC',
]; ];
break; break;
default:
case 'up':
$selectDisabledUp = $selected;
$order = [
'field' => 'disabled',
'order' => 'ASC',
];
break;
} }
break; break;
case 'standby': case 'standby':
switch ($sort) { switch ($sort) {
case 'up':
$selectStandbyUp = $selected;
$order = [
'field' => 'standby',
'order' => 'ASC',
];
break;
case 'down': case 'down':
$selectStandbyDown = $selected; $selectStandbyDown = $selected;
$order = [ $order = [
@ -312,19 +315,20 @@ switch ($sortField) {
'order' => 'DESC', 'order' => 'DESC',
]; ];
break; break;
default:
case 'up':
$selectStandbyUp = $selected;
$order = [
'field' => 'standby',
'order' => 'ASC',
];
break;
} }
break; break;
case 'agent': case 'agent':
switch ($sort) { switch ($sort) {
case 'up':
$selectAgentUp = $selected;
$order = [
'field' => 'agent_name',
'order' => 'ASC',
];
break;
case 'down': case 'down':
$selectAgentDown = $selected; $selectAgentDown = $selected;
$order = [ $order = [
@ -332,19 +336,20 @@ switch ($sortField) {
'order' => 'DESC', 'order' => 'DESC',
]; ];
break; break;
default:
case 'up':
$selectAgentUp = $selected;
$order = [
'field' => 'agent_name',
'order' => 'ASC',
];
break;
} }
break; break;
case 'module': case 'module':
switch ($sort) { switch ($sort) {
case 'up':
$selectModuleUp = $selected;
$order = [
'field' => 'agent_module_name',
'order' => 'ASC',
];
break;
case 'down': case 'down':
$selectModuleDown = $selected; $selectModuleDown = $selected;
$order = [ $order = [
@ -352,19 +357,20 @@ switch ($sortField) {
'order' => 'DESC', 'order' => 'DESC',
]; ];
break; break;
default:
case 'up':
$selectModuleUp = $selected;
$order = [
'field' => 'agent_module_name',
'order' => 'ASC',
];
break;
} }
break; break;
case 'template': case 'template':
switch ($sort) { switch ($sort) {
case 'up':
$selectTemplateUp = $selected;
$order = [
'field' => 'template_name',
'order' => 'ASC',
];
break;
case 'down': case 'down':
$selectTemplateDown = $selected; $selectTemplateDown = $selected;
$order = [ $order = [
@ -372,6 +378,15 @@ switch ($sortField) {
'order' => 'DESC', 'order' => 'DESC',
]; ];
break; break;
default:
case 'up':
$selectTemplateUp = $selected;
$order = [
'field' => 'template_name',
'order' => 'ASC',
];
break;
} }
break; break;
@ -717,13 +732,13 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '<div id="add_action-div-'.$alert['id'].'" class="invisible">'; $data[3] .= '<div id="add_action-div-'.$alert['id'].'" class="invisible">';
$data[3] .= '<form id="add_action_form-'.$alert['id'].'" method="post" style="height:85%;">'; $data[3] .= '<form id="add_action_form-'.$alert['id'].'" method="post" style="height:85%;">';
$data[3] .= '<table class="databox_color w100p bg_color222" style="height:100%;">'; $data[3] .= '<table class="w100p bg_color222">';
$data[3] .= html_print_input_hidden('add_action', 1, true); $data[3] .= html_print_input_hidden('add_action', 1, true);
$data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true); $data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true);
if (! $id_agente) { if (! $id_agente) {
$data[3] .= '<tr class="datos2">'; $data[3] .= '<tr class="datos2">';
$data[3] .= '<td class="datos2 bolder pdd_6px">'; $data[3] .= '<td class="datos2 bolder pdd_6px font_10pt">';
$data[3] .= __('Agent'); $data[3] .= __('Agent');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos">'; $data[3] .= '<td class="datos">';
@ -733,7 +748,7 @@ foreach ($simple_alerts as $alert) {
} }
$data[3] .= '<tr class="datos">'; $data[3] .= '<tr class="datos">';
$data[3] .= '<td class="datos bolder pdd_6px">'; $data[3] .= '<td class="datos bolder pdd_6px font_10pt">';
$data[3] .= __('Module'); $data[3] .= __('Module');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos">'; $data[3] .= '<td class="datos">';
@ -741,15 +756,15 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '</tr>'; $data[3] .= '</tr>';
$data[3] .= '<tr class="datos2">'; $data[3] .= '<tr class="datos2">';
$data[3] .= '<td class="datos2 bolder pdd_6px">'; $data[3] .= '<td class="datos2 bolder pdd_6px font_10pt">';
$data[3] .= __('Action'); $data[3] .= __('Action');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos2">'; $data[3] .= '<td class="datos2">';
$data[3] .= html_print_select($actions, 'action_select', '', '', __('None'), 0, true, false, true, '', false, 'width:150px'); $data[3] .= html_print_select($actions, 'action_select', '', '', __('None'), 0, true, false, true, '', false, 'width:95%');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '</tr>'; $data[3] .= '</tr>';
$data[3] .= '<tr class="datos">'; $data[3] .= '<tr class="datos">';
$data[3] .= '<td class="datos bolder pdd_6px">'; $data[3] .= '<td class="datos bolder pdd_6px font_10pt">';
$data[3] .= __('Number of alerts match from'); $data[3] .= __('Number of alerts match from');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos">'; $data[3] .= '<td class="datos">';
@ -773,7 +788,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '</tr>'; $data[3] .= '</tr>';
$data[3] .= '<tr class="datos2">'; $data[3] .= '<tr class="datos2">';
$data[3] .= '<td class="datos2 bolder pdd_6px">'; $data[3] .= '<td class="datos2 bolder pdd_6px font_10pt">';
$data[3] .= __('Threshold'); $data[3] .= __('Threshold');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos2">'; $data[3] .= '<td class="datos2">';
@ -1127,8 +1142,6 @@ function show_advance_options_action(id_alert) {
function show_add_action(id_alert) { function show_add_action(id_alert) {
$("#add_action-div-" + id_alert).hide () $("#add_action-div-" + id_alert).hide ()
.dialog ({ .dialog ({
resizable: true,
draggable: true,
title: '<?php echo __('Add action'); ?>', title: '<?php echo __('Add action'); ?>',
modal: true, modal: true,
overlay: { overlay: {
@ -1136,14 +1149,14 @@ function show_add_action(id_alert) {
background: "black" background: "black"
}, },
open: function() { open: function() {
$(`#add_action-div-${id_alert}`).css('overflow', 'hidden'); $(`#add_action-div-${id_alert}`).css('overflow', 'initial');
$("select[id^='action_select'], select[id^='action_select']").select2({ $("select[id^='action_select'], select[id^='action_select']").select2({
tags: true, tags: true,
dropdownParent: $("#add_action-div-" + id_alert) dropdownParent: $("#add_action-div-" + id_alert)
}); });
}, },
width: 455, width: 600,
height: 500 height: 300
}) })
.show (); .show ();
} }
@ -1179,8 +1192,8 @@ function show_display_update_action(id_module_action, alert_id, alert_id_agent_m
dropdownParent: $(`#update_action-div-${alert_id}`) dropdownParent: $(`#update_action-div-${alert_id}`)
}); });
}, },
width: 455, width: 600,
height: 500 height: 350
}) })
.show (); .show ();
} }

View File

@ -743,8 +743,9 @@ switch ($action) {
$search = trim(get_parameter('search', '')); $search = trim(get_parameter('search', ''));
$search_sql = ''; $search_sql = '';
if ($search != '') {
$search_name = '%'.$search."%' OR description LIKE '%".$search.'%'; if ($search !== '') {
$search_name = "(name LIKE '%".$search."%' OR description LIKE '%".$search."%')";
} }
$table_aux = new stdClass(); $table_aux = new stdClass();
@ -830,13 +831,10 @@ switch ($action) {
$return_all_group = false; $return_all_group = false;
} }
if ($search != '') { $filter = ['order' => 'name'];
$filter = [
'name' => $search_name, if ($search !== '') {
'order' => 'name', $filter[] = $search_name;
];
} else {
$filter = ['order' => 'name'];
} }
// Fix : group filter was not working // Fix : group filter was not working

View File

@ -165,6 +165,7 @@ if ($layoutDatas === false) {
$alternativeStyle = true; $alternativeStyle = true;
$parents = visual_map_get_items_parents($idVisualConsole);
foreach ($layoutDatas as $layoutData) { foreach ($layoutDatas as $layoutData) {
$idLayoutData = $layoutData['id']; $idLayoutData = $layoutData['id'];
@ -473,7 +474,6 @@ foreach ($layoutDatas as $layoutData) {
break; break;
default: default:
$parents = visual_map_get_items_parents($idVisualConsole);
$table->data[($i + 1)][4] = html_print_select( $table->data[($i + 1)][4] = html_print_select(
$parents, $parents,
'parent_'.$idLayoutData, 'parent_'.$idLayoutData,
@ -740,9 +740,9 @@ foreach ($layoutDatas as $layoutData) {
$pure = get_parameter('pure', 0); $pure = get_parameter('pure', 0);
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
echo '<form method="post" action="index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id'].'">'; echo '<form class="vc_elem_form" method="post" action="index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id'].'">';
} else { } else {
echo "<form method='post' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console=".$idVisualConsole."'>"; echo "<form class='vc_elem_form' method='post' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console=".$idVisualConsole."'>";
} }
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
@ -807,7 +807,30 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
<script type="text/javascript"> <script type="text/javascript">
$(document).ready (function () { $(document).ready (function () {
$('form.vc_elem_form').submit(function() {
var inputs_array = $(this).serializeArray();
var form_action = {};
form_action.name = 'go';
form_action.value = 'Update';
inputs_array.push(form_action);
var serialized_form_inputs = JSON.stringify(inputs_array);
var ajax_url = "<?php echo (is_metaconsole() === true) ? 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console='.$idVisualConsole : 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id']; ?>";
$.post({
url: ajax_url,
data: { serialized_form_inputs },
dataType: "json",
async: false,
complete: function (data) {
location.reload();
}
});
return false;
});
var added_config = { var added_config = {
"selector": "#tinyMCE_editor", "selector": "#tinyMCE_editor",
"elements": "text-label", "elements": "text-label",

View File

@ -40,6 +40,21 @@ require_once $config['homedir'].'/include/functions_visual_map.php';
require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_agents.php';
enterprise_include_once('include/functions_visual_map.php'); enterprise_include_once('include/functions_visual_map.php');
// Bypass the size limitation of posted inputs given by PHP config token 'max_input_vars'.
if (isset($_POST['serialized_form_inputs']) === true) {
$posted_data_serialized = json_decode($_POST['serialized_form_inputs'], true);
unset($_POST['serialized_form_inputs']);
$posted_data_array = array_combine(
array_column($posted_data_serialized, 'name'),
array_column($posted_data_serialized, 'value')
);
// Merge data to $_POST superglobal.
$_POST += $posted_data_array;
}
// Retrieve the visual console id. // Retrieve the visual console id.
set_unless_defined($idVisualConsole, 0); set_unless_defined($idVisualConsole, 0);
// Set default. // Set default.

View File

@ -31,7 +31,7 @@ global $config;
check_login(); check_login();
if (! check_acl($config['id_user'], 0, 'PM')) { if ((bool) check_acl($config['id_user'], 0, 'PM') === false) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
'Trying to access File manager' 'Trying to access File manager'
@ -43,7 +43,24 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
require_once 'include/functions_filemanager.php'; require_once 'include/functions_filemanager.php';
// Header. // Header.
ui_print_page_header(__('File manager'), '', false, '', true); ui_print_standard_header(
__('File manager'),
'',
false,
'',
true,
[],
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('File manager'),
],
]
);
if (isset($config['filemanager']['message']) === true) { if (isset($config['filemanager']['message']) === true) {
echo $config['filemanager']['message']; echo $config['filemanager']['message'];
@ -66,7 +83,7 @@ $real_directory = realpath($config['homedir'].'/'.$directory);
echo '<h4>'.__('Index of %s', io_safe_input($directory)).'</h4>'; echo '<h4>'.__('Index of %s', io_safe_input($directory)).'</h4>';
$upload_file = (bool) get_parameter('upload_file'); $upload_file = (bool) get_parameter('upload_file');
$create_text_file = (bool) get_parameter('create_text_file'); $create_text_file = (bool) get_parameter('create_text_file');
$default_real_directory = realpath($config['homedir'].'/'); $default_real_directory = realpath($config['homedir'].'/');

View File

@ -322,7 +322,7 @@ if ($create_user) {
return; return;
} }
$user_is_admin = (int) get_parameter('is_admin', 0); $user_is_admin = (get_parameter('is_admin', 0) === 0) ? 0 : 1;
if (users_is_admin() === false && $user_is_admin !== 0) { if (users_is_admin() === false && $user_is_admin !== 0) {
db_pandora_audit( db_pandora_audit(
@ -542,7 +542,7 @@ if ($update_user) {
$values['email'] = (string) get_parameter('email'); $values['email'] = (string) get_parameter('email');
$values['phone'] = (string) get_parameter('phone'); $values['phone'] = (string) get_parameter('phone');
$values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments')))); $values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments'))));
$values['is_admin'] = get_parameter('is_admin', 0); $values['is_admin'] = (get_parameter('is_admin', 0) === 0) ? 0 : 1;
$values['language'] = (string) get_parameter('language'); $values['language'] = (string) get_parameter('language');
$values['timezone'] = (string) get_parameter('timezone'); $values['timezone'] = (string) get_parameter('timezone');
$values['default_event_filter'] = (int) get_parameter('default_event_filter'); $values['default_event_filter'] = (int) get_parameter('default_event_filter');
@ -973,40 +973,24 @@ if ($config['user_can_update_password']) {
} }
} }
$own_info = get_user_info($config['id_user']); if (users_is_admin() === true) {
$global_profile = '<div class="label_select_simple user_global_profile" ><span class="input_label" class"mrgn_0px">'.__('Global Profile').'</span>'; $global_profile = '<div class="label_select_simple" style="display: flex;align-items: center;">';
$global_profile .= '<div class="switch_radio_button">'; $global_profile .= '<p class="edit_user_labels" style="margin-top: 0;">'.__('Administrator user').'</p>';
if (users_is_admin()) { $global_profile .= html_print_checkbox_switch(
$global_profile .= html_print_radio_button_extended(
'is_admin', 'is_admin',
1, 0,
[
'label' => __('Administrator'),
'help_tip' => __('This user has permissions to manage all. An admin user should not requiere additional group permissions, except for using Enterprise ACL.'),
],
$user_info['is_admin'], $user_info['is_admin'],
false, true
'', );
'', $global_profile .= '</div>';
} else {
$global_profile = html_print_input_hidden(
'is_admin_sent',
0,
true true
); );
} }
$global_profile .= html_print_radio_button_extended(
'is_admin',
0,
[
'label' => __('Standard User'),
'help_tip' => __('This user has separated permissions to view data in his group agents, create incidents belong to his groups, add notes in another incidents, create personal assignments or reviews and other tasks, on different profiles'),
],
$user_info['is_admin'],
false,
'',
'',
true
);
$global_profile .= '</div></div>';
$email = '<div class="label_select_simple">'.html_print_input_text_extended( $email = '<div class="label_select_simple">'.html_print_input_text_extended(
'email', 'email',
$user_info['email'], $user_info['email'],
@ -1548,35 +1532,33 @@ $(document).ready (function () {
} else { } else {
show_double_auth_deactivation(); show_double_auth_deactivation();
} }
}); });
$('input:radio[name="is_admin"]').change(function() { $('#checkbox-is_admin').change(function() {
if($('#radiobtn0002').prop('checked')) { if($('#checkbox-is_admin').is(':checked') == true) {
$('#metaconsole_agents_manager_div').show(); $('#metaconsole_agents_manager_div').show();
$('#metaconsole_access_node_div').show(); $('#metaconsole_access_node_div').show();
if($('#checkbox-metaconsole_agents_manager').prop('checked')) { if($('#checkbox-metaconsole_agents_manager').prop('checked')) {
$('#metaconsole_assigned_server_div').show(); $('#metaconsole_assigned_server_div').show();
} }
} } else {
else {
$('#metaconsole_agents_manager_div').hide(); $('#metaconsole_agents_manager_div').hide();
$('#metaconsole_access_node_div').hide(); $('#metaconsole_access_node_div').hide();
$('#metaconsole_assigned_server_div').hide(); $('#metaconsole_assigned_server_div').hide();
} }
}); });
$('#checkbox-metaconsole_agents_manager').change(function() { $('#checkbox-metaconsole_agents_manager').change(function() {
if($('#checkbox-metaconsole_agents_manager').prop('checked')) { if($('#checkbox-metaconsole_agents_manager').prop('checked')) {
$('#metaconsole_assigned_server_div').show(); $('#metaconsole_assigned_server_div').show();
} } else {
else {
$('#metaconsole_assigned_server_div').hide(); $('#metaconsole_assigned_server_div').hide();
} }
}); });
$('input:radio[name="is_admin"]').trigger('change'); $('#checkbox-is_admin').trigger('change');
$('#checkbox-metaconsole_agents_manager').trigger('change'); $('#checkbox-metaconsole_agents_manager').trigger('change');
show_data_section(); show_data_section();
$('#checkbox-ehorus_user_level_enabled').change(function () { $('#checkbox-ehorus_user_level_enabled').change(function () {
switch_ehorus_conf(); switch_ehorus_conf();
@ -1665,7 +1647,7 @@ $(document).ready (function () {
function checkProfiles(e) { function checkProfiles(e) {
e.preventDefault(); e.preventDefault();
if ($('input[name="is_admin"]:checked').val() == 1) { if ($('#checkbox-is_admin').is(':checked') == true) {
// Admin does not require profiles. // Admin does not require profiles.
$('#user_profile_form').submit(); $('#user_profile_form').submit();
} else { } else {

View File

@ -1,18 +1,29 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Ajax script for List view for Alerts.
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas *
// Please see http://pandorafms.org for full contribution list * @category Alerts
// This program is free software; you can redistribute it and/or * @package Community
// modify it under the terms of the GNU General Public License * @subpackage Software agents repository
// as published by the Free Software Foundation for version 2. * @version 1.0.0
// This program is distributed in the hope that it will be useful, * @license See below
// 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. * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ==========================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnológicas S.L
* This code is NOT free software. This code is NOT licenced under GPL2 licence
* You cannot redistribute it without written permission of copyright holder.
* ============================================================================
*/
// Begin.
global $config; global $config;
// Login check // Login check.
check_login(); check_login();
require_once 'include/functions_agents.php'; require_once 'include/functions_agents.php';
@ -60,7 +71,7 @@ if ($get_agent_alerts_simple) {
$alerts = agents_get_alerts_simple($id_agent); $alerts = agents_get_alerts_simple($id_agent);
if (empty($alerts)) { if (empty($alerts) === true) {
echo json_encode(false); echo json_encode(false);
return; return;
} }
@ -424,7 +435,7 @@ if ($show_update_action_menu) {
); );
$data .= '<form id="update_action-'.$id_alert.'" method="post" style="height:85%;">'; $data .= '<form id="update_action-'.$id_alert.'" method="post" style="height:85%;">';
$data .= '<table class="databox_color w100p bg_color222" style="height:100%;">'; $data .= '<table class="w100p bg_color222" style="height:100%;">';
$data .= html_print_input_hidden( $data .= html_print_input_hidden(
'update_action', 'update_action',
1, 1,
@ -442,7 +453,7 @@ if ($show_update_action_menu) {
); );
if (! $id_agente) { if (! $id_agente) {
$data .= '<tr class="datos2">'; $data .= '<tr class="datos2">';
$data .= '<td class="datos2 bolder_6px">'; $data .= '<td class="datos2 bolder pdd_6px font_10pt">';
$data .= __('Agent').'&nbsp;'.ui_print_help_icon( $data .= __('Agent').'&nbsp;'.ui_print_help_icon(
'alert_scalate', 'alert_scalate',
true, true,
@ -463,7 +474,7 @@ if ($show_update_action_menu) {
} }
$data .= '<tr class="datos">'; $data .= '<tr class="datos">';
$data .= '<td class="datos bolder_6px">'; $data .= '<td class="datos bolder pdd_6px font_10pt">';
$data .= __('Module'); $data .= __('Module');
$data .= '</td>'; $data .= '</td>';
$data .= '<td class="datos">'; $data .= '<td class="datos">';
@ -478,7 +489,7 @@ if ($show_update_action_menu) {
$data .= '</td>'; $data .= '</td>';
$data .= '</tr>'; $data .= '</tr>';
$data .= '<tr class="datos2">'; $data .= '<tr class="datos2">';
$data .= '<td class="datos2 bolder_6px">'; $data .= '<td class="datos2 bolder pdd_6px font_10pt">';
$data .= __('Action'); $data .= __('Action');
$data .= '</td>'; $data .= '</td>';
$data .= '<td class="datos2">'; $data .= '<td class="datos2">';
@ -494,12 +505,12 @@ if ($show_update_action_menu) {
true, true,
'', '',
false, false,
'width:150px' 'width:95%'
); );
$data .= '</td>'; $data .= '</td>';
$data .= '</tr>'; $data .= '</tr>';
$data .= '<tr class="datos">'; $data .= '<tr class="datos">';
$data .= '<td class="datos bolder_6px">'; $data .= '<td class="datos bolder pdd_6px font_10pt">';
$data .= __('Number of alerts match from'); $data .= __('Number of alerts match from');
$data .= '</td>'; $data .= '</td>';
$data .= '<td class="datos">'; $data .= '<td class="datos">';
@ -523,7 +534,7 @@ if ($show_update_action_menu) {
$data .= '</td>'; $data .= '</td>';
$data .= '</tr>'; $data .= '</tr>';
$data .= '<tr class="datos2">'; $data .= '<tr class="datos2">';
$data .= '<td class="datos2 bolder_6px">'; $data .= '<td class="datos2 bolder pdd_6px font_10pt">';
$data .= __('Threshold'); $data .= __('Threshold');
$data .= '</td>'; $data .= '</td>';
$data .= '<td class="datos2">'; $data .= '<td class="datos2">';

View File

@ -14,7 +14,7 @@ require_once 'include/functions_custom_graphs.php';
require_once 'include/functions_graph.php'; require_once 'include/functions_graph.php';
$save_custom_graph = (bool) get_parameter('save_custom_graph'); $save_custom_graph = (bool) get_parameter('save_custom_graph');
$print_custom_graph = (bool) get_parameter('print_custom_graph'); $print_custom_graph = (bool) get_parameter('print_custom_graph', false);
$print_sparse_graph = (bool) get_parameter('print_sparse_graph'); $print_sparse_graph = (bool) get_parameter('print_sparse_graph');
$get_graphs = (bool) get_parameter('get_graphs_container'); $get_graphs = (bool) get_parameter('get_graphs_container');
@ -52,13 +52,13 @@ if ($save_custom_graph) {
return; return;
} }
if ($print_custom_graph) { if ($print_custom_graph === true) {
ob_clean(); ob_clean();
$width_value = (int) get_parameter('width', CHART_DEFAULT_WIDTH); $width_value = (int) get_parameter('width', CHART_DEFAULT_WIDTH);
if ($width_value === -1) { if ($width_value === -1) {
$width_value = ''; $width_value = '95%';
} }
$params = [ $params = [
@ -214,7 +214,7 @@ if ($get_graphs) {
]; ];
$table .= grafico_modulo_sparse($params); $table .= grafico_modulo_sparse($params);
$contador --; $contador--;
} }
// $table .= "</br>"; // $table .= "</br>";
@ -253,7 +253,7 @@ if ($get_graphs) {
$params_combined $params_combined
); );
$contador --; $contador--;
} }
break; break;
@ -323,7 +323,7 @@ if ($get_graphs) {
]; ];
$table .= grafico_modulo_sparse($params); $table .= grafico_modulo_sparse($params);
$contador --; $contador--;
} }
} }
break; break;

View File

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

View File

@ -950,10 +950,11 @@ function filemanager_get_file_info(string $filepath)
$realpath = realpath($filepath); $realpath = realpath($filepath);
$filepath = str_replace('\\', '/', $filepath); $filepath = str_replace('\\', '/', $filepath);
$mimeExtend = mime_content_type($filepath);
// Windows compatibility. // Windows compatibility.
$info = [ $info = [
'mime' => MIME_UNKNOWN, 'mime' => MIME_UNKNOWN,
'mime_extend' => mime_content_type($filepath), 'mime_extend' => ($mimeExtend === false) ? '' : $mimeExtend,
'link' => 0, 'link' => 0,
'is_dir' => false, 'is_dir' => false,
'name' => basename($realpath), 'name' => basename($realpath),
@ -969,13 +970,13 @@ function filemanager_get_file_info(string $filepath)
'application/x-gzip', 'application/x-gzip',
'application/x-bzip2', 'application/x-bzip2',
]; ];
if (is_dir($filepath)) { if (is_dir($filepath) === true) {
$info['mime'] = MIME_DIR; $info['mime'] = MIME_DIR;
$info['is_dir'] = true; $info['is_dir'] = true;
$info['size'] = 0; $info['size'] = 0;
} else if (strpos($info['mime_extend'], 'image') !== false) { } else if (strpos($info['mime_extend'], 'image') !== false) {
$info['mime'] = MIME_IMAGE; $info['mime'] = MIME_IMAGE;
} else if (in_array($info['mime_extend'], $zip_mimes)) { } else if (in_array($info['mime_extend'], $zip_mimes) === true) {
$info['mime'] = MIME_ZIP; $info['mime'] = MIME_ZIP;
} else if (strpos($info['mime_extend'], 'text') !== false) { } else if (strpos($info['mime_extend'], 'text') !== false) {
$info['mime'] = MIME_TEXT; $info['mime'] = MIME_TEXT;

View File

@ -1444,7 +1444,7 @@ function graphic_combined_module(
array_push($modules, $modulepush); array_push($modules, $modulepush);
array_push($weights, $source['weight']); array_push($weights, $source['weight']);
if ($source['label'] != '' || $params_combined['labels']) { if (empty($source['label']) === false || $params_combined['labels']) {
$agent_description = agents_get_description($id_agent); $agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent); $agent_group = agents_get_agent_group($id_agent);
$agent_address = agents_get_address($id_agent); $agent_address = agents_get_address($id_agent);

View File

@ -1,19 +1,35 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Get File script
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas *
// Please see http://pandorafms.org for full contribution list * @category File manager
// This program is free software; you can redistribute it and/or * @package Pandora FMS
// modify it under the terms of the GNU Lesser General Public License * @subpackage Community
// as published by the Free Software Foundation; version 2 * @version 1.0.0
// This program is distributed in the hope that it will be useful, * @license See below
// 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. * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
// Don't start a session before this import. * | __/| _ | | _ || _ | _| _ | | ___| |__ |
// The session is configured and started inside the config process. * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 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.
require_once 'config.php'; require_once 'config.php';
require_once 'functions.php'; require_once 'functions.php';
require_once 'functions_ui.php';
require_once 'functions_filemanager.php'; require_once 'functions_filemanager.php';
global $config; global $config;
@ -22,21 +38,17 @@ check_login();
$auth_method = db_get_value('value', 'tconfig', 'token', 'auth'); $auth_method = db_get_value('value', 'tconfig', 'token', 'auth');
if ($auth_method != 'ad' && $auth_method != 'ldap') { if ($auth_method !== 'ad' && $auth_method !== 'ldap') {
include_once 'auth/'.$auth_method.'.php'; include_once 'auth/'.$auth_method.'.php';
} }
$hash = get_parameter('hash');
$styleError = 'background:url("../images/err.png") no-repeat scroll 0 0 transparent; padding:4px 1px 6px 30px; color:#CC0000;'; $file_raw = get_parameter('file');
$file_raw = get_parameter('file', null);
$file = base64_decode(urldecode($file_raw)); $file = base64_decode(urldecode($file_raw));
$hash = get_parameter('hash', null); if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$config['server_unique_identifier']) || isset($_SERVER['HTTP_REFERER']) === false) {
$errorMessage = __('Security error. Please contact the administrator.');
if ($file === '' || $hash === '' || $hash !== md5($file_raw.$config['server_unique_identifier']) || !isset($_SERVER['HTTP_REFERER'])) {
echo "<h3 style='".$styleError."'>".__('Security error. Please contact the administrator.').'</h3>';
} else { } else {
$downloadable_file = ''; $downloadable_file = '';
$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY)); $parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
@ -64,15 +76,22 @@ if ($file === '' || $hash === '' || $hash !== md5($file_raw.$config['server_uniq
break; break;
default: default:
// Wrong action.
$downloadable_file = ''; $downloadable_file = '';
// Do nothing
break; break;
} }
} }
if ($downloadable_file === '' || !file_exists($downloadable_file)) { if (empty($downloadable_file) === true || file_exists($downloadable_file) === false) {
echo "<h3 style='".$styleError."'>".__('File is missing in disk storage. Please contact the administrator.').'</h3>'; $errorMessage = __('File is missing in disk storage. Please contact the administrator.');
// Avoid possible inifite loop with referer.
if (isset($_SERVER['HTTP_ORIGIN']) === true && $_SERVER['HTTP_REFERER'] === $_SERVER['HTTP_ORIGIN'].$_SERVER['REQUEST_URI']) {
$refererPath = ui_get_full_url('index.php');
} else {
$refererPath = $_SERVER['HTTP_REFERER'];
}
} else { } else {
// Everything went well.
header('Content-type: aplication/octet-stream;'); header('Content-type: aplication/octet-stream;');
header('Content-type: '.mime_content_type($downloadable_file).';'); header('Content-type: '.mime_content_type($downloadable_file).';');
header('Content-Length: '.filesize($downloadable_file)); header('Content-Length: '.filesize($downloadable_file));
@ -80,3 +99,18 @@ if ($file === '' || $hash === '' || $hash !== md5($file_raw.$config['server_uniq
readfile($downloadable_file); readfile($downloadable_file);
} }
} }
?>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
var refererPath = '<?php echo $refererPath; ?>';
var errorFileOutput = '<?php echo $errorMessage; ?>';
document.body.innerHTML = `<form action="` + refererPath + `" name="failedReturn" method="post" style="display:none;">
<input type="hidden" name="errorFileOutput" value="` + errorFileOutput + `" />
</form>`;
document.forms['failedReturn'].submit();
}, false);
</script>

View File

@ -479,11 +479,10 @@ class Widget
} else if ($this->loadError === true) { } else if ($this->loadError === true) {
$output .= '<div class="container-center">'; $output .= '<div class="container-center">';
$output .= \ui_print_error_message( $output .= \ui_print_error_message(
__('Widget cannot be loaded'), __('Widget cannot be loaded').'. '.__('Please, configure the widget again to recover it'),
'', '',
true true
); );
$output .= __('Please, configure the widget again to recover it');
$output .= '</div>'; $output .= '</div>';
} else { } else {
$output .= $this->load(); $output .= $this->load();

View File

@ -182,6 +182,17 @@ class MapsMadeByUser extends Widget
$this->configurationRequired = false; $this->configurationRequired = false;
if (empty($this->values['vcId']) === true) { if (empty($this->values['vcId']) === true) {
$this->configurationRequired = true; $this->configurationRequired = true;
} else {
$check_exist = db_get_value(
'id',
'tlayout',
'id',
$this->values['vcId']
);
if ($check_exist === false) {
$this->loadError = true;
}
} }
$this->overflow_scrollbars = false; $this->overflow_scrollbars = false;
@ -368,7 +379,7 @@ class MapsMadeByUser extends Widget
$visualConsole = VisualConsole::fromDB( $visualConsole = VisualConsole::fromDB(
['id' => $this->values['vcId']] ['id' => $this->values['vcId']]
); );
} catch (Throwable $e) { } catch (\Throwable $e) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
'Trying to access visual console without Id' 'Trying to access visual console without Id'

View File

@ -172,6 +172,17 @@ class ReportsWidget extends Widget
$this->configurationRequired = false; $this->configurationRequired = false;
if (empty($this->values['reportId']) === true) { if (empty($this->values['reportId']) === true) {
$this->configurationRequired = true; $this->configurationRequired = true;
} else {
$check_exist = db_get_value(
'id_report',
'treport',
'id_report',
$this->values['reportId']
);
if ($check_exist === false) {
$this->loadError = true;
}
} }
$this->overflow_scrollbars = false; $this->overflow_scrollbars = false;

View File

@ -801,7 +801,7 @@ div.module-graph .gauge_d3_class {
.visual-console-item .digital-clock { .visual-console-item .digital-clock {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: space-evenly;
justify-items: center; justify-items: center;
align-content: center; align-content: center;
align-items: center; align-items: center;

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -28,14 +28,14 @@
*/ */
// Begin. // Begin.
if (!defined('__PAN_XHPROF__')) { if (defined('__PAN_XHPROF__') === false) {
define('__PAN_XHPROF__', 0); define('__PAN_XHPROF__', 0);
} }
require 'vendor/autoload.php'; require 'vendor/autoload.php';
if (__PAN_XHPROF__ === 1) { if (__PAN_XHPROF__ === 1) {
if (function_exists('tideways_xhprof_enable')) { if (function_exists('tideways_xhprof_enable') === true) {
tideways_xhprof_enable(); tideways_xhprof_enable();
} else { } else {
error_log('Cannot find tideways_xhprof_enable function'); error_log('Cannot find tideways_xhprof_enable function');
@ -44,7 +44,7 @@ if (__PAN_XHPROF__ === 1) {
// Set character encoding to UTF-8 // Set character encoding to UTF-8
// fixes a lot of multibyte character issues. // fixes a lot of multibyte character issues.
if (function_exists('mb_internal_encoding')) { if (function_exists('mb_internal_encoding') === true) {
mb_internal_encoding('UTF-8'); mb_internal_encoding('UTF-8');
} }
@ -52,10 +52,10 @@ if (function_exists('mb_internal_encoding')) {
// Activate gives more error information, not useful for production sites. // Activate gives more error information, not useful for production sites.
$develop_bypass = 0; $develop_bypass = 0;
if ($develop_bypass != 1) { if ($develop_bypass !== 1) {
// If no config file, automatically try to install. // If no config file, automatically try to install.
if (!file_exists('include/config.php')) { if (file_exists('include/config.php') === false) {
if (!file_exists('install.php')) { if (file_exists('install.php') === false) {
$url = explode('/', $_SERVER['REQUEST_URI']); $url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url = 0; $flag_url = 0;
foreach ($url as $key => $value) { foreach ($url as $key => $value) {
@ -86,25 +86,25 @@ if ($develop_bypass != 1) {
exit; exit;
} }
if (isset($_POST['rename_file'])) { if (isset($_POST['rename_file']) === true) {
$rename_file_install = (bool) $_POST['rename_file']; $rename_file_install = (bool) $_POST['rename_file'];
if ($rename_file_install) { if ($rename_file_install === true) {
$salida_rename = rename('install.php', 'install_old.php'); $salida_rename = rename('install.php', 'install_old.php');
} }
} }
// Check installer presence. // Check installer presence.
if (file_exists('install.php')) { if (file_exists('install.php') === true) {
$login_screen = 'error_install'; $login_screen = 'error_install';
include 'general/error_screen.php'; include 'general/error_screen.php';
exit; exit;
} }
// Check perms for config.php. // Check perms for config.php.
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
if ((substr(sprintf('%o', fileperms('include/config.php')), -4) != '0600') if ((substr(sprintf('%o', fileperms('include/config.php')), -4) !== '0600')
&& (substr(sprintf('%o', fileperms('include/config.php')), -4) != '0660') && (substr(sprintf('%o', fileperms('include/config.php')), -4) !== '0660')
&& (substr(sprintf('%o', fileperms('include/config.php')), -4) != '0640') && (substr(sprintf('%o', fileperms('include/config.php')), -4) !== '0640')
) { ) {
$url = explode('/', $_SERVER['REQUEST_URI']); $url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url = 0; $flag_url = 0;
@ -129,8 +129,8 @@ if ($develop_bypass != 1) {
} }
} }
if ((!file_exists('include/config.php')) if ((file_exists('include/config.php') === false)
|| (!is_readable('include/config.php')) || (is_readable('include/config.php') === false)
) { ) {
$login_screen = 'error_noconfig'; $login_screen = 'error_noconfig';
include 'general/error_screen.php'; include 'general/error_screen.php';
@ -144,7 +144,7 @@ if ((!file_exists('include/config.php'))
require_once 'include/config.php'; require_once 'include/config.php';
require_once 'include/functions_config.php'; require_once 'include/functions_config.php';
if (isset($config['console_log_enabled']) && $config['console_log_enabled'] == 1) { if (isset($config['console_log_enabled']) === true && (int) $config['console_log_enabled'] === 1) {
ini_set('log_errors', 1); ini_set('log_errors', 1);
ini_set('error_log', $config['homedir'].'/log/console.log'); ini_set('error_log', $config['homedir'].'/log/console.log');
} else { } else {
@ -152,26 +152,26 @@ if (isset($config['console_log_enabled']) && $config['console_log_enabled'] == 1
ini_set('error_log', ''); ini_set('error_log', '');
} }
if (isset($config['error'])) { if (isset($config['error']) === true) {
$login_screen = $config['error']; $login_screen = $config['error'];
include 'general/error_screen.php'; include 'general/error_screen.php';
exit; exit;
} }
// If metaconsole activated, redirect to it. // If metaconsole activated, redirect to it.
if (is_metaconsole()) { if (is_metaconsole() === true) {
header('Location: '.ui_get_full_url('index.php')); header('Location: '.ui_get_full_url('index.php'));
// Always exit after sending location headers. // Always exit after sending location headers.
exit; exit;
} }
if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) { if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php') === true) {
include_once ENTERPRISE_DIR.'/include/functions_login.php'; include_once ENTERPRISE_DIR.'/include/functions_login.php';
} }
if (!empty($config['https']) && empty($_SERVER['HTTPS'])) { if (empty($config['https']) === false && empty($_SERVER['HTTPS']) === true) {
$query = ''; $query = '';
if (count($_REQUEST)) { if (count($_REQUEST) > 0) {
// Some (old) browsers don't like the ?&key=var. // Some (old) browsers don't like the ?&key=var.
$query .= '?1=1'; $query .= '?1=1';
} }
@ -208,8 +208,11 @@ if (get_parameter('refr') != null) {
$config['refr'] = (int) get_parameter('refr'); $config['refr'] = (int) get_parameter('refr');
} }
// Get possible errors with files.
$errorFileOutput = (string) get_parameter('errorFileOutput');
$delete_file = get_parameter('del_file'); $delete_file = get_parameter('del_file');
if ($delete_file == 'yes_delete') { if ($delete_file === 'yes_delete') {
$salida_delete = shell_exec('rm /var/www/html/pandora_console/install.php'); $salida_delete = shell_exec('rm /var/www/html/pandora_console/install.php');
} }
@ -251,9 +254,9 @@ $validatedCSRF = validate_csrf_code();
$process_login = false; $process_login = false;
// Update user password. // Update user password.
$change_pass = get_parameter_post('renew_password', 0); $change_pass = (int) get_parameter_post('renew_password');
if ($change_pass == 1) { if ($change_pass === 1) {
$password_old = (string) get_parameter_post('old_password', ''); $password_old = (string) get_parameter_post('old_password', '');
$password_new = (string) get_parameter_post('new_password', ''); $password_new = (string) get_parameter_post('new_password', '');
$password_confirm = (string) get_parameter_post('confirm_new_password', ''); $password_confirm = (string) get_parameter_post('confirm_new_password', '');
@ -269,19 +272,19 @@ if (strlen($search) > 0) {
$config['search_keywords'] = io_safe_input(trim(io_safe_output(get_parameter('keywords')))); $config['search_keywords'] = io_safe_input(trim(io_safe_output(get_parameter('keywords'))));
// If not search category providad, we'll use an agent search. // If not search category providad, we'll use an agent search.
$config['search_category'] = get_parameter('search_category', 'all'); $config['search_category'] = get_parameter('search_category', 'all');
if (($config['search_keywords'] != 'Enter keywords to search') && (strlen($config['search_keywords']) > 0)) { if (($config['search_keywords'] !== 'Enter keywords to search') && (strlen($config['search_keywords']) > 0)) {
$searchPage = true; $searchPage = true;
} }
} }
// Login process. // Login process.
enterprise_include_once('include/auth/saml.php'); enterprise_include_once('include/auth/saml.php');
if (!isset($config['id_user'])) { if (isset($config['id_user']) === false) {
// Clear error messages. // Clear error messages.
unset($_COOKIE['errormsg']); unset($_COOKIE['errormsg']);
setcookie('errormsg', null, -1); setcookie('errormsg', null, -1);
if (isset($_GET['login'])) { if (isset($_GET['login']) === true) {
include_once 'include/functions_db.php'; include_once 'include/functions_db.php';
// Include it to use escape_string_sql function. // Include it to use escape_string_sql function.
$config['auth_error'] = ''; $config['auth_error'] = '';
@ -298,15 +301,15 @@ if (!isset($config['id_user'])) {
// If the auth_code exists, we assume the user has come from // If the auth_code exists, we assume the user has come from
// double authorization page. // double authorization page.
if (isset($_POST['auth_code'])) { if (isset($_POST['auth_code']) === true) {
$double_auth_success = false; $double_auth_success = false;
// The double authentication is activated and the user has // The double authentication is activated and the user has
// surpassed the first step (the login). // surpassed the first step (the login).
// Now the authentication code provided will be checked. // Now the authentication code provided will be checked.
if (isset($_SESSION['prepared_login_da'])) { if (isset($_SESSION['prepared_login_da']) === true) {
if (isset($_SESSION['prepared_login_da']['id_user']) if (isset($_SESSION['prepared_login_da']['id_user']) === true
&& isset($_SESSION['prepared_login_da']['timestamp']) && isset($_SESSION['prepared_login_da']['timestamp']) === true
) { ) {
// The user has a maximum of 5 minutes to introduce // The user has a maximum of 5 minutes to introduce
// the double auth code. // the double auth code.
@ -344,7 +347,7 @@ if (!isset($config['id_user'])) {
// Error message. // Error message.
$config['auth_error'] = __("The code shouldn't be empty"); $config['auth_error'] = __("The code shouldn't be empty");
if (!isset($_SESSION['prepared_login_da']['attempts'])) { if (isset($_SESSION['prepared_login_da']['attempts']) !== false) {
$_SESSION['prepared_login_da']['attempts'] = 0; $_SESSION['prepared_login_da']['attempts'] = 0;
} }
@ -397,7 +400,7 @@ if (!isset($config['id_user'])) {
// the 2nd auth step. // the 2nd auth step.
$nick_in_db = $_SESSION['prepared_login_da']['id_user']; $nick_in_db = $_SESSION['prepared_login_da']['id_user'];
$expired_pass = false; $expired_pass = false;
} else if (($config['auth'] == 'saml') && ($login_button_saml)) { } else if (($config['auth'] === 'saml') && ($login_button_saml)) {
$saml_user_id = enterprise_hook('saml_process_user_login'); $saml_user_id = enterprise_hook('saml_process_user_login');
if (!$saml_user_id) { if (!$saml_user_id) {
$login_failed = true; $login_failed = true;
@ -431,7 +434,7 @@ if (!isset($config['id_user'])) {
// process_user_login is a virtual function which should be defined in each auth file. // process_user_login is a virtual function which should be defined in each auth file.
// It accepts username and password. The rest should be internal to the auth file. // It accepts username and password. The rest should be internal to the auth file.
// The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it // The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it
// process_user_login should return false in case of errors or invalid login, the nickname if correct // process_user_login should return false in case of errors or invalid login, the nickname if correct.
$nick_in_db = process_user_login($nick, $pass); $nick_in_db = process_user_login($nick, $pass);
$expired_pass = false; $expired_pass = false;
@ -1479,7 +1482,7 @@ require 'include/php_to_js_values.php';
var oShow = jQuery.fn.show; var oShow = jQuery.fn.show;
var oHide = jQuery.fn.hide; var oHide = jQuery.fn.hide;
jQuery.fn.show = function() { jQuery.fn.show = function () {
var rv = oShow.apply(this, arguments); var rv = oShow.apply(this, arguments);
adjustFooter(); adjustFooter();
return rv; return rv;
@ -1506,6 +1509,17 @@ require 'include/php_to_js_values.php';
} }
<?php if (empty($errorFileOutput) === false) : ?>
// There are one issue with the file that you trying to catch. Show a dialog with message.
$(document).ready(function() {
confirmDialog({
title: "<?php echo __('Error'); ?>",
message: "<?php echo io_safe_output($errorFileOutput); ?>",
hideCancelButton: true,
});
});
<?php endif; ?>
function show_modal(id) { function show_modal(id) {
var match = /notification-(.*)-id-([0-9]+)/.exec(id); var match = /notification-(.*)-id-([0-9]+)/.exec(id);
if (!match) { if (!match) {

View File

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

View File

@ -18,7 +18,7 @@ require_once 'include/functions_agents.php';
require_once 'include/functions_custom_graphs.php'; require_once 'include/functions_custom_graphs.php';
ui_require_javascript_file('calendar'); ui_require_javascript_file('calendar');
if (! check_acl($config['id_user'], $id_grupo, 'AR') && ! check_acl($config['id_user'], 0, 'AW')) { if (!check_acl($config['id_user'], $id_grupo, 'AR') && !check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
'Trying to access (read) to agent '.agents_get_name($id_agente) 'Trying to access (read) to agent '.agents_get_name($id_agente)
@ -53,20 +53,20 @@ $modules_networkmap_no_proc = agents_get_modules(
false, false,
[ [
'id_modulo' => 2, 'id_modulo' => 2,
// networkmap type // Networkmap type.
'id_tipo_modulo' => [ 'id_tipo_modulo' => [
'<>2', '<>2',
// != generic_proc // != generic_proc
'<>6', '<>6',
// != remote_icmp_proc // != remote_icmp_proc
'<>9', '<>9',
// != remote_tcp_proc // != remote_tcp_proc
'<>6', '<>6',
// != remote_tcp_proc // != remote_tcp_proc
'<>18', '<>18',
// != remote_snmp_proc // != remote_snmp_proc
'<>21', '<>21',
// != async_proc // != async_proc
'<>31', '<>31',
], ],
// != web_proc // != web_proc
@ -82,17 +82,17 @@ $modules_others = agents_get_modules(
[ [
'id_tipo_modulo' => [ 'id_tipo_modulo' => [
'<>2', '<>2',
// != generic_proc // != generic_proc
'<>6', '<>6',
// != remote_icmp_proc // != remote_icmp_proc
'<>9', '<>9',
// != remote_tcp_proc // != remote_tcp_proc
'<>6', '<>6',
// != remote_tcp_proc // != remote_tcp_proc
'<>18', '<>18',
// != remote_snmp_proc // != remote_snmp_proc
'<>21', '<>21',
// != async_proc // != async_proc
'<>31', '<>31',
], ],
// != web_proc // != web_proc
@ -133,7 +133,7 @@ if (empty($modules_boolean)) {
$modules_boolean = []; $modules_boolean = [];
} }
// Cleaned the duplicate $modules and other things // Cleaned the duplicate $modules and other things.
$modules_others = array_diff_key( $modules_others = array_diff_key(
$modules_others, $modules_others,
$modules_networkmap_no_proc $modules_networkmap_no_proc
@ -278,7 +278,7 @@ if ($start_date != $current) {
} }
if ($combined) { if ($combined) {
// Pass the $modules before the ajax call // Pass the $modules before the ajax call.
echo '<div class="combined-graph-container center w100p"'.'data-period="'.$period.'"'.'data-stacked="'.CUSTOM_GRAPH_LINE.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>'; echo '<div class="combined-graph-container center w100p"'.'data-period="'.$period.'"'.'data-stacked="'.CUSTOM_GRAPH_LINE.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
} else { } else {
foreach ($modules as $id_module) { foreach ($modules as $id_module) {
@ -296,7 +296,7 @@ echo '<div id="graph-error-message" class="invisible">';
ui_print_error_message(__('There was an error loading the graph')); ui_print_error_message(__('There was an error loading the graph'));
echo '</div>'; echo '</div>';
// Dialog to save the custom graph // Dialog to save the custom graph.
echo "<div id='dialog_save_custom_graph' class='invisible'>"; echo "<div id='dialog_save_custom_graph' class='invisible'>";
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
@ -314,40 +314,40 @@ $table->data[0][1] = html_print_input_text(
html_print_table($table); html_print_table($table);
echo "<div style='width: ".$table->width."; text-align: right;'>"; echo "<div style='width: ".$table->width."; text-align: right;'>";
html_print_image( html_print_image(
'images/spinner.gif', 'images/spinner.gif',
false, false,
[ [
'style' => 'display: none', 'style' => 'display: none',
'class' => 'loading_save', 'class' => 'loading_save',
] ]
); );
html_print_image( html_print_image(
'images/ok.png', 'images/ok.png',
false, false,
[ [
'style' => 'display: none', 'style' => 'display: none',
'class' => 'ok_save', 'class' => 'ok_save',
] ]
); );
html_print_image( html_print_image(
'images/error_red.png', 'images/error_red.png',
false, false,
[ [
'style' => 'display: none', 'style' => 'display: none',
'class' => 'error_save', 'class' => 'error_save',
] ]
); );
html_print_button( html_print_button(
__('Save'), __('Save'),
'save_custom_graph', 'save_custom_graph',
false, false,
'save_custom_graph_second_step();', 'save_custom_graph_second_step();',
'class="button_save sub save"' 'class="button_save sub save"'
); );
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$("#dialog_save_custom_graph").dialog({ $("#dialog_save_custom_graph").dialog({
@ -358,50 +358,49 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
autoOpen: false autoOpen: false
}); });
}); });
$('#button-save_custom_graph').click(function (event) { $('#button-save_custom_graph').click(function(event) {
$("#dialog_save_custom_graph").dialog("open"); $("#dialog_save_custom_graph").dialog("open");
}); });
function save_custom_graph_second_step() { function save_custom_graph_second_step() {
$(".button_save").disable(); $(".button_save").disable();
$(".ok_save").hide(); $(".ok_save").hide();
$(".error_save").hide(); $(".error_save").hide();
$(".loading_save").show(); $(".loading_save").show();
var params = {}; var params = {};
params["id_modules"] = <?php echo json_encode($modules); ?>; params["id_modules"] = <?php echo json_encode($modules); ?>;
params["name"] = $("input[name='name_custom_graph']").val(); params["name"] = $("input[name='name_custom_graph']").val();
params["description"] = "<?php echo __('Custom graph create from the tab graphs in the agent.'); ?>"; params["description"] = "<?php echo __('Custom graph create from the tab graphs in the agent.'); ?>";
params["stacked"] = <?php echo CUSTOM_GRAPH_LINE; ?>; params["stacked"] = parseInt($("#option_type").val());
params["width"] = <?php echo $width; ?>; params["width"] = <?php echo $width; ?>;
params["height"] = <?php echo $height; ?>; params["height"] = <?php echo $height; ?>;
params["events"] = <?php echo $draw_events; ?>; params["events"] = <?php echo $draw_events; ?>;
params["period"] = <?php echo $period; ?>; params["period"] = <?php echo $period; ?>;
params["save_custom_graph"] = 1; params["save_custom_graph"] = 1;
params["page"] = "include/ajax/graph.ajax"; params["page"] = "include/ajax/graph.ajax";
jQuery.ajax ({ jQuery.ajax({
data: params, data: params,
dataType: "json", dataType: "json",
type: "POST", type: "POST",
url: "ajax.php", url: "ajax.php",
success: function (data) { success: function(data) {
$(".loading_save").hide(); $(".loading_save").hide();
if (data.correct) { if (data.correct) {
$(".ok_save").show(); $(".ok_save").show();
} } else {
else {
$(".error_save").show(); $(".error_save").show();
$(".button_save").enable(); $(".button_save").enable();
} }
} }
}); });
} }
// Load graphs // Load graphs
$(document).ready(function() { $(document).ready(function() {
$('#combined').change(function () { $('#combined').change(function() {
if ($('#combined').val() == 1) { if ($('#combined').val() == 1) {
$('#option_type').empty(); $('#option_type').empty();
$('#option_type').append($('<option>', { $('#option_type').append($('<option>', {
@ -420,8 +419,7 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
value: 3, value: 3,
text: "<?php echo __('Line stack'); ?>" text: "<?php echo __('Line stack'); ?>"
})); }));
} } else {
else {
$('#option_type').empty(); $('#option_type').empty();
$('#option_type').append($('<option>', { $('#option_type').append($('<option>', {
value: 0, value: 0,
@ -434,16 +432,16 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
} }
}); });
var getModulesPHP = function () { var getModulesPHP = function() {
return <?php echo json_encode($modules); ?>; return <?php echo json_encode($modules); ?>;
} }
var requestGraph = function (type, data) { var requestGraph = function(type, data) {
data = data || {}; data = data || {};
type = type || 'custom'; type = type || 'custom';
data.page = 'include/ajax/graph.ajax'; data.page = 'include/ajax/graph.ajax';
data['print_' + type + '_graph'] = 1; data['print_' + type + '_graph'] = 1;
return $.ajax({ return $.ajax({
url: 'ajax.php', url: 'ajax.php',
type: 'POST', type: 'POST',
@ -451,8 +449,8 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
data: data data: data
}) })
} }
var requestCustomGraph = function (graphId, width, height, period, stacked, date, modules) { var requestCustomGraph = function(graphId, width, height, period, stacked, date, modules) {
return requestGraph('custom', { return requestGraph('custom', {
page: 'include/ajax/graph.ajax', page: 'include/ajax/graph.ajax',
print_custom_graph: 1, print_custom_graph: 1,
@ -465,8 +463,8 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
modules_param: modules modules_param: modules
}); });
} }
var requestSparseGraph = function (moduleId, period, showEvents, width, height, title, showAlerts, date, unit, type_g) { var requestSparseGraph = function(moduleId, period, showEvents, width, height, title, showAlerts, date, unit, type_g) {
return requestGraph('sparse', { return requestGraph('sparse', {
page: 'include/ajax/graph.ajax', page: 'include/ajax/graph.ajax',
print_sparse_graph: 1, print_sparse_graph: 1,
@ -482,19 +480,19 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
type_g: type_g type_g: type_g
}); });
} }
var loadCustomGraphs = function () { var loadCustomGraphs = function() {
$('div.combined-graph-container').each(function (index, el) { $('div.combined-graph-container').each(function(index, el) {
loadCustomGraph(el); loadCustomGraph(el);
}); });
} }
var loadCustomGraph = function (element) { var loadCustomGraph = function(element) {
var $container = $(element); var $container = $(element);
var $errorMessage = $('div#graph-error-message'); var $errorMessage = $('div#graph-error-message');
var period = $container.data('period'); var period = $container.data('period');
var conf_stacked = parseInt($("#option_type").val()); var conf_stacked = parseInt($("#option_type").val());
switch (conf_stacked) { switch (conf_stacked) {
case 0: case 0:
var stacked = 0; var stacked = 0;
@ -512,29 +510,29 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
var date = $container.data('date'); var date = $container.data('date');
var height = $container.data('height'); var height = $container.data('height');
var modules = getModulesPHP(); var modules = getModulesPHP();
var width = $container.width() - 20; var width = $container.width() - 20;
var handleSuccess = function (data) { var handleSuccess = function(data) {
$container.html(data); $container.html(data);
} }
var handleError = function (xhr, textStatus, errorThrown) { var handleError = function(xhr, textStatus, errorThrown) {
$container.html($errorMessage.html()); $container.html($errorMessage.html());
} }
requestCustomGraph(0, -1, height, period, stacked, date, modules) requestCustomGraph(0, -1, height, period, stacked, date, modules)
.done(handleSuccess) .done(handleSuccess)
.fail(handleError); .fail(handleError);
} }
var loadSparseGraphs = function () { var loadSparseGraphs = function() {
$('div.sparse-graph-container').each(function (index, el) { $('div.sparse-graph-container').each(function(index, el) {
loadSparseGraph(el); loadSparseGraph(el);
}); });
} }
var loadSparseGraph = function (element) { var loadSparseGraph = function(element) {
var $container = $(element); var $container = $(element);
var $errorMessage = $('div#graph-error-message'); var $errorMessage = $('div#graph-error-message');
var moduleId = $container.data('id_module'); var moduleId = $container.data('id_module');
@ -547,7 +545,7 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
var date = $container.data('date'); var date = $container.data('date');
var height = $container.data('height'); var height = $container.data('height');
var conf_stacked = parseInt($("#option_type").val()); var conf_stacked = parseInt($("#option_type").val());
switch (conf_stacked) { switch (conf_stacked) {
case 0: case 0:
var type_g = 'area'; var type_g = 'area';
@ -556,13 +554,13 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
var type_g = 'line'; var type_g = 'line';
break; break;
} }
var width = $container.width() - 20; var width = $container.width() - 20;
var handleSuccess = function (data) { var handleSuccess = function(data) {
$container.html(data); $container.html(data);
} }
var handleError = function (xhr, textStatus, errorThrown) { var handleError = function(xhr, textStatus, errorThrown) {
$container.html($errorMessage.html()); $container.html($errorMessage.html());
} }
@ -570,9 +568,9 @@ echo "<div style='width: ".$table->width."; text-align: right;'>";
.done(handleSuccess) .done(handleSuccess)
.fail(handleError); .fail(handleError);
} }
// Run // Run
loadCustomGraphs(); loadCustomGraphs();
loadSparseGraphs(); loadSparseGraphs();
}); });
</script> </script>

View File

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

View File

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

View File

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

View File

@ -220,12 +220,11 @@ if ($writeDashboards === 1) {
$output = '<a href="#" class="float-right" onclick=\''; $output = '<a href="#" class="float-right" onclick=\'';
$output .= 'show_option_dialog('.json_encode( $output .= 'show_option_dialog('.json_encode(
[ [
'title' => $text, 'title' => $text,
'btn_text' => __('Ok'), 'btn_text' => __('Ok'),
'btn_cancel' => __('Cancel'), 'btn_cancel' => __('Cancel'),
'url' => $ajaxController, 'url' => $ajaxController,
'url_ajax' => ui_get_full_url('ajax.php'), 'url_ajax' => ui_get_full_url('ajax.php'),
'dashboardId' => $dashboardId,
] ]
); );
$output .= ')\'>'; $output .= ')\'>';

View File

@ -31,7 +31,6 @@ require_once $config['homedir'].'/include/class/HTML.class.php';
$form = [ $form = [
'id' => 'form-search-widget', 'id' => 'form-search-widget',
'action' => $url,
'onsubmit' => 'return false;', 'onsubmit' => 'return false;',
'class' => 'modal-dashboard', 'class' => 'modal-dashboard',
'enctype' => 'multipart/form-data', 'enctype' => 'multipart/form-data',

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.763-220629 Version: 7.0NG.763-220630
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
.visual-console-item .digital-clock { .visual-console-item .digital-clock {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: space-evenly;
justify-items: center; justify-items: center;
align-content: center; align-content: center;
align-items: center; align-items: center;