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
67097e48
Commit
67097e48
authored
May 15, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc: isset() and a twirl of style
parent
03885497
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
20 deletions
+52
-20
certs.inc
src/etc/inc/certs.inc
+52
-20
No files found.
src/etc/inc/certs.inc
View file @
67097e48
...
...
@@ -515,69 +515,101 @@ function cert_get_serial($str_crt, $decode = true) {
return
NULL
;
}
function
is_user_cert
(
$certref
)
{
function
is_user_cert
(
$certref
)
{
global
$config
;
if
(
!
is_array
(
$config
[
'system'
][
'user'
]))
if
(
!
isset
(
$config
[
'system'
][
'user'
]))
{
return
;
}
foreach
(
$config
[
'system'
][
'user'
]
as
$user
)
{
if
(
!
is_array
(
$user
[
'cert'
]))
if
(
!
is_array
(
$user
[
'cert'
]))
{
continue
;
}
foreach
(
$user
[
'cert'
]
as
$cert
)
{
if
(
$certref
==
$cert
)
if
(
$certref
==
$cert
)
{
return
true
;
}
}
}
return
false
;
}
function
is_openvpn_server_cert
(
$certref
)
{
function
is_openvpn_server_cert
(
$certref
)
{
global
$config
;
if
(
!
is_array
(
$config
[
'openvpn'
][
'openvpn-server'
]))
if
(
!
isset
(
$config
[
'openvpn'
][
'openvpn-server'
]))
{
return
;
}
foreach
(
$config
[
'openvpn'
][
'openvpn-server'
]
as
$ovpns
)
{
if
(
$ovpns
[
'certref'
]
==
$certref
)
if
(
$ovpns
[
'certref'
]
==
$certref
)
{
return
true
;
}
}
return
false
;
}
function
is_openvpn_client_cert
(
$certref
)
{
function
is_openvpn_client_cert
(
$certref
)
{
global
$config
;
if
(
!
is_array
(
$config
[
'openvpn'
][
'openvpn-client'
]))
if
(
!
isset
(
$config
[
'openvpn'
][
'openvpn-client'
]))
{
return
;
}
foreach
(
$config
[
'openvpn'
][
'openvpn-client'
]
as
$ovpnc
)
{
if
(
$ovpnc
[
'certref'
]
==
$certref
)
if
(
$ovpnc
[
'certref'
]
==
$certref
)
{
return
true
;
}
}
return
false
;
}
function
is_ipsec_cert
(
$certref
)
{
function
is_ipsec_cert
(
$certref
)
{
global
$config
;
if
(
!
is_array
(
$config
[
'ipsec'
][
'phase1'
]))
if
(
!
isset
(
$config
[
'ipsec'
][
'phase1'
]))
{
return
;
}
foreach
(
$config
[
'ipsec'
][
'phase1'
]
as
$ipsec
)
{
if
(
$ipsec
[
'certref'
]
==
$certref
)
if
(
$ipsec
[
'certref'
]
==
$certref
)
{
return
true
;
}
}
return
false
;
}
function
is_webgui_cert
(
$certref
)
{
function
is_webgui_cert
(
$certref
)
{
global
$config
;
if
((
$config
[
'system'
][
'webgui'
][
'ssl-certref'
]
==
$certref
)
&&
(
$config
[
'system'
][
'webgui'
][
'protocol'
]
!=
"http"
))
return
true
;
return
$config
[
'system'
][
'webgui'
][
'ssl-certref'
]
==
$certref
&&
$config
[
'system'
][
'webgui'
][
'protocol'
]
!=
'http'
;
}
function
is_captiveportal_cert
(
$certref
)
{
function
is_captiveportal_cert
(
$certref
)
{
global
$config
;
if
(
!
is_array
(
$config
[
'captiveportal'
]))
if
(
!
issset
(
$config
[
'captiveportal'
]))
{
return
;
}
foreach
(
$config
[
'captiveportal'
]
as
$portal
)
{
if
(
isset
(
$portal
[
'enable'
])
&&
isset
(
$portal
[
'httpslogin'
])
&&
(
$portal
[
'certref'
]
==
$certref
))
if
(
isset
(
$portal
[
'enable'
])
&&
isset
(
$portal
[
'httpslogin'
])
&&
(
$portal
[
'certref'
]
==
$certref
))
{
return
true
;
}
}
return
false
;
}
...
...
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