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

This commit is contained in:
Ad Schellevis 2017-02-07 19:48:36 +01:00
parent 0d104a9d79
commit a7ef41920a
3 changed files with 14 additions and 0 deletions

View File

@ -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;

View File

@ -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>

View File

@ -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>