diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-07 09:38:49 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-07 09:39:39 -0500 |
commit | b9668e697b5b0e3db84d570ae88fcf1cd0ce5c55 (patch) | |
tree | bf7e2a735d25a59092fc147a2b4fb5b996353a2f /src/usr/local/www/firewall_nat_edit.php | |
parent | 5a5cbf013b3d2a312c5dccb19a6a171aba35b1b5 (diff) | |
download | pfsense-b9668e697b5b0e3db84d570ae88fcf1cd0ce5c55.zip pfsense-b9668e697b5b0e3db84d570ae88fcf1cd0ce5c55.tar.gz |
Fixed #5599
Diffstat (limited to 'src/usr/local/www/firewall_nat_edit.php')
-rw-r--r-- | src/usr/local/www/firewall_nat_edit.php | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php index f0aea90..2de7d4b 100644 --- a/src/usr/local/www/firewall_nat_edit.php +++ b/src/usr/local/www/firewall_nat_edit.php @@ -531,7 +531,7 @@ if ($_POST) { } function build_srctype_list() { - global $pconfig, $ifdisp; + global $pconfig, $ifdisp, $config; $list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network'); @@ -553,6 +553,26 @@ function build_srctype_list() { return($list); } +function srctype_selected() { + global $pconfig, $config; + + $selected = ""; + + $sel = is_specialnet($pconfig['src']); + if (!$sel) { + if ($pconfig['srcmask'] == 32) { + $selected = 'single'; + } else { + $selected = 'network'; + } + } else { + $selected = $pconfig['src']; + } + + + return($selected); +} + function build_dsttype_list() { global $pconfig, $config, $ifdisp; @@ -599,33 +619,26 @@ function build_dsttype_list() { } function dsttype_selected() { - global $pconfig; - - $sel = is_specialnet($pconfig['dst']); - - if (!$sel) { - if ($pconfig['dstmask'] == 32) - return('single'); - - return('network'); - } - - return($pconfig['dst']); -} - -function srctype_selected() { - global $pconfig; - - $sel = is_specialnet($pconfig['src']); + global $pconfig, $config; - if (!$sel) { - if ($pconfig['srcmask'] == 32) - return('single'); + $selected = ""; - return('network'); + if (is_array($config['virtualip']['vip'])) { + $selected = $pconfig['dst']; + } else { + $sel = is_specialnet($pconfig['dst']); + if (!$sel) { + if ($pconfig['dstmask'] == 32) { + $selected = 'single'; + } else { + $selected = 'network'; + } + } else { + $selected = $pconfig['dst']; + } } - return($pconfig['src']); + return($selected); } $closehead = false; |