(auth, legacy) proper error handling

This commit is contained in:
Ad Schellevis 2015-10-28 09:24:15 +00:00
parent b4dc36887d
commit e868dc56d8

View File

@ -727,5 +727,10 @@ function authenticate_user($username, $password, $authcfg = NULL) {
$authFactory = new OPNsense\Auth\AuthenticationFactory;
$authenticator = $authFactory->get($authName);
return $authenticator->authenticate($username, $password) ;
if ($authenticator != null) {
return $authenticator->authenticate($username, $password) ;
} else {
log_error('Unable to retrieve authenticator for '. $authName);
return false;
}
}