From 165f7370b89857b4db89eb2d873fa120791bd8cf Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 2 Aug 2011 15:59:36 +0000 Subject: Polishing of the snort pacakge, part 2: * Get rid of snort_head.inc * No more apply settings button since it does not make sense * Other cleanups in many parts of the code Tested only on 2.0 --- config/snort/snort_interfaces_whitelist_edit.php | 48 ++++-------------------- 1 file changed, 7 insertions(+), 41 deletions(-) (limited to 'config/snort/snort_interfaces_whitelist_edit.php') diff --git a/config/snort/snort_interfaces_whitelist_edit.php b/config/snort/snort_interfaces_whitelist_edit.php index 951ed0b5..c484df9e 100644 --- a/config/snort/snort_interfaces_whitelist_edit.php +++ b/config/snort/snort_interfaces_whitelist_edit.php @@ -101,25 +101,6 @@ if (isset($id) && $a_whitelist[$id]) { $addresssubnettest = false; } -/* this will exec when alert says apply */ -if ($_POST['apply']) { - - if (file_exists("$d_snort_whitelist_dirty_path")) { - conf_mount_rw(); - - /* create whitelist and homenet file then sync files */ - sync_snort_package_empty(); - sync_snort_package(); - - unlink("$d_snort_whitelist_dirty_path"); - - write_config(); - conf_mount_ro(); - - } - -} - if ($_POST['submit']) { conf_mount_rw(); @@ -218,14 +199,15 @@ if ($_POST['submit']) { $w_list['detail'] = $final_address_details; if (isset($id) && $a_whitelist[$id]) - $a_whitelist[$id] = $w_list; + $a_whitelist[$id] = $w_list; else - $a_whitelist[] = $w_list; - - touch($d_snort_whitelist_dirty_path); + $a_whitelist[] = $w_list; write_config(); + /* create whitelist and homenet file then sync files */ + sync_snort_package_empty(); + header("Location: /snort/snort_interfaces_whitelist_edit.php?id=$id"); exit; } @@ -240,32 +222,16 @@ if ($_POST['submit']) { } $pgtitle = "Services: Snort: Whitelist: Edit $whitelist_uuid"; -include("/usr/local/pkg/snort/snort_head.inc"); +include_once("head.inc"); ?> -"> - - + - - -
-