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
439efe64
Commit
439efe64
authored
Aug 07, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) fix some coding errors in openvpn client export / refactor styling
parent
d8a81cda
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
455 additions
and
604 deletions
+455
-604
openvpn-client-export.inc
src/etc/inc/openvpn-client-export.inc
+5
-3
vpn_openvpn_export.php
src/www/vpn_openvpn_export.php
+450
-601
No files found.
src/etc/inc/openvpn-client-export.inc
View file @
439efe64
...
...
@@ -40,8 +40,9 @@ function openvpn_client_export_prefix($srvid, $usrid = null, $crtid = null) {
$settings
=
$config
[
'openvpn'
][
'openvpn-server'
][
$srvid
];
if
(
empty
(
$settings
))
return
false
;
if
(
$settings
[
'disable'
])
if
(
!
empty
(
$settings
[
'disable'
]))
{
return
false
;
}
$host
=
empty
(
$config
[
'system'
][
'hostname'
])
?
"openvpn"
:
$config
[
'system'
][
'hostname'
];
$prot
=
(
$settings
[
'protocol'
]
==
'UDP'
?
'udp'
:
$settings
[
'protocol'
]);
...
...
@@ -75,6 +76,7 @@ function openvpn_client_pem_to_pk12($outpath, $outpass, $crtpath, $keypath, $cap
function
openvpn_client_export_validate_config
(
$srvid
,
$usrid
,
$crtid
)
{
global
$config
,
$g
,
$input_errors
;
$nokeys
=
false
;
// lookup server settings
$settings
=
$config
[
'openvpn'
][
'openvpn-server'
][
$srvid
];
...
...
@@ -82,7 +84,7 @@ function openvpn_client_export_validate_config($srvid, $usrid, $crtid) {
$input_errors
[]
=
"Could not locate server configuration."
;
return
false
;
}
if
(
$settings
[
'disable'
]
)
{
if
(
!
empty
(
$settings
[
'disable'
])
)
{
$input_errors
[]
=
"You cannot export for disabled servers."
;
return
false
;
}
...
...
@@ -93,7 +95,7 @@ function openvpn_client_export_validate_config($srvid, $usrid, $crtid) {
{
$input_errors
[]
=
"Could not locate server certificate."
;
}
else
{
$server_ca
=
lookup_ca
(
$server_cert
[
'caref'
])
;
$server_ca
=
isset
(
$server_cert
[
'caref'
])
?
lookup_ca
(
$server_cert
[
'caref'
])
:
null
;
if
(
!
$server_ca
)
{
$input_errors
[]
=
"Could not locate the CA reference for the server certificate."
;
}
...
...
src/www/vpn_openvpn_export.php
View file @
439efe64
This diff is collapsed.
Click to expand it.
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