diff --git a/htdocs/lib/ws.lib.php b/htdocs/lib/ws.lib.php index 468ed4c2bcd..82ecf7805c6 100755 --- a/htdocs/lib/ws.lib.php +++ b/htdocs/lib/ws.lib.php @@ -55,13 +55,15 @@ function check_authentication($authentication,&$error,&$errorcode,&$errorlabel) // Validation of login with a third party login module method if (! $error) { - $test=true; if (is_array($conf->login_method_modules) && !empty($conf->login_method_modules)) { $login = getLoginMethod($authentication['login'],$authentication['password'],$authentication['entity']); - if ($login) $test=false; + if (empty($login)) $error++; + } + else + { + $errorcode='BAD_LOGIN_METHOD'; $errorlabel='Bad value for login method'; } - if ($test) $error++; } if ($error)