aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export/vpn_openvpn_export.php
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2010-09-04 15:26:55 -0400
committerjim-p <jim@pingle.org>2010-09-04 15:26:55 -0400
commit6837018078c4df27b44522532b0644a48ec1ceb7 (patch)
treeb384ff1234eccdd5b304ffd4325dddf5084dd673 /config/openvpn-client-export/vpn_openvpn_export.php
parent0f44a289caec586d72fd07ea2abc6d2d3a514e69 (diff)
downloadpfsense-packages-6837018078c4df27b44522532b0644a48ec1ceb7.tar.gz
pfsense-packages-6837018078c4df27b44522532b0644a48ec1ceb7.tar.bz2
pfsense-packages-6837018078c4df27b44522532b0644a48ec1ceb7.zip
Update OpenVPN client export package to work with the new user cert setup (and retain compatibility with the old setup too)
Diffstat (limited to 'config/openvpn-client-export/vpn_openvpn_export.php')
-rwxr-xr-xconfig/openvpn-client-export/vpn_openvpn_export.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/config/openvpn-client-export/vpn_openvpn_export.php b/config/openvpn-client-export/vpn_openvpn_export.php
index b2d446f2..d876b519 100755
--- a/config/openvpn-client-export/vpn_openvpn_export.php
+++ b/config/openvpn-client-export/vpn_openvpn_export.php
@@ -47,16 +47,20 @@ if (!is_array($config['system']['user']))
$a_user = $config['system']['user'];
$ras_server = array();
-foreach($a_server as $sindex => & $server) {
+foreach($a_server as $sindex => $server) {
if (isset($server['disable']))
continue;
$ras_user = array();
if (stripos($server['mode'], "server") === false)
continue;
- foreach($a_user as $uindex => & $user) {
+ foreach($a_user as $uindex => $user) {
if (!is_array($user['cert']))
continue;
- foreach($user['cert'] as $cindex => & $cert) {
+ foreach($user['cert'] as $cindex => $cert) {
+ // If $cert is not an array, it's a certref not a cert.
+ if (!is_array($cert))
+ $cert = lookup_cert($cert);
+
if ($cert['caref'] != $server['caref'])
continue;
$ras_userent = array();