summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-09-29 00:05:04 -0600
committerErik Fonnesbeck <efonnes@gmail.com>2010-09-29 00:05:04 -0600
commit44374c0affb575ff5bdd82f4942802602e9dfb3c (patch)
treee4dedaadf6b071d7967d54f98ec54a46a3c23646
parent3e74107e59338392b92300c34a658edec5e4e977 (diff)
downloadpfsense-44374c0affb575ff5bdd82f4942802602e9dfb3c.zip
pfsense-44374c0affb575ff5bdd82f4942802602e9dfb3c.tar.gz
Hide redirect and filter rule association fields when "no rdr" is checked. Ticket #570
-rwxr-xr-xusr/local/www/firewall_nat_edit.php9
-rw-r--r--usr/local/www/javascript/firewall_nat_edit/firewall_nat_edit.js14
2 files changed, 18 insertions, 5 deletions
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index 7f75f83..c1dfaf7 100755
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -443,7 +443,7 @@ include("fbegin.inc"); ?>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("No RDR (NOT)"); ?></td>
<td width="78%" class="vtable">
- <input type="checkbox" name="nordr"<?php if($pconfig['nordr']) echo " CHECKED"; ?>>
+ <input type="checkbox" name="nordr" id="nordr" onClick="nordr_change();" <?php if($pconfig['nordr']) echo "CHECKED"; ?>>
<span class="vexpl"><?=gettext("Enabling this option will disable redirection for traffic matching this rule."); ?>
<br><?=gettext("Hint: this option is rarely needed, don't use this unless you know what you're doing."); ?></span>
</td>
@@ -709,7 +709,7 @@ include("fbegin.inc"); ?>
</span>
</td>
</tr>
- <tr>
+ <tr name="localiptable" id="localiptable">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Redirect target IP"); ?></td>
<td width="78%" class="vtable">
<input autocomplete='off' name="localip" type="text" class="formfldalias" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
@@ -763,7 +763,7 @@ include("fbegin.inc"); ?>
</td>
</tr>
<?php if (isset($id) && $a_nat[$id] && !isset($_GET['dup'])): ?>
- <tr>
+ <tr name="assoctable" id="assoctable">
<td width="22%" valign="top" class="vncell"><?=gettext("Filter rule association"); ?></td>
<td width="78%" class="vtable">
<select name="associated-rule-id">
@@ -794,7 +794,7 @@ include("fbegin.inc"); ?>
</tr>
<?php endif; ?>
<?php if ((!(isset($id) && $a_nat[$id])) || (isset($_GET['dup']))): ?>
- <tr>
+ <tr name="assoctable" id="assoctable">
<td width="22%" valign="top" class="vncell"><?=gettext("Filter rule association"); ?></td>
<td width="78%" class="vtable">
<select name="filter-rule-association" id="filter-rule-association">
@@ -830,6 +830,7 @@ include("fbegin.inc"); ?>
<?php if ($pconfig['srcnot'] || $pconfig['src'] != "any" || $pconfig['srcbeginport'] != "any" || $pconfig['srcendport'] != "any"): ?>
show_source();
<?php endif; ?>
+ nordr_change();
//-->
</script>
<?php
diff --git a/usr/local/www/javascript/firewall_nat_edit/firewall_nat_edit.js b/usr/local/www/javascript/firewall_nat_edit/firewall_nat_edit.js
index 0cf9884..bd88145 100644
--- a/usr/local/www/javascript/firewall_nat_edit/firewall_nat_edit.js
+++ b/usr/local/www/javascript/firewall_nat_edit/firewall_nat_edit.js
@@ -53,6 +53,18 @@ function ext_change() {
}
}
+function nordr_change() {
+ if (document.iform.nordr.checked) {
+ document.getElementById("localiptable").style.display = 'none';
+ document.getElementById("lprtr").style.display = 'none';
+ document.getElementById("assoctable").style.display = 'none';
+ } else {
+ document.getElementById("localiptable").style.display = '';
+ document.getElementById("lprtr").style.display = portsenabled ? '' : 'none';
+ document.getElementById("assoctable").style.display = '';
+ }
+}
+
function show_source() {
if(portsenabled)
document.getElementById("sprtable").style.display = '';
@@ -121,7 +133,7 @@ function proto_change() {
if (portsenabled) {
document.getElementById("sprtable").style.display = showsource == 1 ? '':'none';
document.getElementById("dprtr").style.display = '';
- document.getElementById("lprtr").style.display = '';
+ document.getElementById("lprtr").style.display = document.iform.nordr.checked ? 'none' : '';
} else {
document.getElementById("sprtable").style.display = 'none';
document.getElementById("dprtr").style.display = 'none';
OpenPOWER on IntegriCloud