firewall, formNetworks() is the same as get_specialnets() now

This commit is contained in:
Ad Schellevis 2016-06-01 13:40:25 +02:00
parent aaa94c946b
commit c660d3ec8c
3 changed files with 6 additions and 51 deletions

View File

@ -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; ?>

View File

@ -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;

View File

@ -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; ?>