Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
7febe0a4
Commit
7febe0a4
authored
Oct 24, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Captiveportal, new) work in progress session/client restrictions (related to radius accounting)
parent
b50eee57
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
AccessController.php
...ntrollers/OPNsense/CaptivePortal/Api/AccessController.php
+18
-1
No files found.
src/opnsense/mvc/app/controllers/OPNsense/CaptivePortal/Api/AccessController.php
View file @
7febe0a4
...
@@ -121,6 +121,9 @@ class AccessController extends ApiControllerBase
...
@@ -121,6 +121,9 @@ class AccessController extends ApiControllerBase
}
elseif
(
$this
->
request
->
isPost
())
{
}
elseif
(
$this
->
request
->
isPost
())
{
// close session for long running action
// close session for long running action
$this
->
sessionClose
();
$this
->
sessionClose
();
// init variables for authserver object and name
$authServer
=
null
;
$authServerName
=
""
;
// get username from post
// get username from post
$userName
=
$this
->
request
->
getPost
(
"user"
,
"striptags"
,
null
);
$userName
=
$this
->
request
->
getPost
(
"user"
,
"striptags"
,
null
);
...
@@ -149,7 +152,6 @@ class AccessController extends ApiControllerBase
...
@@ -149,7 +152,6 @@ class AccessController extends ApiControllerBase
}
else
{
}
else
{
// no authentication needed, set username to "anonymous@ip"
// no authentication needed, set username to "anonymous@ip"
$userName
=
"anonymous@"
.
$clientIp
;
$userName
=
"anonymous@"
.
$clientIp
;
$authServerName
=
""
;
$isAuthenticated
=
true
;
$isAuthenticated
=
true
;
}
}
...
@@ -172,6 +174,21 @@ class AccessController extends ApiControllerBase
...
@@ -172,6 +174,21 @@ class AccessController extends ApiControllerBase
'json'
'json'
)
)
);
);
// push session restrictions, if they apply
if
(
array_key_exists
(
'sessionId'
,
$CPsession
)
&&
$authServer
!=
null
)
{
$authProps
=
$authServer
->
getLastAuthProperties
();
// when adding more client/session restrictions, extend next code
// (currently only time is restricted)
if
(
array_key_exists
(
'session_timeout'
,
$authProps
))
{
$backend
->
configdpRun
(
"captiveportal set session_restrictions"
,
array
((
string
)
$cpZone
->
zoneid
,
$CPsession
[
'sessionId'
],
$authProps
[
'session_timeout'
]
)
);
}
}
$CPsession
=
json_decode
(
$CPsession
,
true
);
$CPsession
=
json_decode
(
$CPsession
,
true
);
if
(
$CPsession
!=
null
)
{
if
(
$CPsession
!=
null
)
{
// only return session if configd return a valid json response, otherwise fallback to
// only return session if configd return a valid json response, otherwise fallback to
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment