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
3ccd2632
Commit
3ccd2632
authored
Jul 10, 2015
by
Ad Schellevis
Committed by
Franco Fichtner
Jul 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) more uninitialized issues
parent
b4d2aa2f
Changes
1
Hide 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 @
3ccd2632
...
@@ -368,14 +368,14 @@ function captiveportal_configure_zone($cpcfg) {
...
@@ -368,14 +368,14 @@ function captiveportal_configure_zone($cpcfg) {
killbypid
(
"/var/run/cp_prunedb_
{
$cpzone
}
.pid"
);
killbypid
(
"/var/run/cp_prunedb_
{
$cpzone
}
.pid"
);
/* initialize minicron interval value */
/* 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 */
/* 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
))
if
((
!
is_numeric
(
$croninterval
))
||
(
$croninterval
<
10
))
$croninterval
=
60
;
$croninterval
=
60
;
/* write portal page */
/* 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'
]);
$htmltext
=
base64_decode
(
$cpcfg
[
'page'
][
'htmltext'
]);
else
{
else
{
/* example/template page */
/* example/template page */
...
@@ -403,7 +403,7 @@ function captiveportal_configure_zone($cpcfg) {
...
@@ -403,7 +403,7 @@ function captiveportal_configure_zone($cpcfg) {
unset
(
$htmltext
);
unset
(
$htmltext
);
/* write error page */
/* 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'
]);
$errtext
=
base64_decode
(
$cpcfg
[
'page'
][
'errtext'
]);
else
{
else
{
/* example page */
/* example page */
...
@@ -431,7 +431,7 @@ function captiveportal_configure_zone($cpcfg) {
...
@@ -431,7 +431,7 @@ function captiveportal_configure_zone($cpcfg) {
unset
(
$errtext
);
unset
(
$errtext
);
/* write logout page */
/* 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'
]);
$logouttext
=
base64_decode
(
$cpcfg
[
'page'
][
'logouttext'
]);
else
{
else
{
/* example page */
/* example page */
...
@@ -1029,7 +1029,7 @@ function captiveportal_write_elements()
...
@@ -1029,7 +1029,7 @@ function captiveportal_write_elements()
@
mkdir
(
'/var/db/cpelements'
);
@
mkdir
(
'/var/db/cpelements'
);
if
(
is_array
(
$cpcfg
[
'element'
]))
{
if
(
is
set
(
$cpcfg
[
'element'
])
&&
is
_array
(
$cpcfg
[
'element'
]))
{
foreach
(
$cpcfg
[
'element'
]
as
$data
)
{
foreach
(
$cpcfg
[
'element'
]
as
$data
)
{
if
(
!@
file_put_contents
(
"/var/db/cpelements/
{
$data
[
'name'
]
}
"
,
base64_decode
(
$data
[
'content'
])))
{
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
"
);
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