aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2013-10-17 18:46:14 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2013-10-17 18:46:14 -0400
commit9ab973f6c1c9f66bfa671ff5e7020a93015915b3 (patch)
treef921e722319d648758503d92f7b5616ff1a9a110 /config/snort
parent0ff48067e191b8edb984f52e9c8cb8df777bff05 (diff)
downloadpfsense-packages-9ab973f6c1c9f66bfa671ff5e7020a93015915b3.tar.gz
pfsense-packages-9ab973f6c1c9f66bfa671ff5e7020a93015915b3.tar.bz2
pfsense-packages-9ab973f6c1c9f66bfa671ff5e7020a93015915b3.zip
Fix a bug with returning to previous page.
Diffstat (limited to 'config/snort')
-rwxr-xr-xconfig/snort/snort_rules.php2
-rw-r--r--config/snort/snort_rules_flowbits.php27
2 files changed, 20 insertions, 9 deletions
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)
<tr>
<td width="17px"><img src="../themes/<?=$g['theme']?>/images/icons/icon_plus.gif" width='12' height='12' border='0'/></td>
<td><span class="vexpl"><?php echo gettext("Alert is Not Suppressed"); ?></span></td>
- <td rowspan="3" align="right"><input id="cancelbutton" name="cancelbutton" type="button" class="formbtn" onclick="parent.location='<?=$referrer;?>'" <?php
- echo "value=\"" . gettext("Return") . "\" title=\"" . gettext("Return to previous page") . "\""; ?>/></td>
+ <td rowspan="3" align="right"><input id="cancel" name="cancel" type="submit" class="formbtn" <?php
+ echo "value=\"" . gettext("Return") . "\" title=\"" . gettext("Return to previous page") . "\""; ?>/>
+ <input name="id" type="hidden" value="<?=$id;?>" /></td>
</tr>
<tr>
<td width="17px"><img src="../themes/<?=$g['theme']?>/images/icons/icon_plus_d.gif" width='12' height='12' border='0'/></td>
@@ -283,7 +294,7 @@ if ($savemsg)
<?php if ($count > 20): ?>
<tr>
<td align="center" valign="middle">
- <input id="cancelbutton" name="cancelbutton" type="button" class="formbtn" onclick="parent.location='<?=$referrer;?>'" <?php
+ <input id="cancel" name="cancel" type="submit" class="formbtn" <?php
echo "value=\"" . gettext("Return") . "\" title=\"" . gettext("Return to previous page") . "\""; ?>/>
<input name="id" type="hidden" value="<?=$id;?>" />
</td>