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
86b7b77c
Commit
86b7b77c
authored
Aug 27, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whitespace firewall_nat_out_edit.php
parent
2f264183
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
firewall_nat_out_edit.php
src/www/firewall_nat_out_edit.php
+14
-14
No files found.
src/www/firewall_nat_out_edit.php
View file @
86b7b77c
...
...
@@ -188,33 +188,33 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if
(
in_array
(
$pconfig
[
'protocol'
],
explode
(
" "
,
"any tcp udp tcp/udp"
)))
{
if
(
!
empty
(
$pconfig
[
'sourceport'
])
&&
!
is_portoralias
(
$pconfig
[
'sourceport'
]))
$input_errors
[]
=
gettext
(
"You must supply either a valid port or port alias for the source port entry."
);
$input_errors
[]
=
gettext
(
"You must supply either a valid port or port alias for the source port entry."
);
if
(
!
empty
(
$pconfig
[
'dstport'
])
&&
!
is_portoralias
(
$pconfig
[
'dstport'
]))
$input_errors
[]
=
gettext
(
"You must supply either a valid port or port alias for the destination port entry."
);
$input_errors
[]
=
gettext
(
"You must supply either a valid port or port alias for the destination port entry."
);
if
(
!
empty
(
$pconfig
[
'natport'
])
&&
!
is_port
(
$pconfig
[
'natport'
])
&&
empty
(
$pconfig
[
'nonat'
]))
$input_errors
[]
=
gettext
(
"You must supply a valid port for the NAT port entry."
);
$input_errors
[]
=
gettext
(
"You must supply a valid port for the NAT port entry."
);
}
if
(
!
(
in_array
(
$pconfig
[
'source'
],
array
(
"any"
,
"self"
))
||
is_ipaddroralias
(
$pconfig
[
'source'
])))
{
$input_errors
[]
=
gettext
(
"A valid source must be specified."
);
}
if
(
!
empty
(
$pconfig
[
'source_subnet'
])
&&
!
is_numericint
(
$pconfig
[
'source_subnet'
]))
{
$input_errors
[]
=
gettext
(
"A valid source bit count must be specified."
);
$input_errors
[]
=
gettext
(
"A valid source bit count must be specified."
);
}
if
(
!
(
in_array
(
$pconfig
[
'destination'
],
array
(
"any"
,
"self"
))
||
is_ipaddroralias
(
$pconfig
[
'destination'
])))
{
$input_errors
[]
=
gettext
(
"A valid destination must be specified."
);
}
if
(
!
empty
(
$pconfig
[
'destination_subnet'
])
&&
!
is_numericint
(
$pconfig
[
'destination_subnet'
]))
{
$input_errors
[]
=
gettext
(
"A valid destination bit count must be specified."
);
$input_errors
[]
=
gettext
(
"A valid destination bit count must be specified."
);
}
if
(
$pconfig
[
'destination'
]
==
"any"
&&
!
empty
(
$pconfig
[
'destination_not'
]))
{
$input_errors
[]
=
gettext
(
"Negating destination address of
\"
any
\"
is invalid."
);
$input_errors
[]
=
gettext
(
"Negating destination address of
\"
any
\"
is invalid."
);
}
if
(
!
is_ipaddr
(
$pconfig
[
'targetip'
])
&&
!
is_subnet
(
$pconfig
[
'targetip'
])
&&
!
is_alias
(
$pconfig
[
'targetip'
])
&&
empty
(
$pconfig
[
'nonat'
]))
{
$input_errors
[]
=
gettext
(
"A valid target IP address must be specified."
);
$input_errors
[]
=
gettext
(
"A valid target IP address must be specified."
);
}
/* Verify Pool Options */
if
(
!
is_alias
(
$pconfig
[
'targetip'
])
&&
substr
(
$pconfig
[
'poolopts'
],
0
,
11
)
==
"round-robin"
)
{
...
...
@@ -289,7 +289,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// boolean fields
if
(
!
empty
(
$pconfig
[
'disabled'
]))
{
$natent
[
'disabled'
]
=
true
;
$natent
[
'disabled'
]
=
true
;
}
if
(
!
empty
(
$pconfig
[
'nonat'
]))
{
$natent
[
'nonat'
]
=
true
;
...
...
@@ -306,12 +306,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if
(
isset
(
$id
))
{
$a_out
[
$id
]
=
$natent
;
}
else
{
$natent
[
'created'
]
=
make_config_revision_entry
();
if
(
isset
(
$after
))
{
array_splice
(
$a_out
,
$after
+
1
,
0
,
array
(
$natent
));
}
else
{
$a_out
[]
=
$natent
;
}
$natent
[
'created'
]
=
make_config_revision_entry
();
if
(
isset
(
$after
))
{
array_splice
(
$a_out
,
$after
+
1
,
0
,
array
(
$natent
));
}
else
{
$a_out
[]
=
$natent
;
}
}
if
(
write_config
())
{
mark_subsystem_dirty
(
'natconf'
);
...
...
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