From 9ab973f6c1c9f66bfa671ff5e7020a93015915b3 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Thu, 17 Oct 2013 18:46:14 -0400 Subject: Fix a bug with returning to previous page. --- config/snort/snort_rules.php | 2 +- config/snort/snort_rules_flowbits.php | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort_rules.php b/config/snort/snort_rules.php index 2882a89e..c9852597 100755 --- a/config/snort/snort_rules.php +++ b/config/snort/snort_rules.php @@ -118,7 +118,7 @@ else if ($_POST['openruleset']) else $currentruleset = $categories[0]; -if (empty($categories[0]) && ($currentruleset != "custom.rules")) { +if (empty($categories[0]) && ($currentruleset != "custom.rules") && ($currentruleset != "Auto-Flowbit Rules")) { if (!empty($a_rule[$id]['ips_policy'])) $currentruleset = "IPS Policy - " . ucfirst($a_rule[$id]['ips_policy']); else diff --git a/config/snort/snort_rules_flowbits.php b/config/snort/snort_rules_flowbits.php index 578f6c66..92330ebf 100644 --- a/config/snort/snort_rules_flowbits.php +++ b/config/snort/snort_rules_flowbits.php @@ -50,6 +50,21 @@ if (!is_array($config['installedpackages']['snortglobal']['rule'])) { } $a_nat = &$config['installedpackages']['snortglobal']['rule']; +// Set who called us so we can return to the correct page with +// the RETURN button. We will just trust this User-Agent supplied +// string for now. +session_start(); +if(!isset($_SESSION['org_referer'])) + $_SESSION['org_referer'] = $_SERVER['HTTP_REFERER']; +$referrer = $_SESSION['org_referer']; + +if ($_POST['cancel']) { + unset($_SESSION['org_referer']); + session_write_close(); + header("Location: {$referrer}"); + exit; +} + $id = $_GET['id']; if (isset($_POST['id'])) $id = $_POST['id']; @@ -58,11 +73,6 @@ if (is_null($id)) { exit; } -// Set who called us so we can return to the correct page with -// the RETURN button. We will just trust this User-Agent supplied -// string for now. -$referrer = $_SERVER['HTTP_REFERER']; - $if_real = snort_get_real_interface($a_nat[$id]['interface']); $snort_uuid = $a_nat[$id]['uuid']; @@ -190,8 +200,9 @@ if ($savemsg) - /> + /> + @@ -283,7 +294,7 @@ if ($savemsg) 20): ?> - /> -- cgit v1.2.3