diff options
author | Ermal <eri@pfsense.org> | 2012-07-11 19:27:20 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2012-07-11 19:28:34 +0000 |
commit | 55c807e8129313f9f7911b4097a1e26cd941f623 (patch) | |
tree | 2857ec65ecbcadcf3777b2472b1fb4ca4179f0ec /config/snort/snort_barnyard.php | |
parent | cedf3b86e951a02364f5ad94df3ec5c3fab7c4c5 (diff) | |
download | pfsense-packages-55c807e8129313f9f7911b4097a1e26cd941f623.tar.gz pfsense-packages-55c807e8129313f9f7911b4097a1e26cd941f623.tar.bz2 pfsense-packages-55c807e8129313f9f7911b4097a1e26cd941f623.zip |
Last cleanup. Fixes for issues reported on the forums as well.
Diffstat (limited to 'config/snort/snort_barnyard.php')
-rw-r--r-- | config/snort/snort_barnyard.php | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/config/snort/snort_barnyard.php b/config/snort/snort_barnyard.php index 7102e36d..61078550 100644 --- a/config/snort/snort_barnyard.php +++ b/config/snort/snort_barnyard.php @@ -56,31 +56,20 @@ $pconfig = array(); if (isset($id) && $a_nat[$id]) { /* old options */ $pconfig = $a_nat[$id]; - $pconfig['barnyard_enable'] = $a_nat[$id]['barnyard_enable']; - $pconfig['barnyard_mysql'] = $a_nat[$id]['barnyard_mysql']; $pconfig['barnconfigpassthru'] = base64_decode($a_nat[$id]['barnconfigpassthru']); } if (isset($_GET['dup'])) unset($id); -$if_real = snort_get_real_interface($pconfig['interface']); -$snort_uuid = $pconfig['uuid']; - -/* alert file */ -$d_snortconfdirty_path = "/var/run/snort_conf_{$snort_uuid}_{$if_real}.dirty"; - if ($_POST) { - /* XXX: Mising error reporting?! - * check for overlaps foreach ($a_nat as $natent) { if (isset($id) && ($a_nat[$id]) && ($a_nat[$id] === $natent)) continue; if ($natent['interface'] != $_POST['interface']) - continue; + $input_error[] = "This interface has already an instance defined"; } - */ /* if no errors write to conf */ if (!$input_errors) { @@ -89,8 +78,8 @@ if ($_POST) { $natent = $pconfig; $natent['barnyard_enable'] = $_POST['barnyard_enable'] ? 'on' : 'off'; - $natent['barnyard_mysql'] = $_POST['barnyard_mysql'] ? $_POST['barnyard_mysql'] : $pconfig['barnyard_mysql']; - $natent['barnconfigpassthru'] = $_POST['barnconfigpassthru'] ? base64_encode($_POST['barnconfigpassthru']) : $pconfig['barnconfigpassthru']; + if ($_POST['barnyard_mysql']) $natent['barnyard_mysql'] = $_POST['barnyard_mysql']; unset($natent['barnyard_mysql']); + if ($_POST['barnconfigpassthru']) $natent['barnconfigpassthru'] = base64_encode($_POST['barnconfigpassthru']); unset($natent['barnconfigpassthru']); if ($_POST['barnyard_enable'] == "on") $natent['snortunifiedlog'] = 'on'; else @@ -119,7 +108,8 @@ if ($_POST) { } } -$pgtitle = "Snort: Interface: $id$if_real Barnyard2 Edit"; +$if_friendly = snort_get_friendly_interface($pconfig['interface']); +$pgtitle = "Snort: Interface: {$if_friendly} Barnyard2 Edit"; include_once("head.inc"); ?> |