Fix: debugage authentification ldap
This commit is contained in:
parent
bd34a5416f
commit
8eb90cf9e6
@ -314,34 +314,36 @@ if (! isset($_SESSION["dol_login"]))
|
||||
$ldap->searchUser=$usertotest;
|
||||
$ldap->searchPassword=$passwordtotest;
|
||||
|
||||
if ($ldapdebug) dolibarr_syslog("Authentification LDAP --> Server:".join(',',$ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword);
|
||||
|
||||
$result=$ldap->connect_bind();
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($result == 2)
|
||||
{
|
||||
if ($result == 2)
|
||||
{
|
||||
dolibarr_syslog("Authentification ok (en mode LDAP)");
|
||||
$login=$_POST["username"];
|
||||
dolibarr_syslog("Authentification ok (en mode LDAP)");
|
||||
$login=$_POST["username"];
|
||||
$test=false;
|
||||
}
|
||||
if ($result == 1)
|
||||
{
|
||||
dolibarr_syslog("Authentification ko bad password (en mode LDAP) pour '".$_POST["username"]."'");
|
||||
sleep(1);
|
||||
$langs->load('main');
|
||||
$langs->load('other');
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
}
|
||||
$ldap->close();
|
||||
}
|
||||
else
|
||||
if ($result == 1)
|
||||
{
|
||||
dolibarr_syslog("Authentification ko failed to connect to LDAP (en mode LDAP) pour '".$_POST["username"]."'");
|
||||
dolibarr_syslog("Authentification ko bad password (en mode LDAP) pour '".$_POST["username"]."'");
|
||||
sleep(1);
|
||||
$langs->load('main');
|
||||
$langs->load('other');
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
}
|
||||
$ldap->close();
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("Authentification ko failed to connect to LDAP (en mode LDAP) pour '".$_POST["username"]."'");
|
||||
sleep(1);
|
||||
$langs->load('main');
|
||||
$langs->load('other');
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $login)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user