Commit d95a30ae authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) add interface groups to firewall rules and portforwards, add missing curly braces

(cherry picked from commit 791ccd11)
parent 569d0c33
......@@ -37,21 +37,32 @@ require_once("pfsense-utils.inc");
function formInterfaces() {
global $config;
$interfaces = array();
foreach ( get_configured_interface_with_descr(false, true) as $if => $ifdesc)
foreach ( get_configured_interface_with_descr(false, true) as $if => $ifdesc) {
$interfaces[$if] = $ifdesc;
}
if (!empty($config['ifgroups']['ifgroupentry']) && is_array($config['ifgroups']['ifgroupentry'])) {
foreach ($config['ifgroups']['ifgroupentry'] as $ifgrp) {
$interfaces[$ifgrp['ifname']] = $ifgrp['descr'];
}
}
if (isset($config['l2tp']['mode']) && $config['l2tp']['mode'] == "server")
if (isset($config['l2tp']['mode']) && $config['l2tp']['mode'] == "server") {
$interfaces['l2tp'] = "L2TP VPN";
}
if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] == "server")
if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] == "server") {
$interfaces['pptp'] = "PPTP VPN";
}
if (is_pppoe_server_enabled())
if (is_pppoe_server_enabled()) {
$interfaces['pppoe'] = "PPPoE VPN";
}
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
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'])) {
......
......@@ -44,21 +44,32 @@ $ostypes = json_decode(configd_run('filter list osfp json'));
function formInterfaces() {
global $config;
$interfaces = array();
foreach ( get_configured_interface_with_descr(false, true) as $if => $ifdesc)
foreach ( get_configured_interface_with_descr(false, true) as $if => $ifdesc) {
$interfaces[$if] = $ifdesc;
}
if (!empty($config['ifgroups']['ifgroupentry']) && is_array($config['ifgroups']['ifgroupentry'])) {
foreach ($config['ifgroups']['ifgroupentry'] as $ifgrp) {
$interfaces[$ifgrp['ifname']] = $ifgrp['descr'];
}
}
if (isset($config['l2tp']['mode']) && $config['l2tp']['mode'] == "server")
if (isset($config['l2tp']['mode']) && $config['l2tp']['mode'] == "server") {
$interfaces['l2tp'] = "L2TP VPN";
}
if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] == "server")
if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] == "server") {
$interfaces['pptp'] = "PPTP VPN";
}
if (is_pppoe_server_enabled())
if (is_pppoe_server_enabled()) {
$interfaces['pppoe'] = "PPPoE VPN";
}
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
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'])) {
......
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