diff --git a/src/www/firewall_nat_1to1_edit.php b/src/www/firewall_nat_1to1_edit.php index b92f88c98..94aee1dd4 100644 --- a/src/www/firewall_nat_1to1_edit.php +++ b/src/www/firewall_nat_1to1_edit.php @@ -37,60 +37,15 @@ require_once("pfsense-utils.inc"); function formNetworks() { $networks = array(); $networks["any"] = gettext("any"); - $networks["pptp"] = gettext("PPTP clients"); - $networks["pppoe"] = gettext("PPPoE clients"); - $networks["l2tp"] = gettext("L2TP clients"); - foreach (get_configured_interface_with_descr() as $ifent => $ifdesc) { - $networks[$ifent] = htmlspecialchars($ifdesc) . " " . gettext("net"); - $networks[$ifent."ip"] = htmlspecialchars($ifdesc). " ". gettext("address"); + 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; } -/** - * build array with interface options for this form - */ -function formInterfaces() { - global $config; - $interfaces = array(); - foreach ( get_configured_interface_with_descr(false, true) as $if => $ifdesc) { - $interfaces[$if] = $ifdesc; - } - - if (isset($config['l2tp']['mode']) && $config['l2tp']['mode'] == "server") { - $interfaces['l2tp'] = "L2TP VPN"; - } - - if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] == "server") { - $interfaces['pptp'] = "PPTP VPN"; - } - - if (is_pppoe_server_enabled()) { - $interfaces['pppoe'] = "PPPoE VPN"; - } - - /* add ipsec interfaces */ - if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) { - $interfaces["enc0"] = "IPsec"; - } - - /* add openvpn/tun interfaces */ - if (isset($config['openvpn']['openvpn-server']) || isset($config['openvpn']['openvpn-client'])) { - $interfaces['openvpn'] = 'OpenVPN'; - } - return $interfaces; -} - -/** - * obscured by clouds, is_specialnet uses this.. so let's hide it in here. - * let's kill this another day. - */ -$specialsrcdst = explode(" ", "any pptp pppoe l2tp openvpn"); -$ifdisp = get_configured_interface_with_descr(); -foreach ($ifdisp as $kif => $kdescr) { - $specialsrcdst[] = "{$kif}"; - $specialsrcdst[] = "{$kif}ip"; -} if (!isset($config['nat']['onetoone'])) { $config['nat']['onetoone'] = array(); @@ -306,9 +261,9 @@ include("head.inc");