Commit ebc96f66 authored by Ad Schellevis's avatar Ad Schellevis

(captiveportal, new) work in progress

parent a3f0e27d
...@@ -77,7 +77,7 @@ class AccessController extends ApiControllerBase ...@@ -77,7 +77,7 @@ class AccessController extends ApiControllerBase
// disable standard authentication in CaptivePortal Access API calls. // disable standard authentication in CaptivePortal Access API calls.
// set CORS headers // set CORS headers
$this->response->setHeader("Access-Control-Allow-Origin", "*"); $this->response->setHeader("Access-Control-Allow-Origin", "*");
$this->response->setHeader("Access-Control-Allow-Methods", "POST"); $this->response->setHeader("Access-Control-Allow-Methods", "OPTIONS, GET, POST");
} }
/** /**
...@@ -90,7 +90,7 @@ class AccessController extends ApiControllerBase ...@@ -90,7 +90,7 @@ class AccessController extends ApiControllerBase
if ($this->request->isOptions()) { if ($this->request->isOptions()) {
// return empty result on CORS preflight // return empty result on CORS preflight
return array(); return array();
} elseif ($this->request->isPost() && $this->hasPost('user')) { } elseif ($this->request->isPost() && $this->request->hasPost('user')) {
// close session for long running action // close session for long running action
$this->sessionClose(); $this->sessionClose();
...@@ -117,7 +117,7 @@ class AccessController extends ApiControllerBase ...@@ -117,7 +117,7 @@ class AccessController extends ApiControllerBase
break; break;
} }
} }
$isAuthenticated = true;
if ($isAuthenticated) { if ($isAuthenticated) {
// when authenticated, we have $authServer available to request additional data if needed // when authenticated, we have $authServer available to request additional data if needed
$clientSession = $this->clientSession((string)$cpZone->zoneid); $clientSession = $this->clientSession((string)$cpZone->zoneid);
......
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