diff options
author | bcyrill <cyrill@bannwart.info> | 2012-07-02 22:20:06 +0200 |
---|---|---|
committer | bcyrill <cyrill@bannwart.info> | 2012-07-02 22:20:06 +0200 |
commit | 36f6ed351af7712b07f2e1d37155d91bc883c893 (patch) | |
tree | c1bac956558b822fa40617a70d4f9ce3f00c2932 /etc/inc/upgrade_config.inc | |
parent | e0a45ce03c033d40afbcd9a64b16dc686a000465 (diff) | |
download | pfsense-36f6ed351af7712b07f2e1d37155d91bc883c893.zip pfsense-36f6ed351af7712b07f2e1d37155d91bc883c893.tar.gz |
Use Certificate Manager in Captive Portal settings
Diffstat (limited to 'etc/inc/upgrade_config.inc')
-rw-r--r-- | etc/inc/upgrade_config.inc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index bd12830..88faba4 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -2883,4 +2883,43 @@ function upgrade_087_to_088() { $config['system']['crypto_hardware'] = "glxsb"; } } + +function upgrade_088_to_089() { + global $config; + if (!is_array($config['ca'])) + $config['ca'] = array(); + if (!is_array($config['cert'])) + $config['cert'] = array(); + + /* migrate captive portal ssl to certifcate mngr */ + if (is_array($config['captiveportal'])) { + foreach ($config['captiveportal'] as $id => &$setting) { + if (isset($setting['httpslogin'])) { + /* create cert entry */ + $cert = array(); + $cert['refid'] = uniqid(); + $cert['descr'] = "Captive Portal SSL Cert - {$setting['zone']}"; + $cert['crt'] = $setting['certificate']; + $cert['prv'] = $setting['private-key']; + $config['cert'][] = $cert; + + /* create cert reference */ + unset($setting['certificate']); + unset($setting['private-key']); + $setting['certref'] = $cert['refid']; + + /* create ca entry */ + $ca = array(); + $ca['refid'] = uniqid(); + $ca['descr'] = "Captive Portal SSL CA - {$setting['zone']}"; + $ca['crt'] = $setting['cacertificate']; + $config['ca'][] = $ca; + + /* create ca reference */ + unset($setting['cacertificate']); + $setting['caref'] = $ca['refid']; + } + } + } +} ?> |