mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-27 02:54:27 +00:00
Fix handling of active flag for general external authentication mechanisms.
This commit is contained in:
parent
a1f9288224
commit
fc0db0e23b
@ -139,6 +139,11 @@ class HTTPAuthSession {
|
||||
*/
|
||||
if ( isset($_SERVER['PHP_AUTH_USER']) ) {
|
||||
if ( $p = $this->CheckPassword( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) ) {
|
||||
if ( isset($p->active) && !isset($p->user_active) ) {
|
||||
trace_bug('Some authentication failed to return a dav_principal record and needs fixing.');
|
||||
$p->user_active = $p->active;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maybe some external authentication didn't return false for an inactive
|
||||
* user, so we'll be pedantic here.
|
||||
@ -300,7 +305,11 @@ class HTTPAuthSession {
|
||||
* It can expect that:
|
||||
* - Configuration data will be in $c->authenticate_hook['config'], which might be an array, or whatever is needed.
|
||||
*/
|
||||
return call_user_func( $c->authenticate_hook['call'], $username, $password );
|
||||
$principal = call_user_func( $c->authenticate_hook['call'], $username, $password );
|
||||
if ( $principal !== false && !($principal instanceof Principal) ) {
|
||||
$principal = new Principal('username', $username);
|
||||
}
|
||||
return $principal;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user