diff options
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/auth.inc | 20 | ||||
-rw-r--r-- | etc/inc/config.inc | 26 | ||||
-rw-r--r-- | etc/inc/globals.inc | 2 |
3 files changed, 43 insertions, 5 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index ab04846..f45dbae 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -113,9 +113,21 @@ function local_backed($username, $passwd) { if (!$user)
return false;
- $passwd = crypt($passwd, $user['password']);
+ if ($user['password'])
+ {
+ $passwd = crypt($passwd, $user['password']);
+ if ($passwd == $user['password'])
+ return true;
+ }
+
+ if ($user['md5-hash'])
+ {
+ $passwd = md5($passwd);
+ if ($passwd == $user['md5-hash'])
+ return true;
+ }
- return ($passwd == $user['password']);
+ return false;
}
function local_sync_accounts() {
@@ -366,7 +378,7 @@ function local_group_set($group, $reset = false) { if($debug)
log_error("Running: {$cmd}");
- $fd = popen($cmd, "w"); + $fd = popen($cmd, "w");
fwrite($fd, $user['password']);
pclose($fd);
@@ -882,4 +894,4 @@ function session_auth($backing) { return true;
}
-?> +?>
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"); diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index 66632d9..c8ae12d 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -58,7 +58,7 @@ $g = array( "product_website_footer" => "http://www.pfsense.org/?gui20", "product_email" => "coreteam@pfsense.org", "debug" => false, - "latest_config" => "5.6", + "latest_config" => "5.7", "nopkg_platforms" => array("cdrom"), "minimum_ram_warning" => "115", "minimum_ram_warning_text" => "128 megabytes", |