summaryrefslogtreecommitdiffstats
path: root/etc/inc/upgrade_config.inc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-04-14 04:23:18 -0700
committerPhil Davis <phil.davis@inf.org>2014-04-14 04:23:18 -0700
commitee34e13739d301936f335098f5ba48742edddb12 (patch)
treeec93ddcce86f5cac11eace844f7747e4dae7e912 /etc/inc/upgrade_config.inc
parent146ee078fe8c2cfa65fe957616f845d1862f6e9d (diff)
downloadpfsense-ee34e13739d301936f335098f5ba48742edddb12.zip
pfsense-ee34e13739d301936f335098f5ba48742edddb12.tar.gz
Do not allow upgrade_101_to_102 to exit early
This upgrade step does both Captive Portal stuff and OpenVPN stuff. So do not return early just because there is no Captive Portal config. Both Captive Portal and OpenVPN tests changed to be positive tests, to make sure that everything is checked/tested and there is no chance to return early.
Diffstat (limited to 'etc/inc/upgrade_config.inc')
-rw-r--r--etc/inc/upgrade_config.inc38
1 files changed, 18 insertions, 20 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index b146946..b453f82 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -3182,32 +3182,30 @@ function upgrade_100_to_101() {
function upgrade_101_to_102() {
global $config, $g;
- if (!is_array($config['captiveportal']))
- return;
-
- foreach ($config['captiveportal'] as $cpzone => $cp) {
- if (!is_array($cp['passthrumac']))
- continue;
+ if (is_array($config['captiveportal'])) {
+ foreach ($config['captiveportal'] as $cpzone => $cp) {
+ if (!is_array($cp['passthrumac']))
+ continue;
- foreach ($cp['passthrumac'] as $idx => $passthrumac)
- $config['captiveportal'][$cpzone]['passthrumac'][$idx]['action'] = 'pass';
+ foreach ($cp['passthrumac'] as $idx => $passthrumac)
+ $config['captiveportal'][$cpzone]['passthrumac'][$idx]['action'] = 'pass';
+ }
}
/* Convert OpenVPN Compression option to the new style */
// Nothing to do if there is no OpenVPN tag
- if (!isset($config['openvpn']) || !is_array($config['openvpn']))
- return;
-
- if (is_array($config['openvpn']['openvpn-server'])) {
- foreach ($config['openvpn']['openvpn-server'] as &$vpn) {
- if (!empty($vpn['compression']))
- $vpn['compression'] = "adaptive";
+ if (isset($config['openvpn']) && is_array($config['openvpn'])) {
+ if (is_array($config['openvpn']['openvpn-server'])) {
+ foreach ($config['openvpn']['openvpn-server'] as &$vpn) {
+ if (!empty($vpn['compression']))
+ $vpn['compression'] = "adaptive";
+ }
}
- }
- if (is_array($config['openvpn']['openvpn-client'])) {
- foreach ($config['openvpn']['openvpn-client'] as &$vpn) {
- if (!empty($vpn['compression']))
- $vpn['compression'] = "adaptive";
+ if (is_array($config['openvpn']['openvpn-client'])) {
+ foreach ($config['openvpn']['openvpn-client'] as &$vpn) {
+ if (!empty($vpn['compression']))
+ $vpn['compression'] = "adaptive";
+ }
}
}
}
OpenPOWER on IntegriCloud