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
5abc7a2d
Commit
5abc7a2d
authored
Jul 10, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) more uninitialized issues
parent
b0704185
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
captiveportal.inc
src/etc/inc/captiveportal.inc
+5
-5
No files found.
src/etc/inc/captiveportal.inc
View file @
5abc7a2d
...
...
@@ -368,14 +368,14 @@ function captiveportal_configure_zone($cpcfg) {
killbypid
(
"/var/run/cp_prunedb_
{
$cpzone
}
.pid"
);
/* initialize minicron interval value */
$croninterval
=
$cpcfg
[
'croninterval'
]
?
$cpcfg
[
'croninterval'
]
:
60
;
$croninterval
=
isset
(
$cpcfg
[
'croninterval'
])
&&
!
empty
(
$cpcfg
[
'croninterval'
])
?
$cpcfg
[
'croninterval'
]
:
60
;
/* double check if the $croninterval is numeric and at least 10 seconds. If not we set it to 60 to avoid problems */
if
((
!
is_numeric
(
$croninterval
))
||
(
$croninterval
<
10
))
$croninterval
=
60
;
/* write portal page */
if
(
is
_array
(
$cpcfg
[
'page
'
])
&&
$cpcfg
[
'page'
][
'htmltext'
])
if
(
is
set
(
$cpcfg
[
'page'
][
'htmltext
'
])
&&
$cpcfg
[
'page'
][
'htmltext'
])
$htmltext
=
base64_decode
(
$cpcfg
[
'page'
][
'htmltext'
]);
else
{
/* example/template page */
...
...
@@ -403,7 +403,7 @@ function captiveportal_configure_zone($cpcfg) {
unset
(
$htmltext
);
/* write error page */
if
(
is
_array
(
$cpcfg
[
'page
'
])
&&
$cpcfg
[
'page'
][
'errtext'
])
if
(
is
set
(
$cpcfg
[
'page'
][
'errtext
'
])
&&
$cpcfg
[
'page'
][
'errtext'
])
$errtext
=
base64_decode
(
$cpcfg
[
'page'
][
'errtext'
]);
else
{
/* example page */
...
...
@@ -431,7 +431,7 @@ function captiveportal_configure_zone($cpcfg) {
unset
(
$errtext
);
/* write logout page */
if
(
is
_array
(
$cpcfg
[
'page
'
])
&&
$cpcfg
[
'page'
][
'logouttext'
])
if
(
is
set
(
$cpcfg
[
'page'
][
'logouttext
'
])
&&
$cpcfg
[
'page'
][
'logouttext'
])
$logouttext
=
base64_decode
(
$cpcfg
[
'page'
][
'logouttext'
]);
else
{
/* example page */
...
...
@@ -1029,7 +1029,7 @@ function captiveportal_write_elements()
@
mkdir
(
'/var/db/cpelements'
);
if
(
is_array
(
$cpcfg
[
'element'
]))
{
if
(
is
set
(
$cpcfg
[
'element'
])
&&
is
_array
(
$cpcfg
[
'element'
]))
{
foreach
(
$cpcfg
[
'element'
]
as
$data
)
{
if
(
!@
file_put_contents
(
"/var/db/cpelements/
{
$data
[
'name'
]
}
"
,
base64_decode
(
$data
[
'content'
])))
{
printf
(
gettext
(
"Error: cannot open '%s' in captiveportal_write_elements()%s"
),
$data
[
'name'
],
"
\n
"
);
...
...
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