Be pedantic about checking user is active before we let them in.

This commit is contained in:
Andrew McMillan 2010-11-27 16:42:22 +13:00
parent 97c04fab6f
commit 413618749c

View File

@ -121,8 +121,14 @@ class HTTPAuthSession {
*/
if ( isset($_SERVER['PHP_AUTH_USER']) ) {
if ( $u = $this->CheckPassword( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) ) {
$this->AssignSessionDetails($u);
return;
/**
* Maybe some external authentication didn't return false for an inactive
* user, so we'll be pedantic here.
*/
if ( $u->active ) {
$this->AssignSessionDetails($u);
return;
}
}
}
@ -227,7 +233,8 @@ class HTTPAuthSession {
*/
if (isset($c->authenticate_hook['optional']) && $c->authenticate_hook['optional']) {
if ($hook_response !== false) { return $hook_response; }
} else {
}
else {
return $hook_response;
}
}