mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
2012-08-02 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb_data.sql, pandoradb.data.postgreSQL.sql, pandoradb.data.oracle.sql, include/functions_config.php: fixed the "list_ACL_IPs_for_API" update. * operation/events/events_marquee.php, godmode/setup/setup.php, godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php, godmode/reporting/graphs.php, godmode/reporting/visual_console_builder.wizard.php, godmode/reporting/visual_console_builder.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/alert_list.php, godmode/alerts/configure_alert_template.php, godmode/alerts/alert_templates.php, godmode/alerts/configure_alert_action.php, godmode/alerts/configure_alert_command.php, godmode/alerts/alert_actions.php, godmode/alerts/alert_list.builder.php, godmode/alerts/configure_alert_special_days.php, include/functions_api.php, include/functions_ui.php, include/functions_netflow.php, include/functions_alerts.php, include/functions_menu.php, include/functions_messages.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6846 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
ba23ce80c2
commit
3646e7b843
@ -1,3 +1,28 @@
|
|||||||
|
2012-08-02 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* pandoradb_data.sql, pandoradb.data.postgreSQL.sql,
|
||||||
|
pandoradb.data.oracle.sql, include/functions_config.php: fixed the
|
||||||
|
"list_ACL_IPs_for_API" update.
|
||||||
|
|
||||||
|
* operation/events/events_marquee.php, godmode/setup/setup.php,
|
||||||
|
godmode/reporting/graph_builder.php,
|
||||||
|
godmode/reporting/map_builder.php, godmode/reporting/graphs.php,
|
||||||
|
godmode/reporting/visual_console_builder.wizard.php,
|
||||||
|
godmode/reporting/visual_console_builder.php,
|
||||||
|
godmode/alerts/configure_alert_compound.php,
|
||||||
|
godmode/alerts/alert_list.php,
|
||||||
|
godmode/alerts/configure_alert_template.php,
|
||||||
|
godmode/alerts/alert_templates.php,
|
||||||
|
godmode/alerts/configure_alert_action.php,
|
||||||
|
godmode/alerts/configure_alert_command.php,
|
||||||
|
godmode/alerts/alert_actions.php,
|
||||||
|
godmode/alerts/alert_list.builder.php,
|
||||||
|
godmode/alerts/configure_alert_special_days.php,
|
||||||
|
include/functions_api.php, include/functions_ui.php,
|
||||||
|
include/functions_netflow.php, include/functions_alerts.php,
|
||||||
|
include/functions_menu.php, include/functions_messages.php: cleaned
|
||||||
|
source code style.
|
||||||
|
|
||||||
2012-08-02 Sergio Martin <sergio.martin@artica.es>
|
2012-08-02 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/functions_api.php: Improve returns of
|
* include/functions_api.php: Improve returns of
|
||||||
|
@ -311,7 +311,8 @@ foreach ($actions as $action) {
|
|||||||
}
|
}
|
||||||
if (isset($data)){
|
if (isset($data)){
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
echo "<div class='nf'>".__('No alert actions configured')."</div>";
|
echo "<div class='nf'>".__('No alert actions configured')."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,9 +283,11 @@ $(document).ready (function () {
|
|||||||
function (data, status) {
|
function (data, status) {
|
||||||
if (data === false) {
|
if (data === false) {
|
||||||
$("#value", $value).append ("<em><?php echo __('Unknown') ?></em>");
|
$("#value", $value).append ("<em><?php echo __('Unknown') ?></em>");
|
||||||
} else if (data == "") {
|
}
|
||||||
|
else if (data == "") {
|
||||||
$("#value", $value).append ("<em><?php echo __('Empty') ?></em>");
|
$("#value", $value).append ("<em><?php echo __('Empty') ?></em>");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$("#value", $value).append (data);
|
$("#value", $value).append (data);
|
||||||
}
|
}
|
||||||
$loading.hide ();
|
$loading.hide ();
|
||||||
|
@ -136,7 +136,8 @@ if ($delete_alert) {
|
|||||||
"Fail to deleted alert '$alert_template_name' for module '$module_name' in agent '$agent_name'");
|
"Fail to deleted alert '$alert_template_name' for module '$module_name' in agent '$agent_name'");
|
||||||
}
|
}
|
||||||
|
|
||||||
$messageAction = ui_print_result_message ($result, __('Successfully deleted'), __('Could not be deleted'), '', true);
|
$messageAction = ui_print_result_message ($result,
|
||||||
|
__('Successfully deleted'), __('Could not be deleted'), '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($add_action) {
|
if ($add_action) {
|
||||||
@ -160,7 +161,8 @@ if ($add_action) {
|
|||||||
db_pandora_audit("Alert management", 'Fail to add action ' . $id_action . ' in alert ' . $id_alert_module);
|
db_pandora_audit("Alert management", 'Fail to add action ' . $id_action . ' in alert ' . $id_alert_module);
|
||||||
}
|
}
|
||||||
|
|
||||||
$messageAction = ui_print_result_message ($result, __('Successfully added'), __('Could not be added'), '', true);
|
$messageAction = ui_print_result_message ($result,
|
||||||
|
__('Successfully added'), __('Could not be added'), '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($delete_action) {
|
if ($delete_action) {
|
||||||
@ -176,7 +178,8 @@ if ($delete_action) {
|
|||||||
db_pandora_audit("Alert management", 'Fail to delete action ' . $id_action . ' in alert ' . $id_alert);
|
db_pandora_audit("Alert management", 'Fail to delete action ' . $id_action . ' in alert ' . $id_alert);
|
||||||
}
|
}
|
||||||
|
|
||||||
$messageAction = ui_print_result_message ($result, __('Successfully deleted'), __('Could not be deleted'), '', true);
|
$messageAction = ui_print_result_message ($result,
|
||||||
|
__('Successfully deleted'), __('Could not be deleted'), '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($enable_alert) {
|
if ($enable_alert) {
|
||||||
@ -191,7 +194,8 @@ if ($enable_alert) {
|
|||||||
db_pandora_audit("Alert management", 'Fail to enable ' . $id_alert);
|
db_pandora_audit("Alert management", 'Fail to enable ' . $id_alert);
|
||||||
}
|
}
|
||||||
|
|
||||||
$messageAction = ui_print_result_message ($result, __('Successfully enabled'), __('Could not be enabled'), '', true);
|
$messageAction = ui_print_result_message ($result,
|
||||||
|
__('Successfully enabled'), __('Could not be enabled'), '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($disable_alert) {
|
if ($disable_alert) {
|
||||||
@ -206,7 +210,8 @@ if ($disable_alert) {
|
|||||||
db_pandora_audit("Alert management", 'Fail to disable ' . $id_alert);
|
db_pandora_audit("Alert management", 'Fail to disable ' . $id_alert);
|
||||||
}
|
}
|
||||||
|
|
||||||
$messageAction = ui_print_result_message ($result, __('Successfully disabled'), __('Could not be disabled'), '', true);
|
$messageAction = ui_print_result_message ($result,
|
||||||
|
__('Successfully disabled'), __('Could not be disabled'), '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($standbyon_alert) {
|
if ($standbyon_alert) {
|
||||||
@ -221,7 +226,8 @@ if ($standbyon_alert) {
|
|||||||
db_pandora_audit("Alert management", 'Fail to standby ' . $id_alert);
|
db_pandora_audit("Alert management", 'Fail to standby ' . $id_alert);
|
||||||
}
|
}
|
||||||
|
|
||||||
$messageAction = ui_print_result_message ($result, __('Successfully set standby'), __('Could not be set standby'), '', true);
|
$messageAction = ui_print_result_message ($result,
|
||||||
|
__('Successfully set standby'), __('Could not be set standby'), '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($standbyoff_alert) {
|
if ($standbyoff_alert) {
|
||||||
@ -236,7 +242,8 @@ if ($standbyoff_alert) {
|
|||||||
db_pandora_audit("Alert management", 'Fail to standbyoff ' . $id_alert);
|
db_pandora_audit("Alert management", 'Fail to standbyoff ' . $id_alert);
|
||||||
}
|
}
|
||||||
|
|
||||||
$messageAction = ui_print_result_message ($result, __('Successfully set off standby'), __('Could not be set off standby'), '', true);
|
$messageAction = ui_print_result_message ($result,
|
||||||
|
__('Successfully set off standby'), __('Could not be set off standby'), '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($id_agente) {
|
if ($id_agente) {
|
||||||
@ -270,7 +277,8 @@ else {
|
|||||||
|
|
||||||
if ($tab == 'list') {
|
if ($tab == 'list') {
|
||||||
ui_print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('List'), "images/god2.png", false, "manage_alert_list", true, $buttons);
|
ui_print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('List'), "images/god2.png", false, "manage_alert_list", true, $buttons);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
ui_print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('Create'), "images/god2.png", false, "manage_alert_list", true, $buttons);
|
ui_print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('Create'), "images/god2.png", false, "manage_alert_list", true, $buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,9 +170,11 @@ if ($delete_template) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else {
|
||||||
// Header
|
// Header
|
||||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "", true);
|
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "", true);
|
||||||
|
}
|
||||||
|
|
||||||
$result = alerts_delete_alert_template ($id);
|
$result = alerts_delete_alert_template ($id);
|
||||||
|
|
||||||
@ -281,9 +283,10 @@ foreach ($templates as $template) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui_pagination ($total_templates, $url);
|
ui_pagination ($total_templates, $url);
|
||||||
if (isset($data)){
|
if (isset($data)) {
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
echo "<div class='nf'>".__('No alert templates defined')."</div>";
|
echo "<div class='nf'>".__('No alert templates defined')."</div>";
|
||||||
}
|
}
|
||||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||||
@ -292,5 +295,4 @@ html_print_submit_button (__('Create'), 'create', false, 'class="sub next"');
|
|||||||
html_print_input_hidden ('create_alert', 1);
|
html_print_input_hidden ('create_alert', 1);
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
?>
|
?>
|
@ -142,7 +142,8 @@ if ($id) {
|
|||||||
html_print_input_hidden ('id', $id);
|
html_print_input_hidden ('id', $id);
|
||||||
html_print_input_hidden ('update_action', 1);
|
html_print_input_hidden ('update_action', 1);
|
||||||
html_print_submit_button (__('Update'), 'create', false, 'class="sub upd"');
|
html_print_submit_button (__('Update'), 'create', false, 'class="sub upd"');
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
html_print_input_hidden ('create_action', 1);
|
html_print_input_hidden ('create_action', 1);
|
||||||
html_print_submit_button (__('Create'), 'create', false, 'class="sub wand"');
|
html_print_submit_button (__('Create'), 'create', false, 'class="sub wand"');
|
||||||
}
|
}
|
||||||
@ -154,8 +155,12 @@ ui_require_javascript_file ('pandora_alerts');
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
<?php if ($id_command) : ?>
|
<?php
|
||||||
original_command = "<?php $command = alerts_get_alert_command_command ($id_command);
|
if ($id_command)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
original_command = "<?php
|
||||||
|
$command = alerts_get_alert_command_command ($id_command);
|
||||||
$command = io_safe_output($command);
|
$command = io_safe_output($command);
|
||||||
echo addslashes($command);
|
echo addslashes($command);
|
||||||
?>";
|
?>";
|
||||||
@ -163,7 +168,9 @@ $(document).ready (function () {
|
|||||||
command_description = "<?php echo str_replace("\r\n","<br>",addslashes(io_safe_output(alerts_get_alert_command_description ($id_command)))); ?>";
|
command_description = "<?php echo str_replace("\r\n","<br>",addslashes(io_safe_output(alerts_get_alert_command_description ($id_command)))); ?>";
|
||||||
|
|
||||||
render_command_description(command_description);
|
render_command_description(command_description);
|
||||||
<?php endif; ?>
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
$("#id_command").change (function () {
|
$("#id_command").change (function () {
|
||||||
values = Array ();
|
values = Array ();
|
||||||
values.push ({name: "page",
|
values.push ({name: "page",
|
||||||
|
@ -64,7 +64,8 @@ if ($id) {
|
|||||||
html_print_input_hidden ('id', $id);
|
html_print_input_hidden ('id', $id);
|
||||||
html_print_input_hidden ('update_command', 1);
|
html_print_input_hidden ('update_command', 1);
|
||||||
html_print_submit_button (__('Update'), 'create', false, 'class="sub upd"');
|
html_print_submit_button (__('Update'), 'create', false, 'class="sub upd"');
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
html_print_input_hidden ('create_command', 1);
|
html_print_input_hidden ('create_command', 1);
|
||||||
html_print_submit_button (__('Create'), 'create', false, 'class="sub wand"');
|
html_print_submit_button (__('Create'), 'create', false, 'class="sub wand"');
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,8 @@ function print_alert_compound_steps ($step, $id) {
|
|||||||
echo __('Step').' 1 » ';
|
echo __('Step').' 1 » ';
|
||||||
echo '<span>'.__('Conditions').'</span>';
|
echo '<span>'.__('Conditions').'</span>';
|
||||||
echo '</a>';
|
echo '</a>';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
echo __('Step').' 1 » ';
|
echo __('Step').' 1 » ';
|
||||||
echo '<span>'.__('Conditions').'</span>';
|
echo '<span>'.__('Conditions').'</span>';
|
||||||
}
|
}
|
||||||
@ -67,7 +68,8 @@ function print_alert_compound_steps ($step, $id) {
|
|||||||
echo __('Step').' 2 » ';
|
echo __('Step').' 2 » ';
|
||||||
echo '<span>'.__('Firing').'</span>';
|
echo '<span>'.__('Firing').'</span>';
|
||||||
echo '</a>';
|
echo '</a>';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
echo __('Step').' 2 » ';
|
echo __('Step').' 2 » ';
|
||||||
echo '<span>'.__('Firing').'</span>';
|
echo '<span>'.__('Firing').'</span>';
|
||||||
}
|
}
|
||||||
@ -85,7 +87,8 @@ function print_alert_compound_steps ($step, $id) {
|
|||||||
echo __('Step').' 3 » ';
|
echo __('Step').' 3 » ';
|
||||||
echo '<span>'.__('Recovery').'</span>';
|
echo '<span>'.__('Recovery').'</span>';
|
||||||
echo '</a>';
|
echo '</a>';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
echo __('Step').' 3 » ';
|
echo __('Step').' 3 » ';
|
||||||
echo '<span>'.__('Recovery').'</span>';
|
echo '<span>'.__('Recovery').'</span>';
|
||||||
}
|
}
|
||||||
@ -266,6 +269,7 @@ if ($id && ! $create_compound) {
|
|||||||
$field3_recovery = $compound['field3_recovery'];
|
$field3_recovery = $compound['field3_recovery'];
|
||||||
$id_agent = $compound['id_agent'];
|
$id_agent = $compound['id_agent'];
|
||||||
$id_group = agents_get_agent_group ($id_agent);
|
$id_group = agents_get_agent_group ($id_agent);
|
||||||
|
|
||||||
if (! check_acl ($config['id_user'], $id_group, "AW")) {
|
if (! check_acl ($config['id_user'], $id_group, "AW")) {
|
||||||
db_pandora_audit("ACL Violation",
|
db_pandora_audit("ACL Violation",
|
||||||
"Trying to access Alert Management");
|
"Trying to access Alert Management");
|
||||||
@ -541,7 +545,8 @@ else {
|
|||||||
$data[3] = alerts_get_alert_template_name ($alert['id_alert_template']);
|
$data[3] = alerts_get_alert_template_name ($alert['id_alert_template']);
|
||||||
if ($condition['operation'] == 'NOP') {
|
if ($condition['operation'] == 'NOP') {
|
||||||
$data[4] = html_print_input_hidden ('operations['.$alert['id'].']', 'NOP', true);
|
$data[4] = html_print_input_hidden ('operations['.$alert['id'].']', 'NOP', true);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$data[4] = html_print_select (alerts_compound_operations (),
|
$data[4] = html_print_select (alerts_compound_operations (),
|
||||||
'operations['.$alert['id'].']', $condition['operation'], '', '', '', true);
|
'operations['.$alert['id'].']', $condition['operation'], '', '', '', true);
|
||||||
}
|
}
|
||||||
@ -683,12 +688,20 @@ ui_require_jquery_file ('timeentry');
|
|||||||
var block_size = <?php echo $config['block_size']; ?>;
|
var block_size = <?php echo $config['block_size']; ?>;
|
||||||
var alerts;
|
var alerts;
|
||||||
var compound_alerts;
|
var compound_alerts;
|
||||||
<?php if ($id_agent && isset ($alerts) && $alerts) : ?>
|
<?php
|
||||||
|
if ($id_agent && isset ($alerts) && $alerts) {
|
||||||
|
?>
|
||||||
alerts = Array ();
|
alerts = Array ();
|
||||||
<?php foreach ($alerts as $alert) : ?>
|
<?php
|
||||||
|
foreach ($alerts as $alert) {
|
||||||
|
?>
|
||||||
alerts[<?php echo $alert['id'] ?>] = eval ("("+'<?php echo json_encode ($alert); ?>'+")");
|
alerts[<?php echo $alert['id'] ?>] = eval ("("+'<?php echo json_encode ($alert); ?>'+")");
|
||||||
<?php endforeach; ?>
|
<?php
|
||||||
<?php endif; ?>
|
}
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
function remove_alert () {
|
function remove_alert () {
|
||||||
$(this).parents ("tr:first").remove ();
|
$(this).parents ("tr:first").remove ();
|
||||||
@ -701,7 +714,8 @@ function remove_alert () {
|
|||||||
.attr ("name", "operations["+id+"]")
|
.attr ("name", "operations["+id+"]")
|
||||||
.attr ("value", "NOP");
|
.attr ("value", "NOP");
|
||||||
$("td:last", tr).append (input);
|
$("td:last", tr).append (input);
|
||||||
} else if (len == 0) {
|
}
|
||||||
|
else if (len == 0) {
|
||||||
$("#conditions_list").hide ();
|
$("#conditions_list").hide ();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -722,7 +736,8 @@ function add_alert () {
|
|||||||
.attr ("name", "operations["+id+"]")
|
.attr ("name", "operations["+id+"]")
|
||||||
.attr ("value", "NOP");
|
.attr ("value", "NOP");
|
||||||
$(td).append (input);
|
$(td).append (input);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$(td).append ($("select#operations:last").clone ()
|
$(td).append ($("select#operations:last").clone ()
|
||||||
.show ()
|
.show ()
|
||||||
.attr ("name", "operations["+id+"]")
|
.attr ("name", "operations["+id+"]")
|
||||||
@ -905,7 +920,8 @@ $(document).ready (function () {
|
|||||||
$("#text-other_threshold").attr ("value", "");
|
$("#text-other_threshold").attr ("value", "");
|
||||||
$("#compound-threshold-other_label").show ();
|
$("#compound-threshold-other_label").show ();
|
||||||
$("#compound-threshold-other_input").show ();
|
$("#compound-threshold-other_input").show ();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$("#compound-threshold-other_label").hide ();
|
$("#compound-threshold-other_label").hide ();
|
||||||
$("#compound-threshold-other_input").hide ();
|
$("#compound-threshold-other_input").hide ();
|
||||||
}
|
}
|
||||||
@ -933,7 +949,8 @@ $(document).ready (function () {
|
|||||||
$("#recovery_notify").change (function () {
|
$("#recovery_notify").change (function () {
|
||||||
if (this.value == 1) {
|
if (this.value == 1) {
|
||||||
$("#compound-field2, #compound-field3").show ();
|
$("#compound-field2, #compound-field3").show ();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$("#compound-field2, #compound-field3").hide ();
|
$("#compound-field2, #compound-field3").hide ();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -83,7 +83,8 @@ if ($id) {
|
|||||||
html_print_input_hidden ('id', $id);
|
html_print_input_hidden ('id', $id);
|
||||||
html_print_input_hidden ('update_special_day', 1);
|
html_print_input_hidden ('update_special_day', 1);
|
||||||
html_print_submit_button (__('Update'), 'create', false, 'class="sub upd"');
|
html_print_submit_button (__('Update'), 'create', false, 'class="sub upd"');
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
html_print_input_hidden ('create_special_day', 1);
|
html_print_input_hidden ('create_special_day', 1);
|
||||||
html_print_submit_button (__('Create'), 'create', false, 'class="sub wand"');
|
html_print_submit_button (__('Create'), 'create', false, 'class="sub wand"');
|
||||||
}
|
}
|
||||||
|
@ -817,19 +817,24 @@ $(document).ready (function () {
|
|||||||
if (type == "regex") {
|
if (type == "regex") {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
$("span#example").empty ().append (matches);
|
$("span#example").empty ().append (matches);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$("span#example").empty ().append (matches_not);
|
$("span#example").empty ().append (matches_not);
|
||||||
}
|
}
|
||||||
} else if (type == "max_min") {
|
}
|
||||||
|
else if (type == "max_min") {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
$("span#example").empty ().append (between);
|
$("span#example").empty ().append (between);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$("span#example").empty ().append (between_not);
|
$("span#example").empty ().append (between_not);
|
||||||
}
|
}
|
||||||
} else if (type == "onchange") {
|
}
|
||||||
|
else if (type == "onchange") {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
$("span#example").empty ().append (onchange);
|
$("span#example").empty ().append (onchange);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$("span#example").empty ().append (onchange_not);
|
$("span#example").empty ().append (onchange_not);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -849,7 +854,8 @@ $(document).ready (function () {
|
|||||||
$("#text-other_threshold").attr ("value", "");
|
$("#text-other_threshold").attr ("value", "");
|
||||||
$("#template-threshold-other_label").show ();
|
$("#template-threshold-other_label").show ();
|
||||||
$("#template-threshold-other_input").show ();
|
$("#template-threshold-other_input").show ();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$("#template-threshold-other_label").hide ();
|
$("#template-threshold-other_label").hide ();
|
||||||
$("#template-threshold-other_input").hide ();
|
$("#template-threshold-other_input").hide ();
|
||||||
}
|
}
|
||||||
@ -858,7 +864,8 @@ $(document).ready (function () {
|
|||||||
$("#recovery_notify").change (function () {
|
$("#recovery_notify").change (function () {
|
||||||
if (this.value == 1) {
|
if (this.value == 1) {
|
||||||
$("#template-field2, #template-field3").show ();
|
$("#template-field2, #template-field3").show ();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$("#template-field2, #template-field3").hide ();
|
$("#template-field2, #template-field3").hide ();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -85,7 +85,8 @@ if ($add_graph) {
|
|||||||
db_pandora_audit("Report management", "Create graph #$id_graph");
|
db_pandora_audit("Report management", "Create graph #$id_graph");
|
||||||
else
|
else
|
||||||
db_pandora_audit("Report management", "Fail try to create graph");
|
db_pandora_audit("Report management", "Fail try to create graph");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$id_graph = false;
|
$id_graph = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +116,8 @@ if ($update_graph) {
|
|||||||
else
|
else
|
||||||
db_pandora_audit("Report management", "Fail try to update graph #$id_graph");
|
db_pandora_audit("Report management", "Fail try to update graph #$id_graph");
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$success = false;
|
$success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,7 +152,7 @@ if ($delete_module) {
|
|||||||
$result = db_process_sql_delete('tgraph_source', array('id_gs' => $deleteGraph));
|
$result = db_process_sql_delete('tgraph_source', array('id_gs' => $deleteGraph));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($change_weight){
|
if ($change_weight) {
|
||||||
$weight = get_parameter ('weight');
|
$weight = get_parameter ('weight');
|
||||||
$id_gs = get_parameter ('graph');
|
$id_gs = get_parameter ('graph');
|
||||||
db_process_sql_update('tgraph_source',
|
db_process_sql_update('tgraph_source',
|
||||||
@ -158,7 +160,7 @@ if($change_weight){
|
|||||||
array('id_gs' => $id_gs));
|
array('id_gs' => $id_gs));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($edit_graph) {
|
if ($edit_graph) {
|
||||||
$buttons = array(
|
$buttons = array(
|
||||||
'main' => array('active' => false,
|
'main' => array('active' => false,
|
||||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=main&edit_graph=1&id=' . $id_graph . '">' .
|
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=main&edit_graph=1&id=' . $id_graph . '">' .
|
||||||
@ -199,10 +201,10 @@ switch ($tab) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($add_graph)
|
if ($add_graph)
|
||||||
ui_print_result_message($id_graph, __('Graph stored successfully'), __('There was a problem storing Graph'));
|
ui_print_result_message($id_graph, __('Graph stored successfully'), __('There was a problem storing Graph'));
|
||||||
|
|
||||||
if($add_module)
|
if ($add_module)
|
||||||
ui_print_result_message($result, __('Module added successfully'), __('There was a problem adding Module'));
|
ui_print_result_message($result, __('Module added successfully'), __('There was a problem adding Module'));
|
||||||
|
|
||||||
if ($update_graph)
|
if ($update_graph)
|
||||||
|
@ -122,7 +122,8 @@ if ($multiple_delete) {
|
|||||||
$str_ids = implode (',', $ids);
|
$str_ids = implode (',', $ids);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
db_pandora_audit("Report management", "Multiple delete graph: $str_ids");
|
db_pandora_audit("Report management", "Multiple delete graph: $str_ids");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
db_pandora_audit("Report management", "Fail try to delete graphs: $str_ids");
|
db_pandora_audit("Report management", "Fail try to delete graphs: $str_ids");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +158,8 @@ else
|
|||||||
|
|
||||||
if (!$maps) {
|
if (!$maps) {
|
||||||
echo '<div class="nf">'.('No maps defined').'</div>';
|
echo '<div class="nf">'.('No maps defined').'</div>';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
foreach ($maps as $map) {
|
foreach ($maps as $map) {
|
||||||
|
|
||||||
$data = array ();
|
$data = array ();
|
||||||
@ -175,7 +176,6 @@ if (!$maps) {
|
|||||||
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1">'.html_print_image ("images/cross.png", true).'</a>';
|
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1">'.html_print_image ("images/cross.png", true).'</a>';
|
||||||
}
|
}
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
|
|
||||||
}
|
}
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,8 @@ switch ($activeTab) {
|
|||||||
|
|
||||||
$statusProcessInDB = array('flag' => true, 'message' => $message);
|
$statusProcessInDB = array('flag' => true, 'message' => $message);
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
// One item per module
|
// One item per module
|
||||||
if (empty($name_modules)) {
|
if (empty($name_modules)) {
|
||||||
$statusProcessInDB = array('flag' => true, 'message' => ui_print_error_message (__('No modules selected'), '', true));
|
$statusProcessInDB = array('flag' => true, 'message' => ui_print_error_message (__('No modules selected'), '', true));
|
||||||
|
@ -276,7 +276,8 @@ function item_per_agent_change(itemPerAgent) {
|
|||||||
$('#label_type').append ($('<option></option>').html (<?php echo "'" . __('None') . "'"; ?>).attr('value', 'none'));
|
$('#label_type').append ($('<option></option>').html (<?php echo "'" . __('None') . "'"; ?>).attr('value', 'none'));
|
||||||
|
|
||||||
$('#hidden-item_per_agent_test').val(1);
|
$('#hidden-item_per_agent_test').val(1);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$('#module').removeAttr('disabled');
|
$('#module').removeAttr('disabled');
|
||||||
$('#hidden-item_per_agent_test').val(0);
|
$('#hidden-item_per_agent_test').val(0);
|
||||||
$('#label_type').empty();
|
$('#label_type').empty();
|
||||||
@ -286,6 +287,5 @@ function item_per_agent_change(itemPerAgent) {
|
|||||||
$('#label_type').append ($('<option></option>').html (<?php echo "'" . __('None') . "'"; ?>).attr('value', 'none'));
|
$('#label_type').append ($('<option></option>').html (<?php echo "'" . __('None') . "'"; ?>).attr('value', 'none'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -240,7 +240,7 @@ $zone_name = array('Africa' => __('Africa'), 'America' => __('America'), 'Antarc
|
|||||||
$zone_selected = get_parameter('zone');
|
$zone_selected = get_parameter('zone');
|
||||||
if ($zone_selected == "") {
|
if ($zone_selected == "") {
|
||||||
if ($config["timezone"] != "") {
|
if ($config["timezone"] != "") {
|
||||||
list($zone) = split("/", $config["timezone"]);
|
list($zone) = explode("/", $config["timezone"]);
|
||||||
$zone_selected = $zone;
|
$zone_selected = $zone;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -565,7 +565,7 @@ function alerts_get_alert_template ($id_alert_template) {
|
|||||||
if (empty ($id_alert_template))
|
if (empty ($id_alert_template))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch ($config['dbtype']){
|
switch ($config['dbtype']) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
return db_get_row ('talert_templates', 'id', $id_alert_template);
|
return db_get_row ('talert_templates', 'id', $id_alert_template);
|
||||||
|
@ -44,8 +44,9 @@ function config_create_value ($token, $value) {
|
|||||||
function config_update_value ($token, $value) {
|
function config_update_value ($token, $value) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if ($token == 'list_ACL_IPs_for_API')
|
if ($token == 'list_ACL_IPs_for_API') {
|
||||||
$value = str_replace(array("\r\n", "\r", "\n"), ";", io_safe_output($value));
|
$value = str_replace(array("\r\n", "\r", "\n"), ";", io_safe_output($value));
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset ($config[$token])) {
|
if (!isset ($config[$token])) {
|
||||||
$config[$token] = $value;
|
$config[$token] = $value;
|
||||||
@ -391,8 +392,10 @@ function config_process_config () {
|
|||||||
*/
|
*/
|
||||||
$temp_list_ACL_IPs_for_API = array();
|
$temp_list_ACL_IPs_for_API = array();
|
||||||
if (isset($config['list_ACL_IPs_for_API'])) {
|
if (isset($config['list_ACL_IPs_for_API'])) {
|
||||||
|
if (!empty($config['list_ACL_IPs_for_API'])) {
|
||||||
$temp_list_ACL_IPs_for_API = explode(';', $config['list_ACL_IPs_for_API']);
|
$temp_list_ACL_IPs_for_API = explode(';', $config['list_ACL_IPs_for_API']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$config['list_ACL_IPs_for_API'] = $temp_list_ACL_IPs_for_API;
|
$config['list_ACL_IPs_for_API'] = $temp_list_ACL_IPs_for_API;
|
||||||
$keysConfig = array_keys($config);
|
$keysConfig = array_keys($config);
|
||||||
|
|
||||||
@ -631,7 +634,8 @@ function config_process_config () {
|
|||||||
config_update_value( 'api_password', '');
|
config_update_value( 'api_password', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset ($config['relative_path']) && (isset ($_POST['nick']) || isset ($config['id_user'])) && isset($config['enterprise_installed'])) {
|
if (!isset ($config['relative_path']) && (isset ($_POST['nick'])
|
||||||
|
|| isset ($config['id_user'])) && isset($config['enterprise_installed'])) {
|
||||||
|
|
||||||
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
|
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
|
||||||
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
||||||
@ -722,7 +726,7 @@ function config_check () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_writable ("attachment")){
|
if (!is_writable ("attachment")) {
|
||||||
$config["alert_cnt"]++;
|
$config["alert_cnt"]++;
|
||||||
$_SESSION["alert_msg"] .= ui_print_error_message(
|
$_SESSION["alert_msg"] .= ui_print_error_message(
|
||||||
array('message' => __('Attachment directory is not writable by HTTP Server').'</h3>'.'<p>'.__('Please check that the web server has write rights on the {HOMEDIR}/attachment directory'),
|
array('message' => __('Attachment directory is not writable by HTTP Server').'</h3>'.'<p>'.__('Please check that the web server has write rights on the {HOMEDIR}/attachment directory'),
|
||||||
|
@ -59,7 +59,8 @@ function menu_print_menu (&$menu) {
|
|||||||
|
|
||||||
if (! isset ($main['id'])) {
|
if (! isset ($main['id'])) {
|
||||||
$id = 'menu_'.++$idcounter;
|
$id = 'menu_'.++$idcounter;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$id = $main['id'];
|
$id = $main['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +75,8 @@ function menu_print_menu (&$menu) {
|
|||||||
|
|
||||||
if (($sec == $mainsec) && ($showSubsection)) {
|
if (($sec == $mainsec) && ($showSubsection)) {
|
||||||
$classes[] = 'selected';
|
$classes[] = 'selected';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$classes[] = 'not_selected';
|
$classes[] = 'not_selected';
|
||||||
if ($extensionInMenuParameter == $mainsec)
|
if ($extensionInMenuParameter == $mainsec)
|
||||||
$classes[] = 'selected';
|
$classes[] = 'selected';
|
||||||
@ -139,7 +141,8 @@ function menu_print_menu (&$menu) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//If there is only a string just compare
|
//If there is only a string just compare
|
||||||
if (strpos($sec2, $sub['subsecs']) !== false) {
|
if (strpos($sec2, $sub['subsecs']) !== false) {
|
||||||
$selected_submenu2=true;
|
$selected_submenu2=true;
|
||||||
@ -148,8 +151,11 @@ function menu_print_menu (&$menu) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Set class
|
//Set class
|
||||||
if (($sec2 == $subsec2 || $allsec2 == $subsec2 || $selected_submenu2) && isset ($sub[$subsec2]["options"])
|
if (($sec2 == $subsec2 || $allsec2 == $subsec2 ||
|
||||||
&& (get_parameter_get ($sub[$subsec2]["options"]["name"]) == $sub[$subsec2]["options"]["value"])) {
|
$selected_submenu2) && isset ($sub[$subsec2]["options"])
|
||||||
|
&& (
|
||||||
|
get_parameter_get ($sub[$subsec2]["options"]["name"]) == $sub[$subsec2]["options"]["value"])
|
||||||
|
) {
|
||||||
//If the subclass is selected and there are options and that options value is true
|
//If the subclass is selected and there are options and that options value is true
|
||||||
$class .= 'submenu_selected selected';
|
$class .= 'submenu_selected selected';
|
||||||
$selected = true;
|
$selected = true;
|
||||||
@ -224,7 +230,8 @@ function menu_print_menu (&$menu) {
|
|||||||
|
|
||||||
|
|
||||||
$secExtension = null;
|
$secExtension = null;
|
||||||
if (array_key_exists('sec',$sub)) $secExtension = $sub["sec"];
|
if (array_key_exists('sec',$sub))
|
||||||
|
$secExtension = $sub["sec"];
|
||||||
if (strlen($secExtension) > 0) {
|
if (strlen($secExtension) > 0) {
|
||||||
$secUrl = $secExtension;
|
$secUrl = $secExtension;
|
||||||
$extensionInMenu = 'extension_in_menu='.$mainsec.'&';
|
$extensionInMenu = 'extension_in_menu='.$mainsec.'&';
|
||||||
@ -236,19 +243,20 @@ function menu_print_menu (&$menu) {
|
|||||||
|
|
||||||
if (isset ($sub["text"]) || $selected) {
|
if (isset ($sub["text"]) || $selected) {
|
||||||
$title = ' title="' . $sub["text"] . ' "';
|
$title = ' title="' . $sub["text"] . ' "';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$title = '';
|
$title = '';
|
||||||
}
|
}
|
||||||
$submenu_output .= '<a href="index.php?'.$extensionInMenu.'sec='.$secUrl.'&sec2='.$subsec2.($sub["refr"] ? '&refr=' . $sub["refr"] : '').$link_add.'"' . $title . '>'.$sub["text"].'</a>';
|
$submenu_output .= '<a href="index.php?'.$extensionInMenu.'sec='.$secUrl.'&sec2='.$subsec2.($sub["refr"] ? '&refr=' . $sub["refr"] : '').$link_add.'"' . $title . '>'.$sub["text"].'</a>';
|
||||||
|
|
||||||
if(isset($sub['sub2'])) {
|
if (isset($sub['sub2'])) {
|
||||||
$submenu_output .= html_print_image("include/styles/images/toggle.png", true, array("class" => "toggle", "alt" => "toogle"));
|
$submenu_output .= html_print_image("include/styles/images/toggle.png", true, array("class" => "toggle", "alt" => "toogle"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Print second level submenu
|
//Print second level submenu
|
||||||
if(isset($sub['sub2'])) {
|
if (isset($sub['sub2'])) {
|
||||||
|
|
||||||
//Display if father is selected
|
//Display if father is selected
|
||||||
$display = "style='display:none'";
|
$display = "style='display:none'";
|
||||||
@ -348,8 +356,8 @@ function menu_get_sec($with_categories = false) {
|
|||||||
|
|
||||||
$in_godmode = false;
|
$in_godmode = false;
|
||||||
foreach($menu as $k => $v) {
|
foreach($menu as $k => $v) {
|
||||||
if($with_categories) {
|
if ($with_categories) {
|
||||||
if(!$in_godmode && $k[0] == 'g') {
|
if (!$in_godmode && $k[0] == 'g') {
|
||||||
// Hack to dont confuse with gis activated because godmode
|
// Hack to dont confuse with gis activated because godmode
|
||||||
// sec starts with g (like gismaps)
|
// sec starts with g (like gismaps)
|
||||||
if($k != 'gismaps') {
|
if($k != 'gismaps') {
|
||||||
@ -357,7 +365,7 @@ function menu_get_sec($with_categories = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($in_godmode) {
|
if ($in_godmode) {
|
||||||
$category = __('Administration');
|
$category = __('Administration');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -387,7 +395,7 @@ function menu_get_sec($with_categories = false) {
|
|||||||
* @return array Sections list
|
* @return array Sections list
|
||||||
*/
|
*/
|
||||||
function menu_get_sec_pages($sec,$menu_hash = false) {
|
function menu_get_sec_pages($sec,$menu_hash = false) {
|
||||||
if($menu_hash === false) {
|
if ($menu_hash === false) {
|
||||||
$menu = menu_get_full_sec();
|
$menu = menu_get_full_sec();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -398,7 +406,7 @@ function menu_get_sec_pages($sec,$menu_hash = false) {
|
|||||||
$sec2_array[$menu[$sec]['sec2']] = $menu[$sec]['text'];
|
$sec2_array[$menu[$sec]['sec2']] = $menu[$sec]['text'];
|
||||||
|
|
||||||
// Get the sec2 of the subsections
|
// Get the sec2 of the subsections
|
||||||
foreach($menu[$sec]['sub'] as $k => $v) {
|
foreach ($menu[$sec]['sub'] as $k => $v) {
|
||||||
// Avoid special cases of standalone windows
|
// Avoid special cases of standalone windows
|
||||||
if(preg_match('/^javascript:/',$k) || preg_match('/\.php/',$k)) {
|
if(preg_match('/^javascript:/',$k) || preg_match('/\.php/',$k)) {
|
||||||
continue;
|
continue;
|
||||||
@ -429,11 +437,10 @@ function menu_sec2_in_sec($sec,$sec2) {
|
|||||||
$sec2 = explode('&',$sec2);
|
$sec2 = explode('&',$sec2);
|
||||||
$sec2 = $sec2[0];
|
$sec2 = $sec2[0];
|
||||||
|
|
||||||
if($sec2_array != null && in_array($sec2,array_keys($sec2_array))) {
|
if ($sec2_array != null && in_array($sec2,array_keys($sec2_array))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -51,7 +51,8 @@ function messages_create_message ($usuario_origen, $usuario_destino, $subject, $
|
|||||||
|
|
||||||
if ($return === false) {
|
if ($return === false) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,9 +205,11 @@ function messages_get_count ($user = false, $incl_read = false) {
|
|||||||
global $config;
|
global $config;
|
||||||
$user = $config["id_user"];
|
$user = $config["id_user"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty ($incl_read)) {
|
if (empty ($incl_read)) {
|
||||||
$filter = "AND estado = 0";
|
$filter = "AND estado = 0";
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$filter = "";
|
$filter = "";
|
||||||
}
|
}
|
||||||
$sql = sprintf("SELECT COUNT(*)
|
$sql = sprintf("SELECT COUNT(*)
|
||||||
|
@ -280,7 +280,8 @@ function netflow_data_table ($data, $start_date, $end_date, $aggregate) {
|
|||||||
for ($j = 0; $j < $source_count; $j++) {
|
for ($j = 0; $j < $source_count; $j++) {
|
||||||
if (isset ($values[$source_index[$j]])) {
|
if (isset ($values[$source_index[$j]])) {
|
||||||
$table->data[$i][$j+1] = format_numeric ($values[$source_index[$j]]);
|
$table->data[$i][$j+1] = format_numeric ($values[$source_index[$j]]);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$table->data[$i][$j+1] = 0;
|
$table->data[$i][$j+1] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,13 +391,13 @@ function netflow_get_stats ($start_date, $end_date, $command, $aggregate, $max,
|
|||||||
$command .= " -s $aggregate/$unit -n $max -t " .date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date);
|
$command .= " -s $aggregate/$unit -n $max -t " .date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date);
|
||||||
exec($command, $string);
|
exec($command, $string);
|
||||||
|
|
||||||
if(! is_array($string)){
|
if (! is_array($string)) {
|
||||||
return array ();
|
return array ();
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$values = array();
|
$values = array();
|
||||||
foreach($string as $line){
|
foreach ($string as $line) {
|
||||||
if ($line == '') {
|
if ($line == '') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -477,7 +478,7 @@ function netflow_get_filter_arguments ($filter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Normal filter
|
// Normal filter
|
||||||
if ($filter['ip_dst'] != ''){
|
if ($filter['ip_dst'] != '') {
|
||||||
$filter_args .= ' "(';
|
$filter_args .= ' "(';
|
||||||
$val_ipdst = explode(',', $filter['ip_dst']);
|
$val_ipdst = explode(',', $filter['ip_dst']);
|
||||||
for($i = 0; $i < count ($val_ipdst); $i++){
|
for($i = 0; $i < count ($val_ipdst); $i++){
|
||||||
@ -494,7 +495,7 @@ function netflow_get_filter_arguments ($filter) {
|
|||||||
}
|
}
|
||||||
$filter_args .= ')';
|
$filter_args .= ')';
|
||||||
}
|
}
|
||||||
if ($filter['ip_src'] != ''){
|
if ($filter['ip_src'] != '') {
|
||||||
if ($filter_args == '') {
|
if ($filter_args == '') {
|
||||||
$filter_args .= ' "(';
|
$filter_args .= ' "(';
|
||||||
}
|
}
|
||||||
@ -502,7 +503,7 @@ function netflow_get_filter_arguments ($filter) {
|
|||||||
$filter_args .= ' and (';
|
$filter_args .= ' and (';
|
||||||
}
|
}
|
||||||
$val_ipsrc = explode(',', $filter['ip_src']);
|
$val_ipsrc = explode(',', $filter['ip_src']);
|
||||||
for($i = 0; $i < count ($val_ipsrc); $i++){
|
for ($i = 0; $i < count ($val_ipsrc); $i++) {
|
||||||
if ($i > 0) {
|
if ($i > 0) {
|
||||||
$filter_args .= ' or ';
|
$filter_args .= ' or ';
|
||||||
}
|
}
|
||||||
@ -524,7 +525,7 @@ function netflow_get_filter_arguments ($filter) {
|
|||||||
$filter_args .= ' and (';
|
$filter_args .= ' and (';
|
||||||
}
|
}
|
||||||
$val_dstport = explode(',', $filter['dst_port']);
|
$val_dstport = explode(',', $filter['dst_port']);
|
||||||
for($i = 0; $i < count ($val_dstport); $i++){
|
for ($i = 0; $i < count ($val_dstport); $i++) {
|
||||||
if ($i > 0) {
|
if ($i > 0) {
|
||||||
$filter_args .= ' or ';
|
$filter_args .= ' or ';
|
||||||
}
|
}
|
||||||
@ -540,7 +541,7 @@ function netflow_get_filter_arguments ($filter) {
|
|||||||
$filter_args .= ' and (';
|
$filter_args .= ' and (';
|
||||||
}
|
}
|
||||||
$val_srcport = explode(',', $filter['src_port']);
|
$val_srcport = explode(',', $filter['src_port']);
|
||||||
for($i = 0; $i < count ($val_srcport); $i++){
|
for ($i = 0; $i < count ($val_srcport); $i++) {
|
||||||
if ($i > 0) {
|
if ($i > 0) {
|
||||||
$filter_args .= ' or ';
|
$filter_args .= ' or ';
|
||||||
}
|
}
|
||||||
|
@ -1612,7 +1612,8 @@ function ui_print_module_warn_value ($max_warning, $min_warning, $str_warning, $
|
|||||||
|
|
||||||
if ($max_warning != $min_warning) {
|
if ($max_warning != $min_warning) {
|
||||||
$data .= format_for_graph($max_warning) ."/". format_for_graph ($min_warning);
|
$data .= format_for_graph($max_warning) ."/". format_for_graph ($min_warning);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$data .= __("N/A");
|
$data .= __("N/A");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1620,7 +1621,8 @@ function ui_print_module_warn_value ($max_warning, $min_warning, $str_warning, $
|
|||||||
|
|
||||||
if ($max_critical != $min_critical){
|
if ($max_critical != $min_critical){
|
||||||
$data .= format_for_graph($max_critical) ."/". format_for_graph ($min_critical);
|
$data .= format_for_graph($max_critical) ."/". format_for_graph ($min_critical);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$data .= __("N/A");
|
$data .= __("N/A");
|
||||||
}
|
}
|
||||||
$data .= "</span>";
|
$data .= "</span>";
|
||||||
@ -1793,40 +1795,40 @@ function ui_get_include_contents ($filename, $params = false) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function ui_toggle($code, $name, $title = '', $hidde_default = true) {
|
function ui_toggle($code, $name, $title = '', $hidde_default = true) {
|
||||||
// Generate unique Id
|
// Generate unique Id
|
||||||
$uniqid = uniqid('');
|
$uniqid = uniqid('');
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
if($hidde_default) {
|
if ($hidde_default) {
|
||||||
$style = 'display:none';
|
$style = 'display:none';
|
||||||
$toggle_a = "$('#tgl_div_".$uniqid."').show();";
|
$toggle_a = "$('#tgl_div_".$uniqid."').show();";
|
||||||
$toggle_b = "$('#tgl_div_".$uniqid."').hide();";
|
$toggle_b = "$('#tgl_div_".$uniqid."').hide();";
|
||||||
$image_a = html_print_image("images/go.png", true, false, true);
|
$image_a = html_print_image("images/go.png", true, false, true);
|
||||||
$image_b = html_print_image("images/down.png", true, false, true);
|
$image_b = html_print_image("images/down.png", true, false, true);
|
||||||
$original = "images/down.png";
|
$original = "images/down.png";
|
||||||
}else {
|
}
|
||||||
|
else {
|
||||||
$style = '';
|
$style = '';
|
||||||
$toggle_a = "$('#tgl_div_".$uniqid."').hide();";
|
$toggle_a = "$('#tgl_div_".$uniqid."').hide();";
|
||||||
$toggle_b = "$('#tgl_div_".$uniqid."').show();";
|
$toggle_b = "$('#tgl_div_".$uniqid."').show();";
|
||||||
$image_a = html_print_image("images/down.png", true, false, true);
|
$image_a = html_print_image("images/down.png", true, false, true);
|
||||||
$image_b = html_print_image("images/go.png", true, false, true);
|
$image_b = html_print_image("images/go.png", true, false, true);
|
||||||
$original = "images/go.png";
|
$original = "images/go.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link to toggle
|
// Link to toggle
|
||||||
echo '<a href="#" id="tgl_ctrl_'.$uniqid.'"><b>'.$name.'</b> '.html_print_image ($original, true, array ("title" => $title, "id" => "image_".$uniqid)).'</a><br /><br />';
|
echo '<a href="#" id="tgl_ctrl_'.$uniqid.'"><b>'.$name.'</b> '.html_print_image ($original, true, array ("title" => $title, "id" => "image_".$uniqid)).'</a><br /><br />';
|
||||||
|
|
||||||
// Code into a div
|
// Code into a div
|
||||||
echo "<div id='tgl_div_".$uniqid."' style='".$style."'>\n";
|
echo "<div id='tgl_div_".$uniqid."' style='".$style."'>\n";
|
||||||
echo $code;
|
echo $code;
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
|
||||||
// JQuery Toggle
|
// JQuery Toggle
|
||||||
|
|
||||||
echo '<script type="text/javascript">';
|
|
||||||
echo '/* <![CDATA[ */';
|
|
||||||
echo "$(document).ready (function () {";
|
|
||||||
|
|
||||||
|
echo '<script type="text/javascript">';
|
||||||
|
echo '/* <![CDATA[ */';
|
||||||
|
echo "$(document).ready (function () {";
|
||||||
echo "$('#tgl_ctrl_".$uniqid."').toggle(function() {";
|
echo "$('#tgl_ctrl_".$uniqid."').toggle(function() {";
|
||||||
echo $toggle_a;
|
echo $toggle_a;
|
||||||
echo "$('#image_".$uniqid."').attr({src: '".$image_a."'});";
|
echo "$('#image_".$uniqid."').attr({src: '".$image_a."'});";
|
||||||
@ -1834,9 +1836,9 @@ echo "$(document).ready (function () {";
|
|||||||
echo $toggle_b;
|
echo $toggle_b;
|
||||||
echo "$('#image_".$uniqid."').attr({src: '".$image_b."'});";
|
echo "$('#image_".$uniqid."').attr({src: '".$image_b."'});";
|
||||||
echo "});";
|
echo "});";
|
||||||
echo "});";
|
echo "});";
|
||||||
echo '/* ]]> */';
|
echo '/* ]]> */';
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +42,7 @@ check_login ();
|
|||||||
session_write_close ();
|
session_write_close ();
|
||||||
|
|
||||||
|
|
||||||
if(!isInACL($_SERVER['REMOTE_ADDR'])){
|
if (!isInACL($_SERVER['REMOTE_ADDR'])) {
|
||||||
db_pandora_audit("ACL Violation",
|
db_pandora_audit("ACL Violation",
|
||||||
"Trying to access marquee without ACL Access");
|
"Trying to access marquee without ACL Access");
|
||||||
require ("../../general/noaccess.php");
|
require ("../../general/noaccess.php");
|
||||||
@ -51,7 +51,7 @@ if(!isInACL($_SERVER['REMOTE_ADDR'])){
|
|||||||
|
|
||||||
$groups = users_get_groups ($config["id_user"], "AR");
|
$groups = users_get_groups ($config["id_user"], "AR");
|
||||||
//Otherwise select all groups the user has rights to.
|
//Otherwise select all groups the user has rights to.
|
||||||
if(!empty($groups)) {
|
if (!empty($groups)) {
|
||||||
$sql_group_filter = " AND id_grupo IN (".implode (",", array_keys ($groups)).")";
|
$sql_group_filter = " AND id_grupo IN (".implode (",", array_keys ($groups)).")";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -65,13 +65,24 @@ if (!check_acl ($config["id_user"], 0, "PM")) {
|
|||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$sql = "SELECT evento, timestamp, id_agente FROM tevento WHERE 1=1 $sql_group_filter ORDER BY utimestamp DESC LIMIT 0 , $MAX_MARQUEE_EVENTS";
|
$sql = "SELECT evento, timestamp, id_agente
|
||||||
|
FROM tevento
|
||||||
|
WHERE 1=1 $sql_group_filter
|
||||||
|
ORDER BY utimestamp DESC
|
||||||
|
LIMIT 0 , $MAX_MARQUEE_EVENTS";
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$sql = "SELECT evento, timestamp, id_agente FROM tevento WHERE 1=1 $sql_group_filter ORDER BY utimestamp DESC LIMIT $MAX_MARQUEE_EVENTS OFFSET 0";
|
$sql = "SELECT evento, timestamp, id_agente
|
||||||
|
FROM tevento
|
||||||
|
WHERE 1=1 $sql_group_filter
|
||||||
|
ORDER BY utimestamp DESC
|
||||||
|
LIMIT $MAX_MARQUEE_EVENTS OFFSET 0";
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$sql = "SELECT evento, timestamp, id_agente FROM tevento WHERE (1=1 $sql_group_filter ) AND rownum <= $MAX_MARQUEE_EVENTS ORDER BY utimestamp DESC";
|
$sql = "SELECT evento, timestamp, id_agente
|
||||||
|
FROM tevento
|
||||||
|
WHERE (1=1 $sql_group_filter ) AND rownum <= $MAX_MARQUEE_EVENTS
|
||||||
|
ORDER BY utimestamp DESC";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +90,9 @@ $result = db_get_all_rows_sql ($sql);
|
|||||||
foreach ($result as $row) {
|
foreach ($result as $row) {
|
||||||
$agente = "";
|
$agente = "";
|
||||||
if ($row["id_agente"] != 0){
|
if ($row["id_agente"] != 0){
|
||||||
$agente = db_get_sql ("SELECT nombre FROM tagente WHERE id_agente = ". $row["id_agente"]);
|
$agente = db_get_sql ("SELECT nombre
|
||||||
|
FROM tagente
|
||||||
|
WHERE id_agente = ". $row["id_agente"]);
|
||||||
$agente = $agente . " : ";
|
$agente = $agente . " : ";
|
||||||
}
|
}
|
||||||
$output .= strtoupper($agente) . $row["evento"]. " , ". human_time_comparation($row["timestamp"]);
|
$output .= strtoupper($agente) . $row["evento"]. " , ". human_time_comparation($row["timestamp"]);
|
||||||
|
@ -91,7 +91,7 @@ INSERT INTO tconfig (token, value) VALUES ('netflow_path', '/var/spool/pandora/d
|
|||||||
INSERT INTO tconfig (token, value) VALUES ('netflow_interval', '300');
|
INSERT INTO tconfig (token, value) VALUES ('netflow_interval', '300');
|
||||||
INSERT INTO tconfig (token, value) VALUES ('netflow_daemon', '/usr/bin/nfcapd');
|
INSERT INTO tconfig (token, value) VALUES ('netflow_daemon', '/usr/bin/nfcapd');
|
||||||
INSERT INTO tconfig (token, value) VALUES ('event_fields', 'evento,id_agente,estado,timestamp');
|
INSERT INTO tconfig (token, value) VALUES ('event_fields', 'evento,id_agente,estado,timestamp');
|
||||||
INSERT INTO tconfig (token, value) VALUES ('list_ACL_IPs_for_API_0', '127.0.0.1');
|
INSERT INTO tconfig (token, value) VALUES ('list_ACL_IPs_for_API', '127.0.0.1');
|
||||||
INSERT INTO tconfig (token, value) VALUES ('enable_pass_policy', 0);
|
INSERT INTO tconfig (token, value) VALUES ('enable_pass_policy', 0);
|
||||||
INSERT INTO tconfig (token, value) VALUES ('pass_size', 4);
|
INSERT INTO tconfig (token, value) VALUES ('pass_size', 4);
|
||||||
INSERT INTO tconfig (token, value) VALUES ('pass_needs_numbers', 0);
|
INSERT INTO tconfig (token, value) VALUES ('pass_needs_numbers', 0);
|
||||||
|
@ -87,7 +87,7 @@ INSERT INTO "tconfig" ("token", "value") VALUES
|
|||||||
('netflow_interval', '300'),
|
('netflow_interval', '300'),
|
||||||
('netflow_daemon', '/usr/bin/nfcapd'),
|
('netflow_daemon', '/usr/bin/nfcapd'),
|
||||||
('event_fields', 'evento,id_agente,estado,timestamp'),
|
('event_fields', 'evento,id_agente,estado,timestamp'),
|
||||||
('list_ACL_IPs_for_API_0', '127.0.0.1'),
|
('list_ACL_IPs_for_API', '127.0.0.1'),
|
||||||
('enable_pass_policy', 0),
|
('enable_pass_policy', 0),
|
||||||
('pass_size', 4),
|
('pass_size', 4),
|
||||||
('pass_needs_numbers', 0),
|
('pass_needs_numbers', 0),
|
||||||
|
@ -86,7 +86,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||||||
('netflow_interval', '300'),
|
('netflow_interval', '300'),
|
||||||
('netflow_daemon', '/usr/bin/nfcapd'),
|
('netflow_daemon', '/usr/bin/nfcapd'),
|
||||||
('event_fields', 'evento,id_agente,estado,timestamp'),
|
('event_fields', 'evento,id_agente,estado,timestamp'),
|
||||||
('list_ACL_IPs_for_API_0', '127.0.0.1'),
|
('list_ACL_IPs_for_API', '127.0.0.1'),
|
||||||
('enable_pass_policy', 0),
|
('enable_pass_policy', 0),
|
||||||
('pass_size', 4),
|
('pass_size', 4),
|
||||||
('pass_needs_numbers', 0),
|
('pass_needs_numbers', 0),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user