diff options
author | Ermal <eri@pfsense.org> | 2011-09-04 16:05:24 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-09-04 16:05:24 +0000 |
commit | 705fa7e5dc114a76ef048005f3dc8b3103294b16 (patch) | |
tree | 3a3481f72fabc7c8b68c22651b59848f395c40cb | |
parent | 26adf4e5b503ef318ad9111606732f50c77b0342 (diff) | |
download | pfsense-packages-705fa7e5dc114a76ef048005f3dc8b3103294b16.tar.gz pfsense-packages-705fa7e5dc114a76ef048005f3dc8b3103294b16.tar.bz2 pfsense-packages-705fa7e5dc114a76ef048005f3dc8b3103294b16.zip |
Quick round of fixes to not break lighty
-rw-r--r-- | config/snort/snort_alerts.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/config/snort/snort_alerts.php b/config/snort/snort_alerts.php index 8e81d16a..7bd47934 100644 --- a/config/snort/snort_alerts.php +++ b/config/snort/snort_alerts.php @@ -80,34 +80,36 @@ if ($_POST['save']) write_config(); header("Location: /snort/snort_alerts.php"); + exit; } } if ($_POST['delete']) { - conf_mount_rw(); if(file_exists('/var/log/snort/alert')) { + conf_mount_rw(); @file_put_content("/var/log/snort/alert", ""); post_delete_logs(); mwexec('/usr/sbin/chown snort:snort /var/log/snort/*', true); mwexec('/bin/chmod 660 /var/log/snort/*', true); - sleep(2); mwexec('/usr/bin/killall -HUP snort', true); + conf_mount_ro(); + + header("Location: /snort/snort_alerts.php"); + exit; } - conf_mount_ro(); } if ($_POST['download']) { - ob_start(); //importanr or other post will fail $save_date = exec('/bin/date "+%Y-%m-%d-%H-%M-%S"'); $file_name = "snort_logs_{$save_date}.tar.gz"; - exec("/usr/bin/tar cfz /tmp/snort_logs_{$save_date}.tar.gz /var/log/snort"); + exec("/usr/bin/tar cfz /tmp/{$file_name} /var/log/snort"); - if (file_exists("/tmp/snort_logs_{$save_date}.tar.gz")) { + if (file_exists("/tmp/{$file_name}")) { $file = "/tmp/snort_logs_{$save_date}.tar.gz"; header("Expires: Mon, 26 Jul 1997 05:00:00 GMT\n"); header("Pragma: private"); // needed for IE @@ -117,10 +119,11 @@ if ($_POST['download']) header("Content-length: ".filesize($file)); header("Content-disposition: attachment; filename = {$file_name}"); readfile("$file"); - exec("/bin/rm /tmp/snort_logs_{$save_date}.tar.gz"); - od_end_clean(); //importanr or other post will fail - } else - echo 'Error no saved file.'; + exec("/bin/rm /tmp/{$file_name}"); + } + + header("Location: /snort/snort_alerts.php"); + exit; } |