Merge remote-tracking branch 'origin/develop' into new-vc-line-element

This commit is contained in:
Daniel Barbero Martin 2020-01-23 08:14:24 +01:00
commit 6c6403336f
6 changed files with 102 additions and 7 deletions

View File

@ -109,6 +109,6 @@ if (empty($data)) {
}
echo '{
"label": "'.$graph_title.'",
"data": [["'.time().'", '.$data.']]
"label": "'.htmlspecialchars($graph_title, ENT_QUOTES).'",
"data": [["'.time().'", '.htmlspecialchars($data, ENT_QUOTES).']]
}';

View File

@ -3318,7 +3318,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
case 'new':
?>
<tr id="general_template" style="" class="datos">
<td colspan="3">
<td colspan="4">
<?php
echo __('Please save the report to start adding items into the list.');
?>

View File

@ -46,6 +46,13 @@ if (! check_acl($config['id_user'], 0, 'PM')
$baseurl = ui_get_full_url(false, false, false, false);
$current_package = db_get_value(
'value',
'tconfig',
'token',
'current_package_enterprise'
);
?>
<!-- Add the stylesheet here cause somehow the 'ui_require_css_file'
@ -90,6 +97,8 @@ is not working on the metaconsole and there is no time to fix it -->
var text1_package_file = "<?php echo __('There is a new update available'); ?>\n";
var text2_package_file = "<?php echo __('There is a new update available to apply. Do you want to start the update process?'); ?>\n";
var text1_warning = "<?php echo __('WARNING'); ?>\n";
var text2_warning = "<?php echo __('This update does not correspond to the next version of Pandora'); ?>\n";
var applying_mr = "<?php echo __('Applying DB MR'); ?>\n";
var cancel_button = "<?php echo __('Cancel'); ?>\n";
var ok_button = "<?php echo __('Ok'); ?>\n";
@ -109,5 +118,5 @@ is not working on the metaconsole and there is no time to fix it -->
<script src="<?php echo $baseurl; ?>/include/javascript/update_manager.js"></script>
<script type="text/javascript">
form_upload("<?php echo $baseurl; ?>");
form_upload("<?php echo $baseurl; ?>", "<?php echo $current_package; ?>");
</script>

View File

@ -5485,6 +5485,45 @@ function get_help_info($section_name)
} else {
$result .= 'Discovery&printable=yes';
}
case 'alert_configure':
if ($es) {
$result .= 'Alerts#Correlation_alert_creation';
} else {
$result .= 'Alerts#Correlation_alert_creation';
}
break;
case 'alert_correlation':
if ($es) {
$result .= 'Alerts#Alert_correlation:_event_and_log_alerts';
} else {
$result .= 'Alerts#Alert_correlation:_event_and_log_alerts';
}
break;
case 'alert_rules':
if ($es) {
$result .= 'Alerts#Rules_within_a_correlation_alert';
} else {
$result .= 'Alerts#Rules_within_a_correlation_alert';
}
break;
case 'alert_fields':
if ($es) {
$result .= 'Alerts#Step_3:_Advanced_fields';
} else {
$result .= 'Alerts#Step_3:_Advanced_fields';
}
break;
case 'alert_triggering':
if ($es) {
$result .= 'Alerts#Configuring_an_alert_template';
} else {
$result .= 'Alerts#Configuring_an_alert_template';
}
break;
}

View File

@ -57,6 +57,9 @@ switch ($graph_type) {
$out_of_lim_str = io_safe_output(get_parameter('out_of_lim_str', false));
$out_of_lim_image = get_parameter('out_of_lim_image', false);
// Add relative path to avoid phar object injection.
$out_of_lim_image = '../graphs/'.$out_of_lim_image;
$title = get_parameter('title');
$mode = get_parameter('mode', 1);

View File

@ -4,7 +4,7 @@
var correct_install_progress = true;
function form_upload(homeurl) {
function form_upload(homeurl, current_package) {
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
//Thanks to: http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/
@ -164,7 +164,7 @@ function form_upload(homeurl) {
.change();
// Begin the installation
install_package(res.package, homeurl);
install_package(res.package, homeurl, current_package);
});
} else {
// Something has gone wrong!
@ -214,7 +214,7 @@ function formatFileSize(bytes) {
return (bytes / 1000).toFixed(2) + " KB";
}
function install_package(package, homeurl) {
function install_package(package, homeurl, current_package) {
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
$(
@ -1235,6 +1235,50 @@ function install_package(package, homeurl) {
$("#pkg_apply_dialog").html(dialog_text);
$("#pkg_apply_dialog").dialog("open");
const number_update = package.match(/package_(\d+).oum/);
if (number_update === null || number_update[1] != current_package - 0 + 1) {
$(
"<div id='warning_pkg' class='dialog ui-dialog-content' title='" +
package_available +
"'></div>"
).dialog({
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 600,
height: 250,
buttons: [
{
text: ok_button,
click: function() {
$(this).dialog("close");
}
}
]
});
var dialog_warning = "<div class='update_popup'>";
dialog_warning =
dialog_warning +
"<div class='update_text'><h3>" +
text1_warning +
"</h3>";
dialog_warning = dialog_warning + "<p>" + text2_warning + "</p></div>";
dialog_warning =
dialog_warning +
"<div class='update_icon'><img src='" +
home_url +
"images/icono_warning_mr.png'></div>";
dialog_warning = dialog_warning + "</div>";
$("#warning_pkg").html(dialog_warning);
}
}
function check_install_package(package, homeurl) {