Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
53822605
Commit
53822605
authored
Mar 04, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nat: hide input for "interface address" option; toggle bitmask correctly
parent
7aa89257
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
firewall_nat_out_edit.php
src/www/firewall_nat_out_edit.php
+6
-8
No files found.
src/www/firewall_nat_out_edit.php
View file @
53822605
...
...
@@ -237,22 +237,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// target ip/net
if
(
empty
(
$pconfig
[
'targetip'
]))
{
// empty target "Interface address"
$natent
[
'target'
]
=
$pconfig
[
'targetip'
]
;
$natent
[
'target'
]
=
$pconfig
[
'targetip'
];
$natent
[
'targetip_subnet'
]
=
0
;
$natent
[
'target'
]
=
$pconfig
[
'targetip'
]
;
}
elseif
(
!
array_key_exists
(
$pconfig
[
'targetip'
],
formTranslateAddresses
()))
{
// a bit vague behaviour in "target" and "targetip", if a custom net is given
// the backend code wants target to be filled with "other-subnet".
// if any other known net is given, target is used to provide the actual address....
// -- can't remove this behaviour now without breaking old confid, so let's reimplement
$natent
[
'target'
]
=
'other-subnet'
;
$natent
[
'targetip'
]
=
trim
(
$pconfig
[
'targetip'
])
;
$natent
[
'targetip_subnet'
]
=
$pconfig
[
'targetip_subnet'
]
;
$natent
[
'targetip'
]
=
trim
(
$pconfig
[
'targetip'
]);
$natent
[
'targetip_subnet'
]
=
$pconfig
[
'targetip_subnet'
];
}
else
{
$natent
[
'target'
]
=
$pconfig
[
'targetip'
]
;
$natent
[
'target'
]
=
$pconfig
[
'targetip'
];
}
// handle fields containing portnumbers
if
(
in_array
(
$pconfig
[
'protocol'
],
explode
(
" "
,
"any tcp udp tcp/udp"
)))
{
if
(
isset
(
$pconfig
[
'staticnatport'
])
&&
empty
(
$pconfig
[
'nonat'
]))
{
...
...
@@ -567,7 +565,7 @@ include("head.inc");
<tr>
<td>
<select
name=
"targetip"
id=
"targetip"
class=
"selectpicker"
data-live-search=
"true"
data-size=
"5"
data-width=
"auto"
>
<option
data-other=
true
value=
""
<?=
empty
(
$pconfig
[
'targetip'
])
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"Interface address"
);
?>
</option>
<option
value=
""
<?=
empty
(
$pconfig
[
'targetip'
])
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"Interface address"
);
?>
</option>
<option
data-other=
true
value=
"
<?=
$pconfig
[
'targetip'
];
?>
"
<?=
!
empty
(
$pconfig
[
'target'
])
&&
!
array_key_exists
(
$pconfig
[
'targetip'
],
formTranslateAddresses
()
)
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"Single host or Network"
);
?>
</option>
<?php
foreach
(
formTranslateAddresses
()
as
$optKey
=>
$optValue
)
:
?>
<option
value=
"
<?=
$optKey
;
?>
"
<?=
$pconfig
[
'target'
]
==
$optKey
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
...
...
@@ -582,7 +580,7 @@ include("head.inc");
<div
class=
"input-group"
>
<!-- updates to "other" option in source -->
<input
type=
"text"
for=
"targetip"
value=
"
<?=
$pconfig
[
'targetip'
];
?>
"
aria-label=
"
<?=
gettext
(
"Translation address"
);
?>
"
/>
<select
name=
"targetip_subnet"
class=
"selectpicker"
data-size=
"5"
data-width=
"auto"
for=
"
destination
"
>
<select
name=
"targetip_subnet"
class=
"selectpicker"
data-size=
"5"
data-width=
"auto"
for=
"
targetip
"
>
<?php
for
(
$i
=
32
;
$i
>
0
;
$i
--
)
:
?>
<option
value=
"
<?=
$i
;
?>
"
<?=
$i
==
$pconfig
[
'targetip_subnet'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$i
;
?>
</option>
<?php
endfor
;
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment