From 9150f7c55e0f9b6500784a011b08ed688e0c9859 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 1 Sep 2011 16:07:07 +0000 Subject: Correct some code in preprocessort page --- config/snort/snort_preprocessors.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort_preprocessors.php b/config/snort/snort_preprocessors.php index df4e9b6a..80a72628 100644 --- a/config/snort/snort_preprocessors.php +++ b/config/snort/snort_preprocessors.php @@ -1,7 +1,7 @@ . @@ -46,7 +46,10 @@ $a_nat = &$config['installedpackages']['snortglobal']['rule']; $id = $_GET['id']; if (isset($_POST['id'])) $id = $_POST['id']; - +if (is_null($id)) { + header("Location: /snort/snort_interfaces.php"); + exit; +} if (isset($_GET['dup'])) { $id = $_GET['dup']; $after = $_GET['dup']; @@ -130,7 +133,6 @@ if (isset($id) && $a_nat[$id]) { /* convert fake interfaces to real */ $if_real = snort_get_real_interface($pconfig['interface']); - $snort_uuid = $pconfig['uuid']; /* alert file */ @@ -138,15 +140,14 @@ $d_snortconfdirty_path = "/var/run/snort_conf_{$snort_uuid}_{$if_real}.dirty"; if ($_POST["Submit"]) { - /* check for overlaps */ + $natent = array(); /* if no errors write to conf */ if (!$input_errors) { - $natent = array(); /* repost the options already in conf */ - if ($pconfig['interface'] != "") { $natent['interface'] = $pconfig['interface']; } + $natent['uuid'] = $pconfig['uuid']; + $natent['interface'] = $pconfig['interface']; if ($pconfig['enable'] != "") { $natent['enable'] = $pconfig['enable']; } - if ($pconfig['uuid'] != "") { $natent['uuid'] = $pconfig['uuid']; } if ($pconfig['descr'] != "") { $natent['descr'] = $pconfig['descr']; } if ($pconfig['performance'] != "") { $natent['performance'] = $pconfig['performance']; } if ($pconfig['blockoffenders7'] != "") { $natent['blockoffenders7'] = $pconfig['blockoffenders7']; } -- cgit v1.2.3