diff options
author | robiscool <robrob2626@yahoo.com> | 2009-11-30 20:42:34 -0800 |
---|---|---|
committer | robiscool <robrob2626@yahoo.com> | 2009-11-30 20:42:34 -0800 |
commit | 84f9461274f2d25c1e0a4da0557158a6bb36d817 (patch) | |
tree | a06b80f4cf2b4d5cee7231277830afb22cd36073 /config/snort-dev/snort_interfaces_edit.php | |
parent | 4a7d90c3e640171e85d43e3c063348d1fa3e52c7 (diff) | |
download | pfsense-packages-84f9461274f2d25c1e0a4da0557158a6bb36d817.tar.gz pfsense-packages-84f9461274f2d25c1e0a4da0557158a6bb36d817.tar.bz2 pfsense-packages-84f9461274f2d25c1e0a4da0557158a6bb36d817.zip |
snort-dev, add interface gui options, add check if interface is in use
Diffstat (limited to 'config/snort-dev/snort_interfaces_edit.php')
-rw-r--r-- | config/snort-dev/snort_interfaces_edit.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/config/snort-dev/snort_interfaces_edit.php b/config/snort-dev/snort_interfaces_edit.php index 410bb02b..cdf2f3e1 100644 --- a/config/snort-dev/snort_interfaces_edit.php +++ b/config/snort-dev/snort_interfaces_edit.php @@ -119,14 +119,28 @@ if ($_POST["Submit"]) { // $input_errors[] = "The target port range must be an integer between 1 and 65535."; // } - if ($_POST['interface'] == $pconfig['interface']) { - $input_errors[] = "The {$pconfig['interface']} interface is in use. Please select another interface."; - } - if ($pconfig['descr'] == "") { - $input_errors[] = "Please enter a description for your reference."; - } + // if ($config['installedpackages']['snortglobal']['rule']) { + if ($_POST['descr'] == "") { + $input_errors[] = "Please enter a description for your reference."; + } + + if ($id == "" && $config['installedpackages']['snortglobal']['rule'][0]['interface'] != "") { + + $rule_array = $config['installedpackages']['snortglobal']['rule']; + $id_c = -1; + foreach ($rule_array as $value) { + $id_c += 1; + + $result_lan = $config['installedpackages']['snortglobal']['rule'][$id_c]['interface']; + $if_real = convert_friendly_interface_to_real_interface_name($result_lan); + + if ($_POST['interface'] == $result_lan) { + $input_errors[] = "Interface $result_lan is in use. Please select another interface."; + } + } + } /* check for overlaps */ foreach ($a_nat as $natent) { @@ -169,8 +183,6 @@ if ($_POST["Submit"]) { write_config(); // stop_service("snort"); - //create_snort_conf(); - //create_barnyard2_conf(); if ($pconfig['interface'] != "") { sync_package_snort(); |