Can cumulate error message on different authentication modes
This commit is contained in:
parent
4d91e448ce
commit
396b532400
@ -69,6 +69,8 @@ function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $auth
|
||||
|
||||
// Validation of login/pass/entity with standard modules
|
||||
if (empty($login)) {
|
||||
unset($_SESSION["dol_loginmesg"]);
|
||||
|
||||
$test = true;
|
||||
foreach ($authmode as $mode) {
|
||||
if ($test && $mode && !$login) {
|
||||
@ -111,7 +113,7 @@ function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $auth
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('other', 'main', 'errors'));
|
||||
|
||||
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorFailedToLoadLoginFileForMode", $mode);
|
||||
$_SESSION["dol_loginmesg"] = (isset($_SESSION["dol_loginmesg"]) ? $_SESSION["dol_loginmesg"].', ' : '').$langs->transnoentitiesnoconv("ErrorFailedToLoadLoginFileForMode", $mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -736,6 +736,7 @@ if (!defined('NOLOGIN')) {
|
||||
// Validation of login/pass/entity
|
||||
// If ok, the variable login will be returned
|
||||
// If error, we will put error message in session under the name dol_loginmesg
|
||||
// Note authmode is an array for example: array('0'=>'dolibarr', '1'=>'google');
|
||||
if ($test && $goontestloop && (GETPOST('actionlogin', 'aZ09') == 'login' || $dolibarr_main_authentication != 'dolibarr')) {
|
||||
$login = checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $authmode);
|
||||
if ($login === '--bad-login-validity--') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user