From 4763db0d8ca282fc0e3d0165ba9804fae2e7aefe Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 29 Sep 2011 22:53:27 +0000 Subject: Correct clearing the alerts. --- config/snort/snort.inc | 2 +- config/snort/snort_alerts.php | 29 +++++++++-------------------- 2 files changed, 10 insertions(+), 21 deletions(-) (limited to 'config') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index f27bb383..2973a409 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -473,7 +473,7 @@ function post_delete_logs() //create_barnyard2_conf($id, $if_real, $snort_uuid); if ($value['perform_stat'] == 'on') - file_put_contents("/var/log/snort/snort_{$snort_uuid}_{$if_real}.stats", ""); + @file_put_contents("/var/log/snort/snort_{$snort_uuid}_{$if_real}.stats", ""); } } } diff --git a/config/snort/snort_alerts.php b/config/snort/snort_alerts.php index 7bd47934..49bb9bff 100644 --- a/config/snort/snort_alerts.php +++ b/config/snort/snort_alerts.php @@ -85,7 +85,7 @@ if ($_POST['save']) } -if ($_POST['delete']) +if ($_GET['clear']) { if(file_exists('/var/log/snort/alert')) { @@ -96,10 +96,9 @@ if ($_POST['delete']) mwexec('/bin/chmod 660 /var/log/snort/*', true); mwexec('/usr/bin/killall -HUP snort', true); conf_mount_ro(); - - header("Location: /snort/snort_alerts.php"); - exit; } + header("Location: /snort/snort_alerts.php"); + exit; } if ($_POST['download']) @@ -304,9 +303,9 @@ if ($pconfig['arefresh'] == 'on')
All - log files will be saved. + onclick="return confirm('Do you really want to remove all your logs ? All snort rule interfces may have to be restarted.')"> Warning: all log files will be deleted.
@@ -561,21 +560,11 @@ if ($pconfig['arefresh'] == 'on') - - + - var myTable = {}; - window.addEvent('domready', function(){ - myTable = new sortableTable('myTable', {overCls: 'over'}); - }); - +echo $snort_custom_rnd_box; +?> -- cgit v1.2.3