From 9a53a154cde4b4a4e1b21ab92281f8090140a359 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 18 Jan 2011 13:37:13 -0500 Subject: Don't use references in OpenVPN client export. It doesn't need to modify anything, and there probably won't be enough data for it to make a measurable speed difference. --- .../openvpn-client-export.inc | 24 +++++++++++----------- .../openvpn-client-export/vpn_openvpn_export.php | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc index 5cd75ce8..d145c8a3 100755 --- a/config/openvpn-client-export/openvpn-client-export.inc +++ b/config/openvpn-client-export/openvpn-client-export.inc @@ -106,8 +106,8 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoke } // lookup server certificate info - $server_cert =& lookup_cert($settings['certref']); - $server_ca =& lookup_ca($server_cert['caref']); + $server_cert = lookup_cert($settings['certref']); + $server_ca = lookup_ca($server_cert['caref']); if (!$server_cert || !$server_ca) { $input_errors[] = "Could not locate certificate."; return false; @@ -115,7 +115,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoke // lookup user info if ($usrid) { - $user =& $config['system']['user'][$usrid]; + $user = $config['system']['user'][$usrid]; if (!$user) { $input_errors[] = "Could not find user settings."; return false; @@ -124,7 +124,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoke // lookup user certificate info if ($settings['mode'] != "server_user") { - $cert =& $user['cert'][$crtid]; + $cert = $user['cert'][$crtid]; if (!$cert) return false; // If $cert is not an array, it's a certref not a cert. @@ -273,8 +273,8 @@ function openvpn_client_export_installer($srvid, $usrid, $crtid, $useaddr, $uset $nokeys = false; // lookup server certificate info - $server_cert =& lookup_cert($settings['certref']); - $server_ca =& lookup_ca($server_cert['caref']); + $server_cert = lookup_cert($settings['certref']); + $server_ca = lookup_ca($server_cert['caref']); if (!$server_cert || !$server_ca) { $input_errors[] = "Could not find a valid certificate."; return false; @@ -282,7 +282,7 @@ function openvpn_client_export_installer($srvid, $usrid, $crtid, $useaddr, $uset // lookup user info if ($usrid) { - $user =& $config['system']['user'][$usrid]; + $user = $config['system']['user'][$usrid]; if (!$user) { $input_errors[] = "Could not find the details about userid: {$usrid}"; return false; @@ -291,7 +291,7 @@ function openvpn_client_export_installer($srvid, $usrid, $crtid, $useaddr, $uset // lookup user certificate info if ($settings['mode'] != "server_user") { - $cert =& $user['cert'][$crtid]; + $cert = $user['cert'][$crtid]; if (!$cert) return false; // If $cert is not an array, it's a certref not a cert. @@ -396,21 +396,21 @@ function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $usead return false; // lookup server certificate info - $server_cert =& lookup_cert($settings['certref']); - $server_ca =& lookup_ca($server_cert['caref']); + $server_cert = lookup_cert($settings['certref']); + $server_ca = lookup_ca($server_cert['caref']); if (!$server_cert || !$server_ca) return false; // lookup user info if ($usrid) { - $user =& $config['system']['user'][$usrid]; + $user = $config['system']['user'][$usrid]; if (!$user) return false; } // lookup user certificate info if ($settings['mode'] != "server_user") { - $cert =& $user['cert'][$crtid]; + $cert = $user['cert'][$crtid]; if (!$cert) return false; // If $cert is not an array, it's a certref not a cert. diff --git a/config/openvpn-client-export/vpn_openvpn_export.php b/config/openvpn-client-export/vpn_openvpn_export.php index 0834941c..e0681aea 100755 --- a/config/openvpn-client-export/vpn_openvpn_export.php +++ b/config/openvpn-client-export/vpn_openvpn_export.php @@ -338,12 +338,12 @@ include("head.inc");