Commit aaa94c94 authored by Ad Schellevis's avatar Ad Schellevis

fix get_specialnets() to use new interface plugin structure

parent 5a3a3a84
...@@ -290,14 +290,19 @@ function get_std_save_message() ...@@ -290,14 +290,19 @@ function get_std_save_message()
return $to_return; return $to_return;
} }
function get_specialnets() function get_specialnets($only_enabled=false)
{ {
$specialnets = array("(self)" => "This Firewall", "pptp" => "PPTP clients", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients"); $specialnets = array();
$spiflist = get_configured_interface_with_descr(false, true); $specialnets["any"] = gettext("any");
foreach ($spiflist as $ifgui => $ifdesc) { $specialnets["(self)"] = gettext("This Firewall");
$specialnets[$ifgui] = $ifdesc . " net"; $filter = $only_enabled ? array("enable" => true) : array();
$specialnets[$ifgui . 'ip'] = $ifdesc . " address"; foreach (legacy_config_get_interfaces($filter) as $ifent => $ifdetail) {
$specialnets[$ifent] = htmlspecialchars($ifdetail['descr']) . " " . gettext("net");
if (!isset($ifdetail['virtual'])) {
$specialnets[$ifent."ip"] = htmlspecialchars($ifdetail['descr']). " ". gettext("address");
}
} }
return $specialnets; return $specialnets;
} }
......
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