Commit 192b6eb6 authored by Ad Schellevis's avatar Ad Schellevis

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

parent 196da2bb
...@@ -141,15 +141,17 @@ class AccessController extends ApiControllerBase ...@@ -141,15 +141,17 @@ class AccessController extends ApiControllerBase
$authFactory = new AuthenticationFactory(); $authFactory = new AuthenticationFactory();
foreach (explode(',', (string)$cpZone->authservers) as $authServerName) { foreach (explode(',', (string)$cpZone->authservers) as $authServerName) {
$authServer = $authFactory->get(trim($authServerName)); $authServer = $authFactory->get(trim($authServerName));
// try this auth method if ($authServer != null) {
$isAuthenticated = $authServer->authenticate( // try this auth method
$userName, $isAuthenticated = $authServer->authenticate(
$this->request->getPost("password", "string") $userName,
); $this->request->getPost("password", "string")
);
if ($isAuthenticated) { if ($isAuthenticated) {
// stop trying, when authenticated // stop trying, when authenticated
break; break;
}
} }
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment