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
caf43295
Commit
caf43295
authored
Oct 14, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(captiveportal, new) add properties to config class
parent
23b3fc5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
__init__.py
src/opnsense/scripts/OPNsense/CaptivePortal/lib/__init__.py
+14
-2
No files found.
src/opnsense/scripts/OPNsense/CaptivePortal/lib/__init__.py
View file @
caf43295
...
...
@@ -59,7 +59,19 @@ class Config(object):
if
self
.
_conf_handle
!=
None
:
for
section
in
self
.
_conf_handle
.
sections
():
if
section
.
find
(
'zone_'
)
==
0
:
result
[
section
.
split
(
'_'
)[
1
]]
=
dict
()
zoneid
=
section
.
split
(
'_'
)[
1
]
result
[
zoneid
]
=
dict
()
for
item
in
self
.
_conf_handle
.
items
(
section
):
result
[
section
.
split
(
'_'
)[
1
]][
item
[
0
]]
=
item
[
1
]
result
[
zoneid
][
item
[
0
]]
=
item
[
1
]
# convert allowed(MAC)addresses string to list
if
'allowedaddresses'
in
result
[
zoneid
]
and
result
[
zoneid
][
'allowedaddresses'
]
.
strip
()
!=
''
:
result
[
zoneid
][
'allowedaddresses'
]
=
\
map
(
lambda
x
:
x
.
strip
(),
result
[
zoneid
][
'allowedaddresses'
]
.
split
(
','
))
else
:
result
[
zoneid
][
'allowedaddresses'
]
=
list
()
if
'allowedmacaddresses'
in
result
[
zoneid
]
and
result
[
zoneid
][
'allowedmacaddresses'
]
.
strip
()
!=
''
:
result
[
zoneid
][
'allowedmacaddresses'
]
=
\
map
(
lambda
x
:
x
.
strip
(),
result
[
zoneid
][
'allowedmacaddresses'
]
.
split
(
','
))
else
:
result
[
zoneid
][
'allowedmacaddresses'
]
=
list
()
return
result
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