summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2009-10-23 00:07:41 +0200
committerSeth Mos <seth.mos@xs4all.nl>2009-10-23 00:07:41 +0200
commit21729218d6b53e5d9a9eaf3fcc1eba0827e0fd95 (patch)
tree3d28bcf7e9ca73032e1edea7ba7ff37bc7d13b87
parentefdf0b9cac36996fa5bfc9a11aa91f8cd87a7e1b (diff)
downloadpfsense-21729218d6b53e5d9a9eaf3fcc1eba0827e0fd95.zip
pfsense-21729218d6b53e5d9a9eaf3fcc1eba0827e0fd95.tar.gz
Restore the filter_get_vpns_list() functionality
Increase readability
-rw-r--r--etc/inc/filter.inc36
1 files changed, 24 insertions, 12 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index c0f7bc1..89d4e97 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -451,24 +451,36 @@ function filter_get_vpns_list() {
$vpns = "";
$vpns_arr = array();
/* ipsec */
- if (isset($config['ipsec']['enable']))
- if (is_array($config['ipsec']['phase2']))
- foreach ($config['ipsec']['phase2'] as $ph2ent)
- if(!$ph2ent['mobile'] and !$ph2ent['mode']=='transport')
+ if (isset($config['ipsec']['enable'])){
+ if (is_array($config['ipsec']['phase2'])) {
+ foreach ($config['ipsec']['phase2'] as $ph2ent) {
+ if((!$ph2ent['mobile']) && ($ph2ent['mode'] != 'transport')) {
$vpns_arr[] = ipsec_idinfo_to_cidr($ph2ent['remoteid']);
+ }
+ }
+ }
+ }
/* openvpn */
- foreach (array('client', 'server') as $type)
- if (is_array($$config['openvpn']["openvpn-$type"]))
- foreach ($config['openvpn']["openvpn-$type"] as & $settings)
- if (is_array($settings))
- if(is_subnet($settings['remote-subnet']))
+ foreach (array('client', 'server') as $type) {
+ if (is_array($$config['openvpn']["openvpn-$type"])) {
+ foreach ($config['openvpn']["openvpn-$type"] as & $settings) {
+ if (is_array($settings)) {
+ if(is_subnet($settings['remote-subnet'])) {
$vpns_arr[] = $tunnel['remote_network'];
+ }
+ }
+ }
+ }
+ }
/* pppoe */
- if ($config['pppoe']['remoteip'])
- if(is_subnet($tunnel['remote-subnet']))
+ if ($config['pppoe']['remoteip']) {
+ if(is_subnet($tunnel['remote-subnet'])) {
$vpns_arr[] = $config['pppoe']['remoteip'] ."/". $config['pppoe']['pppoe_subnet'];
- if(!empty($vpns_arr))
+ }
+ }
+ if(!empty($vpns_arr)) {
$vpns = implode(" ", $vpns_arr);
+ }
return $vpns;
}
OpenPOWER on IntegriCloud