summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-09-01 12:32:29 +0000
committerErmal <eri@pfsense.org>2010-09-01 12:32:29 +0000
commit8e0c376055498bf0a43ff2114062cd8ef8992a09 (patch)
tree1cc4000be46fed1ac7715dcdb827f6a53d823eb0
parent990fb7a9a9b03f744c56792011f1c1e2950ce764 (diff)
downloadpfsense-8e0c376055498bf0a43ff2114062cd8ef8992a09.zip
pfsense-8e0c376055498bf0a43ff2114062cd8ef8992a09.tar.gz
Ticket #568. Do not show the save/cancel buttons on the edit page of firewall rules if that are advanced options set.
-rwxr-xr-xusr/local/www/firewall_rules.php44
-rwxr-xr-xusr/local/www/firewall_rules_edit.php2
-rwxr-xr-xusr/local/www/guiconfig.inc42
3 files changed, 45 insertions, 43 deletions
diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php
index 3c2ccd6..616bc10 100755
--- a/usr/local/www/firewall_rules.php
+++ b/usr/local/www/firewall_rules.php
@@ -51,48 +51,6 @@ require_once("shaper.inc");
$pgtitle = array(gettext("Firewall"),gettext("Rules"));
-function check_for_advanced_options(&$item) {
- $item_set = "";
- if($item['max'])
- $item_set .= "max {$item['max']} ";
- if($item['max-src-nodes'])
- $item_set .= "max-src-nodes {$item['max-src-nodes']} ";
- if($item['max-src-conn'])
- $item_set .= "max-src-conn {$item['max-src-conn']} ";
- if($item['max-src-states'])
- $item_set .= "max-src-states {$item['max-src-states']} ";
- if($item['statetype'] != "keep state" && $item['statetype'] != "")
- $item_set .= "statetype {$item['statetype']} ";
- if($item['statetimeout'])
- $item_set .= "statetimeout {$item['statetimeout']} ";
- if($item['nosync'])
- $item_set .= "nosync ";
- if($item['max-src-conn-rate'])
- $item_set .= "max-src-conn-rate {$item['max-src-conn-rate']} ";
- if($item['max-src-conn-rates'])
- $item_set .= "max-src-conn-rates {$item['max-src-conn-rates']} ";
- if($item['gateway'])
- $item_set .= "gateway {$item['gateway']} ";
- if($item['dnpipe'])
- $item_set .= "limiter {$item['dnpipe']} ";
- if($item['pdnpipe'])
- $item_set .= "limiter {$item['pdnpipe']} ";
- if($item['l7container'])
- $item_set .= "layer7 {$item['l7container']} ";
- if($item['tag'])
- $item_set .= "tag {$item['tag']} ";
- if($item['tagged'])
- $item_set .= "tagged {$item['tagged']} ";
- if(isset($item['allowopts']))
- $item_set .= "allowopts ";
- if(isset($item['disablereplyto']))
- $item_set .= "disable reply-to ";
- if($item['tcpflags_any'] || $item['tcpflags1'] || $item['tcpflags2'])
- $item_set .= "tcpflags set";
-
- return $item_set;
-}
-
function delete_nat_association($id) {
global $config;
@@ -455,7 +413,7 @@ if($_REQUEST['undodrag']) {
continue;
if (isset($filterent['floating']) && "FloatingRules" != $if)
continue;
- $isadvset = check_for_advanced_options($filterent);
+ $isadvset = firewall_check_for_advanced_options($filterent);
if($isadvset)
$advanced_set = "<img src=\"./themes/{$g['theme']}/images/icons/icon_advanced.gif\" title=\"" . gettext("advanced settings set") . ": {$isadvset}\" border=\"0\">";
else
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index fd39718..813842c 100755
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -969,6 +969,7 @@ include("head.inc");
<span class="vexpl"><?=gettext("You may enter a description here for your reference.");?></span>
</td>
</tr>
+<?php if (!isset($id) || !($a_filter[$id] && firewall_check_for_advanced_options($a_filter[$id]) <> "")): ?>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
@@ -980,6 +981,7 @@ include("head.inc");
<input name="after" type="hidden" value="<?=$after;?>">
</td>
</tr>
+<?php endif; ?>
<tr>
<td>&nbsp;</td>
</tr>
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 229b032..458488e 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -477,6 +477,48 @@ function filter_rules_sort() {
unset($config['filter']['rule'][$i]['seq']);
}
+function firewall_check_for_advanced_options(&$item) {
+ $item_set = "";
+ if($item['max'])
+ $item_set .= "max {$item['max']} ";
+ if($item['max-src-nodes'])
+ $item_set .= "max-src-nodes {$item['max-src-nodes']} ";
+ if($item['max-src-conn'])
+ $item_set .= "max-src-conn {$item['max-src-conn']} ";
+ if($item['max-src-states'])
+ $item_set .= "max-src-states {$item['max-src-states']} ";
+ if($item['statetype'] != "keep state" && $item['statetype'] != "")
+ $item_set .= "statetype {$item['statetype']} ";
+ if($item['statetimeout'])
+ $item_set .= "statetimeout {$item['statetimeout']} ";
+ if($item['nosync'])
+ $item_set .= "nosync ";
+ if($item['max-src-conn-rate'])
+ $item_set .= "max-src-conn-rate {$item['max-src-conn-rate']} ";
+ if($item['max-src-conn-rates'])
+ $item_set .= "max-src-conn-rates {$item['max-src-conn-rates']} ";
+ if($item['gateway'])
+ $item_set .= "gateway {$item['gateway']} ";
+ if($item['dnpipe'])
+ $item_set .= "limiter {$item['dnpipe']} ";
+ if($item['pdnpipe'])
+ $item_set .= "limiter {$item['pdnpipe']} ";
+ if($item['l7container'])
+ $item_set .= "layer7 {$item['l7container']} ";
+ if($item['tag'])
+ $item_set .= "tag {$item['tag']} ";
+ if($item['tagged'])
+ $item_set .= "tagged {$item['tagged']} ";
+ if(isset($item['allowopts']))
+ $item_set .= "allowopts ";
+ if(isset($item['disablereplyto']))
+ $item_set .= "disable reply-to ";
+ if($item['tcpflags_any'] || $item['tcpflags1'] || $item['tcpflags2'])
+ $item_set .= "tcpflags set";
+
+ return $item_set;
+}
+
function gentitle($title) {
global $navlevelsep;
if(!is_array($title))
OpenPOWER on IntegriCloud