mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-28 03:04:15 +00:00
Retry contacting LDAP server and fail with 503 if unavailable.
We can't call $request->DoResponse() at this point because we haven't done all that stuff yet...
This commit is contained in:
parent
724a549502
commit
a267a25165
@ -294,8 +294,13 @@ function LDAP_check($username, $password ){
|
|||||||
|
|
||||||
$ldapDriver = getStaticLdap();
|
$ldapDriver = getStaticLdap();
|
||||||
if ( !$ldapDriver->valid ) {
|
if ( !$ldapDriver->valid ) {
|
||||||
dbg_error_log( "ERROR", "Couldn't contact LDAP server for authentication" );
|
sleep(1); // Sleep very briefly to try and survive intermittent issues
|
||||||
return false;
|
$ldapDriver = getStaticLdap();
|
||||||
|
if ( !$ldapDriver->valid ) {
|
||||||
|
dbg_error_log( "ERROR", "Couldn't contact LDAP server for authentication" );
|
||||||
|
header( sprintf("HTTP/1.1 %d %s", 503, translate("Authentication server unavailable.")) );
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mapping = $c->authenticate_hook['config']['mapping_field'];
|
$mapping = $c->authenticate_hook['config']['mapping_field'];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user