summaryrefslogtreecommitdiffstats
path: root/etc/inc/auth.inc
diff options
context:
space:
mode:
authormgrooms <mgrooms@shrew.net>2009-03-15 00:31:55 +0000
committermgrooms <mgrooms@shrew.net>2009-03-15 00:39:19 +0000
commit0092b3bd47bdfa8b3bc24e140235e4693918ee46 (patch)
tree1618c52053505a6eb015e0a683fa5e95b2e1ecfc /etc/inc/auth.inc
parentd1d1e96136b30e0069474d8c204feca6c9e25985 (diff)
downloadpfsense-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/auth.inc')
-rw-r--r--etc/inc/auth.inc20
1 files changed, 16 insertions, 4 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;
}
-?>
+?>
OpenPOWER on IntegriCloud