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
f8b9d427
Commit
f8b9d427
authored
Jan 26, 2016
by
Ad Schellevis
Committed by
Franco Fichtner
Jan 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(mvc) extend CertificateField type
(cherry picked from commit
be965a7f
)
parent
cc9605d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
CertificateField.php
.../app/models/OPNsense/Base/FieldTypes/CertificateField.php
+20
-1
No files found.
src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/CertificateField.php
View file @
f8b9d427
...
...
@@ -44,11 +44,30 @@ class CertificateField extends BaseField
*/
protected
$internalIsContainer
=
false
;
/**
* @var string certificate type cert/ca, reflects config section to use as source
*/
private
$certificateType
=
"cert"
;
/**
* @var array collected options
*/
private
static
$internalOptionList
=
array
();
/**
* set certificate type (cert/ca)
* @param $value certificate type
*/
public
function
setType
(
$value
)
{
if
(
trim
(
strtolower
(
$value
))
==
"ca"
)
{
$this
->
certificateType
=
"ca"
;
}
else
{
$this
->
certificateType
=
"cert"
;
}
}
/**
* generate validation data (list of certificates)
*/
...
...
@@ -56,7 +75,7 @@ class CertificateField extends BaseField
{
if
(
count
(
$this
->
internalOptionList
)
==
0
)
{
$configObj
=
Config
::
getInstance
()
->
object
();
foreach
(
$configObj
->
cert
as
$cert
)
{
foreach
(
$configObj
->
{
$this
->
certificateType
}
as
$cert
)
{
self
::
$internalOptionList
[(
string
)
$cert
->
refid
]
=
(
string
)
$cert
->
descr
;
}
}
...
...
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