Merge branch 'develop' into ent-13188-no-salen-todos-lo-modulos-en-custom-graphs

This commit is contained in:
Pablo Aragon 2024-04-29 10:09:01 +02:00
commit a95943479a
86 changed files with 655 additions and 298 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.776-240423
Version: 7.0NG.776-240429
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.776-240423"
pandora_version="7.0NG.776-240429"
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

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

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.776
%define release 240423
%define release 240429
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.776
%define release 240423
%define release 240429
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.776
%define release 240423
%define release 240429
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.776
%define release 240423
%define release 240429
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.776
%define release 240423
%define release 240429
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.776"
PI_BUILD="240423"
PI_BUILD="240429"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{240423}
{240429}
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.776 Build 240423")
#define PANDORA_VERSION ("7.0NG.776 Build 240429")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.776(Build 240423))"
VALUE "ProductVersion", "(7.0NG.776(Build 240429))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.776-240423
Version: 7.0NG.776-240429
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.776-240423"
pandora_version="7.0NG.776-240429"
package_pear=0
package_pandora=1

View File

@ -55,7 +55,7 @@ switch ($graph) {
if ($os == 'windows') {
$data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(httpd)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."');
} else {
$apache = exec("ps aux | grep apache2 | grep -v safe | grep -v grep && echo 1 || echo 0") == 1 ? "apache2" : "apache";
$apache = exec('ps aux | grep apache2 | grep -v safe | grep -v grep && echo 1 || echo 0') == 1 ? 'apache2' : 'apache';
$data = exec("ps aux | grep $apache | grep -v safe | grep -v grep | awk '{ sum+=$3 } END { print sum }'");
}
break;

View File

@ -7754,4 +7754,9 @@ ALTER TABLE `tdeployment_hosts` DROP COLUMN `arch`;
-- Update all deployment recon tasks port
UPDATE `trecon_task` SET `field4` = 41121 WHERE `type` = 9;
-- Update execution in proxmox discovery plugin
SET @short_name = 'pandorafms.proxmox';
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
UPDATE `tdiscovery_apps_executions` SET `execution` = ''_exec1_' --conf '_tempfileProxmox_'' WHERE `id_app` = @id_app;
COMMIT;

View File

@ -52,7 +52,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
}
// ======= Servers List ===============================================
if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) {
if ((bool) check_acl($config['id_user'], 0, 'PM') !== false) {
$servers = [];
$servers_info = servers_get_info();
@ -363,20 +363,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
$display_counter = 'display:none';
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$header_setup .= '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup&section=general').'">';
$header_setup .= html_print_image(
'images/configuration@svg.svg',
true,
[
'alt' => __('Setup'),
'class' => 'bot invert_filter main_menu_icon',
'title' => __('Setup'),
]
);
$header_setup .= '</a></div>';
}
$header_autorefresh = '<div id="header_autorefresh">';
$header_autorefresh .= $autorefresh_link_open_img;
$header_autorefresh .= $autorefresh_img;
@ -391,6 +377,20 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
$header_autorefresh_counter .= '</div>';
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$header_setup .= '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup&section=general').'">';
$header_setup .= html_print_image(
'images/configuration@svg.svg',
true,
[
'alt' => __('Setup'),
'class' => 'bot invert_filter main_menu_icon',
'title' => __('Setup'),
]
);
$header_setup .= '</a></div>';
}
$modal_box = '<div id="modal_help" class="invisible">
<div id="modal-feedback-form" class="invisible"></div>
<div id="msg-header" class="invisible"></div>

View File

@ -906,7 +906,8 @@ $table->data[0][] = html_print_label_input_block(
false,
true,
'',
$disabled_in_execution
$disabled_in_execution,
'width: 100%;'
)
);
@ -939,8 +940,9 @@ $table->data[1][] = html_print_label_input_block(
true,
false,
true,
'',
$disabled_in_execution
'w100p',
$disabled_in_execution,
'width: 100%;'
).ui_print_input_placeholder(
__('Quiet: Modules will not generate events or fire alerts.').'<br>'.__('Disable Agents: Disables the selected agents.').'<br>'.__('Disable Alerts: Disable alerts for the selected agents.'),
true
@ -964,7 +966,8 @@ $table->data[2][] = html_print_label_input_block(
false,
true,
'',
$disabled_in_execution
$disabled_in_execution,
'width: 100%;'
)
);

View File

@ -294,10 +294,14 @@ $(document).ready (function () {
// configure your validation
$("form.add_alert_form").validate({
rules: {
id_agent_module: { valueNotEquals: "0" }
id_agent_module: { valueNotEquals: "0" },
template: { valueNotEquals: "0" },
id_agent: { valueNotEquals: "" },
},
messages: {
id_agent_module: { valueNotEquals: "Please select an item!" }
id_agent_module: { valueNotEquals: "<?php echo __('Please select an item'); ?>!"},
template: { valueNotEquals: "<?php echo __('Please select a templete'); ?>!"},
id_agent: { valueNotEquals: "<?php echo __('Please select an agent'); ?>!"},
}
});
$("select#template").change (function () {

View File

@ -220,7 +220,6 @@ if ($create_alert) {
if (is_metaconsole()) {
// Restore db connection.
metaconsole_restore_db();
echo '<script>window.location.assign("index.php?sec=estado&sec2=operation/agentes/alerts_status")</script>';
}
}

View File

@ -473,6 +473,13 @@ if ($access_console_node === true) {
enterprise_hook('translate_string_submenu');
$menu_godmode['gsetup']['sub'] = $sub;
} else if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$menu_godmode['gservers']['text'] = __('Servers');
$menu_godmode['gservers']['sec2'] = 'godmode/servers/modificar_server';
$menu_godmode['gservers']['id'] = 'god-servers';
$sub = [];
enterprise_hook('manage_satellite_submenu');
$menu_godmode['gservers']['sub'] = $sub;
}
}

View File

@ -870,7 +870,7 @@ switch ($action) {
// ui_pagination($total_reports, $url, $offset, $pagination);
$table = new stdClass();
$table->id = 'report_list';
$table->styleTable = 'margin: 0 10px;';
$table->styleTable = '';
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;

View File

@ -34,7 +34,7 @@ require_once $config['homedir'].'/include/functions_graph.php';
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
if (! check_acl($config['id_user'], 0, 'PM') && ((bool) check_acl($config['id_user'], 0, 'AW') === true && $_GET['server_remote'] === null)) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Server Management'
@ -286,19 +286,21 @@ if (isset($_GET['server']) === true) {
$id_server
);
$buttons = '';
$buttons = [];
// Buttons.
$buttons = [
'standard_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=standard_editor&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'</a>',
],
'advanced_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=advanced_editor&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'</a>',
],
];
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$buttons = [
'standard_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=standard_editor&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'</a>',
],
'advanced_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=advanced_editor&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'</a>',
],
];
}
if ($server_type === SERVER_TYPE_ENTERPRISE_SATELLITE) {
$buttons['agent_editor'] = [

View File

@ -28,7 +28,9 @@
// Begin.
require_once 'include/functions_clippy.php';
require_once 'pending_alerts_list.php';
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
include 'pending_alerts_list.php';
}
global $config;

View File

@ -234,18 +234,18 @@ class ExtensionsDiscovery extends Wizard
url_str = `<a target="_blank" class="link-important" href="${url}">'.__('here').'</a>`;
}
var markup = "<ul class=\'\'>";
var markup = "<ul class=\'\' style=\'padding: 15px 0px 0px 25px;\'>";
if (msgs_json.includes('.NOT_FOUND_MSG.')) {
markup += "<li>&nbsp;&nbsp;&nbsp;'.__('The required files for the application were not found.').'</li>";
markup += \'<li class="lato font_10pt bolder">&nbsp;&nbsp;&nbsp;'.__('The required files for the application were not found.').'</li>\';
}
if (msgs_json.includes('.ENTERPRISE_MSG.')) {
markup += "<li>&nbsp;&nbsp;&nbsp;'.__('This discovery application is for Enterprise customers only.').'</li>";
markup += \'<li class="lato font_10pt bolder">&nbsp;&nbsp;&nbsp;'.__('This discovery application is for Enterprise customers only.').'</li>\';
}
if (msgs_json.includes('.URL_MSG.')) {
markup += \'<li>&nbsp;&nbsp;&nbsp;'.__('You can download this application from').' \'+url_str+\'.</li>\';
markup += \'<li class="lato font_10pt bolder">&nbsp;&nbsp;&nbsp;'.__('You can download this application from').' \'+url_str+\'.</li>\';
}
markup += "</ul>";

View File

@ -553,7 +553,6 @@ class SatelliteCollection extends HTML
},
datatype: "json",
success: function(data) {
console.log(data);
showMsg(data);
},
error: function(e) {
@ -596,7 +595,6 @@ class SatelliteCollection extends HTML
},
datatype: "json",
success: function(data) {
console.log(data);
showMsg(data);
},
error: function(e) {
@ -615,7 +613,7 @@ class SatelliteCollection extends HTML
function showMsg(data) {
var title = "<?php echo __('Success'); ?>";
var dt_satellite_agents = $("#satellite_collections").DataTable();
dt_<?php echo $this->tableId; ?>.draw(false);
dt_satellite_agents.draw(false);
var text = '';
var failed = 0;

View File

@ -22,7 +22,7 @@ use DI\ContainerBuilder;
/*
* Pandora build version and version
*/
$build_version = 'PC240423';
$build_version = 'PC240429';
$pandora_version = 'v7.0NG.776';
// Do not overwrite default timezone set if defined.

View File

@ -1119,11 +1119,13 @@ function events_get_all(
}
}
if (!$user_is_admin && users_can_manage_group_all('ER') === false) {
$ER_groups = users_get_groups($config['id_user'], 'ER', true);
if (!$user_is_admin && users_can_manage_group_all('EM') === false) {
$EM_groups = users_get_groups($config['id_user'], 'EM', true, true);
$EW_groups = users_get_groups($config['id_user'], 'EW', true, true);
}
if (!$user_is_admin && users_can_manage_group_all('ER') === false) {
$ER_groups = users_get_groups($config['id_user'], 'ER', true);
// Get groups where user have ER grants.
if ((bool) $filter['search_secondary_groups'] === true) {
$sql_filters[] = sprintf(
@ -1155,7 +1157,7 @@ function events_get_all(
}
// Free search.
if (empty($filter['search']) === false && (bool) $filter['regex'] === false) {
if (empty($filter['search']) === false) {
if (isset($config['dbconnection']->server_version) === true
&& $config['dbconnection']->server_version > 50600
) {
@ -1185,23 +1187,39 @@ function events_get_all(
$array_search[] = 'lower(ta.alias)';
}
// Disregard repeated whitespaces when searching.
$collapsed_spaces_search = preg_replace('/(&#x20;)+/', '&#x20;', $filter['search']);
if ((bool) $filter['regex'] === true) {
$sql_search = ' AND (';
foreach ($array_search as $key => $field) {
$sql_search .= sprintf(
'%s %s %s REGEXP "%s" ',
($key === 0) ? '' : $nexo,
$field,
$not_search,
preg_replace('/(?<!\\\\)"/', '', io_safe_output($filter['search'])),
);
$sql_search .= ' ';
}
$sql_search = ' AND (';
foreach ($array_search as $key => $field) {
$sql_search .= sprintf(
'%s LOWER(REGEXP_REPLACE(%s, "(&#x20;)+", "&#x20;")) %s like LOWER("%%%s%%")',
($key === 0) ? '' : $nexo,
$field,
$not_search,
$collapsed_spaces_search
);
$sql_search .= ' ';
$sql_search .= ' )';
} else {
// Disregard repeated whitespaces when searching.
$collapsed_spaces_search = preg_replace('/(&#x20;)+/', '&#x20;', $filter['search']);
$sql_search = ' AND (';
foreach ($array_search as $key => $field) {
$sql_search .= sprintf(
'%s LOWER(REGEXP_REPLACE(%s, "(&#x20;)+", "&#x20;")) %s like LOWER("%%%s%%")',
($key === 0) ? '' : $nexo,
$field,
$not_search,
$collapsed_spaces_search
);
$sql_search .= ' ';
}
$sql_search .= ' )';
}
$sql_search .= ' )';
$sql_filters[] = $sql_search;
}
@ -1674,7 +1692,7 @@ function events_get_all(
}
}
if (!$user_is_admin && users_can_manage_group_all('ER') === false) {
if (!$user_is_admin && users_can_manage_group_all('EM') === false) {
$exists_id_grupo = false;
foreach ($fields as $field) {
if (str_contains($field, 'te.id_grupo') === true || str_contains($field, 'te.*') === true) {
@ -1798,7 +1816,7 @@ function events_get_all(
return $sql;
}
if (!$user_is_admin && users_can_manage_group_all('ER') === false) {
if (!$user_is_admin && users_can_manage_group_all('EM') === false) {
$can_manage = '0 as user_can_manage';
if (empty($EM_groups) === false) {
$can_manage = sprintf(
@ -5928,17 +5946,30 @@ function events_get_instructions($event, $max_text_length=300)
return $value;
}
$event_name = ui_print_truncate_text(
io_safe_output($event['evento']),
GENERIC_SIZE_TEXT,
false,
true,
false,
'...'
);
$over_event_name = base64_encode($event_name);
$output = '<div id="hidden_event_instructions_'.$event['id_evento'].'"';
$output .= ' class="event_instruction">';
$output .= $value;
$output .= '</div>';
$output .= '<span id="value_event_'.$event['id_evento'].'" class="nowrap">';
$output .= '<span id="value_event_text_'.$event['id_evento'].'"></span>';
$output .= '<a href="javascript:show_instructions('.$event['id_evento'].')">';
$output .= '<a href="javascript:show_instructions('.$event['id_evento'].',\''.$over_event_name.'\')">';
$output .= html_print_image(
'images/default_list.png',
true,
['title' => $over_text]
[
'title' => $over_text,
'class' => 'invert_filter',
]
).'</a></span>';
return $output;

View File

@ -3308,7 +3308,8 @@ function graph_custom_sql_graph(
$only_image=false,
$homeurl='',
$ttl=1,
$max_num_elements=8
$max_num_elements=8,
$layout=false
) {
global $config;
@ -3509,6 +3510,10 @@ function graph_custom_sql_graph(
if ((int) $ttl === 2) {
$options['dataLabel'] = ['display' => 'auto'];
if ($layout !== false && is_array($layout) === true) {
$options['layout'] = $layout;
}
}
$output .= vbar_graph(

View File

@ -2529,7 +2529,8 @@ function html_print_extended_select_for_time(
$no_change=false,
$allow_zero=0,
$units=null,
$script_input=''
$script_input='',
$units_select2=false
) {
global $config;
$admin = is_user_admin($config['id_user']);
@ -2619,7 +2620,19 @@ function html_print_extended_select_for_time(
echo '</div>';
echo '<div id="'.$uniq_name.'_manual" class="inline_flex">';
html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class, $script_input);
html_print_input_text(
$uniq_name.'_text',
$selected,
'',
$size,
255,
false,
$readonly,
false,
'',
$class.(($units_select2 === true) ? ' w100p' : ''),
$script_input
);
html_print_input_hidden($name, $selected, false, $uniq_name);
html_print_select(
@ -2643,7 +2656,7 @@ function html_print_extended_select_for_time(
false,
false,
false,
false
$units_select2
);
echo '&nbsp&nbsp<a href="javascript:">'.html_print_image(
'images/logs@svg.svg',
@ -2656,6 +2669,7 @@ function html_print_extended_select_for_time(
]
).'</a>';
echo '</div>';
echo "<script type='text/javascript'>
$(document).ready (function () {
period_select_init('".$uniq_name."', ".(($allow_zero) ? 1 : 0).");
@ -2676,6 +2690,18 @@ function html_print_extended_select_for_time(
}, 100);
}
</script>";
if ($units_select2 === true) {
echo '
<script>
$(document).ready (function () {
$("#'.$uniq_name.'_units").select2();
$("#'.$uniq_name.'_units").data("select2").$container.addClass("mrgn_lft_10px_imp");
});
</script>
';
}
$returnString = ob_get_clean();
if ($return) {
@ -6359,7 +6385,8 @@ function html_print_input($data, $wrapper='div', $input_only=false)
((isset($data['no_change']) === true) ? $data['no_change'] : ''),
((isset($data['allow_zero']) === true) ? $data['allow_zero'] : ''),
((isset($data['units']) === true) ? $data['units'] : null),
((isset($data['script_input']) === true) ? $data['script_input'] : '')
((isset($data['script_input']) === true) ? $data['script_input'] : ''),
((isset($data['units_select2']) === true) ? $data['units_select2'] : '')
);
break;

View File

@ -169,6 +169,10 @@ function menu_print_menu(&$menu)
$sec2 = 'godmode/users/profile_list';
} else if ($sec2 === 'godmode/users/configure_token') {
$sec2 = 'godmode/users/token_list';
} else if ($sec2 === 'godmode/servers/modificar_server' && check_acl($config['id_user'], 0, 'AW') && (bool) check_acl($config['id_user'], 0, 'PM') === false) {
$sec2 = 'enterprise/godmode/servers/list_satellite';
} else if ($sec2 === 'enterprise/godmode/snmpconsole/snmp_trap_editor_form') {
$sec2 = 'enterprise/godmode/snmpconsole/snmp_trap_editor';
} else {
$sec2 = (string) get_parameter('sec2');
}

View File

@ -1389,6 +1389,7 @@ function netflow_draw_item(
$show_summary=true,
$show_table=true
) {
global $config;
$aggregate = $filter['aggregate'];
$interval = ($end_date - $start_date);
if (is_metaconsole() === true) {
@ -1568,13 +1569,20 @@ function netflow_draw_item(
$data_top_n
);
// Theme.
$theme = $config['style'];
$text_color = ($theme !== 'pandora_black') ? '#333' : '#fff';
$graph_output = pie_graph(
$pie_data,
[
'width' => 200,
'height' => 200,
'ttl' => ($output === 'PDF') ? 2 : 1,
'dataLabel' => ['display' => 'auto'],
'dataLabel' => [
'display' => 'auto',
'color' => $text_color,
],
'layout' => [
'padding' => [
'top' => 15,

View File

@ -2736,7 +2736,8 @@ function reporting_event_report_module(
$ttl,
$id_server,
$metaconsole_dbtable,
$filter_event_filter_exclude
$filter_event_filter_exclude,
$content['id_agent_module']
);
if (empty($data)) {
@ -6686,6 +6687,7 @@ function reporting_sql_graph(
$type_sql_graph
) {
global $config;
$layout = false;
switch ($type_sql_graph) {
case 'sql_graph_hbar':
@ -6694,6 +6696,7 @@ function reporting_sql_graph(
break;
case 'sql_graph_vbar':
$layout = ['padding' => ['top' => '40']];
$return['type'] = 'sql_graph_vbar';
break;
@ -6768,7 +6771,8 @@ function reporting_sql_graph(
$only_image,
ui_get_full_url(false, false, false, false),
$ttl,
$content['top_n_value']
$content['top_n_value'],
$layout
);
break;
@ -11725,7 +11729,8 @@ function reporting_get_module_detailed_event(
$ttl=1,
$id_server=false,
$metaconsole_dbtable=false,
$filter_event_filter_exclude=false
$filter_event_filter_exclude=false,
$id_agent=false
) {
global $config;
@ -11748,7 +11753,7 @@ function reporting_get_module_detailed_event(
foreach ($id_modules as $id_module) {
$event['data'] = events_get_agent(
false,
$id_agent,
(int) $period,
(int) $date,
$history,

View File

@ -112,8 +112,8 @@ function reporting_html_header(
}
$data[] = $title.$sizhfin;
$data[] = $sizh.$subtitle.$sizhfin;
$data[] = "<div class='right'>".$sizh.$date_text.$sizhfin.'</div>';
$data[] = $sizh.__('Group').': '.$subtitle.$sizhfin;
$data[] = '<div class="flex-content-right flex-items-center">'.$sizh.__('Data time').': '.$sizhfin."<div class='right mrgn_lft_15px'>".$sizh.$date_text.$sizhfin.'</div></div>';
}
array_push($table->data, $data);
@ -194,6 +194,9 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
$table->head = [];
$table->colspan = [];
$table->rowstyle = ['background-color: #686868'];
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[2] = '33%';
if (isset($item['label']) && $item['label'] != '') {
$id_agent = $item['id_agent'];
@ -3606,7 +3609,7 @@ function reporting_html_group_report($table, $item, $pdf=0)
}
$graph_width = 280;
$graph_height = 250;
$graph_height = 300;
$out = '<table width="100%" class="info_table">';
$out .= '<tbody>';
@ -3688,7 +3691,7 @@ function reporting_html_group_report($table, $item, $pdf=0)
$out .= '<div id="events_per_agent_pie" style="height: '.$graph_height.'px">';
if ((int) $ttl === 2) {
$out .= '<img src="data:image/png;base64,';
$out .= '<img width="350" src="data:image/png;base64,';
} else {
$out .= '<div id="status_pie" style="margin: auto;">';
}
@ -3730,7 +3733,7 @@ function reporting_html_group_report($table, $item, $pdf=0)
$out .= '<div id="group_os_pie" style="height: '.$graph_height.'px">';
if ((int) $ttl === 2) {
$out .= '<img src="data:image/png;base64,';
$out .= '<img width="350" src="data:image/png;base64,';
} else {
$out .= '<div id="status_pie" style="margin: auto;">';
}
@ -4104,7 +4107,7 @@ function reporting_html_historical_data($table, $item, $pdf=0)
// Center every row
foreach ($table1->data[0] as $k => $v) {
for ($i = 0; $i < count($table1->data); $i++){
for ($i = 0; $i < count($table1->data); $i++) {
$table1->cellstyle[$i][$k] = 'text-align: center;';
}
}
@ -4187,7 +4190,7 @@ function reporting_html_database_serialized($table, $item, $pdf=0)
// Center every row
foreach ($table1->data[0] as $k => $v) {
for ($i = 0; $i < count($table1->data); $i++){
for ($i = 0; $i < count($table1->data); $i++) {
$table1->cellstyle[$i][$k] = 'text-align: center;';
}
}
@ -6432,7 +6435,7 @@ function reporting_html_sql($table, $item, $pdf=0)
// Center every row
foreach ($table2->data[0] as $k => $v) {
for ($i = 0; $i < count($table2->data); $i++){
for ($i = 0; $i < count($table2->data); $i++) {
$table2->cellstyle[$i][$k] = 'text-align: center;';
}
}
@ -7883,6 +7886,12 @@ function reporting_html_ncm_list($table, $item, $pdf=0)
*/
function reporting_html_ncm_backups($table, $item, $pdf=0)
{
global $config;
if ($config['style'] === 'pandora_black') {
ui_require_css_file('pandora_black');
}
ui_require_css_file('diff2html.min');
ui_require_css_file('highlight.min');
ui_require_css_file('highlight/vs.min');

View File

@ -301,8 +301,7 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t
if (empty($message['no_close']) === false) {
// Workaround.
$no_close_bool = false;
// $no_close_bool = (bool) $message['no_close'];
$no_close_bool = (bool) $message['no_close'];
}
if (empty($message['force_style']) === false) {

View File

@ -547,6 +547,7 @@ function line_graph(
function get_build_setup_charts($type, $options, $data)
{
global $config;
$user_info = get_user_info($config['id_user']);
$factory = new Factory();
@ -1294,6 +1295,10 @@ function get_build_setup_charts($type, $options, $data)
}
}
if (isset($user_info['id_skin']) === true) {
$chart->options()->setTheme($user_info['id_skin']);
}
// Add Datasets.
$setData = $chart->createDataSet();
switch ($type) {

View File

@ -2566,19 +2566,13 @@ function menuActionButtonResizing() {
function check_period_warning(time, title, message) {
var period = time.value;
var times = 0;
if (period >= 2592000 && period < 7776000) {
WarningPeriodicityModal(title, message);
} else if (period >= 7776000 && period < 15552000) {
do {
WarningPeriodicityModal(title, message);
times = times + 1;
} while (times < 2);
WarningPeriodicityModal(title, message);
} else if (period >= 15552000) {
do {
WarningPeriodicityModal(title, message);
times = times + 1;
} while (times < 3);
WarningPeriodicityModal(title, message);
}
}

View File

@ -625,6 +625,10 @@ var TreeController = {
$("#fixed-bottom-box-head-title").html(
$("#fixedBottomHeadTitle").html()
);
$("#fixed-bottom-box-head-title")
.closest(".fixed-bottom-box")
.addClass("tree-view-bottom-modal");
},
error: function(xhr, textStatus, errorThrown) {
callback(errorThrown);
@ -1543,7 +1547,7 @@ var TreeController = {
} else if (controller.tree.length == 0) {
controller.recipient.empty();
controller.recipient.html(
"<div>" + controller.emptyMessage + "</div>"
"<div class='recipent'>" + controller.emptyMessage + "</div>"
);
return;
}

View File

@ -363,6 +363,27 @@ class Manager implements PublicLogin
}
/**
* Generates a hash to authenticate in public dashboards with user form url.
*
* @param string|null $other_secret To authenticate some parts
* of public dashboards (like visual consoles or wux widgets)
* another hash is needed. Other secret avoid
* to reuse the main hash to view other components.
*
* @return string Returns a hash with the authenticaction.
*/
public static function generatePublicHashUser(?string $other_secret='', $id_user=''):string
{
global $config;
$str = $config['dbpass'];
$str .= ($id_user ?? $config['id_user']);
$str .= $other_secret;
return hash('sha256', $str);
}
/**
* Validates a hash to authenticate in public dashboards.
*
@ -411,6 +432,33 @@ class Manager implements PublicLogin
$config['public_dashboard'] = true;
$config['force_instant_logout'] = true;
return true;
} else {
$dashboards = self::getDashboards();
$dashboards = array_reduce(
$dashboards,
function ($carry, $item) {
$carry[$item['id']] = $item['name'];
return $carry;
},
[]
);
foreach ($dashboards as $key => $layout) {
$hash_compare = self::generatePublicHash($key);
if (hash_equals($hash, $hash_compare)) {
// "Log" user in.
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
$_SESSION['id_usuario'] = get_parameter('id_user');
session_write_close();
$config['public_dashboard'] = true;
$config['force_instant_logout'] = true;
return true;
}
}
}
// Remove id user from config array if authentication has failed.
@ -1013,6 +1061,17 @@ class Manager implements PublicLogin
break;
}
}
if (empty($this->dashboardId) === true) {
$id_user_url = get_parameter('id_user', $config['id_user']);
foreach ($dashboards as $key => $layout) {
$hash_compare = self::generatePublicHashUser($key, $id_user_url);
if (hash_equals($hash_aux, $hash_compare)) {
$this->dashboardId = $key;
break;
}
}
}
}
if ($this->dashboardId === 0

View File

@ -423,6 +423,7 @@ class BasicChart extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];

View File

@ -306,6 +306,7 @@ class BlockHistogram extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];

View File

@ -317,6 +317,7 @@ class DataMatrix extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];
@ -335,6 +336,7 @@ class DataMatrix extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'slice\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];

View File

@ -394,6 +394,7 @@ class CustomGraphWidget extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];

View File

@ -373,6 +373,7 @@ class GraphModuleHistogramWidget extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];

View File

@ -207,6 +207,7 @@ class Netflow extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];
$chart_types = netflow_get_chart_types();
@ -366,8 +367,8 @@ class Netflow extends Widget
'',
'HTML',
0,
($size['width'] - 50),
($size['height'] - 20),
($size['width'] + 120),
($size['height'] + 120),
),
],
true
@ -462,7 +463,7 @@ class Netflow extends Widget
public function getSizeModalConfiguration(): array
{
$size = [
'width' => 400,
'width' => 600,
'height' => 530,
];

View File

@ -449,6 +449,7 @@ class SingleGraphWidget extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];
@ -527,99 +528,101 @@ class SingleGraphWidget extends Widget
'id' => 'div_projection_period',
'style' => $display_projection,
'arguments' => [
'name' => 'period_projection',
'type' => 'interval',
'value' => $values['period_projection'],
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
],
];
$inputs['inputs']['row2'][] = [
'label' => __('Maximum'),
'id' => 'div_period_maximum',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_maximum',
'id' => 'period_maximum',
'type' => 'switch',
'value' => $values['period_maximum'],
],
];
$inputs['inputs']['row2'][] = [
'label' => __('Minimum'),
'id' => 'div_period_minimum',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_minimum',
'id' => 'period_minimum',
'type' => 'switch',
'value' => $values['period_minimum'],
],
];
$inputs['inputs']['row2'][] = [
'label' => __('Average'),
'id' => 'div_period_average',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_average',
'id' => 'period_average',
'type' => 'switch',
'value' => $values['period_average'],
],
];
$inputs['inputs']['row2'][] = [
'label' => __('Summatory'),
'id' => 'div_period_summatory',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_summatory',
'id' => 'period_summatory',
'type' => 'switch',
'value' => $values['period_summatory'],
],
];
$inputs['inputs']['row2'][] = [
'label' => __('Slice period'),
'id' => 'div_period_slice_chart',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_slice_chart',
'name' => 'period_projection',
'type' => 'interval',
'value' => (string) $values['period_slice_chart'],
'custom_fields' => [
SECONDS_1HOUR => __('1 hour'),
SECONDS_1DAY => __('1 day'),
SECONDS_1WEEK => __('1 week'),
SECONDS_1MONTH => __('1 month'),
'value' => $values['period_projection'],
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];
$inputs['inputs']['row2'][] = [
'label' => __('Maximum'),
'id' => 'div_period_maximum',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_maximum',
'id' => 'period_maximum',
'type' => 'switch',
'value' => $values['period_maximum'],
],
],
];
];
$options_period_mode = [
CUSTOM_GRAPH_AREA => __('Area'),
CUSTOM_GRAPH_LINE => __('Line'),
CUSTOM_GRAPH_VBARS => __('Vertical bars'),
];
$inputs['inputs']['row2'][] = [
'label' => __('Minimum'),
'id' => 'div_period_minimum',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_minimum',
'id' => 'period_minimum',
'type' => 'switch',
'value' => $values['period_minimum'],
],
];
$inputs['inputs']['row2'][] = [
'label' => __('Type chart'),
'id' => 'div_period_mode',
'style' => $display_periodicity_chart,
'arguments' => [
'type' => 'select',
'fields' => $options_period_mode,
'name' => 'period_mode',
'selected' => $values['period_mode'],
'return' => true,
],
];
$inputs['inputs']['row2'][] = [
'label' => __('Average'),
'id' => 'div_period_average',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_average',
'id' => 'period_average',
'type' => 'switch',
'value' => $values['period_average'],
],
];
return $inputs;
$inputs['inputs']['row2'][] = [
'label' => __('Summatory'),
'id' => 'div_period_summatory',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_summatory',
'id' => 'period_summatory',
'type' => 'switch',
'value' => $values['period_summatory'],
],
];
$inputs['inputs']['row2'][] = [
'label' => __('Slice period'),
'id' => 'div_period_slice_chart',
'style' => $display_periodicity_chart,
'arguments' => [
'name' => 'period_slice_chart',
'type' => 'interval',
'value' => (string) $values['period_slice_chart'],
'custom_fields' => [
SECONDS_1HOUR => __('1 hour'),
SECONDS_1DAY => __('1 day'),
SECONDS_1WEEK => __('1 week'),
SECONDS_1MONTH => __('1 month'),
],
'units_select2' => true,
],
];
$options_period_mode = [
CUSTOM_GRAPH_AREA => __('Area'),
CUSTOM_GRAPH_LINE => __('Line'),
CUSTOM_GRAPH_VBARS => __('Vertical bars'),
];
$inputs['inputs']['row2'][] = [
'label' => __('Type chart'),
'id' => 'div_period_mode',
'style' => $display_periodicity_chart,
'arguments' => [
'type' => 'select',
'fields' => $options_period_mode,
'name' => 'period_mode',
'selected' => $values['period_mode'],
'return' => true,
],
];
return $inputs;
}

View File

@ -383,6 +383,7 @@ class SLAPercentWidget extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];

View File

@ -262,6 +262,7 @@ class TopNWidget extends Widget
'style_icon' => 'flex-grow: 0',
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'units_select2' => true,
],
];

View File

@ -684,7 +684,7 @@ class TreeViewWidget extends Widget
'dateFormat' => DATE_FORMAT_JS,
'userLanguage' => get_user_language(),
'translate' => [
'emptyMessage' => __('No data found'),
'emptyMessage' => ui_print_info_message(['no_close' => true, 'message' => __('No data found.')], '', true),
'foundMessage' => $foundMessage,
'total' => [
'agents' => __('Total agents'),

View File

@ -230,7 +230,26 @@ class User extends Entity implements PublicLogin
global $config;
$str = $config['dbpass'];
$str .= $config['id_user'];
$str .= ($config['id_user'] ?? get_parameter('id_user'));
$str .= $other_secret;
return hash('sha256', $str);
}
/**
* Generates a hash to authenticate in public views with user from url.
*
* @param string|null $other_secret If you need to authenticate using a
* varable string, use this 'other_secret' to customize the hash.
*
* @return string Returns a hash with the authenticaction.
*/
public static function generatePublicHashUser(?string $other_secret='', $id_user_url=''): string
{
global $config;
$str = $config['dbpass'];
$str .= ($id_user_url ?? $config['id_user']);
$str .= $other_secret;
return hash('sha256', $str);
}

View File

@ -139,7 +139,7 @@ class View extends \HTML
});
ui.jqXHR.fail(function () {
ui.panel.html(
"Couldn\'t load Data. Plz Reload Page or Try Again Later."
"'.__('The data could not be loaded. Please reload the page or try again later.').'"
);
});
},

View File

@ -954,6 +954,7 @@ input.resize_button {
right: 6%;
}
.recipent > div > table,
.new-widget-message > div > table,
.container-center > div > table {
display: flex;
@ -961,6 +962,7 @@ input.resize_button {
align-items: center;
}
.recipent > div > table tr td > div,
.new-widget-message > div > table tr td > div,
.container-center > div > table tr td > div {
position: absolute;
@ -1017,3 +1019,16 @@ ul.select2-selection__rendered > li.select2-selection__choice {
.select2-results__option {
line-break: anywhere;
}
#period_manual > input[type="text"] {
box-sizing: border-box !important;
}
.recipent {
height: 100%;
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}

View File

@ -7273,6 +7273,10 @@ div.graph div.legend table {
margin-left: 10px;
}
.mrgn_lft_10px_imp {
margin-left: 10px !important;
}
.mrgn_lft_15px {
margin-left: 15px;
}
@ -14261,6 +14265,11 @@ table.filter-table-adv td > div.row-flex input {
width: 100%;
}
div.fixed-bottom-box.tree-view-bottom-modal {
z-index: 1;
border: 1px solid var(--border-color);
}
.custom-graph-editor
#select_multiple_modules_filtered
> div.agents-modules-multiple-search-bar

View File

@ -1136,6 +1136,7 @@ select,
.white_table_graph_header {
color: var(--text-color) !important;
border-radius: 0;
background-color: var(--secondary-color) !important;
}
.white_table_graph {
@ -1477,6 +1478,7 @@ select[multiple] option:checked,
select[multiple] option:active,
select[multiple] option:hover {
background: #008d86 !important;
color: var(--text-color);
}
.select2-search.select2-search--dropdown,
@ -2095,6 +2097,12 @@ select option:checked {
filter: invert(1);
}
.d2h-file-list-header,
.d2h-file-name-wrapper,
.d2h-file-collapse {
color: #333 !important;
}
.grid-stack-item-content {
background-color: var(--secondary-color);
}
@ -2103,6 +2111,10 @@ select option:checked {
background-color: var(--secondary-color);
}
.color_666 {
color: var(--text-color);
}
.black-and-white {
filter: saturate(0);
}

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.776';
$build = '240423';
$build = '240429';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -1026,11 +1026,18 @@ if (is_ajax() === true) {
return;
}
$data = networkmap_refresh_holding_area($networkmap_id, $x, $y);
$filter = db_get_value('filter', 'tmap', 'id', $networkmap_id);
$filter = json_decode($filter, true);
if (!empty($data)) {
$return['correct'] = true;
$return['holding_area'] = $data;
if (isset($filter['empty_map']) === false
|| (isset($filter['empty_map']) === true && $filter['empty_map'] !== 1)
) {
$data = networkmap_refresh_holding_area($networkmap_id, $x, $y);
if (!empty($data)) {
$return['correct'] = true;
$return['holding_area'] = $data;
}
}
ob_end_clean();

View File

@ -38,6 +38,13 @@ ob_start();
// Fullscreen by default.
$config['pure'] = get_parameter('pure', 1);
$dashboardId = get_parameter('dashboardId', null);
if ($dashboardId !== null) {
include 'general/noaccess.php';
return;
}
require_once 'dashboard.php';
// Clean session to avoid direct access.

View File

@ -1249,27 +1249,7 @@ if (is_ajax() === true) {
}
}
$regex_validation = false;
if (empty($tmp) === false && $regex !== '') {
foreach (json_decode(json_encode($tmp), true) as $key => $field) {
if ($key === 'b64') {
continue;
}
$field = strip_tags($field);
if (preg_match('/'.io_safe_output($regex).'/', $field)) {
$regex_validation = true;
}
}
if ($regex_validation === true) {
$carry[] = $tmp;
}
} else {
$carry[] = $tmp;
}
$carry[] = $tmp;
return $carry;
}
);
@ -1289,11 +1269,10 @@ if (is_ajax() === true) {
// RecordsTotal && recordsfiltered resultados totales.
echo json_encode(
[
'data' => ($data ?? []),
'buffers' => $buffers,
'recordsTotal' => $count,
'recordsFiltered' => $count,
'showAlwaysPagination' => (empty($regex) === false) ? true : false,
'data' => ($data ?? []),
'buffers' => $buffers,
'recordsTotal' => $count,
'recordsFiltered' => $count,
]
);
} catch (Exception $e) {
@ -2666,20 +2645,22 @@ try {
// Always add options column.
$fields = array_merge(
$fields,
[
if ((bool) check_acl($config['id_user'], 0, 'EW') === true) {
$fields = array_merge(
$fields,
[
'text' => 'options',
'class' => 'table_action_buttons mw100px',
],
[
'text' => 'm',
'extra' => $checkbox_all,
'class' => 'w20px no-text-imp',
],
]
);
[
'text' => 'options',
'class' => 'table_action_buttons mw100px',
],
[
'text' => 'm',
'extra' => $checkbox_all,
'class' => 'w20px no-text-imp',
],
]
);
}
// Get column names.
$column_names = events_get_column_names($fields, true);
@ -2890,8 +2871,8 @@ try {
'column_names' => $column_names,
'columns' => $fields,
'no_sortable_columns' => [
-1,
-2,
'options',
'm',
'column-instructions',
'user_comment',
],
@ -3715,11 +3696,19 @@ function datetime_picker_callback() {
datetime_picker_callback();
function show_instructions(id){
function show_instructions(id, title_event){
title = "<?php echo __('Instructions'); ?>";
$('#hidden_event_instructions_' + id).dialog({
title: title,
width: 600
title: `${title+' '+atob(title_event)}`,
width: 650,
draggable: true,
modal: true,
closeOnEscape: true,
open: function(){
$('.ui-widget-overlay').bind('click',function(){
$('#hidden_event_instructions_' + id).dialog('close');
})
}
});
}

View File

@ -53,6 +53,8 @@ $time_start = date('H:i:s', $date_params['date_init']);
$date_init = date('Y/m/d', $date_params['date_init']);
$time_init = date('H:i:s', $date_params['date_init']);
$time = $time_end;
$custom_date_end = date('Y/m/d H:i:s', $date_params['date_end']);
$period = $date_params['period'];
@ -94,6 +96,9 @@ if (empty($schedule_report) === false) {
echo '<br>';
}
if (empty($time) === true) {
$time = date(TIME_FORMAT);
}
// ------------------- INIT HEADER --------------------------------------
$url = "index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=$id_report&date=$date&time=$time&pure=$pure";

View File

@ -133,16 +133,16 @@ $table->data[0][3] = "<a href='index.php?search_category=modules&keywords=".$con
// ~ $table->data[0][5] = "<a href='index.php?search_category=alerts&keywords=" . $config['search_keywords'] . "&head_search_keywords=Search'>" .
// ~ sprintf(__("%s Found"), $totalAlerts) . "</a>";
// ---------------------------------------------------------------------
$table->data[0][6] = html_print_image('images/input_user.png', true, ['title' => __('Users found'), 'class' => 'invert_filter']);
$table->data[0][6] = html_print_image('images/input_user.png', true, ['title' => __('Users found')]);
$table->data[0][7] = "<a href='index.php?search_category=users&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalUsers).'</a>';
$table->data[0][8] = html_print_image('images/chart_curve.png', true, ['title' => __('Graphs found'), 'class' => 'invert_filter']);
$table->data[0][9] = "<a href='index.php?search_category=graphs&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalGraphs).'</a>';
$table->data[0][10] = html_print_image('images/reporting.png', true, ['title' => __('Reports found'), 'class' => 'invert_filter']);
$table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Visual consoles')]);
$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Visual consoles'), 'class' => 'main_menu_icon invert_filter']);
$table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
if (enterprise_installed()) {
$table->data[0][14] = html_print_image('images/policy@svg.svg', true, ['title' => __('Policies'), 'class' => 'main_menu_icon']);
$table->data[0][14] = html_print_image('images/policy@svg.svg', true, ['title' => __('Policies'), 'class' => 'main_menu_icon invert_filter']);
$table->data[0][15] = "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalPolicies).'</a>';
}

View File

@ -66,7 +66,10 @@ if ($searchMain) {
'text' => "<a href='index.php?search_category=main&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/zoom_mc.png',
true,
['title' => __('Global search')]
[
'title' => __('Global search'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
'active' => $searchTab == 'main',
];
@ -79,7 +82,10 @@ if ($searchAgents) {
'text' => "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/op_monitoring.png',
true,
['title' => __('Agents')]
[
'title' => __('Agents'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
'active' => $searchTab == 'agents',
];
@ -92,7 +98,10 @@ if ($searchUsers) {
'text' => "<a href='index.php?search_category=users&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/op_workspace.png',
true,
['title' => __('Users')]
[
'title' => __('Users'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
'active' => $searchTab == 'users',
];
@ -105,7 +114,10 @@ if ($searchAlerts) {
'text' => "<a href='index.php?search_category=alerts&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/op_alerts.png',
true,
['title' => __('Alerts')]
[
'title' => __('Alerts'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
'active' => $searchTab == 'alerts',
];
@ -118,7 +130,10 @@ if ($searchGraphs) {
'text' => "<a href='index.php?search_category=graphs&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/chart.png',
true,
['title' => __('Graphs')]
[
'title' => __('Graphs'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
'active' => $searchTab == 'graphs',
];
@ -131,7 +146,10 @@ if ($searchReports) {
'text' => "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/op_reporting.png',
true,
['title' => __('Reports')]
[
'title' => __('Reports'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
'active' => $searchTab == 'reports',
];
@ -144,7 +162,10 @@ if ($searchMaps) {
'text' => "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/visual_console.png',
true,
['title' => __('Visual consoles')]
[
'title' => __('Visual consoles'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
'active' => $searchTab == 'maps',
];
@ -157,7 +178,10 @@ if ($searchModules) {
'text' => "<a href='index.php?search_category=modules&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/brick.png',
true,
['title' => __('Modules')]
[
'title' => __('Modules'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
'active' => $searchTab == 'modules',
];
@ -172,7 +196,7 @@ if ($searchPolicies) {
true,
[
'title' => __('Policies'),
'class' => 'main_menu_icon',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
'active' => $searchTab == 'policies',

View File

@ -13,6 +13,12 @@
// GNU General Public License for more details.
require_once '../../include/config.php';
$id_layout = get_parameter('id_layout', null);
if ($id_layout !== null) {
include '../../general/noaccess.php';
return;
}
use PandoraFMS\User;
// Set root on homedir, as defined in setup.
@ -73,6 +79,17 @@ foreach ($vcs as $key => $data) {
}
}
$id_user_url = get_parameter('id_user', $config['id_user']);
if (empty($visualConsoleId) === true) {
foreach ($vcs as $key => $data) {
$hash_compare = User::generatePublicHashUser($key, $id_user_url);
if (hash_equals($hash_compare, $hash)) {
$visualConsoleId = (int) $key;
break;
}
}
}
if (empty($visualConsoleId) === true) {
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.776
%define release 240423
%define release 240429
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.776
%define release 240423
%define release 240429
# 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.776
%define release 240423
%define release 240429
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -2947,7 +2947,7 @@ SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_na
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_proxmox');
-- Insert into tdiscovery_apps_executions
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, '&#039;_exec1_&#039;&#x20;-g&#x20;&#039;__taskGroup__&#039;&#x20;--host&#x20;&#039;_host_&#039;&#x20;--port&#x20;&#039;_port_&#039;&#x20;--user&#x20;&#039;_user_&#039;&#x20;--password&#x20;&#039;_password_&#039;&#x20;--vm&#x20;&#039;_scanVM_&#039;&#x20;--lxc&#x20;&#039;_scanLXC_&#039;&#x20;--backups&#x20;&#039;_scanBackups_&#039;&#x20;--nodes&#x20;&#039;_scanNodes_&#039;&#x20;--transfer_mode&#x20;tentacle&#x20;--tentacle_address&#x20;&#039;_tentacleIP_&#039;&#x20;--tentacle_port&#x20;&#039;_tentaclePort_&#039;&#x20;--as_discovery_plugin&#x20;1');
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileProxmox_&#039;');
-- Insert new SAP APP
SET @short_name = 'pandorafms.sap.deset';

View File

@ -92,6 +92,11 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
*/
protected $indexAxis;
/**
* @var string
*/
protected $theme;
/**
* @return Layout
@ -194,7 +199,7 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
/**
* @return bool
* @return boolean
*/
public function disableAnimation()
{
@ -323,6 +328,32 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
}
/**
* Get font color.
*
* @return string
*/
public function getTheme()
{
return $this->theme;
}
/**
* Set font color.
*
* @param string $Theme Global font color.
*
* @return $this
*/
public function setTheme($theme)
{
$this->theme = $theme;
return $this;
}
/**
* @return array
*/

View File

@ -30,7 +30,7 @@ class JavaScript extends Renderer
// Watermark.
if (empty($this->chart->defaults()->getWatermark()) === false) {
$script[] = 'const chart_watermark_'.$this->chart->getId().' = {
$script[] = 'const chart_watermark_'.$this->chart->getId().' = {
id: "chart_watermark_'.$this->chart->getId().'",
beforeDraw: (chart) => {
if (Object.prototype.hasOwnProperty.call(chart, "config") &&
@ -128,11 +128,9 @@ class JavaScript extends Renderer
}
}
};';
$script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');';
$script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');';
}
// Create chart.
$script[] = 'try {';
$script[] = " var chart = new Chart( ctx, {$json} );";
@ -143,6 +141,32 @@ class JavaScript extends Renderer
$script[] = ' Chart.defaults.font.style = "'.($this->chart->defaults()->getFonts()->getStyle() ?? 'normal').'";';
$script[] = ' Chart.defaults.font.weight = "'.($this->chart->defaults()->getFonts()->getWeight() ?? '').'";';
if ($this->chart->options()->getTheme() !== null) {
if ((int) $this->chart->options()->getTheme() === 2) {
$script[] = ' Chart.defaults.color = "#ffffff";';
$script[] = '
if (chart.config.options.scales !== undefined
&& chart.config.options.scales.x !== undefined
&& chart.config.options.scales.x.ticks !== undefined
) {
chart.config.options.scales.x.ticks.color = "#ffffff";
}
if (chart.config.options.scales !== undefined &&
chart.config.options.scales.y !== undefined &&
chart.config.options.scales.y.ticks !== undefined
) {
chart.config.options.scales.y.ticks.color = "#ffffff";
}
if (chart.config.options.title !== undefined ) {
chart.config.options.title.fontColor = "#ffffff";
}
';
}
}
$script[] = '} catch (error) {';
$script[] = ' console.error(error);';
$script[] = '}';

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.776-240423
Version: 7.0NG.776-240429
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.776-240423"
pandora_version="7.0NG.776-240429"
package_cpan=0
package_pandora=1

View File

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

View File

@ -3674,12 +3674,12 @@ Updates the keep_alive module for the given agent.
sub pandora_module_keep_alive ($$$$$) {
my ($pa_config, $id_agent, $agent_name, $server_id, $dbh) = @_;
logger($pa_config, "Updating keep_alive module for agent '" . safe_output($agent_name) . "'.", 10);
logger($pa_config, "Updating keep_alive modules for agent '" . safe_output($agent_name) . "'.", 10);
# Update keepalive module
my $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND delete_pending = 0 AND id_tipo_modulo = 100', $id_agent);
if (defined ($module)) {
my %data = ('data' => 1);
# Update keepalive modules
my @modules = get_db_rows($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente = ? AND delete_pending = 0 AND id_tipo_modulo = 100', $id_agent);
my %data = ('data' => 1);
foreach my $module (@modules) {
pandora_process_module ($pa_config, \%data, '', $module, 'keep_alive', '', time(), $server_id, $dbh);
}
}
@ -7010,8 +7010,21 @@ Returns 1 if this server is the current master, 0 otherwise.
=cut
##########################################################################
sub pandora_is_master ($) {
my ($pa_config) = @_;
sub pandora_is_master ($;$) {
my ($pa_config, $dbh) = @_;
# When multiprocess is enabled the variable $Master is not shared between
# servers.
if (defined($dbh) && $pa_config->{'multiprocess'} == 1) {
my $current_master = get_db_value_limit ($dbh, 'SELECT name FROM tserver
WHERE master <> 0 AND status = 1
ORDER BY master DESC', 1);
if (defined($current_master) && $current_master eq $pa_config->{'servername'}) {
return 1;
}
return 0;
}
if ($Master eq $pa_config->{'servername'}) {
return 1;

View File

@ -143,7 +143,7 @@ sub data_producer ($) {
# By default, after create a tasks it takes the utimestamp to 0
# Status -1 means "done".
my @rows;
if (pandora_is_master($pa_config) == 0) {
if (pandora_is_master($pa_config, $dbh) == 0) {
@rows = get_db_rows ($dbh, 'SELECT * FROM trecon_task
WHERE id_recon_server = ?
AND disabled = 0

View File

@ -83,7 +83,7 @@ sub data_producer ($) {
my @tasks;
my @rows;
if (pandora_is_master($pa_config) == 0) {
if (pandora_is_master($pa_config, $dbh) == 0) {
if ($pa_config->{'dbengine'} ne 'oracle') {
@rows = get_db_rows ($dbh,
'SELECT tagent_module_inventory.id_agent_module_inventory, tagent_module_inventory.flag, tagent_module_inventory.timestamp

View File

@ -96,7 +96,7 @@ sub data_producer ($) {
my @rows;
my $network_filter = enterprise_hook ('get_network_filter', [$pa_config]);
if (pandora_is_master($pa_config) == 0) {
if (pandora_is_master($pa_config, $dbh) == 0) {
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
FROM tagente, tagente_modulo, tagente_estado
WHERE server_name = ?

View File

@ -96,7 +96,7 @@ sub data_producer ($) {
my @tasks;
my @rows;
if (pandora_is_master($pa_config) == 0) {
if (pandora_is_master($pa_config, $dbh) == 0) {
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
FROM tagente, tagente_modulo, tagente_estado
WHERE server_name = ?

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.776";
my $pandora_build = "240423";
my $pandora_build = "240429";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -93,7 +93,7 @@ sub data_producer ($) {
my @tasks;
my @rows;
if (pandora_is_master($pa_config) == 0) {
if (pandora_is_master($pa_config, $dbh) == 0) {
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo,
tagente_modulo.flag, last_execution_try
FROM tagente, tagente_modulo, tagente_estado

View File

@ -94,7 +94,7 @@ sub data_producer ($) {
my @tasks;
my @rows;
if (pandora_is_master($pa_config) == 0) {
if (pandora_is_master($pa_config, $dbh) == 0) {
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
FROM tagente, tagente_modulo, tagente_estado
WHERE server_name = ?

View File

@ -124,7 +124,7 @@ sub data_producer ($) {
my @tasks;
my @rows;
if (pandora_is_master($pa_config) == 0) {
if (pandora_is_master($pa_config, $dbh) == 0) {
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
FROM tagente, tagente_modulo, tagente_estado
WHERE server_name = ?

View File

@ -7,7 +7,7 @@
%define debug_package %{nil}
%define name pandorafms_server
%define version 7.0NG.776
%define release 240423
%define release 240429
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.776
%define release 240423
%define release 240429
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -38,7 +38,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.776 Build 240423";
my $version = "7.0NG.776 Build 240429";
# 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.776 Build 240423";
my $version = "7.0NG.776 Build 240429";
# save program name for logging
my $progname = basename($0);

View File

@ -165,7 +165,7 @@ sub prepare_tree {
} else {
$snmp_call{'oid'} = $config->{'oid_base'} . $config->{'x86_indexes'}{'__idx__'}.$ifIndex;
}
my $raw = snmp_walk(\%snmp_call);
return $raw if (ref($raw) eq "HASH");
@ -518,6 +518,9 @@ $filename =~ tr/./_/;
$config->{'tmp_file'} = $filename.'.idx' if empty($config->{'tmp_file'});
$config->{'log'} = $filename.'.log' if empty($config->{'log'});
# Escape special characters
$config->{'community'} =~ s/([^\/\w])/\\$1/g;
# Check snmp connectivity
my $sysobjectid = snmp_get({%{$config}, 'oid' => '.1.3.6.1.2.1.1.2.0'});