Merge branch 'develop' into ent-12517-cambiar-nombre-al-token-allow-all-ips

This commit is contained in:
Daniel Cebrian 2023-11-27 16:59:29 +01:00
commit ead68be05a
110 changed files with 1582 additions and 796 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.774-231123
Version: 7.0NG.774-231127
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.774-231123"
pandora_version="7.0NG.774-231127"
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.774';
use constant AGENT_BUILD => '231123';
use constant AGENT_BUILD => '231127';
# 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.774
%define release 231123
%define release 231127
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.774
%define release 231123
%define release 231127
%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.774
%define release 231123
%define release 231127
%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.774
%define release 231123
%define release 231127
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.774
%define release 231123
%define release 231127
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.774"
PI_BUILD="231123"
PI_BUILD="231127"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{231123}
{231127}
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.774 Build 231123")
#define PANDORA_VERSION ("7.0NG.774 Build 231127")
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.774(Build 231123))"
VALUE "ProductVersion", "(7.0NG.774(Build 231127))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

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

View File

@ -0,0 +1,8 @@
START TRANSACTION;
-- Delete table tagent_access
DROP TABLE tagent_access;
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
COMMIT;

View File

@ -418,7 +418,7 @@ switch ($login_screen) {
}
if ($config['enterprise_installed']) {
if ($config['reset_pass_option']) {
if ($config['reset_pass_option'] && $config['auth'] === 'mysql') {
$reset_pass_link = 'reset_pass.php';
// Reset password link.
echo '<div class="reset_password">';

View File

@ -217,6 +217,7 @@ foreach ($fields as $field) {
array_push($table->data, $data);
}
$tablePagination = '';
if ($fields) {
html_print_table($table);
$tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false);
@ -231,6 +232,9 @@ html_print_action_buttons(
[ 'icon' => 'next' ],
true
),
['type' => 'form_action']
[
'type' => 'form_action',
'right_content' => $tablePagination,
],
);
echo '</form>';

View File

@ -2000,7 +2000,11 @@ ui_require_jquery_file('json');
$('#' + thisLabel).prop('checked', true);
$('#' + thisLabel).siblings().prop('checked', false);
if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) {
var type_selected = $("#id_module_type").val();
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
var type_name_selected = type_names[type_selected];
if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true || type_name_selected == 'generic_data_string') {
$("#svg_dinamic").hide();
} else {
paint_graph_values();

View File

@ -31,13 +31,14 @@ if (is_ajax()) {
return;
}
echo '<h3>'.$template['name'].'</h3>';
echo '<h3 style="background-color: #14524f">'.$template['name'].'</h3>';
echo html_print_image('images/info.svg', true, ['class' => 'invert_filter']);
echo ui_print_alert_template_example($template['id'], true, true, false);
echo '<br />';
echo '<br />';
echo '<strong>'.__('Type').': </strong>';
echo alerts_get_alert_templates_type_name($template['type']);
echo '<br />';
echo ui_print_alert_template_example($template['id'], true);
echo '<br />';
if ($template['description'] != '') {

View File

@ -520,7 +520,7 @@ $(document).ready (function () {
name: "id_action",
value: "<?php echo (int) $id; ?>"
});
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
values,
function (data, status) {
@ -552,6 +552,9 @@ $(document).ready (function () {
// If the row is empty, hide it
if (field_row == '') {
// Clear hidden fields.
$("[name=field" + i + "_value]").val('');
$("[name=field" + i + "_recovery_value]").val('')
$table_macros_field.hide();
continue;
}

View File

@ -1240,7 +1240,7 @@ if ($step == 2) {
'priority',
$priority,
'',
0,
'',
0,
true,
false,

View File

@ -27,7 +27,6 @@ if (! check_acl($config['id_user'], 0, 'DM')) {
// Get some general DB stats (not very heavy)
// NOTE: this is not realtime monitoring stats, are more focused on DB sanity
$stat_access = db_get_sql('SELECT COUNT(*) FROM tagent_access WHERE id_agent != 0');
$stat_data = db_get_sql('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo != 0');
$stat_data_log4x = db_get_sql('SELECT COUNT(*) FROM tagente_datos_log4x WHERE id_agente_modulo != 0');
$stat_data_string = db_get_sql('SELECT COUNT(*) FROM tagente_datos_string WHERE id_agente_modulo != 0');
@ -149,18 +148,6 @@ echo $stat_modules;
echo '</b></td></tr>';
echo '<tr class="rowOdd"><td>';
echo __('Total agent access records');
echo '<td><b>';
if ($stat_access > $max_access) {
echo "<font color='#ff0000'>$stat_access</font>";
} else {
echo $stat_access;
}
echo '</b></td></tr>';
// Sanity
echo '<tr><th colspan=2><i>';
echo __('Database sanity');

View File

@ -68,7 +68,7 @@ foreach ($layer_ids as $layer_id) {
$layer_list[] = [
'id' => (strpos($layer_id, 'new_') === false) ? (int) $layer_id : null,
'layer_name' => $trimmed_name,
'layer_visible' => ((int) $layers[$layer_id]['visible'] === 1),
'layer_visible' => ($layers[$layer_id]['visible'] === 'true'),
'layer_group' => (int) $layers[$layer_id]['agents_from_group'],
'layer_agent_list' => $layers[$layer_id]['agents'],
'layer_group_list' => $layers[$layer_id]['groups'],
@ -560,21 +560,23 @@ html_print_table($table);
$user_groups = users_get_groups($config['user'], 'AR', false);
echo '<h3>'.__('Layers').'</h3>';
echo '<fieldset class="margin-bottom-10"><legend>'.__('Layers').'</legend>';
$table->width = '100%';
$table->class = 'databox filters';
$table->valign = [];
$table->valign[0] = 'top';
$table->valign[1] = 'top';
$table->valign[0] = 'top; width: 50%';
$table->valign[1] = 'top; width: 50%';
$table->data = [];
$table->data[0][0] = '<h4>'.__('List of layers').'</h4>';
$table->data[0][1] = '<div class="right">'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add "', true).'</div>';
$table->data[1][0] = '<table class="databox" border="0" cellpadding="4" cellspacing="4" id="list_layers"></table>';
$table->data[1][1] = '<div id="form_layer" class="invisible">
$table->data[1][0] = '<div id="form_layer" class="invisible">
<table id="form_layer_table" class="" border="0" cellpadding="4" cellspacing="4">
<tr>
<td colspan="4"><hr/></td>
</tr>
<tr>
<td>'.__('Layer name').':</td>
<td>'.html_print_input_text('layer_name_form', '', '', 20, 40, true).'</td>
@ -592,10 +594,6 @@ $table->data[1][1] = '<div id="form_layer" class="invisible">
<td>'.__('Agent').':</td>
<td colspan="3">';
$table->data[1][1] .= html_print_button(__('Add agent'), 'add_agent', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
$params = [];
$params['return'] = true;
$params['show_helptip'] = true;
@ -608,12 +606,13 @@ $params['javascript_function_action_after_select'] = 'active_button_add_agent';
$params['javascript_is_function_select'] = true;
$params['disabled_javascript_on_blur_function'] = false;
$table->data[1][1] .= ui_print_agent_autocomplete_input($params);
$table->data[1][1] .= '</td>
$table->data[1][0] .= ui_print_agent_autocomplete_input($params);
$buttonAgent = html_print_button(__('Add agent'), 'add_agent', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
$table->data[1][0] .= '</td>
</tr>
<tr>
<td colspan="4" align="right">'.$buttonAgent.'</td>
</tr>
<tr>
<td colspan="4">
<h4>'.__('List of Agents to be shown in the layer').'</h4>
@ -641,7 +640,7 @@ $params['disabled_javascript_on_blur_function'] = false;
$agent_for_group_input = ui_print_agent_autocomplete_input($params);
$add_group_btn = html_print_button(__('Add'), 'add_group', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
$table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
$table->data[1][0] .= '<tr><td colspan="4"><hr /></td></tr>
<tr>
<td>'.__('Group').':</td>
<td colspan="3">'.$group_select.'</td>
@ -661,7 +660,7 @@ $table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
</td>
</tr>';
$table->data[1][1] .= '<tr>
$table->data[1][0] .= '<tr>
<td align="right" colspan="4">'.html_print_button(__('Save Layer'), 'save_layer', false, 'javascript:saveNewLayer();', 'class="sub wand"', true).'
'.html_print_input_hidden('current_edit_layer_id', '', true).'
</td>
@ -669,7 +668,12 @@ $table->data[1][1] .= '<tr>
</table>
</div>';
$table->data[1][1] = '<fieldset>
<legend>'.__('Layers list').'</legend>
<table class="databox invisible" border="0" id="list_layers"></table>
</fieldset>';
html_print_table($table);
echo '</fieldset>';
switch ($action) {
case 'save_new':
@ -1229,6 +1233,8 @@ function getLayerRow (layerId, layerData) {
.append($editCol)
.append($deleteCol);
$("#list_layers").removeClass('invisible');
return $row;
}

View File

@ -757,6 +757,125 @@ if ($tab == 'tree') {
/*
* Group tree view.
*/
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters filter-table-adv';
if (is_metaconsole() === true) {
$table->cellspacing = 0;
$table->cellpadding = 0;
}
$search_group_string = get_parameter('search_group_string', '');
$search_agent_string = get_parameter('search_agent_string', '');
$agent_status = get_parameter('agent_status', '');
$show_not_init_agents = get_parameter('show_not_init_agents', 1);
$show_not_init_modules = get_parameter('show_not_init_modules', 1);
$show_full_hirearchy = get_parameter('show_full_hirearchy', 1);
$table->data = [];
$table->head = [];
$table->style = [];
$table->style[0] = 'width: 50%;';
$table->style[1] = 'width: 50%;';
$table->data[0][0] = html_print_label_input_block(
__('Search group'),
html_print_input_text(
'search_group_string',
$search_group_string,
'',
25,
255,
true,
false,
false,
'',
)
);
$agents_status_list = agents_status_list();
$table->data[0][1] = html_print_label_input_block(
__('Search by agent status').ui_print_help_tip(__('Shows the groups that contain an agent with the status that has been searched'), true),
html_print_select(
$agents_status_list,
'agent_status',
$agent_status,
'',
__('All'),
'',
true,
false,
false,
'w200p',
false,
'width: 100%;'
)
);
$table->data[1][0] = html_print_label_input_block(
__('Search by agent').ui_print_help_tip(__('Shows groups that contain an agent matching the search'), true),
html_print_input_text(
'search_agent_string',
$search_agent_string,
'',
25,
255,
true,
false,
false,
'',
)
);
$table->data[1][1] = html_print_label_input_block(
__('Show full hierarchy'),
html_print_checkbox_switch_extended(
'show_full_hirearchy',
1,
$show_full_hirearchy,
false,
'',
'',
true
)
);
$table->data[3][0] = '&nbsp;';
$table->data[3][1] = html_print_submit_button(
__('Filter'),
'filter',
false,
[
'class' => 'float-right',
'icon' => 'search',
],
true
);
$form = "<form method='post' action=''>";
$form .= html_print_table($table, true);
$form .= '</form>';
ui_toggle(
$form,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
echo "<div id='tree-controller-recipient'></div>";
} else {
/*
@ -826,6 +945,8 @@ if ($tab == 'tree') {
);
$form .= '</form>';
ui_toggle(
$form,
'<span class="subsection_header_title">'.__('Filters').'</span>',
@ -1058,87 +1179,119 @@ $tab = 'group_edition';
<?php } ?>
<script type="text/javascript">
var treeController = TreeController.getController();
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty();
let show_full_hirearchy = "<?php echo $show_full_hirearchy; ?>";
let show_not_init_agents = "<?php echo $show_not_init_agents; ?>";
let show_not_init_modules = "<?php echo $show_not_init_modules; ?>";
showSpinner();
$('#checkbox-show_full_hirearchy').on("change", function() {
if (show_full_hirearchy == 1) {
show_full_hirearchy = 0;
} else {
show_full_hirearchy = 1;
}
});
var parameters = {};
parameters['page'] = "include/ajax/tree.ajax";
parameters['getChildren'] = 1;
parameters['type'] = "<?php echo $tab; ?>";
parameters['filter'] = {};
parameters['filter']['searchGroup'] = '';
parameters['filter']['searchAgent'] = '';
parameters['filter']['statusAgent'] = '';
parameters['filter']['searchModule'] = '';
parameters['filter']['statusModule'] = '';
parameters['filter']['groupID'] = '';
parameters['filter']['tagID'] = '';
parameters['filter']['searchHirearchy'] = 1;
parameters['filter']['show_not_init_agents'] = 1;
parameters['filter']['show_not_init_modules'] = 1;
$('#button-filter').on('click', function(event) {
console.log('here');
event.preventDefault();
$.ajax({
type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
data: parameters,
success: function(data) {
if (data.success) {
hideSpinner();
load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules);
});
treeController.init({
recipient: $("div#tree-controller-recipient"),
page: parameters['page'],
emptyMessage: "<?php echo __('No data found'); ?>",
foundMessage: "<?php echo __('Found groups'); ?>",
tree: data.tree,
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
filter: parameters['filter'],
counterTitles: {
total: {
agents: "<?php echo __('Total agents'); ?>",
modules: "<?php echo __('Total modules'); ?>",
none: "<?php echo __('Total'); ?>"
},
alerts: {
agents: "<?php echo __('Fired alerts'); ?>",
modules: "<?php echo __('Fired alerts'); ?>",
none: "<?php echo __('Fired alerts'); ?>"
},
critical: {
agents: "<?php echo __('Critical agents'); ?>",
modules: "<?php echo __('Critical modules'); ?>",
none: "<?php echo __('Critical'); ?>"
},
warning: {
agents: "<?php echo __('Warning agents'); ?>",
modules: "<?php echo __('Warning modules'); ?>",
none: "<?php echo __('Warning'); ?>"
},
unknown: {
agents: "<?php echo __('Unknown agents'); ?>",
modules: "<?php echo __('Unknown modules'); ?>",
none: "<?php echo __('Unknown'); ?>"
},
not_init: {
agents: "<?php echo __('Not init agents'); ?>",
modules: "<?php echo __('Not init modules'); ?>",
none: "<?php echo __('Not init'); ?>"
},
ok: {
agents: "<?php echo __('Normal agents'); ?>",
modules: "<?php echo __('Normal modules'); ?>",
none: "<?php echo __('Normal'); ?>"
window.addEventListener('load', function() {
load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules);
});
function load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules) {
var treeController = TreeController.getController();
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty();
showSpinner();
var parameters = {};
parameters['page'] = "include/ajax/tree.ajax";
parameters['getChildren'] = 1;
parameters['type'] = "<?php echo $tab; ?>";
parameters['filter'] = {};
parameters['filter']['searchGroup'] = $('#text-search_group_string').val();
parameters['filter']['searchAgent'] = $('#text-search_agent_string').val();
parameters['filter']['statusAgent'] = $('#agent_status option:selected').val();
parameters['filter']['searchModule'] = '';
parameters['filter']['statusModule'] = '';
parameters['filter']['groupID'] = '';
parameters['filter']['tagID'] = '';
parameters['filter']['searchHirearchy'] = 1;
parameters['filter']['show_full_hirearchy'] = show_full_hirearchy;
parameters['filter']['show_not_init_agents'] = show_not_init_agents;
parameters['filter']['show_not_init_modules'] = show_not_init_modules;
$.ajax({
type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
data: parameters,
success: function(data) {
if (data.success) {
hideSpinner();
treeController.init({
recipient: $("div#tree-controller-recipient"),
page: parameters['page'],
emptyMessage: "<?php echo __('No data found'); ?>",
foundMessage: "<?php echo __('Found groups'); ?>",
tree: data.tree,
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
filter: parameters['filter'],
counterTitles: {
total: {
agents: "<?php echo __('Total agents'); ?>",
modules: "<?php echo __('Total modules'); ?>",
none: "<?php echo __('Total'); ?>"
},
alerts: {
agents: "<?php echo __('Fired alerts'); ?>",
modules: "<?php echo __('Fired alerts'); ?>",
none: "<?php echo __('Fired alerts'); ?>"
},
critical: {
agents: "<?php echo __('Critical agents'); ?>",
modules: "<?php echo __('Critical modules'); ?>",
none: "<?php echo __('Critical'); ?>"
},
warning: {
agents: "<?php echo __('Warning agents'); ?>",
modules: "<?php echo __('Warning modules'); ?>",
none: "<?php echo __('Warning'); ?>"
},
unknown: {
agents: "<?php echo __('Unknown agents'); ?>",
modules: "<?php echo __('Unknown modules'); ?>",
none: "<?php echo __('Unknown'); ?>"
},
not_init: {
agents: "<?php echo __('Not init agents'); ?>",
modules: "<?php echo __('Not init modules'); ?>",
none: "<?php echo __('Not init'); ?>"
},
ok: {
agents: "<?php echo __('Normal agents'); ?>",
modules: "<?php echo __('Normal modules'); ?>",
none: "<?php echo __('Normal'); ?>"
}
}
}
});
}
},
dataType: "json"
});
});
}
},
dataType: "json"
});
}
</script>

View File

@ -519,9 +519,9 @@ if (!$maps && is_metaconsole() === false) {
$data = [];
if (is_metaconsole() === false) {
$data[0] = '<a href="index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;id='.$map['id'].'&amp;refr='.$refr.'">'.$map['name'].'</a>';
$data[0] = '<a href="index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;id='.$map['id'].'&amp;refr='.$refr.'">'.io_safe_output($map['name']).'</a>';
} else {
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&amp;refr='.$refr.'">'.$map['name'].'</a>';
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&amp;refr='.$refr.'">'.io_safe_output($map['name']).'</a>';
}
$data[1] = ui_print_group_icon($map['id_group'], true);
@ -541,7 +541,7 @@ if (!$maps && is_metaconsole() === false) {
true,
['class' => 'main_menu_icon invert_filter']
).'</a>';
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.io_safe_output($map['name']).'\')) return false;">'.html_print_image(
'images/delete.svg',
true,
['class' => 'main_menu_icon invert_filter']
@ -552,7 +552,7 @@ if (!$maps && is_metaconsole() === false) {
true,
['class' => 'main_menu_icon invert_filter']
).'</a>';
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.io_safe_output($map['name']).'\')) return false;">'.html_print_image(
'images/delete.svg',
true,
['class' => 'main_menu_icon invert_filter']

View File

@ -150,6 +150,7 @@ $fullscale = false;
$percentil = false;
$image_threshold = false;
$time_compare_overlapped = false;
$unknowns_graph = false;
// Added for events items.
$server_multiple = [0];
@ -354,6 +355,7 @@ switch ($action) {
$percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0;
$image_threshold = (isset($style['image_threshold']) === true) ? (bool) $style['image_threshold'] : false;
$graph_render = $item['graph_render'];
$unknowns_graph = $item['check_unknowns_graph'];
// The break hasn't be forgotten.
case 'simple_baseline_graph':
case 'projection_graph':
@ -2954,6 +2956,23 @@ if (is_metaconsole() === true) {
</td>
</tr>
<tr id="row_unknowns_graph" class="datos">
<td class="bolder">
<?php
echo __('Show unknowns in graph');
?>
</td>
<td>
<?php
html_print_checkbox_switch(
'unknowns_graph',
1,
$unknowns_graph
);
?>
</td>
</tr>
<tr id="row_time_compare_overlapped" class="datos">
<td class="bolder">
<?php
@ -6877,6 +6896,7 @@ function chooseType() {
$("#row_group_by").hide();
$("#row_type_show").hide();
$("#row_use_prefix_notation").hide();
$("#row_unknowns_graph").hide();
$("#row_os_selector").hide();
$("#row_os_version_regexp").hide();
$("#row_os_end_of_life").hide();
@ -6969,6 +6989,7 @@ function chooseType() {
$("#row_image_threshold").show();
$("#row_graph_render").show();
$("#row_percentil").show();
$("#row_unknowns_graph").show();
// Force type.
if('<?php echo $action; ?>' === 'new'){

View File

@ -777,7 +777,7 @@ $table->data[0][0] = html_print_label_input_block(
)
);
$table->data[0][1] = html_print_label_input_block(
__('Poisition'),
__('Position'),
html_print_input_text_extended(
'position_to_delete',
1,

View File

@ -1928,6 +1928,7 @@ switch ($action) {
$values['graph_render'] = (int) get_parameter(
'graph_render'
);
$values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] = (int) get_parameter(
@ -2867,6 +2868,7 @@ switch ($action) {
$values['graph_render'] = (int) get_parameter(
'graph_render'
);
$values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] = (int) get_parameter(

View File

@ -151,7 +151,7 @@ $table->data[0][] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$visualConsoleName,
io_safe_output($visualConsoleName),
'',
80,
100,

View File

@ -163,7 +163,7 @@ switch ($activeTab) {
$background_color = (string) get_parameter('background_color');
$width = (int) get_parameter('width');
$height = (int) get_parameter('height');
$visualConsoleName = (string) get_parameter('name');
$visualConsoleName = (string) io_safe_input(get_parameter('name'));
$is_favourite = (int) get_parameter('is_favourite_sent');
$auto_adjust = (int) get_parameter('auto_adjust_sent');
@ -239,7 +239,7 @@ switch ($activeTab) {
if ($uploadOK == 1) {
if (move_uploaded_file($_FILES['background_image']['tmp_name'], $target_file)) {
$background = $nameImage;
$values['background'] = $background;
$values['background'] = io_safe_input($background);
$error2 = chmod($target_file, 0644);
$uploadOK = $error2;
} else {
@ -872,7 +872,7 @@ $buttons[$activeTab]['active'] = true;
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
ui_print_standard_header(
($visualConsoleName ?? ''),
(io_safe_output($visualConsoleName) ?? ''),
'images/visual_console.png',
false,
$tab_builder,

View File

@ -64,32 +64,33 @@ $table->style = [];
// $table->style[0] = 'font-weight: bold';
$table->align = [];
$table->align[1] = 'center';
$table->align[3] = 'center';
$table->align[8] = 'right';
$table->align[4] = 'center';
$table->align[9] = 'right';
$table->headstyle[1] = 'text-align:center';
$table->headstyle[3] = 'text-align:center';
$table->headstyle[8] = 'text-align:right;width: 120px;';
$table->headstyle[4] = 'text-align:center';
$table->headstyle[9] = 'text-align:right;width: 120px;';
$table->titleclass = 'tabletitle';
$table->titlestyle = 'text-transform:uppercase;';
$table->style[6] = 'display: flex;align-items: center;';
$table->style[7] = 'display: flex;align-items: center;';
$table->head = [];
$table->head[0] = __('Name');
$table->head[1] = __('Status');
$table->head[2] = __('Type');
$table->head[3] = __('Version');
$table->head[4] = __('Modules');
$table->head[5] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true);
$table->head[6] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true);
$table->head[3] = __('Master');
$table->head[4] = __('Version');
$table->head[5] = __('Modules');
$table->head[6] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true);
$table->head[7] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true);
// This will have a column of data such as "6 hours".
$table->head[7] = __('Updated');
$table->head[8] = __('Updated');
// Only Pandora Administrator can delete servers.
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$table->head[8] = '<span title="Operations">'.__('Op.').'</span>';
$table->head[9] = '<span title="Operations">'.__('Op.').'</span>';
}
$table->data = [];
@ -143,9 +144,11 @@ foreach ($servers as $server) {
}
// Type.
$data[2] = '<span class="nowrap">'.$server['img'];
$data[2] = '<span class="nowrap">'.$server['img'].'&nbsp;&nbsp;&nbsp;&nbsp;'.$server['name'];
if ($server['master'] == $master) {
$data[2] .= ui_print_help_tip(__('This is a master server'), true);
$data[3] .= __('Yes', true);
} else {
$data[3] .= __('-');
}
if ((int) $server['exec_proxy'] === 1) {
@ -157,27 +160,27 @@ foreach ($servers as $server) {
case 'event':
case 'autoprovision':
case 'migration':
$data[3] = $server['version'];
$data[4] = __('N/A');
$data[4] = $server['version'];
$data[5] = __('N/A');
$data[6] = __('N/A');
break;
case 'export':
$data[3] = $server['version'];
$data[4] = $server['modules'].' '.__('of').' '.$server['modules_total'];
$data[5] = __('N/A');
$data[4] = $server['version'];
$data[5] = $server['modules'].' '.__('of').' '.$server['modules_total'];
$data[6] = __('N/A');
break;
default:
$data[3] = $server['version'];
$data[4] = $server['modules'].' '.__('of').' '.$server['modules_total'];
$data[5] = '<span class="nowrap">'.$server['lag_txt'].'</span>';
$data[4] = $server['version'];
$data[5] = $server['modules'].' '.__('of').' '.$server['modules_total'];
$data[6] = '<span class="nowrap">'.$server['lag_txt'].'</span>';
break;
}
$data[6] = '';
$data[7] = '';
if ($server['queued_modules'] > 500) {
$data[6] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
$data[7] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
'images/info-warning.svg',
true,
[
@ -189,9 +192,9 @@ foreach ($servers as $server) {
).'</a></div>&nbsp;&nbsp;';
}
$data[6] .= $server['threads'].' : '.$server['queued_modules'];
$data[7] .= $server['threads'].' : '.$server['queued_modules'];
$data[7] = ui_print_timestamp($server['keepalive'], true);
$data[8] = ui_print_timestamp($server['keepalive'], true);
if ($server['type'] === 'data') {
$ext = '_server';
@ -208,11 +211,11 @@ foreach ($servers as $server) {
// Only Pandora Administrator can delete servers.
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$data[8] = '';
$data[9] = '';
if ($server['type'] === 'recon') {
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
$data[8] .= html_print_image(
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
$data[9] .= html_print_image(
'images/snmp-trap@svg.svg',
true,
[
@ -221,12 +224,12 @@ foreach ($servers as $server) {
]
);
$data[8] .= '</a>';
$data[9] .= '</a>';
}
if ($server['type'] === 'data') {
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
$data[8] .= html_print_image(
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
$data[9] .= html_print_image(
'images/force@svg.svg',
true,
[
@ -234,10 +237,10 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
$data[8] .= '</a>';
$data[9] .= '</a>';
} else if ($server['type'] === 'enterprise snmp') {
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
$data[8] .= html_print_image(
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
$data[9] .= html_print_image(
'images/force@svg.svg',
true,
[
@ -245,12 +248,12 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
$data[8] .= '</a>';
$data[9] .= '</a>';
}
if ($server['type'] === 'event' && (bool) check_acl($config['id_user'], 0, 'LM') === true) {
$data[8] .= '<a class="open-alerts-list-modal" href="">';
$data[8] .= html_print_image(
$data[9] .= '<a class="open-alerts-list-modal" href="">';
$data[9] .= html_print_image(
'images/alert@svg.svg',
true,
[
@ -258,11 +261,11 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
$data[8] .= '</a>';
$data[9] .= '</a>';
}
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
$data[8] .= html_print_image(
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
$data[9] .= html_print_image(
'images/edit.svg',
true,
[
@ -270,11 +273,11 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
$data[8] .= '</a>';
$data[9] .= '</a>';
if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) {
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">';
$data[8] .= html_print_image(
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">';
$data[9] .= html_print_image(
'images/agents@svg.svg',
true,
[
@ -282,10 +285,10 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
$data[8] .= '</a>';
$data[9] .= '</a>';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
$data[8] .= html_print_image(
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
$data[9] .= html_print_image(
'images/remote-configuration@svg.svg',
true,
[
@ -293,12 +296,12 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
$data[8] .= '</a>';
$data[9] .= '</a>';
$names_servers[$safe_server_name] = false;
}
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&amp;delete=1').'">';
$data[8] .= html_print_image(
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&amp;delete=1').'">';
$data[9] .= html_print_image(
'images/delete.svg',
true,
[
@ -307,14 +310,14 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
$data[8] .= '</a>';
$data[9] .= '</a>';
}
if ($tiny) {
unset($data[4]);
unset($data[6]);
unset($data[5]);
unset($data[7]);
unset($data[8]);
unset($data[9]);
}
$ext = '';
@ -323,10 +326,10 @@ foreach ($servers as $server) {
}
if ($tiny) {
unset($table->head[4]);
unset($table->head[6]);
unset($table->head[5]);
unset($table->head[7]);
unset($table->head[8]);
unset($table->head[9]);
}
if ($tiny) {

View File

@ -71,6 +71,8 @@ if (isset($config['filemanager']['message']) === true) {
$fallback_directory = 'images';
// Get directory.
$directory = (string) get_parameter('directory');
$directory = str_replace('&lt;', '', $text);
$directory = str_replace('&gt;', '', $text);
if (empty($directory) === true) {
$directory = $fallback_directory;
} else {

View File

@ -46,7 +46,7 @@ if ($idOS > 0) {
$description = $os['description'];
$icon = $os['icon_name'];
} else {
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$icon = get_parameter('icon', 0);
}
@ -87,9 +87,16 @@ if ($is_management_allowed === true) {
if (in_array($file_ext, $allowed_extensions) === false) {
$message = 9;
} else if (exif_imagetype($file_tmp) === false && $file_ext !== 'svg') {
$message = 10;
} else {
$message = 8;
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
$file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
if ($file_uploaded !== true) {
$message = 10;
}
}
}
} else {
@ -108,7 +115,7 @@ if ($is_management_allowed === true) {
if ($resultOrId === false) {
$message = 2;
$tab = 'builder';
$tab = 'manage_os';
$actionHidden = 'save';
$textButton = __('Create');
$classButton = ['icon' => 'wand'];
@ -144,13 +151,19 @@ if ($is_management_allowed === true) {
if (in_array($file_ext, $allowed_extensions) === false) {
$message = 9;
} else if (exif_imagetype($file_tmp) === false) {
$message = 10;
} else {
$message = 8;
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
$file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
if ($file_uploaded !== true) {
$message = 10;
}
}
}
} else {
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$icon = get_parameter('icon', 0);
@ -254,7 +267,7 @@ $table->class = 'databox filter-table-adv';
$table->data[0][] = html_print_label_input_block(
__('Name'),
html_print_input_text('name', $name, __('Name'), 20, 30, true, false, false, '', 'w250px')
html_print_input_text('name', $name, __('Name'), 20, 30, true, false, true, '', 'w250px')
);
$table->data[0][] = html_print_label_input_block(
@ -290,6 +303,28 @@ html_print_action_buttons(
echo '</form>';
$id_message = get_parameter('id_message', 0);
if ($id_message !== 0) {
switch ($id_message) {
case 8:
echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
break;
case 9:
echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
break;
case 10:
echo ui_print_error_message(__('An error ocurrered to upload icon'), '', true);
break;
default:
// Nothing to do.
break;
}
}
function get_list_os_icons_dir()
{

View File

@ -162,11 +162,15 @@ if (empty($id_message) === false) {
break;
case 8:
echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=8');
break;
case 9:
echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=9');
break;
case 10:
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=10');
break;
default:

View File

@ -154,8 +154,7 @@ if ($update_config == 1 && $config['history_db_enabled'] == 1) {
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
$total_agents = db_get_value('count(*)', 'tagente');
$disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
// $disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
$table_status = new StdClass();
$table_status->width = '100%';
$table_status->class = 'databox filters';
@ -666,8 +665,8 @@ $table_other->data[2][1] = html_print_label_input_block(
true
)
);
$table_other->data[3][0] = html_print_label_input_block(
/*
$table_other->data[3][0] = html_print_label_input_block(
__('Use agent access graph'),
html_print_checkbox_switch(
'agentaccess',
@ -676,9 +675,9 @@ $table_other->data[3][0] = html_print_label_input_block(
true,
$disable_agentaccess
)
);
$table_other->data[3][1] = html_print_label_input_block(
);
*/
$table_other->data[3][0] = html_print_label_input_block(
__('Max. recommended number of files in attachment directory'),
html_print_input_text(
'num_files_attachment',

View File

@ -370,7 +370,7 @@ switch ($section) {
break;
default:
$subpage = 'seccion: '.$section;
$subpage = 'seccion: ';
// Default.
break;
}

View File

@ -535,16 +535,47 @@ html_print_action_buttons(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
[
'icon' => 'update',
'onclick' => 'onFormSubmit()',
],
true
)
);
echo '</form>';
echo ui_print_warning_message(
[
'message' => __('Session timeout must be a number'),
'force_class' => 'invisible js_warning_msg',
],
'',
true
);
?>
<script type="text/javascript">
function onFormSubmit() {
const isNumber = n => $.isNumeric(n);
let session_timeout = $('#text-session_timeout').val()
if(isNumber(session_timeout)) {
if (session_timeout < 0) {
session_timeout = -1;
}
if (session_timeout > 604800) {
session_timeout = 604800;
}
$('#text-session_timeout').val(session_timeout);
} else {
$('.js_warning_msg').removeClass('invisible');
event.preventDefault();
return false;
}
}
function showAndHide() {
if ($('input[type=checkbox][name=double_auth_enabled]:checked').val() == 1) {
$('#table1-2FA_all_users').removeClass('invisible');

View File

@ -686,23 +686,55 @@ if ($update_user) {
$id_user = (string) get_parameter('id_user', '');
if ($password_new != '') {
$correct_password = false;
if ($config['auth'] !== 'mysql') {
ui_print_error_message(__('It is not possible to change the password because external authentication is being used'));
} else {
$correct_password = false;
$user_credentials_check = process_user_login($id_user, $own_password_confirm, true);
$user_credentials_check = process_user_login($id_user, $own_password_confirm, true);
if ($user_credentials_check !== false) {
$correct_password = true;
}
if ($user_credentials_check !== false) {
$correct_password = true;
}
if ((string) $password_confirm === (string) $password_new) {
if ($correct_password === true || is_user_admin($config['id_user'])) {
if ((is_user_admin($config['id_user']) === false || $config['enable_pass_policy_admin']) && $config['enable_pass_policy']) {
$pass_ok = login_validate_pass($password_new, $id, true);
if ($pass_ok != 1) {
ui_print_error_message($pass_ok);
if ((string) $password_confirm === (string) $password_new) {
if ($correct_password === true || is_user_admin($config['id_user'])) {
if ((is_user_admin($config['id_user']) === false || $config['enable_pass_policy_admin']) && $config['enable_pass_policy']) {
$pass_ok = login_validate_pass($password_new, $id, true);
if ($pass_ok != 1) {
ui_print_error_message($pass_ok);
} else {
$res2 = update_user_password($id, $password_new);
if ($res2) {
db_process_sql_insert(
'tsesion',
[
'id_sesion' => '',
'id_usuario' => $id,
'ip_origen' => $_SERVER['REMOTE_ADDR'],
'accion' => 'Password&#x20;change',
'descripcion' => 'Access password updated',
'fecha' => date('Y-m-d H:i:s'),
'utimestamp' => time(),
]
);
$res3 = save_pass_history($id, $password_new);
// Generate new API token.
$newToken = api_token_generate();
$res4 = update_user($id, ['api_token' => $newToken]);
}
ui_print_result_message(
$res1 || $res2,
__('User info successfully updated'),
__('Error updating user info (no change?)')
);
}
} else {
$res2 = update_user_password($id, $password_new);
if ($res2) {
$res3 = save_pass_history($id, $password_new);
db_process_sql_insert(
'tsesion',
[
@ -715,7 +747,6 @@ if ($update_user) {
'utimestamp' => time(),
]
);
$res3 = save_pass_history($id, $password_new);
// Generate new API token.
$newToken = api_token_generate();
@ -729,54 +760,27 @@ if ($update_user) {
);
}
} else {
$res2 = update_user_password($id, $password_new);
if ($res2) {
$res3 = save_pass_history($id, $password_new);
db_process_sql_insert(
'tsesion',
[
'id_sesion' => '',
'id_usuario' => $id,
'ip_origen' => $_SERVER['REMOTE_ADDR'],
'accion' => 'Password&#x20;change',
'descripcion' => 'Access password updated',
'fecha' => date('Y-m-d H:i:s'),
'utimestamp' => time(),
]
);
// Generate new API token.
$newToken = api_token_generate();
$res4 = update_user($id, ['api_token' => $newToken]);
if ($own_password_confirm === '') {
ui_print_error_message(__('Password of the active user is required to perform password change'));
} else {
ui_print_error_message(__('Password of active user is not correct'));
}
ui_print_result_message(
$res1 || $res2,
__('User info successfully updated'),
__('Error updating user info (no change?)')
);
}
} else {
if ($own_password_confirm === '') {
ui_print_error_message(__('Password of the active user is required to perform password change'));
} else {
ui_print_error_message(__('Password of active user is not correct'));
}
db_process_sql_insert(
'tsesion',
[
'id_sesion' => '',
'id_usuario' => $id,
'ip_origen' => $_SERVER['REMOTE_ADDR'],
'accion' => 'Password&#x20;change',
'descripcion' => 'Access password update failed',
'fecha' => date('Y-m-d H:i:s'),
'utimestamp' => time(),
]
);
ui_print_error_message(__('Passwords does not match'));
}
} else {
db_process_sql_insert(
'tsesion',
[
'id_sesion' => '',
'id_usuario' => $id,
'ip_origen' => $_SERVER['REMOTE_ADDR'],
'accion' => 'Password&#x20;change',
'descripcion' => 'Access password update failed',
'fecha' => date('Y-m-d H:i:s'),
'utimestamp' => time(),
]
);
ui_print_error_message(__('Passwords does not match'));
}
} else {
$has_skin = false;

View File

@ -327,7 +327,7 @@ $passwordManageTable->data = [];
$passwordManageTable->data['captions_newpassword'][0] = __('New password');
$passwordManageTable->rowclass['fields_newpassword'] = 'w540px';
$passwordManageTable->data['fields_newpassword'][0] = html_print_input_text_extended(
$passwordManageTable->data['fields_newpassword'][0] = '<div class="relative container-div-input-password ">'.html_print_input_text_extended(
'password_new',
'',
'password_new',
@ -337,16 +337,17 @@ $passwordManageTable->data['fields_newpassword'][0] = html_print_input_text_exte
$view_mode,
'',
[
'class' => 'input w100p',
'class' => 'input',
'placeholder' => __('Password'),
'style' => 'width: 540px',
],
true,
true
);
).'</div>';
$passwordManageTable->data['captions_repeatpassword'][0] = __('Repeat new password');
$passwordManageTable->rowclass['fields_repeatpassword'] = 'w540px';
$passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_extended(
$passwordManageTable->data['fields_repeatpassword'][0] = '<div class="relative container-div-input-password ">'.html_print_input_text_extended(
'password_confirm',
'',
'password_conf',
@ -358,10 +359,11 @@ $passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_e
[
'class' => 'input w100p',
'placeholder' => __('Password confirmation'),
'style' => 'width: 540px',
],
true,
true
);
).'</div>';
if ($new_user === false && users_is_admin() === false) {
$passwordManageTable->data['captions_currentpassword'][0] = __('Current password');

View File

@ -99,10 +99,26 @@ if ($method === 'draw') {
$table->data = [];
$where_name = '';
if (strlen($filter['free_search']) > 0) {
$where = 'WHERE name LIKE "%'.$filter['free_search'].'%"';
} else {
$where = '';
$where_name = 'name LIKE "%'.$filter['free_search'].'%"';
}
$where_group = '';
if (empty($filter['group']) === false && $filter['group'] !== '0') {
$where_group = sprintf('id_group = %s', $filter['group']);
if (empty($where_name) === false) {
$where_group = 'AND '.$where_group;
}
}
$where = '';
if (empty($where_name) === false || empty($where_group) === false) {
$where = sprintf(
'WHERE %s %s',
$where_name,
$where_group
);
}
$sql = 'SELECT * FROM tdashboard '.$where.' ORDER BY id '.$pagination;

View File

@ -92,6 +92,8 @@ $get_id_source_event = get_parameter('get_id_source_event');
$node_id = (int) get_parameter('node_id', 0);
$settings_modal = get_parameter('settings', 0);
$parameters_modal = get_parameter('parameters', 0);
$draw_events_graph = get_parameter('drawEventsGraph', false);
// User private filter.
$current_filter = get_parameter('current_filter', 0);
$private_filter_event = get_parameter('private_filter_event', 0);
@ -2751,3 +2753,10 @@ if ($draw_row_response_info === true) {
echo $output;
return;
}
if ((bool) $draw_events_graph === true) {
$filter = get_parameter('filter');
$output = event_print_graph($filter);
echo $output;
return;
}

View File

@ -1361,10 +1361,12 @@ if (check_login()) {
$additionalLinkAction = '&amp;flag=1';
$linkCaption = __('Force checks');
$imgaction = 'images/force@svg.svg';
$visibility = '';
} else {
$additionalLinkAction = '';
$linkCaption = __('Refresh');
$imgaction = 'images/go-back@svg.svg';
$visibility = 'visibility: initial;';
}
$moduleActionButtons[] = html_print_anchor(
@ -1376,6 +1378,7 @@ if (check_login()) {
[
'title' => __('Force remote check'),
'class' => 'main_menu_icon forced_title',
'style' => $visibility,
]
),
],

View File

@ -38,6 +38,10 @@ if ($change_label === '1') {
$source = get_parameter('source', 0);
$user = get_parameter('user', '');
$value = get_parameter('value', 0) ? 1 : 0;
$user_info = get_user_info($config['id_user']);
if ((bool) $user_info['is_admin'] === false && $config['id_user'] !== $user) {
return false;
}
// Update the label value.
ob_clean();

View File

@ -59,6 +59,7 @@ if (is_ajax() === true) {
$metaID = (int) get_parameter('metaID', 0);
$childrenMethod = get_parameter('childrenMethod', 'on_demand');
$default_filters = [
'searchAgent' => '',
'statusAgent' => AGENT_STATUS_ALL,
@ -69,6 +70,7 @@ if (is_ajax() === true) {
];
$filter = get_parameter('filter', $default_filters);
$agent_a = check_acl($config['id_user'], 0, 'AR');
$agent_w = check_acl($config['id_user'], 0, 'AW');
$access = ($agent_a === true) ? 'AR' : (($agent_w === true) ? 'AW' : 'AR');

View File

@ -70,8 +70,7 @@ $otherSerialize = get_parameter('other');
$otherMode = get_parameter('other_mode', 'url_encode');
$returnType = get_parameter('return_type', 'string');
$info = get_parameter('info', '');
$raw_decode = (bool) get_parameter('raw_decode', false);
$raw_decode = (bool) get_parameter('raw_decode', true);
$other = parseOtherParameter($otherSerialize, $otherMode, $raw_decode);
$apiPassword = io_output_password(
db_get_value_filter(

View File

@ -829,17 +829,47 @@ class AgentWizard extends HTML
];
}
html_print_action_buttons(
html_print_submit_button(
$this->actionLabel,
'sub-protocol',
$create_modules_button = '';
if ($this->actionType === 'snmp' && $this->version !== null && $this->message['type'][0] !== 'error') {
$create_modules_button = html_print_submit_button(
__('Create modules'),
'create-modules-action',
false,
[
'icon' => 'cog',
'onclick' => '$("#form-main-wizard").submit();',
'icon' => 'next',
'onclick' => 'processListModules()',
],
true
)
);
} else if ($this->actionType === 'wmi' && $this->protocol === 'wmi' && $this->message['type'][0] !== 'error') {
$create_modules_button = html_print_submit_button(
__('Create modules'),
'create-modules-action',
false,
[
'icon' => 'next',
'onclick' => 'processListModules()',
],
true
);
} else {
$create_modules_button = '';
}
html_print_action_buttons(
[
html_print_submit_button(
$this->actionLabel,
'sub-protocol',
false,
[
'icon' => 'cog',
'onclick' => '$("#form-main-wizard").submit();',
],
true
),
$create_modules_button,
]
);
// Prints main form.
@ -3765,7 +3795,10 @@ class AgentWizard extends HTML
'label' => __('Create modules'),
'name' => 'create-modules-action',
'type' => 'button',
'attributes' => [ 'icon' => 'next' ],
'attributes' => [
'icon' => 'next',
'style' => 'display: none;',
],
'script' => 'processListModules();',
'return' => true,
],

View File

@ -269,13 +269,6 @@ class ConsoleSupervisor
$this->checkSyncQueueStatus();
}
/*
* Check number of agents is equals and more than 200.
* NOTIF.ACCESSSTASTICS.PERFORMANCE
*/
$this->checkAccessStatisticsPerformance();
/*
* Checkc agent missing libraries.
* NOTIF.AGENT.LIBRARY
@ -573,13 +566,6 @@ class ConsoleSupervisor
$this->checkSyncQueueStatus();
}
/*
* Check number of agents is equals and more than 200.
* NOTIF.ACCESSSTASTICS.PERFORMANCE
*/
$this->checkAccessStatisticsPerformance();
/*
* Checkc agent missing libraries.
* NOTIF.AGENT.LIBRARY
@ -732,6 +718,8 @@ class ConsoleSupervisor
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup&section=perf',
]
);
} else {
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
}
} else {
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
@ -2390,17 +2378,19 @@ class ConsoleSupervisor
include_once $config['homedir'].'/include/functions_update_manager.php';
$login = get_parameter('login', false);
if (update_manager_verify_registration() === false) {
$this->notify(
[
'type' => 'NOTIF.UPDATEMANAGER.REGISTRATION',
'title' => __('This instance is not registered in the Update manager section'),
'message' => __('Click here to start the registration process'),
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
]
);
} else {
$this->cleanNotifications('NOTIF.UPDATEMANAGER.REGISTRATION');
if ($config['autoupdate'] === '1' || $_GET['sec2'] === 'godmode/update_manager/update_manager') {
if (update_manager_verify_registration() === false) {
$this->notify(
[
'type' => 'NOTIF.UPDATEMANAGER.REGISTRATION',
'title' => __('This instance is not registered in the Update manager section'),
'message' => __('Click here to start the registration process'),
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
]
);
} else {
$this->cleanNotifications('NOTIF.UPDATEMANAGER.REGISTRATION');
}
}
}

View File

@ -580,9 +580,6 @@ class Diagnostics extends Wizard
$countModuleData = db_get_value_sql(
'SELECT COUNT(*) FROM tagente_datos'
);
$countAgentAccess = db_get_value_sql(
'SELECT COUNT(*) FROM tagent_access'
);
$countEvents = db_get_value_sql('SELECT COUNT(*) FROM tevento');
if (enterprise_installed() === true) {
@ -595,39 +592,35 @@ class Diagnostics extends Wizard
$result = [
'error' => false,
'data' => [
'countAgents' => [
'countAgents' => [
'name' => __('Total agents'),
'value' => $countAgents,
],
'countModules' => [
'countModules' => [
'name' => __('Total modules'),
'value' => $countModules,
],
'countGroups' => [
'countGroups' => [
'name' => __('Total groups'),
'value' => $countGroups,
],
'countModuleData' => [
'countModuleData' => [
'name' => __('Total module data records'),
'value' => $countModuleData,
],
'countAgentAccess' => [
'name' => __('Total agent access record'),
'value' => $countAgentAccess,
],
'countEvents' => [
'countEvents' => [
'name' => __('Total events'),
'value' => $countEvents,
],
'countTraps' => [
'countTraps' => [
'name' => __('Total traps'),
'value' => $countTraps,
],
'countUsers' => [
'countUsers' => [
'name' => __('Total users'),
'value' => $countUsers,
],
'countSessions' => [
'countSessions' => [
'name' => __('Total sessions'),
'value' => $countSessions,
],

View File

@ -47,6 +47,7 @@ class TipsWindow
'renderPreview',
'setShowTipsAtStartup',
'getTips',
'getTipById',
];
/**
@ -221,8 +222,13 @@ class TipsWindow
*
* @return array $tip
*/
public function getTipById($idTip)
public function getTipById($idTip=false, $return=false)
{
if ($idTip === false) {
$idTip = get_parameter('idTip');
}
$return = get_parameter('return', false);
$tip = db_get_row(
'twelcome_tip',
'id',
@ -232,9 +238,20 @@ class TipsWindow
$tip['title'] = io_safe_output($tip['title']);
$tip['text'] = io_safe_output($tip['text']);
$tip['url'] = io_safe_output($tip['url']);
$tip['files'] = $this->getFilesFromTip($tip['id']);
}
return $tip;
if ($return !== false) {
if (empty($tip) === false) {
echo json_encode(['success' => true, 'data' => $tip]);
return;
} else {
echo json_encode(['success' => false]);
return;
}
} else {
return $tip;
}
}

View File

@ -106,20 +106,24 @@ class TreeGroupEdition extends TreeGroup
}
// Build the group hierarchy.
foreach ($groups as $id => $group) {
if (isset($groups[$id]['parent']) === true
&& ($groups[$id]['parent'] != 0)
) {
$parent = $groups[$id]['parent'];
// Parent exists.
if (isset($groups[$parent]['children']) === false) {
$groups[$parent]['children'] = [];
}
if (isset($this->filter['show_full_hirearchy']) === false
|| (isset($this->filter['show_full_hirearchy']) === true && (bool) $this->filter['show_full_hirearchy'] === true)
) {
foreach ($groups as $id => $group) {
if (isset($groups[$id]['parent']) === true
&& ($groups[$id]['parent'] != 0)
) {
$parent = $groups[$id]['parent'];
// Parent exists.
if (isset($groups[$parent]['children']) === false) {
$groups[$parent]['children'] = [];
}
// Store a reference to the group into the parent.
$groups[$parent]['children'][] = &$groups[$id];
// This group was introduced into a parent.
$groups[$id]['have_parent'] = true;
// Store a reference to the group into the parent.
$groups[$parent]['children'][] = &$groups[$id];
// This group was introduced into a parent.
$groups[$id]['have_parent'] = true;
}
}
}
@ -167,24 +171,112 @@ class TreeGroupEdition extends TreeGroup
];
$group_acl = '';
if (users_can_manage_group_all('AR') === false) {
$user_groups_str = implode(',', $this->userGroupsArray);
$group_acl = sprintf(
'AND id_grupo IN (%s)',
$user_groups_str
$search_agent = '';
$status_agent = '';
$inner_agent = '';
if ((bool) is_metaconsole() === true) {
if (users_can_manage_group_all('AR') === false) {
$user_groups_str = implode(',', $this->userGroupsArray);
$group_acl = sprintf(
' AND tgrupo.id_grupo IN (%s) ',
$user_groups_str
);
}
if (isset($this->filter['searchAgent']) === true && empty($this->filter['searchAgent']) === false
|| isset($this->filter['statusAgent']) === true && strlen($this->filter['statusAgent']) > 0
) {
$inner_agent = 'INNER JOIN tmetaconsole_agent ON tgrupo.id_grupo = tmetaconsole_agent.id_grupo';
}
if (isset($this->filter['searchAgent']) === true && empty($this->filter['searchAgent']) === false) {
$search_agent = ' AND tmetaconsole_agent.alias LIKE "%'.$this->filter['searchAgent'].'%" ';
}
if (isset($this->filter['statusAgent']) === true && strlen($this->filter['statusAgent']) > 0) {
switch ($this->filter['statusAgent']) {
case AGENT_STATUS_NORMAL:
$status_agent = ' AND (
tmetaconsole_agent.critical_count = 0
AND tmetaconsole_agent.warning_count = 0
AND tmetaconsole_agent.unknown_count = 0
AND tmetaconsole_agent.normal_count > 0)';
break;
case AGENT_STATUS_WARNING:
$status_agent = ' AND (
tmetaconsole_agent.critical_count = 0
AND tmetaconsole_agent.warning_count > 0
AND tmetaconsole_agent.total_count > 0)';
break;
case AGENT_STATUS_CRITICAL:
$status_agent = ' AND tmetaconsole_agent.critical_count > 0';
break;
case AGENT_STATUS_UNKNOWN:
$status_agent = ' AND (
tmetaconsole_agent.critical_count = 0
AND tmetaconsole_agent.warning_count = 0
AND tmetaconsole_agent.unknown_count > 0)';
break;
case AGENT_STATUS_NOT_NORMAL:
$status_agent = ' AND (
tmetaconsole_agent.normal_count <> total_count
OR tmetaconsole_agent.total_count = notinit_count)';
break;
case AGENT_STATUS_NOT_INIT:
$status_agent = ' AND (
tmetaconsole_agent.total_count = 0
OR tmetaconsole_agent.total_count = notinit_count)';
break;
default:
// Nothing to do.
break;
}
}
$sql = sprintf(
'SELECT tgrupo.id_grupo AS gid,
tgrupo.nombre as name,
tgrupo.parent,
tgrupo.icon
FROM tgrupo
%s
WHERE 1=1
%s
%s
%s ',
$inner_agent,
$search_agent,
$status_agent,
$group_acl
);
} else {
if (users_can_manage_group_all('AR') === false) {
$user_groups_str = implode(',', $this->userGroupsArray);
$group_acl = sprintf(
'AND id_grupo IN (%s)',
$user_groups_str
);
}
$sql = sprintf(
'SELECT id_grupo AS gid,
nombre as name,
parent,
icon
FROM tgrupo
WHERE 1=1
%s ',
$group_acl
);
}
$sql = sprintf(
'SELECT id_grupo AS gid,
nombre as name,
parent,
icon
FROM tgrupo
WHERE 1=1 %s',
$group_acl
);
$stats = db_get_all_rows_sql($sql);
$group_stats = [];
foreach ($stats as $group) {

View File

@ -702,7 +702,7 @@ class WelcomeWindow extends Wizard
<?php
echo html_print_input_hidden('check_connectivity', 1);
echo html_print_label_input_block(
__('Ip target'),
__('IP address target'),
html_print_input_text(
'ip_target',
'',
@ -717,7 +717,7 @@ class WelcomeWindow extends Wizard
)
);
echo html_print_label_input_block(
__('Agent name'),
__('Agent alias'),
html_print_input_text(
'agent_name',
'',
@ -732,7 +732,7 @@ class WelcomeWindow extends Wizard
)
);
echo html_print_label_input_block(
__('Module group'),
__('Agent group'),
html_print_select_from_sql(
'SELECT * FROM tgrupo ORDER BY nombre',
'id_group',
@ -747,7 +747,6 @@ class WelcomeWindow extends Wizard
'width: 100%;'
)
);
echo html_print_submit_button(__('Create'), 'create_conectivity', false, ['icon' => 'next', 'style' => 'margin-top:15px; float:right;']);
?>
</div>
@ -1263,14 +1262,18 @@ class WelcomeWindow extends Wizard
});
});
$('#button-create_conectivity').click(function(){
$('#button-create_conectivity').click(function(e){
if($("#text-ip_target")[0].checkValidity() == false) {
$("#text-ip_target")[0].reportValidity();
return false;
}
$.ajax({
async: false,
type: "POST",
url: "include/ajax/task_to_perform.php",
data: {
check_connectivity: 1,
id_group: $('#id_group :selected').val(),
id_group: $('#id_group1 option:selected').val(),
ip_target: $('#text-ip_target').val(),
agent_name: $('#text-agent_name').val(),
},

View File

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

View File

@ -45,6 +45,7 @@ define('EVENT_NEW', 0);
define('EVENT_VALIDATE', 1);
define('EVENT_PROCESS', 2);
define('EVENT_NO_VALIDATED', 3);
define('EVENT_NO_PROCESS', 4);
// Events group by constants.
define('EVENT_GROUP_REP_ALL', 0);

View File

@ -4845,6 +4845,48 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
$data[1] = $time_elapsed;
$table_contact->data[] = $data;
if (enterprise_installed() === true) {
// SecurityMon line.
$id_module_group = db_get_value('id_mg', 'tmodule_group', 'name', 'Security');
$modules = db_get_all_rows_filter(
'tagente_modulo',
[
'id_agente' => $agent['id_agente'],
'id_module_group' => $id_module_group,
]
);
if (is_array($modules) === true && count($modules) > 0) {
$secmon_status = secmon_status($agent['id_agente']);
$data = [];
$data[0] = '<b>'.__('SecurityMon').'</b>';
$data[1] = ui_print_status_secmon_div($secmon_status, __('Total security modules: %s', count($modules)));
$table_contact->data[] = $data;
}
// Hardening line.
$module_score = modules_get_agentmodule_id(io_safe_input('Hardening - Score'), $agent['id_agente']);
$hardening = '';
if (is_array($module_score) === true && key_exists('id_agente_modulo', $module_score) == true) {
$raw_data_score = modules_get_raw_data($module_score['id_agente_modulo'], 0, time());
$hardening = format_numeric($raw_data_score[0]['datos'], 2);
$data = [];
$data[0] = '<b>'.__('Hardening').'</b>';
$data[1] = $hardening.' %';
$table_contact->data[] = $data;
}
// Vulnerabilities line.
$vuls = get_vulnerabilities($agent['id_agente']);
if (is_array($vuls) === true && count($vuls) > 0) {
$score = get_score($vuls);
$data = [];
$data[0] = '<b>'.__('Vulnerability').'</b>';
$data[1] = ui_print_status_vulnerability_div($score);
$table_contact->data[] = $data;
}
}
$agent_contact = html_print_div(
[
'class' => 'agent_details_header',
@ -4856,4 +4898,25 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
$agent_contact .= html_print_table($table_contact, true);
return $agent_contact;
}
/**
* Return an array with a list of status agents
*
* @return array.
*/
function agents_status_list()
{
$status_list = [];
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
return $status_list;
}

View File

@ -12952,7 +12952,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
$values = [];
if ($other['data'][0] != '') {
$values['event'] = $other['data'][0];
$values['event'] = io_safe_input(io_safe_output($other['data'][0]));
} else {
returnError('Event text required.');
return;

View File

@ -917,10 +917,6 @@ function config_update_config()
$error_update[] = __('Batch statistics period (secs)');
}
if (config_update_value('agentaccess', (int) get_parameter('agentaccess'), true) === false) {
$error_update[] = __('Use agent access graph');
}
if (config_update_value('num_files_attachment', (int) get_parameter('num_files_attachment'), true) === false) {
$error_update[] = __('Max. recommended number of files in attachment directory');
}
@ -2237,10 +2233,6 @@ function config_process_config()
config_update_value('show_qr_code_header', false);
}
if (!isset($config['agentaccess'])) {
config_update_value('agentaccess', true);
}
if (!isset($config['timezone'])) {
config_update_value('timezone', 'Europe/Berlin');
}

View File

@ -982,6 +982,9 @@ function events_get_all(
case EVENT_NO_VALIDATED:
$filter['status'][$key] = (EVENT_NEW.', '.EVENT_PROCESS);
case EVENT_NO_PROCESS:
$filter['status'][$key] = (EVENT_NEW.', '.EVENT_VALIDATE);
default:
// Ignore.
break;
@ -1027,6 +1030,24 @@ function events_get_all(
$validatedState
);
break;
case EVENT_NO_PROCESS:
// Show comments in validated events.
$validatedState = '';
if ($validatedEvents === true) {
$validatedState = sprintf(
'OR estado = %d',
EVENT_VALIDATE
);
}
$sql_filters[] = sprintf(
' AND (estado = %d OR estado = %d %s)',
EVENT_NEW,
EVENT_VALIDATE,
$validatedState
);
break;
}
}
}
@ -3204,12 +3225,14 @@ function events_get_all_status($report=false)
$fields[1] = __('Only validated');
$fields[2] = __('Only in process');
$fields[3] = __('Only not validated');
$fields[4] = __('Only not in process');
} else {
$fields[-1] = __('All event');
$fields[0] = __('New');
$fields[1] = __('Validated');
$fields[2] = __('In process');
$fields[3] = __('Not Validated');
$fields[4] = __('Not in process');
}
return $fields;
@ -4039,7 +4062,13 @@ function events_get_response_target(
if (empty($event['custom_data']) === false) {
$custom_data = json_decode($event['custom_data']);
foreach ($custom_data as $key => $value) {
$target = str_replace('_customdata_'.$key.'_', $value, $target);
if (is_array($value) === true) {
foreach ($value as $k => $v) {
$target = str_replace('_customdata_'.$k.'_', $v, $target);
}
} else {
$target = str_replace('_customdata_'.$key.'_', $value, $target);
}
}
if (strpos($target, '_customdata_json_') !== false) {
@ -5993,17 +6022,47 @@ function get_count_event_criticity(
$type = 'AND event_type = "'.$eventType.'"';
}
$groups = ' ';
$groups = ' ';
if ((int) $groupId !== 0) {
$groups = 'AND id_grupo IN ('.$groupId.')';
}
$status = ' ';
if ((int) $eventStatus !== -1) {
$status = 'AND estado = '.$eventStatus;
$status = ' ';
if (empty($eventStatus) === false) {
switch ($eventStatus) {
case EVENT_ALL:
default:
// Do not filter.
break;
case EVENT_NEW:
case EVENT_VALIDATE:
case EVENT_PROCESS:
$status = sprintf(
' AND estado = %d',
$eventStatus
);
break;
case EVENT_NO_VALIDATED:
$status = sprintf(
' AND (estado = %d OR estado = %d)',
EVENT_NEW,
EVENT_PROCESS
);
break;
case EVENT_NO_PROCESS:
$status = sprintf(
' AND (estado = %d OR estado = %d)',
EVENT_NEW,
EVENT_VALIDATE
);
break;
}
}
$criticity = ' ';
$criticity = ' ';
if (empty($criticityId) === false) {
$criticity = 'AND criticity IN ('.$criticityId.')';
}
@ -6199,3 +6258,144 @@ function event_get_counter_extraId(array $event, ?array $filters)
return $counters;
}
function event_print_graph(
$filter,
$graph_height=100,
) {
global $config;
$show_all_data = false;
$events = events_get_all(['te.id_evento', 'te.timestamp', 'te.utimestamp'], $filter, null, null, 'te.utimestamp', true);
if (empty($filter['date_from']) === false
&& empty($filter['time_from']) === false
&& empty($filter['date_to']) === false
&& empty($filter['time_to']) === false
) {
$start_utimestamp = strtotime($filter['date_from'].' '.$filter['time_from']);
$end_utimestamp = strtotime($filter['date_to'].' '.$filter['time_to']);
} else if ($filter['event_view_hr'] !== '') {
$start_utimestamp = strtotime('-'.$filter['event_view_hr'].' hours');
$end_utimestamp = strtotime('now');
} else {
$show_all_data = true;
$start_utimestamp = $events[0]['utimestamp'];
$end_utimestamp = $events[array_key_last($events)]['utimestamp'];
}
$data_events = [];
$control_timestamp = $start_utimestamp;
$count = 0;
foreach ($events as $event) {
if ($event['utimestamp'] === $control_timestamp) {
$count++;
} else {
$control_timestamp = $event['utimestamp'];
$count = 1;
}
$data_events[$control_timestamp] = $count;
}
$num_data = count($data_events);
$num_intervals = $num_data;
$period = ($end_utimestamp - $start_utimestamp);
if ($period <= SECONDS_6HOURS) {
$chart_time_format = 'H:i:s';
} else if ($period < SECONDS_1DAY) {
$chart_time_format = 'H:i';
} else if ($period < SECONDS_15DAYS) {
$chart_time_format = 'M d H:i';
} else if ($period < SECONDS_1MONTH) {
$chart_time_format = 'M d H\h';
} else {
$chart_time_format = 'M d H\h';
}
$chart = [];
$labels = [];
$color = [];
$count = 0;
if ($show_all_data === true) {
foreach ($events as $event) {
if ($event['utimestamp'] === $control_timestamp) {
$count++;
} else {
$control_timestamp = $event['utimestamp'];
$count = 1;
}
$data_events[$control_timestamp] = $count;
}
$data_events = array_reverse($data_events, true);
foreach ($data_events as $utimestamp => $count) {
$labels[] = date($chart_time_format, $utimestamp);
$chart[] = [
'y' => $count,
'x' => date($chart_time_format, $utimestamp),
];
$color[] = '#82b92f';
}
} else {
$interval_length = (int) ($period / $num_intervals);
$intervals = [];
$intervals[0] = $start_utimestamp;
for ($i = 0; $i < $num_intervals; $i++) {
$intervals[($i + 1)] = ($intervals[$i] + $interval_length);
}
$control_data = [];
foreach ($data_events as $utimestamp => $count_event) {
for ($i = 0; $i < $num_intervals; $i++) {
if ((int) $utimestamp > (int) $intervals[$i] && (int) $utimestamp < (int) $intervals[($i + 1)]) {
$control_data[(string) $intervals[$i]] += $count_event;
}
}
}
for ($i = 0; $i < $num_intervals; $i++) {
$labels[] = date($chart_time_format, $intervals[$i]);
$chart[] = [
'y' => $control_data[$intervals[$i]],
'x' => date($chart_time_format, $intervals[$i]),
];
$color[] = '#82b92f';
}
}
$water_mark = [
'file' => $config['homedir'].'/images/logo_vertical_water.png',
'url' => ui_get_full_url('/images/logo_vertical_water.png'),
];
$options = [
'height' => $graph_height,
'waterMark' => $water_mark,
'legend' => ['display' => false],
'colors' => $color,
'border' => false,
'scales' => [
'x' => [
'grid' => ['display' => false],
],
'y' => [
'grid' => ['display' => false],
],
],
'labels' => $labels,
];
$graph = '<div style="width:100%; height: '.$graph_height.'px;">';
$graph .= vbar_graph($chart, $options);
$graph .= '</div>';
return $graph;
}

View File

@ -2525,92 +2525,6 @@ function combined_graph_summatory_average(
}
/**
* Print a graph with access data of agents.
*
* @param integer $id_agent Agent Id.
* @param integer $period Timestamp period graph.
* @param boolean|null $return Type return.
*
* @return string
*/
function graphic_agentaccess(
int $id_agent,
int $period=0,
?bool $return=false,
?bool $agent_view=false
) {
global $config;
// Dates.
$date = get_system_time();
$datelimit = ($date - $period);
$interval = 3600;
// Query.
$sql = sprintf(
'SELECT utimestamp, count(*) as data
FROM tagent_access
WHERE id_agent = %d
AND utimestamp >= %d
AND utimestamp <= %d
GROUP BY TRUNCATE(utimestamp/%d,0)',
$id_agent,
$datelimit,
$date,
$interval
);
$data = db_get_all_rows_sql($sql);
// Array data.
$data_array = [];
$colors = [];
if (isset($data) === true && is_array($data) === true) {
foreach ($data as $value) {
$time = io_safe_output(date('H:m', $value['utimestamp']));
$labels[] = $time;
$data_array[] = [
'y' => (int) $value['data'],
'x' => $time,
];
$colors[] = '#82b92f';
}
}
$options = [];
$options['grid']['hoverable'] = true;
if ($agent_view === true) {
$options['agent_view'] = true;
}
$options = [
'height' => 125,
'colors' => $colors,
'legend' => ['display' => false],
'scales' => [
'x' => [
'grid' => ['display' => false],
'ticks' => [
'fonts' => ['size' => 8],
],
],
'y' => [
'grid' => ['display' => false],
'ticks' => [
'fonts' => ['size' => 8],
],
],
],
'labels' => $labels,
];
return vbar_graph($data_array, $options);
}
/**
* Print a pie graph with alerts defined/fired data
*

View File

@ -1745,7 +1745,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
'label' => __('Agents'),
'label_class' => 'font-title-font',
'type' => 'select_from_sql',
'sql' => 'SELECT `id_agente`,`nombre` FROM tagente',
'sql' => 'SELECT `id_agente`,`alias` FROM tagente',
'name' => 'filtered-module-agents-'.$uniqId,
'selected' => explode(',', $data['mAgents']),
'return' => true,
@ -4939,8 +4939,8 @@ function html_print_input_file($name, $return=false, $options=false, $inline_upl
$inline_upload_anchor_to_form
),
[
'mode' => 'link',
'style' => 'min-width: initial;',
'class' => 'secondary',
'style' => 'min-width: initial; position: relative; margin-left: 5%; ',
],
true,
);
@ -7305,8 +7305,10 @@ function html_print_select_date_range(
$time_end='',
$date_text=SECONDS_1DAY,
$class='w100p',
$date_format='Y/m/d',
$time_format='H:i:s'
$date_format_php='Y/m/d',
$time_format_php='H:i:s',
$date_format_js='yy/mm/dd',
$time_format_js='HH:mm:ss'
) {
global $config;
@ -7328,21 +7330,21 @@ function html_print_select_date_range(
}
if ($date_end === '') {
$date_end = date($date_format);
$date_end = date($date_format_php);
}
if ($date_init === '') {
$date_init = date($date_format, strtotime($date_end.' -1 days'));
$date_init = date($date_format_php, strtotime($date_end.' -1 days'));
}
$date_init = date($date_format, strtotime($date_init));
$date_init = date($date_format_php, strtotime($date_init));
if ($time_init === '') {
$time_init = date($time_format);
$time_init = date($time_format_php);
}
if ($time_end === '') {
$time_end = date($time_format);
$time_end = date($time_format_php);
}
$fields[SECONDS_1DAY] = __('Last 24hr');
@ -7508,7 +7510,7 @@ function html_print_select_date_range(
}
$('#text-date').datepicker({
dateFormat: '".DATE_FORMAT_JS."',
dateFormat: '".$date_format_js."',
changeMonth: true,
changeYear: true,
showAnim: 'slideDown'
@ -7516,7 +7518,7 @@ function html_print_select_date_range(
$('[id^=text-time_init]').timepicker({
showSecond: true,
timeFormat: '".TIME_FORMAT_JS."',
timeFormat: '".$time_format_js."',
timeOnlyTitle: '".__('Choose time')."',
timeText: '".__('Time')."',
hourText: '".__('Hour')."',
@ -7527,7 +7529,7 @@ function html_print_select_date_range(
});
$('[id^=text-date_init]').datepicker ({
dateFormat: '".DATE_FORMAT_JS."',
dateFormat: '".$date_format_js."',
changeMonth: true,
changeYear: true,
showAnim: 'slideDown',
@ -7549,7 +7551,7 @@ function html_print_select_date_range(
});
$('[id^=text-date_end]').datepicker ({
dateFormat: '".DATE_FORMAT_JS."',
dateFormat: '".$date_format_js."',
changeMonth: true,
changeYear: true,
showAnim: 'slideDown',
@ -7572,7 +7574,7 @@ function html_print_select_date_range(
$('[id^=text-time_end]').timepicker({
showSecond: true,
timeFormat: '".TIME_FORMAT_JS."',
timeFormat: '".$time_format_js."',
timeOnlyTitle: '".__('Choose time')."',
timeText: '".__('Time')."',
hourText: '".__('Hour')."',

View File

@ -142,7 +142,6 @@ function notifications_get_subtypes(?string $source=null)
'NOTIF.PANDORADB.HISTORICAL',
'NOTIF.HISTORYDB.MR',
'NOTIF.EXT.ELASTICSEARCH',
'NOTIF.EXT.LOGSTASH',
'NOTIF.METACONSOLE.DB_CONNECTION',
'NOTIF.DOWNTIME',
'NOTIF.UPDATEMANAGER.REGISTRATION',
@ -659,7 +658,15 @@ function notifications_get_user_label_status($source, $user, $label)
*/
function notifications_set_user_label_status($source, $user, $label, $value)
{
global $config;
$user_info = get_user_info($config['id_user']);
if ((bool) $user_info['is_admin'] === false && $config['id_user'] !== $user) {
return false;
}
$source_info = notifications_get_all_sources(['id' => $source]);
if (!isset($source_info[0])
|| !$source_info[0]['enabled']
|| !$source_info[0]['user_editable']

View File

@ -11294,7 +11294,7 @@ function reporting_simple_graph(
),
'ttl' => $ttl,
'compare' => $time_compare_overlapped,
'show_unknown' => true,
'show_unknown' => $content['check_unknowns_graph'],
'percentil' => ($content['style']['percentil'] == 1) ? $config['percentil'] : null,
'fullscale' => $fullscale,
'server_id' => $id_meta,

View File

@ -3249,7 +3249,7 @@ function reporting_html_group_report($table, $item, $pdf=0)
$out .= '</tr>';
$out .= '<tr>';
$out .= '</td>';
$out .= '<td><fieldset><legend>'.__('Events per agent').'</legend>';
$out .= '<td><fieldset><legend>'.__('Events by agent').'</legend>';
$data = [];
$options = [];
$labels = [];

View File

@ -665,6 +665,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'data';
$id_modulo = 1;
$server['name'] = __('Data server');
break;
case SERVER_TYPE_NETWORK:
@ -678,6 +679,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'network';
$id_modulo = 2;
$server['name'] = __('Network server');
break;
case SERVER_TYPE_SNMP:
@ -691,6 +693,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'snmp';
$id_modulo = 0;
$server['name'] = __('SNMP Trap server');
break;
case SERVER_TYPE_DISCOVERY:
@ -704,6 +707,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'recon';
$id_modulo = 0;
$server['name'] = __('Discovery server');
break;
case SERVER_TYPE_PLUGIN:
@ -717,6 +721,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'plugin';
$id_modulo = 4;
$server['name'] = __('Plugin server');
break;
case SERVER_TYPE_PREDICTION:
@ -730,6 +735,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'prediction';
$id_modulo = 5;
$server['name'] = __('Prediction server');
break;
case SERVER_TYPE_WMI:
@ -743,6 +749,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'wmi';
$id_modulo = 6;
$server['name'] = __('WMI server');
break;
case SERVER_TYPE_EXPORT:
@ -756,6 +763,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'export';
$id_modulo = 0;
$server['name'] = __('Export server');
break;
case SERVER_TYPE_INVENTORY:
@ -769,6 +777,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'inventory';
$id_modulo = 0;
$server['name'] = __('Inventory server');
break;
case SERVER_TYPE_WEB:
@ -782,6 +791,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'web';
$id_modulo = 0;
$server['name'] = __('Web server');
break;
case SERVER_TYPE_EVENT:
@ -795,6 +805,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'event';
$id_modulo = 2;
$server['name'] = __('Event server');
break;
case SERVER_TYPE_CORRELATION:
@ -808,6 +819,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'correlation';
$id_modulo = 0;
$server['name'] = __('Correlation server');
break;
case SERVER_TYPE_ENTERPRISE_ICMP:
@ -821,6 +833,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'enterprise icmp';
$id_modulo = 2;
$server['name'] = __('Enterprise ICMP server');
break;
case SERVER_TYPE_ENTERPRISE_SNMP:
@ -834,6 +847,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'enterprise snmp';
$id_modulo = 2;
$server['name'] = __('Enterprise SNMP server');
break;
case SERVER_TYPE_ENTERPRISE_SATELLITE:
@ -847,6 +861,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'enterprise satellite';
$id_modulo = 0;
$server['name'] = __('Enterprise Satellite server');
break;
case SERVER_TYPE_ENTERPRISE_TRANSACTIONAL:
@ -860,6 +875,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'enterprise transactional';
$id_modulo = 0;
$server['name'] = __('Enterprise Transactional server');
break;
case SERVER_TYPE_MAINFRAME:
@ -873,6 +889,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'mainframe';
$id_modulo = 0;
$server['name'] = __('Mainframe server');
break;
case SERVER_TYPE_SYNC:
@ -886,6 +903,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'sync';
$id_modulo = 0;
$server['name'] = __('Sync server');
break;
case SERVER_TYPE_WUX:
@ -899,6 +917,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'wux';
$id_modulo = 0;
$server['name'] = __('Wux server');
break;
case SERVER_TYPE_SYSLOG:
@ -912,6 +931,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'syslog';
$id_modulo = 0;
$server['name'] = __('Syslog server');
break;
case SERVER_TYPE_NCM:
@ -925,6 +945,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'ncm';
$id_modulo = 0;
$server['name'] = __('NCM server');
break;
case SERVER_TYPE_AUTOPROVISION:
@ -938,6 +959,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'autoprovision';
$id_modulo = 0;
$server['name'] = __('Autoprovision server');
break;
case SERVER_TYPE_MIGRATION:
@ -951,6 +973,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'migration';
$id_modulo = 0;
$server['name'] = __('Migration server');
break;
case SERVER_TYPE_ALERT:
@ -964,6 +987,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'alert';
$id_modulo = 0;
$server['name'] = __('Alert server');
break;
case SERVER_TYPE_NETFLOW:
@ -977,6 +1001,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'netflow';
$id_modulo = 0;
$server['name'] = __('Netflow server');
break;
case SERVER_TYPE_LOG:
@ -990,6 +1015,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'log';
$id_modulo = 0;
$server['name'] = __('Log server');
break;
case SERVER_TYPE_MADE:
@ -1003,6 +1029,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
);
$server['type'] = 'made';
$id_modulo = 0;
$server['name'] = __('MADE server');
break;
default:

View File

@ -644,14 +644,16 @@ function snmp_browser_print_oid(
if (isset($_POST['print_create_agent_module'])) {
// Hidden by default.
$output .= html_print_button(
__('Create agent module'),
'create_module_agent_single',
false,
'show_add_module()',
'class="sub add invisible"',
true
);
if (is_metaconsole() === false) {
$output .= html_print_button(
__('Create agent module'),
'create_module_agent_single',
false,
'show_add_module()',
'class="sub add invisible"',
true
);
}
}
if (isset($_POST['print_copy_oid'])) {
@ -1238,13 +1240,15 @@ function snmp_browser_print_container(
if ($show_massive_buttons) {
$output .= '<div id="snmp_create_buttons" style="display:none">';
$output .= html_print_submit_button(
__('Create agent modules'),
'create_modules_agent',
false,
['class' => 'sub add'],
true
);
if (is_metaconsole() === false) {
$output .= html_print_submit_button(
__('Create agent modules'),
'create_modules_agent',
false,
['class' => 'sub add'],
true
);
}
if (is_management_allowed() === true && enterprise_installed()) {
$output .= html_print_submit_button(

View File

@ -792,7 +792,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
false,
false,
'',
'white-box-content mrgn_top_0 mrgn_btn_0px',
'white-box-content-no-height mrgn_top_0 mrgn_btn_0px',
'white_table_flex'
);
@ -812,7 +812,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
true,
false,
'',
'white-box-content mrgn_top_0 mrgn_btn_0px border-bottom-gray',
'white-box-content-no-height mrgn_top_0 mrgn_btn_0px border-bottom-gray',
'white_table_flex'
);
}
@ -987,7 +987,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
true,
empty($table_advanced->data),
'',
'white-box-content mrgn_top_0 mrgn_btn_0px border-bottom-gray',
'white-box-content-no-height mrgn_top_0 mrgn_btn_0px border-bottom-gray',
'white_table_flex'
);

View File

@ -1802,11 +1802,14 @@ function ui_print_string_substr($string, $cutoff=16, $return=false, $fontsize=0)
*
* @return An HTML string if return was true.
*/
function ui_print_alert_template_example($id_alert_template, $return=false, $print_values=true)
function ui_print_alert_template_example($id_alert_template, $return=false, $print_values=true, $print_icon=true)
{
$output = '';
$output .= html_print_image('images/information.png', true, ['class' => 'invert_filter']);
if ($print_icon === true) {
$output .= html_print_image('images/information.png', true, ['class' => 'invert_filter']);
}
$output .= '<span id="example">';
$template = alerts_get_alert_template($id_alert_template);
@ -8230,3 +8233,43 @@ function ui_update_name_fav_element($id_element, $section, $label)
]
);
}
function ui_print_status_vulnerability_div(float $score)
{
$return = '';
$class = 'status_rounded_rectangles forced_title';
if (((float) $score) <= 5) {
return ui_print_div('group_view_ok '.$class, $score);
}
if (((float) $score) > 5 && ((float) $score) <= 7.5) {
return ui_print_div('group_view_warn '.$class, $score);
}
if (((float) $score) > 7.5) {
return ui_print_div('group_view_crit '.$class, $score);
}
return $return;
}
function ui_print_status_secmon_div($status, $title=false)
{
$class = 'status_rounded_rectangles forced_title';
if (($status) === 'normal') {
$title = ($title === false) ? __('normal') : $title;
return ui_print_div('group_view_ok '.$class, $title);
}
if (($status) === 'warning') {
$title = ($title === false) ? __('warning') : $title;
return ui_print_div('group_view_warn '.$class, $title);
}
if (($status) === 'critical') {
$title = ($title === false) ? __('critical') : $title;
return ui_print_div('group_view_crit '.$class, $title);
}
}

View File

@ -45,6 +45,7 @@ if (file_exists('../languages/'.$user_language.'.mo') === true) {
$type = (string) get_parameter('type', 'csv');
$data = (string) get_parameter('data');
$data = strip_tags(io_safe_output($data));
$data = json_decode(io_safe_output($data), true);
$default_filename = 'data_exported - '.date($config['date_format']);

View File

@ -1228,6 +1228,12 @@ function get_build_setup_charts($type, $options, $data)
) {
$colors = $options['colors'];
$borders = $options['colors'];
if (isset($options['border']) === true && (bool) $options['border'] === false) {
$borders = [];
foreach ($colors as $color) {
$borders[] = 'rgba(0, 0, 0, 0)';
}
}
} else {
// Colors.
$defaultColor = [];

View File

@ -2223,6 +2223,9 @@ function pandoraFlotArea(
}
var dataInSelection = ranges.xaxis.to - ranges.xaxis.from;
if (dataInSelection < 35000) {
return;
}
var maxticks_zoom = dataInSelection / 3600000 / number_ticks;
if (maxticks_zoom < 0.001) {

View File

@ -1739,3 +1739,8 @@ function loadModal() {
}
}
window.onload = loadModal;
function openEvents(severity) {
$('input[name="filter[severity]"]').val(severity);
$("#event_redirect").submit();
}

View File

@ -500,16 +500,25 @@ function configure_modules_form() {
"checked",
data["critical_inverse"]
);
$("#checkbox-warning_inverse").prop("checked", data["warning_inverse"]);
$("#checkbox-percentage_warning").prop(
"uncheck",
data["percentage_warning"]
);
$("#checkbox-percentage_critical").prop(
"uncheck",
data["percentage_critical"]
);
$("#label-radius-normal_warning").trigger("click");
$("#label-radius-normal_critical").trigger("click");
if (data["warning_inverse"] == true) {
$("#label-radius-warning_inverse").trigger("click");
}
if (data["critical_inverse"] == true) {
$("#label-radius-critical_inverse").trigger("click");
}
if (data["percentage_warning"] == true) {
$("#label-radius-percentage_warning").trigger("click");
}
if (data["percentage_critical"] == true) {
$("#label-radius-percentage_critical").trigger("click");
}
$("#component_loading").hide();
$("#id_module_type").change();
if ($("#id_category").is("select")) {

View File

@ -81,14 +81,17 @@ function removeInputImage(e) {
$("#notices_images").addClass("invisible");
}
}
function render({ title, text, url, files }) {
function render({ title, text, url, files, method }) {
$("#title_tip").html(title);
$("#text_tip").html(text);
if (url) {
$("#url_tip").removeClass("invisible");
$("#button-learn_more").removeAttr("disabled");
$("#button-learn_more").removeClass("disabled_button");
$("#url_tip").attr("href", url);
} else {
$("#url_tip").addClass("invisible");
$("#button-learn_more").attr("disabled", "disabled");
$("#button-learn_more").addClass("disabled_button");
$("#url_tip").attr("href", "");
}
$(".carousel").empty();
@ -110,7 +113,11 @@ function render({ title, text, url, files }) {
if (index >= limitRound - 1) {
$($(".count-round-tip")[0]).addClass("active");
} else {
$($(".count-round-tip")[index + 1]).addClass("active");
if (method == "next") {
$($(".count-round-tip")[index + 1]).addClass("active");
} else {
$($(".count-round-tip")[index - 1]).addClass("active");
}
}
return false;
}
@ -147,23 +154,79 @@ function render_counter() {
function next_tip() {
if (idTips.length >= totalTips) {
idTips = [];
$("#hidden-tip_position").val(-1);
}
$.ajax({
method: "POST",
url: url,
dataType: "json",
data: {
page: page,
method: "getRandomTip",
exclude: JSON.stringify(idTips)
},
success: function({ success, data }) {
if (success) {
idTips.push(parseInt(data.id));
render(data);
let tip_position = parseInt($("#hidden-tip_position").val()) + 1;
let idTip = idTips[tip_position];
if (idTip === undefined) {
$.ajax({
method: "POST",
url: url,
dataType: "json",
data: {
page: page,
method: "getRandomTip",
exclude: JSON.stringify(idTips)
},
success: function({ success, data }) {
if (success) {
let tip_position = parseInt($("#hidden-tip_position").val()) + 1;
$("#hidden-tip_position").val(tip_position);
idTips.push(parseInt(data.id));
data.method = "next";
render(data);
}
}
}
});
});
} else {
$.ajax({
method: "POST",
url: url,
dataType: "json",
data: {
page: page,
method: "getTipById",
idTip: idTip,
return: true
},
success: function({ success, data }) {
if (success) {
let tip_position = parseInt($("#hidden-tip_position").val()) + 1;
$("#hidden-tip_position").val(tip_position);
data.method = "next";
render(data);
}
}
});
}
}
function previous_tip() {
let actual_tip_position = parseInt($("#hidden-tip_position").val());
if (actual_tip_position != 0) {
let tip_position = parseInt($("#hidden-tip_position").val()) - 1;
let idTip = idTips[tip_position];
$.ajax({
method: "POST",
url: url,
dataType: "json",
data: {
page: page,
method: "getTipById",
idTip: idTip,
return: true
},
success: function({ success, data }) {
if (success) {
let tip_position = parseInt($("#hidden-tip_position").val()) - 1;
$("#hidden-tip_position").val(tip_position);
data.method = "prev";
render(data);
}
}
});
}
}
function load_tips_modal(settings) {

View File

@ -620,9 +620,16 @@ class ClusterManager
if (empty($tmp->group) === true) {
$tmp->group = __('Not set');
} else {
// Html div part for csv export.
$tmp->group = ui_print_group_icon(
$tmp->group,
true
).html_print_div(
[
'content' => groups_get_name($tmp->group),
'class' => 'invisible',
],
true
);
}
@ -636,9 +643,16 @@ class ClusterManager
}
// Status.
// Html div part for csv export.
$tmp->known_status = ui_print_module_status(
$tmp->known_status,
true
).html_print_div(
[
'content' => $tmp->known_status,
'class' => 'invisible',
],
true
);
// Options. View.

View File

@ -731,8 +731,7 @@ class Manager implements PublicLogin
int $limit=-1,
bool $favourite=false,
bool $slideshow=false,
string $id_user='',
array $rowFilter=[]
string $id_user=''
):array {
global $config;
@ -750,14 +749,6 @@ class Manager implements PublicLogin
$sql_where .= 'AND td.cells_slideshow = 1';
}
if (empty((int) $rowFilter['id_group']) === false) {
$sql_where .= ' AND td.id_group = '.$rowFilter['id_group'];
}
if (empty($rowFilter['name_filter']) === false) {
$sql_where .= ' AND td.name like "%'.$rowFilter['name_filter'].'%"';
}
if (empty($id_user) === true) {
$id_user = $config['id_user'];
}
@ -953,13 +944,6 @@ class Manager implements PublicLogin
private function showList()
{
global $config;
$id_group_filter = \get_parameter_post('id_group', '');
$name_filter = \get_parameter_post('name', '');
$rowFilter = [
'id_group' => $id_group_filter,
'name_filter' => $name_filter,
];
$limit_sql = $config['block_size'];
@ -973,7 +957,7 @@ class Manager implements PublicLogin
$resultCopy = $this->copy();
}
$dashboards = $this->getDashboards($this->offset, $limit_sql, false, false, '', $rowFilter);
$dashboards = $this->getDashboards($this->offset, $limit_sql);
$count = $this->getDashboardsCount();
View::render(

View File

@ -296,11 +296,7 @@ class EventCardboard extends Widget
];
// Event status.
$fields = [
-1 => __('All event'),
1 => __('Only validated'),
0 => __('Only pending'),
];
$fields = events_get_all_status(true);
$inputs['inputs']['row1'][] = [
'label' => __('Event status'),
@ -331,8 +327,13 @@ class EventCardboard extends Widget
$return_all_group = true;
}
$help_tip = ui_print_help_tip(
__('Only the first group selected will be used on the redirect to events view.'),
true
);
$inputs['inputs']['row1'][] = [
'label' => __('Groups'),
'label' => __('Groups').$help_tip,
'arguments' => [
'type' => 'select_groups',
'name' => 'groupId[]',
@ -530,6 +531,16 @@ class EventCardboard extends Widget
);
}
$output .= '<form style="display: none" action="'.ui_get_full_url('index.php?sec=eventos&sec2=operation/events/events').'" method="POST" id="event_redirect">';
$output .= html_print_input_hidden('filter[event_type]', $this->values['eventType'], true, false, false, 'filter[event_type]');
$output .= html_print_input_hidden('filter[event_view_hr]', $this->values['maxHours'], true, false, false, 'filter[event_view_hr]');
$output .= html_print_input_hidden('filter[status]', $this->values['eventStatus'], true, false, false, 'filter[status]');
$output .= html_print_input_hidden('filter[id_group_filter]', $this->values['groupId'][0], true, false, false, 'filter[id_group_filter]');
$output .= html_print_input_hidden('filter[severity]', '', true, false, false, 'filter[severity]');
$output .= html_print_input_hidden('get_events', '1', true, false, false, 'get_events');
$output .= html_print_input_hidden('filter[tag_with]', 'WyIwIl0=', true, false, false, 'filter[tag_with]');
$output .= html_print_input_hidden('filter[tag_without]', 'WyIwIl0=', true, false, false, 'filter[tag_without]');
$output .= '</form>';
$output .= '<table class="w100p h100p table-border-0 event-cardboard-widget"><tbody><tr>';
$width_td = (100 / count(explode(',', $severity)));
@ -543,7 +554,8 @@ class EventCardboard extends Widget
}
}
switch ((int) $key) {
$severity_row = (int) $key;
switch ($severity_row) {
case 0:
$text = __('Maintenance');
$color = get_priority_class((int) $key);
@ -604,7 +616,7 @@ class EventCardboard extends Widget
$border = ' border-right: 1px solid white; border-collapse: collapse;';
}
$output .= '<td class="'.$color.'" style="width: '.$width_td.'%;'.$border.'"><span class="med_data">';
$output .= '<td class="'.$color.'" style="width: '.$width_td.'%;'.$border.'" onclick="openEvents('.$severity_row.')"><span class="med_data">';
$output .= $count;
$output .= '</span><br>';
$output .= $text;

View File

@ -396,6 +396,7 @@ class EventsListWidget extends Widget
0 => \__('Only pending'),
2 => \__('Only in process'),
3 => \__('Only not validated'),
4 => \__('Only not in process'),
];
$inputs['inputs']['row1'][] = [

View File

@ -950,6 +950,23 @@ input.resize_button {
right: 6%;
}
.new-widget-message > div > table,
.container-center > div > table {
display: flex;
flex-direction: column;
align-items: center;
}
.new-widget-message > div > table tr td > div,
.container-center > div > table tr td > div {
position: absolute;
right: 20px;
}
.parent_graph > .graph {
margin-left: 10px;
}
.event-cardboard-widget td {
cursor: pointer;
}

View File

@ -4933,6 +4933,7 @@ div#dialog_messages table th:last-child {
margin-top: 55px;
border-radius: 5px;
max-height: 530px;
position: fixed;
}
#notification-wrapper::before {
@ -6443,6 +6444,18 @@ div#status_pie {
min-width: 100%;
}
.white-box-content-no-height {
width: 100%;
background-color: #fff;
box-sizing: border-box;
/*border: 1px solid #e2e2e2;*/
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 10px;
min-width: 100%;
}
.white-box-content-clean {
padding-left: 2em;
padding-top: 1em;
@ -6720,6 +6733,7 @@ table.table_modal_alternate tr td:first-child {
white-space: normal;
word-break: break-all;
line-height: 1.3;
max-width: 40px !important;
}
table#agent_interface_info .flot-text .flot-x-axis div {
@ -11768,16 +11782,14 @@ p.trademark-copyright {
}
.show-hide-pass {
position: absolute;
right: 9px;
top: 4px;
position: fixed;
border: 0;
outline: none;
margin: 0;
margin-left: -50px;
height: 30px;
width: 40px;
cursor: pointer;
display: inline-block;
display: initial;
}
.show-hide-pass-background {
@ -12771,6 +12783,28 @@ tr.shown td.details-control {
background-color: #81b92e3b !important;
}
.ui-dialog .tips_header.ui-dialog-titlebar {
height: fit-content !important;
}
.arrow_counter:hover {
cursor: pointer;
}
.disabled_button {
background-color: #ccc !important;
border: 2px solid #444 !important;
color: #444 !important;
}
.disabled_button:hover {
cursor: not-allowed;
}
.counter-tips {
margin-right: 20px;
}
.ui-datepicker-title > span {
color: #82b92e !important;
}
@ -12792,3 +12826,8 @@ tr.shown td.details-control {
position: relative;
top: -92px;
}
#cluetip-inner > #example {
position: absolute;
margin-left: 5px;
}

View File

@ -1871,3 +1871,8 @@ a.pandora_pagination,
#general-tactical-view #horizontalBar .labels .label span {
color: black;
}
#score-bar .labels-bar span,
#score-bar .labels-bar div {
color: white;
}

View File

@ -233,6 +233,10 @@
vertical-align: middle;
}
#audit_logs > tbody > tr > td > img {
padding-right: 10px;
}
.table_action_buttons > a,
.table_action_buttons > img,
.table_action_buttons > button,

View File

@ -21,7 +21,7 @@
display: flex !important;
padding: 0px 20px;
justify-content: space-between;
height: fit-content;
height: fit-content !important;
background-color: white;
color: #161628;
border-top-left-radius: 25px !important;
@ -161,6 +161,7 @@ span.count-round-tip.active {
margin-top: 10px;
}
.arrow_counter {
cursor: pointer;
width: 7px;
margin: 0px 5px;
}

View File

@ -119,7 +119,7 @@
.dt-buttons {
display: flex;
margin: 10px;
margin-left: 0px;
margin-left: 10px;
position: relative;
}
.dt-buttons button {
@ -148,6 +148,15 @@
.col-md-7 {
width: 80%;
}
.col-sl-12 {
width: 100%;
display: flex;
}
.col-sl-4 {
width: 33%;
margin: 10px;
}
}
@keyframes load {

View File

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

View File

@ -313,55 +313,6 @@ for ($i = 0; $i < $custom_fields_count; $i++) {
* END: TABLE DATA BUILD
*/
/*
* START: ACCESS RATE GRAPH
*/
$access_agent = db_get_value_sql(
'SELECT COUNT(id_agent)
FROM tagent_access
WHERE id_agent = '.$id_agente
);
if ((bool) $config['agentaccess'] === true && $access_agent > 0) {
$agentAccessRateHeader = html_print_div(
[
'class' => 'agent_details_header',
'content' => '<span class="subsection_header_title">'.__('Agent access rate (Last 24h)').'</span>',
],
true
);
$agentAccessRateContent = html_print_div(
[
'class' => 'white-table-graph-content',
'content' => graphic_agentaccess(
$id_agente,
SECONDS_1DAY,
true,
true
),
],
true
);
$agentAccessRate = html_print_div(
[
'class' => 'box-flat agent_details_col mrgn_lft_20px w50p',
'id' => 'table_access_rate',
'content' => $agentAccessRateHeader.$agentAccessRateContent,
],
true
);
} else {
$agentAccessRate = '';
}
/*
* END: ACCESS RATE GRAPH
*/
/*
* START: TABLE INTERFACES
*/
@ -598,7 +549,7 @@ html_print_div(
html_print_div(
[
'class' => 'agent_details_line',
'content' => $agentEvents.$agentAccessRate,
'content' => $agentEvents,
]
);

View File

@ -789,10 +789,6 @@ function print_table(
}
html_print_table($table);
if (count($selected_interfaces) > $config['block_size']) {
ui_pagination(count($selected_interfaces), false, $pagination_index, 0, false, 'offset', true, '');
}
} else {
ui_print_info_message(['no_close' => true, 'message' => __('No search parameters')]);
}

View File

@ -2348,6 +2348,7 @@ if (empty($result) === false) {
array_push($table->data, $data);
}
echo '<div class="total_pages">'.sprintf(__('Total items: %s'), $count).'</div>';
html_print_table($table);
if ($count_modules > $config['block_size']) {

View File

@ -2604,6 +2604,27 @@ try {
// Open current filter quick reference.
$active_filters_div = '<div class="filter_summary">';
$active_filters_div .= '<div>';
$active_filters_div .= '<div class="label box-shadow">'.__('Show graph').'</div>';
$active_filters_div .= html_print_div(
[
'class' => 'content',
'style' => 'padding-top: 5px !important;',
'content' => html_print_checkbox_switch_extended(
'show_event_graph',
1,
false,
false,
'',
'',
true
),
],
true
);
$active_filters_div .= '</div>';
// Current filter.
$active_filters_div .= '<div>';
$active_filters_div .= '<div class="label box-shadow">'.__('Current filter').'</div>';
@ -2642,6 +2663,10 @@ try {
case EVENT_NO_VALIDATED:
$active_filters_div .= __('Not validated.');
break;
case EVENT_NO_PROCESS:
$active_filters_div .= __('Not in process.');
break;
}
$active_filters_div .= '</div>';
@ -2690,6 +2715,42 @@ try {
$show_hide_filters = 'invisible';
}
// Print graphs
$graph_background = '';
if ($config['style'] === 'pandora') {
$graph_background = ' background-color: #fff;';
} else if ($config['style'] === 'pandora_black') {
$graph_background = ' background-color: #222;';
}
$graph_div = html_print_div(
[
'id' => 'events-graph',
'class' => 'invisible',
'style' => 'margin-bottom: 10px; text-align: left;'.$graph_background,
],
true
);
$graph_div .= html_print_div(
[
'id' => 'events-graph-loading',
'class' => 'center invisible',
'content' => html_print_image(
'images/spinner.gif',
true,
[
'title' => __('Loading'),
'class' => 'invert_filter',
]
),
],
true
);
// Print datatable.
html_print_div(
[
@ -2713,7 +2774,7 @@ try {
'inputs' => [],
'extra_buttons' => $buttons,
],
'extra_html' => $active_filters_div,
'extra_html' => $active_filters_div.$graph_div,
'pagination_options' => [
[
$config['block_size'],
@ -3261,6 +3322,19 @@ function reorder_tags_inputs() {
}
/* Tag management ends */
$(document).ready( function() {
let hidden_graph = true;
$('#checkbox-show_event_graph').on('change', function(){
if (hidden_graph == true) {
hidden_graph = false;
$('#events-graph').removeClass('invisible');
show_events_graph();
} else {
hidden_graph = true;
$('#events-graph').html();
$('#events-graph').addClass('invisible');
}
});
let refresco = <?php echo get_parameter('refr', 0); ?>;
$('#refresh option[value='+refresco+']').attr('selected', 'selected');
@ -3426,6 +3500,10 @@ $(document).ready( function() {
$("#button-remove_without").click(function() {
click_button_remove_tag("without");
});
$("#button-events_form_search_bt").click(function(){
show_events_graph();
});
//Autorefresh in fullscreen
@ -3641,4 +3719,27 @@ function show_event_dialo(event, dialog_page) {
);
return false;
}
function show_events_graph(){
var inputs = $("#events_form :input");
var values = {};
inputs.each(function() {
values[this.name] = $(this).val();
});
$.ajax({
method: 'POST',
url: '<?php echo ui_get_full_url('ajax.php'); ?>',
data: {
page: 'include/ajax/events',
drawEventsGraph: true,
filter: values
},
success: function (data){
$('#events-graph')
.empty()
.html(data);
}
});
}
</script>

View File

@ -38,7 +38,7 @@ $send_mes = (bool) get_parameter('send_mes', false);
$new_msg = (string) get_parameter('new_msg');
$dst_user = get_parameter('dst_user');
$dst_group = get_parameter('dst_group');
$subject = io_safe_html_tags(get_parameter('subject'));
$subject = io_safe_input(get_parameter('subject'));
$message = (string) get_parameter('message');
$read_message = (bool) get_parameter('read_message', false);
$reply = (bool) get_parameter('reply', false);
@ -132,7 +132,7 @@ if ($read_message) {
echo '<h1>Conversation with '.$user_name.'</h1>';
}
echo '<h2>Subject: '.$message['subject'].'</h2>';
echo '<h2>Subject: '.io_safe_output($message['subject']).'</h2>';
$conversation = messages_get_conversation($message);

View File

@ -259,7 +259,7 @@ if (empty($messages) === true) {
$pathSubject = 'index.php?sec=message_list&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;id_message='.$message_id;
}
$contentSubject = (empty($message['subject']) === true) ? __('No Subject') : $message['subject'];
$contentSubject = (empty($message['subject']) === true) ? __('No Subject') : io_safe_output($message['subject']);
if ((int) $message['read'] !== 1) {
$contentSubject = '<strong>'.$contentSubject.'</strong>';

View File

@ -72,6 +72,7 @@ if ($searchAgents) {
$has_secondary = enterprise_hook('agents_is_using_secondary_groups');
$stringSearchSQL = str_replace('&amp;', '&', $stringSearchSQL);
$stringSearchSQL = str_replace('&#92;', '\\', $stringSearchSQL);
$sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
INNER JOIN taddress_agent ON
taddress.id_a = taddress_agent.id_a

View File

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

View File

@ -293,12 +293,12 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
-- -----------------------------------------------------
-- Table `tagent_access`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tagent_access` (
`id_agent` INT UNSIGNED NOT NULL DEFAULT 0,
`utimestamp` BIGINT NOT NULL DEFAULT 0,
KEY `agent_index` (`id_agent`),
KEY `idx_utimestamp` USING BTREE (`utimestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- CREATE TABLE IF NOT EXISTS `tagent_access` (
-- `id_agent` INT UNSIGNED NOT NULL DEFAULT 0,
-- `utimestamp` BIGINT NOT NULL DEFAULT 0,
-- KEY `agent_index` (`id_agent`),
-- KEY `idx_utimestamp` USING BTREE (`utimestamp`)
-- ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- -----------------------------------------------------
-- Table `talert_snmp`
@ -1646,6 +1646,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`cat_security_hardening` INT NOT NULL DEFAULT 0,
`ignore_skipped` INT NOT NULL DEFAULT 0,
`status_of_check` TINYTEXT,
`check_unknowns_graph` tinyint DEFAULT '0',
PRIMARY KEY(`id_rc`),
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
ON UPDATE CASCADE ON DELETE CASCADE

View File

@ -67,74 +67,6 @@ if (isset($resultCopy) === true) {
);
}
// Filter table.
$filter_id_group = \get_parameter_post('id_group', '');
$filter_name = \get_parameter_post('name', '');
$filterTable = new stdClass();
$filterTable->class = 'filter-table-adv w100p';
$filterTable->size[0] = '20%';
$filterTable->size[1] = '20%';
$filterTable->data = [];
$filterTable->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'AR',
true,
'id_group',
$filter_id_group,
'',
'',
'',
true,
false,
true,
'w100p',
false,
''
)
);
$filterTable->data[0][1] = html_print_label_input_block(
__('Name'),
html_print_input_text('name', $filter_name, '', 25, 80, true)
);
$form_html = '<form id="form_dashboard_search" method="post" action="'.$urlDashboard.'">';
$form_html .= html_print_table($filterTable, true);
$form_html .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'uptbutton',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
),
],
true
);
$form_html .= '</form>';
ui_toggle(
$form_html,
'<span class="subsection_header_title">'.__('Filter').'</span>',
'dashboard_search',
false,
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
if (empty($dashboards) === true) {
ui_print_info_message(
[
@ -189,15 +121,21 @@ if (empty($dashboards) === true) {
'form' => [
'inputs' => [
[
'label' => __('Free search'),
'label' => __('Name'),
'type' => 'text',
'class' => 'w400px',
'class' => 'w80p',
'id' => 'free_search',
'name' => 'free_search',
],
[
'label' => __('Group'),
'type' => 'select_groups',
'id' => 'group',
'name' => 'group',
],
],
],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar ',
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
'csv' => false,
]
);

View File

@ -72,37 +72,36 @@ $output .= '<h2 id="title_tip">'.$title.'</h2>';
$output .= '<p id="text_tip">';
$output .= $text;
$output .= '</p>';
$link_class = 'invisible';
$disabled_class = 'disabled_button';
$disabled = true;
if (empty($url) === false && $url !== '') {
$link_class = '';
$disabled_class = '';
$disabled = false;
}
$output .= '<a href="'.$url.'" class="'.$link_class.'" target="_blank" id="url_tip">'.__('See more info').'</a>';
$output .= '</div>';
$output .= '<div class="ui-dialog-buttonset">';
$output .= '<a href="'.$url.'" class="" target="_blank" id="url_tip">';
$output .= html_print_button(
__('Maybe later'),
__('Learn more'),
'learn_more',
$disabled,
'',
false,
'',
[
'onclick' => 'close_dialog()',
'class' => 'secondary mini',
],
['class' => 'secondary mini '.$disabled_class],
true
);
$output .= '</a>';
$output .= '<div class="counter-tips">';
$output .= html_print_image('images/arrow-left-grey.png', true, ['class' => 'arrow_counter']);
$output .= html_print_image('images/arrow-right-grey.png', true, ['class' => 'arrow_counter']);
$output .= html_print_image('images/arrow-left-grey.png', true, ['class' => 'arrow_counter', 'onclick' => 'previous_tip()']);
$output .= html_print_image('images/arrow-right-grey.png', true, ['class' => 'arrow_counter', 'onclick' => 'next_tip()']);
$output .= html_print_input_hidden('tip_position', 0, true);
$output .= '</div>';
if ($preview === true) {
$output .= html_print_button(
__('Ok'),
'next_tip',
__('Close'),
'close_dialog',
false,
'',
[
@ -113,12 +112,12 @@ if ($preview === true) {
);
} else {
$output .= html_print_button(
__('Ok'),
'next_tip',
__('Close'),
'close_dialog',
false,
'',
[
'onclick' => 'next_tip()',
'onclick' => 'close_dialog()',
'class' => ($totalTips === '1') ? 'mini hide-button' : 'mini',
],
true

View File

@ -43,7 +43,7 @@ if ((int) $cellData['id_widget'] !== 0 || $widgetId !== 0) {
true
);
$output .= '<div class="new-widget-message">';
$output .= '<div class="new-widget-message w100p">';
$output .= \ui_print_info_message(
__('Please select widget'),
'',

View File

@ -268,7 +268,7 @@
<div class="row" id="auto-rescaling">
<div class="col-8 br-r trigger-100">
<div class="subtitle link padding10 padding2">
<?php echo __('Number of events per hour ('.$config['event_view_hr'].' hrs)'); ?></b> <a href="index.php?sec=eventos&sec2=operation/events/events&filter[event_view_hr]=24&filter[tag_with]=WyIwIl0=&filter[tag_without]=WyIwIl0="><?php echo __('Info'); ?></a>
<?php echo __('Number of events per hour ('.$config['event_view_hr'].' hrs)'); ?></b> <a href="index.php?sec=eventos&sec2=operation/events/events&filter[event_view_hr]=<?php echo $config['event_view_hr']; ?>&filter[tag_with]=WyIwIl0=&filter[tag_without]=WyIwIl0="><?php echo __('Info'); ?></a>
</div>
<div id="events-last-24"><?php echo $Events->loading(); ?></div>
<div class="row br-t h100p observer">

View File

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

Some files were not shown because too many files have changed in this diff Show More