mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-21 17:06:22 +00:00
Fix the storing of cached credentials when an authentication hook is used.
Thank you LDAP tests for picking up this issue!
This commit is contained in:
parent
521594bc3f
commit
0b709c791d
@ -368,11 +368,14 @@ class HTTPAuthSession {
|
||||
* - Configuration data will be in $c->authenticate_hook['config'], which might be an array, or whatever is needed.
|
||||
*/
|
||||
$principal = call_user_func( $c->authenticate_hook['call'], $username, $password );
|
||||
if ( $principal !== false && !($principal instanceof Principal) ) {
|
||||
$principal = new Principal('username', $username);
|
||||
}
|
||||
|
||||
if ( $principal === false ) {
|
||||
$this->SetCache($username, $password, 'fail');
|
||||
} else if (!($principal instanceof Principal) ) {
|
||||
} else {
|
||||
$this->SetCache($username, $password, 'pass');
|
||||
$principal = new Principal('username', $username);
|
||||
}
|
||||
|
||||
return $principal;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user