diff options
Diffstat (limited to 'etc/inc/auth.inc')
-rw-r--r-- | etc/inc/auth.inc | 20 |
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;
}
-?> +?>
|