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
c660d3ec
Commit
c660d3ec
authored
Jun 01, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall, formNetworks() is the same as get_specialnets() now
parent
aaa94c94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
51 deletions
+6
-51
firewall_nat_1to1_edit.php
src/www/firewall_nat_1to1_edit.php
+2
-17
firewall_nat_edit.php
src/www/firewall_nat_edit.php
+2
-17
firewall_rules_edit.php
src/www/firewall_rules_edit.php
+2
-17
No files found.
src/www/firewall_nat_1to1_edit.php
View file @
c660d3ec
...
...
@@ -31,21 +31,6 @@ require_once("guiconfig.inc");
require_once
(
"interfaces.inc"
);
require_once
(
"pfsense-utils.inc"
);
/**
* fetch list of selectable networks to use in form
*/
function
formNetworks
()
{
$networks
=
array
();
$networks
[
"any"
]
=
gettext
(
"any"
);
foreach
(
legacy_config_get_interfaces
(
array
(
"enable"
=>
true
))
as
$ifent
=>
$ifdetail
)
{
$networks
[
$ifent
]
=
htmlspecialchars
(
$ifdetail
[
'descr'
])
.
" "
.
gettext
(
"net"
);
if
(
!
isset
(
$ifdetail
[
'virtual'
]))
{
$networks
[
$ifent
.
"ip"
]
=
htmlspecialchars
(
$ifdetail
[
'descr'
])
.
" "
.
gettext
(
"address"
);
}
}
return
$networks
;
}
if
(
!
isset
(
$config
[
'nat'
][
'onetoone'
]))
{
$config
[
'nat'
][
'onetoone'
]
=
array
();
...
...
@@ -310,7 +295,7 @@ include("head.inc");
<?php
endforeach
;
?>
</optgroup>
<optgroup
label=
"
<?=
gettext
(
"Networks"
);
?>
"
>
<?php
foreach
(
formNetworks
(
)
as
$ifent
=>
$ifdesc
)
:
<?php
foreach
(
get_specialnets
(
true
)
as
$ifent
=>
$ifdesc
)
:
?>
<option
value=
"
<?=
$ifent
;
?>
"
<?=
$pconfig
[
'src'
]
==
$ifent
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$ifdesc
;
?>
</option>
<?php
endforeach
;
?>
...
...
@@ -361,7 +346,7 @@ include("head.inc");
<?php
endforeach
;
?>
</optgroup>
<optgroup
label=
"
<?=
gettext
(
"Networks"
);
?>
"
>
<?php
foreach
(
formNetworks
(
)
as
$ifent
=>
$ifdesc
)
:
<?php
foreach
(
get_specialnets
(
true
)
as
$ifent
=>
$ifdesc
)
:
?>
<option
value=
"
<?=
$ifent
;
?>
"
<?=
$pconfig
[
'dst'
]
==
$ifent
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$ifdesc
;
?>
</option>
<?php
endforeach
;
?>
...
...
src/www/firewall_nat_edit.php
View file @
c660d3ec
...
...
@@ -32,21 +32,6 @@ require_once("guiconfig.inc");
require_once
(
"pfsense-utils.inc"
);
require_once
(
"filter.inc"
);
/**
* fetch list of selectable networks to use in form
*/
function
formNetworks
()
{
$networks
=
array
();
$networks
[
"any"
]
=
gettext
(
"any"
);
foreach
(
legacy_config_get_interfaces
(
array
(
"enable"
=>
true
))
as
$ifent
=>
$ifdetail
)
{
$networks
[
$ifent
]
=
htmlspecialchars
(
$ifdetail
[
'descr'
])
.
" "
.
gettext
(
"net"
);
if
(
!
isset
(
$ifdetail
[
'virtual'
]))
{
$networks
[
$ifent
.
"ip"
]
=
htmlspecialchars
(
$ifdetail
[
'descr'
])
.
" "
.
gettext
(
"address"
);
}
}
return
$networks
;
}
// init config and get reference
if
(
!
isset
(
$config
[
'nat'
][
'rule'
])
||
!
is_array
(
$config
[
'nat'
][
'rule'
]))
{
...
...
@@ -620,7 +605,7 @@ $( document ).ready(function() {
<?php
endforeach
;
?>
</optgroup>
<optgroup
label=
"
<?=
gettext
(
"Networks"
);
?>
"
>
<?php
foreach
(
formNetworks
(
)
as
$ifent
=>
$ifdesc
)
:
<?php
foreach
(
get_specialnets
(
true
)
as
$ifent
=>
$ifdesc
)
:
?>
<option
value=
"
<?=
$ifent
;
?>
"
<?=
$pconfig
[
'src'
]
==
$ifent
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$ifdesc
;
?>
</option>
<?php
endforeach
;
?>
...
...
@@ -734,7 +719,7 @@ $( document ).ready(function() {
<?php
endforeach
;
?>
</optgroup>
<optgroup
label=
"
<?=
gettext
(
"Networks"
);
?>
"
>
<?php
foreach
(
formNetworks
(
)
as
$ifent
=>
$ifdesc
)
:
<?php
foreach
(
get_specialnets
(
true
)
as
$ifent
=>
$ifdesc
)
:
?>
<option
value=
"
<?=
$ifent
;
?>
"
<?=
$pconfig
[
'dst'
]
==
$ifent
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$ifdesc
;
?>
</option>
<?php
endforeach
;
...
...
src/www/firewall_rules_edit.php
View file @
c660d3ec
...
...
@@ -44,21 +44,6 @@ if ($ostypes == null) {
}
/**
* fetch list of selectable networks to use in form
*/
function
formNetworks
()
{
$networks
=
array
();
$networks
[
"any"
]
=
gettext
(
"any"
);
foreach
(
legacy_config_get_interfaces
(
array
(
"enable"
=>
true
))
as
$ifent
=>
$ifdetail
)
{
$networks
[
$ifent
]
=
htmlspecialchars
(
$ifdetail
[
'descr'
])
.
" "
.
gettext
(
"net"
);
if
(
!
isset
(
$ifdetail
[
'virtual'
]))
{
$networks
[
$ifent
.
"ip"
]
=
htmlspecialchars
(
$ifdetail
[
'descr'
])
.
" "
.
gettext
(
"address"
);
}
}
return
$networks
;
}
/**
* check if advanced options are set on selected element
*/
...
...
@@ -857,7 +842,7 @@ include("head.inc");
<?php
endforeach
;
?>
</optgroup>
<optgroup
label=
"
<?=
gettext
(
"Networks"
);
?>
"
>
<?php
foreach
(
formNetworks
(
)
as
$ifent
=>
$ifdesc
)
:
<?php
foreach
(
get_specialnets
(
true
)
as
$ifent
=>
$ifdesc
)
:
?>
<option
value=
"
<?=
$ifent
;
?>
"
<?=
$pconfig
[
'src'
]
==
$ifent
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$ifdesc
;
?>
</option>
<?php
endforeach
;
?>
...
...
@@ -987,7 +972,7 @@ include("head.inc");
<?php
endforeach
;
?>
</optgroup>
<optgroup
label=
"
<?=
gettext
(
"Networks"
);
?>
"
>
<?php
foreach
(
formNetworks
(
)
as
$ifent
=>
$ifdesc
)
:
<?php
foreach
(
get_specialnets
(
true
)
as
$ifent
=>
$ifdesc
)
:
?>
<option
value=
"
<?=
$ifent
;
?>
"
<?=
$pconfig
[
'dst'
]
==
$ifent
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
$ifdesc
;
?>
</option>
<?php
endforeach
;
?>
...
...
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