diff options
author | Seth Mos <seth.mos@dds.nl> | 2011-01-18 09:10:36 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2011-01-18 09:10:36 +0100 |
commit | 1f74cd2d101f032472a4968a10b64161652d6c1f (patch) | |
tree | d692513243aaed6003264f0b877b50cbeb69328b /usr/local/www/firewall_nat_1to1_edit.php | |
parent | c9d174dfc0a29c59ae35f43a470460f36f695b61 (diff) | |
parent | 96e889fc1e938187dd18238d80e3163e1aca3006 (diff) | |
download | pfsense-1f74cd2d101f032472a4968a10b64161652d6c1f.zip pfsense-1f74cd2d101f032472a4968a10b64161652d6c1f.tar.gz |
Merge remote branch 'upstream/master'
Conflicts:
etc/inc/interfaces.inc
etc/inc/system.inc
Diffstat (limited to 'usr/local/www/firewall_nat_1to1_edit.php')
-rwxr-xr-x | usr/local/www/firewall_nat_1to1_edit.php | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php index 199adef..b6a307a 100755 --- a/usr/local/www/firewall_nat_1to1_edit.php +++ b/usr/local/www/firewall_nat_1to1_edit.php @@ -131,22 +131,25 @@ if ($_POST) { $_POST['dsttype'] = "single"; } - if (($_POST['external'] && !is_ipaddroralias($_POST['external']))) + /* For external, user can enter only ip's */ + if (($_POST['external'] && !is_ipaddr($_POST['external']))) $input_errors[] = gettext("A valid external subnet must be specified."); - /* if user enters an alias and selects "network" then disallow. */ - if( ($_POST['srctype'] == "network" && is_alias($_POST['src']) ) - || ($_POST['dsttype'] == "network" && is_alias($_POST['dst']) ) ) + /* For dst, if user enters an alias and selects "network" then disallow. */ + if ($_POST['dsttype'] == "network" && is_alias($_POST['dst']) ) $input_errors[] = gettext("You must specify single host or alias for alias entries."); + /* For src, user can enter only ip's or networks */ if (!is_specialnet($_POST['srctype'])) { - if (($_POST['src'] && !is_ipaddroralias($_POST['src']))) { - $input_errors[] = sprintf(gettext("%s is not a valid source IP address or alias."), $_POST['src']); + if (($_POST['src'] && !is_ipaddr($_POST['src']))) { + $input_errors[] = sprintf(gettext("%s is not a valid internal IP address."), $_POST['src']); } if (($_POST['srcmask'] && !is_numericint($_POST['srcmask']))) { - $input_errors[] = gettext("A valid source bit count must be specified."); + $input_errors[] = gettext("A valid internal bit count must be specified."); } } + + /* For dst, user can enter ip's, networks or aliases */ if (!is_specialnet($_POST['dsttype'])) { if (($_POST['dst'] && !is_ipaddroralias($_POST['dst']))) { $input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."), $_POST['dst']); @@ -309,12 +312,12 @@ function typesel_change() { <td width="78%" class="vtable"> <input name="external" type="text" class="formfldalias" id="external" size="20" value="<?=htmlspecialchars($pconfig['external']);?>"> <br/> - <span class="vexpl"><?=gettext("Enter the external (usually on a WAN) subnet's starting address for the 1:1 mapping. The subnet mask from the source address below will be applied to this IP address."); ?><br> + <span class="vexpl"><?=gettext("Enter the external (usually on a WAN) subnet's starting address for the 1:1 mapping. The subnet mask from the internal address below will be applied to this IP address."); ?><br> <?=gettext("Hint: this is generally an address owned by the router itself on the selected interface."); ?></span> </td> </tr> <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Source"); ?></td> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Internal IP"); ?></td> <td width="78%" class="vtable"> <input name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked"; ?>> <strong><?=gettext("not"); ?></strong> @@ -330,7 +333,7 @@ function typesel_change() { <?php $sel = is_specialnet($pconfig['src']); ?> <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>><?=gettext("any"); ?></option> - <option value="single" <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host"); ?></option> + <option value="single" <?php if ((($pconfig['srcmask'] == 32) || !isset($pconfig['srcmask'])) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host"); ?></option> <option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network"); ?></option> <?php if(have_ruleint_access("pptp")): ?> <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients"); ?></option> @@ -481,9 +484,7 @@ if($config['aliases']['alias'] <> "") <!-- var addressarray=new Array(<?php echo $aliasesaddr; ?>); - var oTextbox1 = new AutoSuggestControl(document.getElementById("external"), new StateSuggestions(addressarray)); - var oTextbox2 = new AutoSuggestControl(document.getElementById("src"), new StateSuggestions(addressarray)); - var oTextbox3 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray)); + var oTextbox1 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray)); //--> </script> <?php include("fend.inc"); ?> |