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
d49d6b0e
Commit
d49d6b0e
authored
Feb 05, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
captive portal: backported logging fixes from master
parent
05dc4630
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
system.inc
src/etc/inc/system.inc
+1
-0
AccessController.php
...ntrollers/OPNsense/CaptivePortal/Api/AccessController.php
+5
-0
cp-background-process.py
...e/scripts/OPNsense/CaptivePortal/cp-background-process.py
+1
-1
No files found.
src/etc/inc/system.inc
View file @
d49d6b0e
...
@@ -844,6 +844,7 @@ function system_syslogd_start()
...
@@ -844,6 +844,7 @@ function system_syslogd_start()
if
(
!
isset
(
$syslogcfg
[
'disablelocallogging'
]))
if
(
!
isset
(
$syslogcfg
[
'disablelocallogging'
]))
$syslogconf
.=
<<<EOD
$syslogconf
.=
<<<EOD
local3.* {$log_directive}/var/log/vpn.log
local3.* {$log_directive}/var/log/vpn.log
!captiveportal
local4.* {$log_directive}/var/log/portalauth.log
local4.* {$log_directive}/var/log/portalauth.log
local7.* {$log_directive}/var/log/dhcpd.log
local7.* {$log_directive}/var/log/dhcpd.log
*.notice;kern.debug;lpr.info;mail.crit;daemon.none; {$log_directive}/var/log/system.log
*.notice;kern.debug;lpr.info;mail.crit;daemon.none; {$log_directive}/var/log/system.log
...
...
src/opnsense/mvc/app/controllers/OPNsense/CaptivePortal/Api/AccessController.php
View file @
d49d6b0e
...
@@ -161,6 +161,7 @@ class AccessController extends ApiControllerBase
...
@@ -161,6 +161,7 @@ class AccessController extends ApiControllerBase
}
}
if
(
$isAuthenticated
)
{
if
(
$isAuthenticated
)
{
$this
->
getLogger
(
"captiveportal"
)
->
info
(
"AUTH "
.
$userName
.
" ("
.
$clientIp
.
") zone "
.
$zoneid
);
// 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
);
if
(
$clientSession
[
'clientState'
]
==
'AUTHORIZED'
)
{
if
(
$clientSession
[
'clientState'
]
==
'AUTHORIZED'
)
{
...
@@ -202,6 +203,7 @@ class AccessController extends ApiControllerBase
...
@@ -202,6 +203,7 @@ class AccessController extends ApiControllerBase
}
}
}
}
}
else
{
}
else
{
$this
->
getLogger
(
"captiveportal"
)
->
info
(
"DENY "
.
$userName
.
" ("
.
$clientIp
.
") zone "
.
$zoneid
);
return
array
(
"clientState"
=>
'NOT_AUTHORIZED'
,
"ipAddress"
=>
$clientIp
);
return
array
(
"clientState"
=>
'NOT_AUTHORIZED'
,
"ipAddress"
=>
$clientIp
);
}
}
}
}
...
@@ -236,6 +238,9 @@ class AccessController extends ApiControllerBase
...
@@ -236,6 +238,9 @@ class AccessController extends ApiControllerBase
);
);
$status
=
json_decode
(
$statusRAW
,
true
);
$status
=
json_decode
(
$statusRAW
,
true
);
if
(
$status
!=
null
)
{
if
(
$status
!=
null
)
{
$this
->
getLogger
(
"captiveportal"
)
->
info
(
"LOGOUT "
.
$clientSession
[
'userName'
]
.
" ("
.
$this
->
getClientIp
()
.
") zone "
.
$zoneid
);
return
$status
;
return
$status
;
}
}
}
}
...
...
src/opnsense/scripts/OPNsense/CaptivePortal/cp-background-process.py
View file @
d49d6b0e
...
@@ -45,7 +45,7 @@ class CPBackgroundProcess(object):
...
@@ -45,7 +45,7 @@ class CPBackgroundProcess(object):
"""
"""
def
__init__
(
self
):
def
__init__
(
self
):
# open syslog and notice startup
# open syslog and notice startup
syslog
.
openlog
(
'captiveportal'
,
logoption
=
syslog
.
LOG_DAEMON
)
syslog
.
openlog
(
'captiveportal'
,
logoption
=
syslog
.
LOG_DAEMON
,
facility
=
syslog
.
LOG_LOCAL4
)
syslog
.
syslog
(
syslog
.
LOG_NOTICE
,
'starting captiveportal background process'
)
syslog
.
syslog
(
syslog
.
LOG_NOTICE
,
'starting captiveportal background process'
)
# handles to ipfw, arp the config and the internal administration
# handles to ipfw, arp the config and the internal administration
self
.
ipfw
=
IPFW
()
self
.
ipfw
=
IPFW
()
...
...
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