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
c4782349
Commit
c4782349
authored
Mar 27, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
captiveportal: cleanups loosely related to #114
parent
d80be7bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
25 deletions
+6
-25
captiveportal.inc
src/etc/inc/captiveportal.inc
+4
-13
system.inc
src/etc/inc/system.inc
+1
-1
services_captiveportal.php
src/www/services_captiveportal.php
+1
-11
No files found.
src/etc/inc/captiveportal.inc
View file @
c4782349
...
...
@@ -679,12 +679,13 @@ function captiveportal_init_webgui_zone($cpcfg) {
* timestamp,ipfw_rule_no,clientip,clientmac,username,sessionid,password,session_timeout,idle_timeout,session_terminate_time,interim_interval
* (password is in Base64 and only saved when reauthentication is enabled)
*/
function
captiveportal_prune_old
()
{
function
captiveportal_prune_old
()
{
global
$g
,
$config
,
$cpzone
,
$cpzoneid
;
if
(
empty
(
$cpzone
))
if
(
empty
(
$cpzone
))
{
return
;
}
$cpc
=
new
OPNsense\CaptivePortal\CPClient
();
...
...
@@ -853,20 +854,11 @@ function captiveportal_prune_old() {
}
}
}
}
unset
(
$cpdb
);
}
/* send RADIUS acct stop for all current clients */
function
captiveportal_radius_stop_all
()
{
global
$config
,
$cpzone
;
...
...
@@ -1637,4 +1629,3 @@ function captiveportal_send_server_accounting($off = false) {
$racct
->
close
();
return
$retvalue
;
}
?>
src/etc/inc/system.inc
View file @
c4782349
...
...
@@ -918,7 +918,7 @@ function system_generate_lighty_config(
@
mkdir
(
'/tmp/lighttpdcompress'
);
if
(
$captive_portal
!==
false
)
{
$captiveportal
=
",
\"
mod_rewrite
\"
,
\"
mod_evasive
\"
"
;
$captiveportal
=
',"mod_evasive"'
;
$captive_portal_rewrite
=
"url.rewrite-once = (
\"
(.*captiveportal.*)
\"
=>
\"
$1
\"
,
\"
(.*)
\"
=>
\"
/index.php?zone=
{
$captive_portal
}
&redirurl=$1
\"
)
\n
"
;
$maxprocperip
=
$config
[
'captiveportal'
][
$captive_portal
][
'maxprocperip'
];
...
...
src/www/services_captiveportal.php
View file @
c4782349
...
...
@@ -382,18 +382,8 @@ if ($_POST) {
$newcp
[
'page'
][
'logouttext'
]
=
base64_encode
(
file_get_contents
(
$_FILES
[
'logoutfile'
][
'tmp_name'
]));
write_config
();
/* Clear up unselected interfaces */
$newifaces
=
explode
(
","
,
$newcp
[
'interface'
]);
$toremove
=
array_diff
(
$oldifaces
,
$newifaces
);
if
(
!
empty
(
$toremove
))
{
foreach
(
$toremove
as
$removeif
)
{
$removeif
=
get_real_interface
(
$removeif
);
mwexec
(
"/sbin/ipfw zone
{
$cpzoneid
}
mdel
{
$removeif
}
"
);
}
}
captiveportal_configure_zone
(
$newcp
);
unset
(
$newcp
,
$newifaces
,
$toremove
);
unset
(
$newcp
);
filter_configure
();
header
(
"Location: services_captiveportal_zones.php"
);
exit
;
...
...
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