Commit c660d3ec authored by Ad Schellevis's avatar Ad Schellevis

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

parent aaa94c94
...@@ -31,21 +31,6 @@ require_once("guiconfig.inc"); ...@@ -31,21 +31,6 @@ require_once("guiconfig.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
require_once("pfsense-utils.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'])) { if (!isset($config['nat']['onetoone'])) {
$config['nat']['onetoone'] = array(); $config['nat']['onetoone'] = array();
...@@ -310,7 +295,7 @@ include("head.inc"); ...@@ -310,7 +295,7 @@ include("head.inc");
<?php endforeach; ?> <?php endforeach; ?>
</optgroup> </optgroup>
<optgroup label="<?=gettext("Networks");?>"> <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> <option value="<?=$ifent;?>" <?= $pconfig['src'] == $ifent ? "selected=\"selected\"" : ""; ?>><?=$ifdesc;?></option>
<?php endforeach; ?> <?php endforeach; ?>
...@@ -361,7 +346,7 @@ include("head.inc"); ...@@ -361,7 +346,7 @@ include("head.inc");
<?php endforeach; ?> <?php endforeach; ?>
</optgroup> </optgroup>
<optgroup label="<?=gettext("Networks");?>"> <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> <option value="<?=$ifent;?>" <?= $pconfig['dst'] == $ifent ? "selected=\"selected\"" : ""; ?>><?=$ifdesc;?></option>
<?php endforeach; ?> <?php endforeach; ?>
......
...@@ -32,21 +32,6 @@ require_once("guiconfig.inc"); ...@@ -32,21 +32,6 @@ require_once("guiconfig.inc");
require_once("pfsense-utils.inc"); require_once("pfsense-utils.inc");
require_once("filter.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 // init config and get reference
if (!isset($config['nat']['rule']) || !is_array($config['nat']['rule'])) { if (!isset($config['nat']['rule']) || !is_array($config['nat']['rule'])) {
...@@ -620,7 +605,7 @@ $( document ).ready(function() { ...@@ -620,7 +605,7 @@ $( document ).ready(function() {
<?php endforeach; ?> <?php endforeach; ?>
</optgroup> </optgroup>
<optgroup label="<?=gettext("Networks");?>"> <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> <option value="<?=$ifent;?>" <?= $pconfig['src'] == $ifent ? "selected=\"selected\"" : ""; ?>><?=$ifdesc;?></option>
<?php endforeach; ?> <?php endforeach; ?>
...@@ -734,7 +719,7 @@ $( document ).ready(function() { ...@@ -734,7 +719,7 @@ $( document ).ready(function() {
<?php endforeach; ?> <?php endforeach; ?>
</optgroup> </optgroup>
<optgroup label="<?=gettext("Networks");?>"> <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> <option value="<?=$ifent;?>" <?= $pconfig['dst'] == $ifent ? "selected=\"selected\"" : ""; ?>><?=$ifdesc;?></option>
<?php endforeach; <?php endforeach;
......
...@@ -44,21 +44,6 @@ if ($ostypes == null) { ...@@ -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 * check if advanced options are set on selected element
*/ */
...@@ -857,7 +842,7 @@ include("head.inc"); ...@@ -857,7 +842,7 @@ include("head.inc");
<?php endforeach; ?> <?php endforeach; ?>
</optgroup> </optgroup>
<optgroup label="<?=gettext("Networks");?>"> <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> <option value="<?=$ifent;?>" <?= $pconfig['src'] == $ifent ? "selected=\"selected\"" : ""; ?>><?=$ifdesc;?></option>
<?php endforeach; ?> <?php endforeach; ?>
...@@ -987,7 +972,7 @@ include("head.inc"); ...@@ -987,7 +972,7 @@ include("head.inc");
<?php endforeach; ?> <?php endforeach; ?>
</optgroup> </optgroup>
<optgroup label="<?=gettext("Networks");?>"> <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> <option value="<?=$ifent;?>" <?= $pconfig['dst'] == $ifent ? "selected=\"selected\"" : ""; ?>><?=$ifdesc;?></option>
<?php endforeach; ?> <?php endforeach; ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment