From e1e2edc25cdecd36af6f2bb2d1e75b7857cafaed Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Tue, 28 Jan 2014 11:43:56 -0500 Subject: Fix so forced rule toggles back to its default on 2nd click --- config/snort/snort_rules.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'config') diff --git a/config/snort/snort_rules.php b/config/snort/snort_rules.php index 4307c8de..71fdbd16 100755 --- a/config/snort/snort_rules.php +++ b/config/snort/snort_rules.php @@ -167,18 +167,12 @@ if ($_GET['act'] == "toggle" && $_GET['ids'] && !empty($rules_map)) { $sid= $_GET['ids']; // See if the target SID is in our list of modified SIDs, - // and toggle it if present; otherwise, add it to the - // appropriate list. - if (isset($enablesid[$gid][$sid])) { + // and toggle it back to default if present; otherwise, + // add it to the appropriate modified SID list. + if (isset($enablesid[$gid][$sid])) unset($enablesid[$gid][$sid]); - if (!isset($disablesid[$gid][$sid])) - $disablesid[$gid][$sid] = "disablesid"; - } - elseif (isset($disablesid[$gid][$sid])) { + elseif (isset($disablesid[$gid][$sid])) unset($disablesid[$gid][$sid]); - if (!isset($enablesid[$gid][$sid])) - $enablesid[$gid][$sid] = "enablesid"; - } else { if ($rules_map[$gid][$sid]['disabled'] == 1) $enablesid[$gid][$sid] = "enablesid"; @@ -759,7 +753,7 @@ if ($savemsg) { $textse = ""; $iconb = "icon_reject_d.gif"; $disable_cnt++; - $title = gettext("Disabled by user. Click to toggle to enabled state"); + $title = gettext("Disabled by user. Click to toggle to default state"); } elseif (($v['disabled'] == 1) && (!isset($enablesid[$gid][$sid]))) { $textss = ""; @@ -772,7 +766,7 @@ if ($savemsg) { $textss = $textse = ""; $iconb = "icon_reject.gif"; $enable_cnt++; - $title = gettext("Enabled by user. Click to toggle to disabled state"); + $title = gettext("Enabled by user. Click to toggle to default state"); } else { $textss = $textse = ""; -- cgit v1.2.3