From 1ef295d754f838935412ddefc8d5fa00c51bcc1c Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Tue, 14 May 2013 00:38:49 -0300 Subject: snort - (re)include two level menu and change start stop icons to toggle status as well show current snort status --- config/snort/snort_interfaces.php | 45 ++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 15 deletions(-) (limited to 'config/snort/snort_interfaces.php') diff --git a/config/snort/snort_interfaces.php b/config/snort/snort_interfaces.php index 4c21cdd9..a2523872 100755 --- a/config/snort/snort_interfaces.php +++ b/config/snort/snort_interfaces.php @@ -184,6 +184,7 @@ if ($pfsense_stable == 'yes') @@ -240,15 +242,28 @@ foreach ($a_nat as $natent): ?> /* convert fake interfaces to real and check if iface is up */ /* There has to be a smarter way to do this */ $if_real = snort_get_real_interface($natent['interface']); + $natend_friendly= snort_get_friendly_interface($natent['interface']); $snort_uuid = $natent['uuid']; - if (snort_is_running($snort_uuid, $if_real) == 'no') - $iconfn = 'pass'; - else + if (snort_is_running($snort_uuid, $if_real) == 'no'){ $iconfn = 'block'; - if (snort_is_running($snort_uuid, $if_real, 'barnyard2') == 'no') - $biconfn = 'pass'; - else + $iconfn_msg1 = 'Snort is not running on '; + $iconfn_msg2 = '. Click to start.'; + } + else{ + $iconfn = 'pass'; + $iconfn_msg1 = 'Snort is running on '; + $iconfn_msg = '. Click to stop.'; + } + if (snort_is_running($snort_uuid, $if_real, 'barnyard2') == 'no'){ $biconfn = 'block'; + $biconfn_msg1 = 'Barnyard2 is not running on '; + $biconfn_msg2 = '. Click to start.'; + } + else{ + $biconfn = 'pass'; + $biconfn_msg1 = 'Barnyard2 is running on '; + $biconfn_msg2 = '. Click to stop.'; + } /* See if interface has any rules defined and set boolean flag */ $no_rules = true; @@ -271,7 +286,7 @@ foreach ($a_nat as $natent): ?> id="frd" ondblclick="document.location='snort_interfaces_edit.php?id=';"> - @@ -417,9 +434,7 @@ foreach ($a_nat as $natent): ?> an interface and settings. - -- cgit v1.2.3
echo " "; + title='" . gettext($iconfn_msg1.$natend_friendly.$iconfn_msg2) . "'>"; echo ($no_rules) ? " " : ""; } else echo strtoupper("disabled"); @@ -325,7 +340,7 @@ foreach ($a_nat as $natent): ?> echo " "; + title='" . gettext($biconfn_msg1.$natend_friendly.$biconfn_msg2) . "'>"; } else echo strtoupper("disabled"); ?> @@ -406,9 +421,11 @@ foreach ($a_nat as $natent): ?>   Click on the "> icon to start - snort and barnyard2. + "> + "> icons will show current + snort and barnyard2 status.
  Click on the "> icon to stop - snort and barnyard2. + Click on the status icons to toggle snort and barnyard2 status.