mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
(captive portal) add group enforcement, closes https://github.com/opnsense/core/issues/1377
This commit is contained in:
parent
0d104a9d79
commit
a7ef41920a
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user