Commit a7ef4192 authored by Ad Schellevis's avatar Ad Schellevis

(captive portal) add group enforcement, closes https://github.com/opnsense/core/issues/1377

parent 0d104a9d
......@@ -148,6 +148,11 @@ class AccessController extends ApiControllerBase
$this->request->getPost("password", "string")
);
// check group when group enforcement is set
if ($isAuthenticated && (string)$cpZone->authEnforceGroup != "") {
$isAuthenticated = $authServer->groupAllowed($userName, $cpZone->authEnforceGroup);
}
if ($isAuthenticated) {
// stop trying, when authenticated
break;
......
......@@ -26,6 +26,12 @@
<style>tokenize</style>
<help><![CDATA[Select authentication methods to use, leave empty for no authentication needed.]]></help>
</field>
<field>
<id>zone.authEnforceGroup</id>
<label>Enforce local group</label>
<type>dropdown</type>
<help><![CDATA[Restrict access to users in the selected (local)group.]]></help>
</field>
<field>
<id>zone.idletimeout</id>
<label>Idle timeout (minutes)</label>
......
......@@ -31,6 +31,9 @@
<multiple>Y</multiple>
<default>Local Database</default>
</authservers>
<authEnforceGroup type="AuthGroupField">
<Required>N</Required>
</authEnforceGroup>
<idletimeout type="IntegerField">
<Required>Y</Required>
<Default>0</Default>
......
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