(captiveportal, new) failsafe, don't try to authenticate if handler not found

This commit is contained in:
Ad Schellevis 2015-12-01 19:22:56 +01:00
parent 196da2bb5f
commit 192b6eb65d

View File

@ -141,15 +141,17 @@ class AccessController extends ApiControllerBase
$authFactory = new AuthenticationFactory();
foreach (explode(',', (string)$cpZone->authservers) as $authServerName) {
$authServer = $authFactory->get(trim($authServerName));
// try this auth method
$isAuthenticated = $authServer->authenticate(
$userName,
$this->request->getPost("password", "string")
);
if ($authServer != null) {
// try this auth method
$isAuthenticated = $authServer->authenticate(
$userName,
$this->request->getPost("password", "string")
);
if ($isAuthenticated) {
// stop trying, when authenticated
break;
if ($isAuthenticated) {
// stop trying, when authenticated
break;
}
}
}
} else {