diff options
author | mgrooms <mgrooms@shrew.net> | 2009-03-15 00:31:55 +0000 |
---|---|---|
committer | mgrooms <mgrooms@shrew.net> | 2009-03-15 00:39:19 +0000 |
commit | 0092b3bd47bdfa8b3bc24e140235e4693918ee46 (patch) | |
tree | 1618c52053505a6eb015e0a683fa5e95b2e1ecfc /etc/inc/config.inc | |
parent | d1d1e96136b30e0069474d8c204feca6c9e25985 (diff) | |
download | pfsense-0092b3bd47bdfa8b3bc24e140235e4693918ee46.zip pfsense-0092b3bd47bdfa8b3bc24e140235e4693918ee46.tar.gz |
Modify captive portal to use centralized user management. The user manager has
been modified to include an account expiration option to support this service.
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r-- | etc/inc/config.inc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 7c8597e..026b90f 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -2217,6 +2217,32 @@ endif; $config['version'] = "5.6"; } + /* Convert 5.6 -> 5.7 */ + if ($config['version'] <= 5.6) { + + /* migrate captivate portal to user manager */ + if (is_array($config['captiveportal']['user'])) { + foreach($config['captiveportal']['user'] as $user) { + // avoid user conflicts + if ($config['system']['user'][$user['name']]) + continue; + $user['scope'] = "user"; + if (isset($user['expirationdate'])) { + $user['expires'] = $user['expirationdate']; + unset($user['expirationdate']); + } + if (isset($user['password'])) { + $user['md5-hash'] = $user['password']; + unset($user['password']); + } + $config['system']['user'][] = $user; + } + unset($config['captiveportal']['user']); + } + + $config['version'] = "5.7"; + } + $now = date("H:i:s"); log_error("Ended Configuration upgrade at $now"); |