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
70588a21
Commit
70588a21
authored
Nov 30, 2016
by
Ad Schellevis
Committed by
Franco Fichtner
Dec 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(firewall) some missing alias options, spotted by @jschellevis
(cherry picked from commit
18c49439
)
parent
8060cea0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
6 deletions
+93
-6
firewall_nat.php
src/www/firewall_nat.php
+1
-1
firewall_nat_out.php
src/www/firewall_nat_out.php
+34
-2
firewall_nat_out_edit.php
src/www/firewall_nat_out_edit.php
+58
-3
No files found.
src/www/firewall_nat.php
View file @
70588a21
...
...
@@ -394,7 +394,7 @@ $( document ).ready(function() {
$localport
.=
'-'
.
$localendport
;
}
?>
<?php
if
(
isset
(
$natent
[
'
destination'
][
'port'
])
&&
is_alias
(
$natent
[
'destination'
][
'
port'
]))
:
?>
<?php
if
(
isset
(
$natent
[
'
local-port'
])
&&
is_alias
(
$natent
[
'local-
port'
]))
:
?>
<span
title=
"
<?=
htmlspecialchars
(
get_alias_description
(
$localport
));
?>
"
data-toggle=
"tooltip"
>
<?=
htmlspecialchars
(
pprint_port
(
$localport
));
?>
</span>
...
...
src/www/firewall_nat_out.php
View file @
70588a21
...
...
@@ -385,7 +385,23 @@ include("head.inc");
</td>
<td
class=
"hidden-xs hidden-sm"
>
<?=
!
empty
(
$natent
[
'protocol'
])
?
$natent
[
'protocol'
]
.
'/'
:
""
;
?>
<?=
!
empty
(
$natent
[
'sourceport'
])
?
$natent
[
'sourceport'
]
:
"*"
;
?>
<?php
if
(
empty
(
$natent
[
'sourceport'
]))
:?>
*
<?
php
elseif
(
isset
(
$natent
[
'sourceport'
])
&&
is_alias
(
$natent
[
'sourceport'
]))
:?>
<
span
title
=
"<?=htmlspecialchars(get_alias_description(
$natent['sourceport']
));?>"
data
-
toggle
=
"tooltip"
>
<?=
htmlspecialchars
(
pprint_port
(
$natent
[
'sourceport'
]));
?>
</span>
<a
href=
"/firewall_aliases_edit.php?name=
<?=
htmlspecialchars
(
$natent
[
'sourceport'
]);
?>
"
title=
"
<?=
gettext
(
"edit alias"
);
?>
"
data-toggle=
"tooltip"
>
<i
class=
"fa fa-list"
></i>
</a>
<?php
else
:?>
<?=
htmlspecialchars
(
$natent
[
'sourceport'
])
?>
<?php
endif
;
?>
</td>
<td
class=
"hidden-xs hidden-sm"
>
<?=
isset
(
$natent
[
'destination'
][
'not'
])
?
"! "
:
""
;
?>
...
...
@@ -403,7 +419,23 @@ include("head.inc");
</td>
<td
class=
"hidden-xs hidden-sm"
>
<?=
!
empty
(
$natent
[
'protocol'
])
?
$natent
[
'protocol'
]
.
'/'
:
""
;
?>
<?=
empty
(
$natent
[
'dstport'
])
?
"*"
:
$natent
[
'dstport'
]
;
?>
<?php
if
(
empty
(
$natent
[
'dstport'
]))
:?>
*
<?
php
elseif
(
isset
(
$natent
[
'dstport'
])
&&
is_alias
(
$natent
[
'dstport'
]))
:?>
<
span
title
=
"<?=htmlspecialchars(get_alias_description(
$natent['dstport']
));?>"
data
-
toggle
=
"tooltip"
>
<?=
htmlspecialchars
(
pprint_port
(
$natent
[
'dstport'
]));
?>
</span>
<a
href=
"/firewall_aliases_edit.php?name=
<?=
htmlspecialchars
(
$natent
[
'dstport'
]);
?>
"
title=
"
<?=
gettext
(
"edit alias"
);
?>
"
data-toggle=
"tooltip"
>
<i
class=
"fa fa-list"
></i>
</a>
<?php
else
:?>
<?=
htmlspecialchars
(
$natent
[
'dstport'
])
?>
<?php
endif
;
?>
</td>
<td
class=
"hidden-xs hidden-sm"
>
<?php
...
...
src/www/firewall_nat_out_edit.php
View file @
70588a21
...
...
@@ -164,9 +164,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
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."
);
if
(
!
empty
(
$pconfig
[
'natport'
])
&&
!
is_port
(
$pconfig
[
'natport'
])
&&
empty
(
$pconfig
[
'nonat'
]))
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."
);
}
}
if
(
!
(
in_array
(
$pconfig
[
'source'
],
array
(
"any"
,
"(self)"
))
||
is_ipaddroralias
(
$pconfig
[
'source'
])))
{
$input_errors
[]
=
gettext
(
"A valid source must be specified."
);
...
...
@@ -507,7 +508,34 @@ include("head.inc");
<tr>
<td><a
id=
"help_for_src_port"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Source port:"
);
?>
</td>
<td>
<input
name=
"sourceport"
type=
"text"
value=
"
<?=
$pconfig
[
'sourceport'
];
?>
"
/>
<table
class=
"table table-condensed"
>
<tbody>
<tr>
<td>
<select
id=
"sourceport"
name=
"sourceport"
class=
"selectpicker"
data-live-search=
"true"
data-size=
"5"
data-width=
"auto"
>
<option
data-other=
true
value=
"
<?=
$pconfig
[
'sourceport'
];
?>
"
>
(
<?=
gettext
(
"other"
);
?>
)
</option>
<optgroup
label=
"
<?=
gettext
(
"Aliases"
);
?>
"
>
<?php
foreach
(
legacy_list_aliases
(
"port"
)
as
$alias
)
:
?>
<option
value=
"
<?=
$alias
[
'name'
];
?>
"
<?=
$pconfig
[
'sourceport'
]
==
$alias
[
'name'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
htmlspecialchars
(
$alias
[
'name'
]);
?>
</option>
<?php
endforeach
;
?>
</optgroup>
<optgroup
label=
"
<?=
gettext
(
"Well-known ports"
);
?>
"
>
<option
value=
""
<?=
$pconfig
[
'sourceport'
]
==
""
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"any"
);
?>
</option>
<?php
foreach
(
$wkports
as
$wkport
=>
$wkportdesc
)
:
?>
<option
value=
"
<?=
$wkport
;
?>
"
<?=
$wkport
==
$pconfig
[
'sourceport'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
htmlspecialchars
(
$wkportdesc
);
?>
</option>
<?php
endforeach
;
?>
</optgroup>
</select>
</td>
</tr>
<tr>
<td>
<input
type=
"text"
value=
"
<?=
$pconfig
[
'sourceport'
];
?>
"
for=
"sourceport"
>
<!-- updates to "other" option in localbeginport -->
</td>
</tr>
</tbody>
</table>
<div
class=
"hidden"
for=
"help_for_src_port"
>
<?=
gettext
(
"(leave blank for any)"
);
?>
</div>
...
...
@@ -562,7 +590,34 @@ include("head.inc");
<tr>
<td><a
id=
"help_for_dstport"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Destination port:"
);
?>
</td>
<td>
<input
name=
"dstport"
type=
"text"
value=
"
<?=
$pconfig
[
'dstport'
];
?>
"
/>
<table
class=
"table table-condensed"
>
<tbody>
<tr>
<td>
<select
id=
"dstport"
name=
"dstport"
class=
"selectpicker"
data-live-search=
"true"
data-size=
"5"
data-width=
"auto"
>
<option
data-other=
true
value=
"
<?=
$pconfig
[
'dstport'
];
?>
"
>
(
<?=
gettext
(
"other"
);
?>
)
</option>
<optgroup
label=
"
<?=
gettext
(
"Aliases"
);
?>
"
>
<?php
foreach
(
legacy_list_aliases
(
"port"
)
as
$alias
)
:
?>
<option
value=
"
<?=
$alias
[
'name'
];
?>
"
<?=
$pconfig
[
'dstport'
]
==
$alias
[
'name'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
htmlspecialchars
(
$alias
[
'name'
]);
?>
</option>
<?php
endforeach
;
?>
</optgroup>
<optgroup
label=
"
<?=
gettext
(
"Well-known ports"
);
?>
"
>
<option
value=
""
<?=
$pconfig
[
'dstport'
]
==
""
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"any"
);
?>
</option>
<?php
foreach
(
$wkports
as
$wkport
=>
$wkportdesc
)
:
?>
<option
value=
"
<?=
$wkport
;
?>
"
<?=
$wkport
==
$pconfig
[
'dstport'
]
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
htmlspecialchars
(
$wkportdesc
);
?>
</option>
<?php
endforeach
;
?>
</optgroup>
</select>
</td>
</tr>
<tr>
<td>
<input
type=
"text"
value=
"
<?=
$pconfig
[
'dstport'
];
?>
"
for=
"dstport"
>
<!-- updates to "other" option in localbeginport -->
</td>
</tr>
</tbody>
</table>
<div
class=
"hidden"
for=
"help_for_dstport"
>
<?=
gettext
(
"(leave blank for any)"
);
?>
</div>
...
...
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