LSauthMethod: fix PHP warning

This commit is contained in:
Benjamin Renard 2021-04-14 16:09:03 +02:00
parent c81e2d0ee3
commit 6d95f9bfd5

View file

@ -67,12 +67,15 @@ class LSauthMethod extends LSlog_staticLoggerClass {
if (!$authobjects || !is_array($authobjects)) {
LSerror :: addErrorCode('LSauth_01');
self :: log_debug("No user found for provided username '".$this -> authData['username']."'");
return false;
}
elseif (count($authobjects) > 1) {
if (count($authobjects) > 1) {
self :: log_debug('Multiple users match with provided username: '.implode(', ', array_keys($authobjects)));
LSerror :: addErrorCode('LSauth_02');
return false;
}
// Authentication succeeded
return array_pop($authobjects);
}