From e27c484b01b55b6d1198f46aefb84ac6fc23afb0 Mon Sep 17 00:00:00 2001 From: jim-p Date: Sat, 30 Jun 2012 22:45:30 -0400 Subject: Generalize this variable name --- config/openvpn-client-export/openvpn-client-export.inc | 8 ++++---- config/openvpn-client-export/vpn_openvpn_export.php | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'config/openvpn-client-export') diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc index b018d006..1852be46 100755 --- a/config/openvpn-client-export/openvpn-client-export.inc +++ b/config/openvpn-client-export/openvpn-client-export.inc @@ -151,7 +151,7 @@ function openvpn_client_export_validate_config($srvid, $usrid, $crtid) { return array($settings, $server_cert, $server_ca, $servercn, $user, $cert, $nokeys); } -function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, $nokeys = false, $proxy, $zipconf = false, $outpass = "", $skiptls=false, $doslines=false, $advancedoptions = "") { +function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, $nokeys = false, $proxy, $expformat = "baseconf", $outpass = "", $skiptls=false, $doslines=false, $advancedoptions = "") { global $config, $input_errors, $g; $nl = ($doslines) ? "\r\n" : "\n"; @@ -264,7 +264,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoke $conf .= $advancedoptions; $conf .= $nl; - if ($zipconf == true) { + if ($expformat == "zip") { // create template directory $tempdir = "{$g['tmp_path']}/{$prefix}"; mkdir($tempdir, 0700, true); @@ -339,7 +339,7 @@ function openvpn_client_export_installer($srvid, $usrid, $crtid, $useaddr, $uset $pwdfle .= "{$proxy['password']}\r\n"; file_put_contents("{$confdir}/{$proxy['passwdfile']}", $pwdfle); } - $conf = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, $nokeys, $proxy, false, "", false, true, $advancedoptions); + $conf = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, $nokeys, $proxy, "", "baseconf", false, true, $advancedoptions); if (!$conf) { $input_errors[] = "Could not create a config to export."; return false; @@ -433,7 +433,7 @@ function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $usead file_put_contents("{$tempdir}/{$proxy['passwdfile']}", $pwdfle); } - $conf = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, true, $proxy, false, "", true, $advancedoptions); + $conf = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, true, $proxy, "baseconf", "", true, $advancedoptions); if (!$conf) return false; diff --git a/config/openvpn-client-export/vpn_openvpn_export.php b/config/openvpn-client-export/vpn_openvpn_export.php index 28bf2232..dceaf20f 100755 --- a/config/openvpn-client-export/vpn_openvpn_export.php +++ b/config/openvpn-client-export/vpn_openvpn_export.php @@ -168,14 +168,15 @@ if (!empty($act)) { $exp_name = openvpn_client_export_prefix($srvid); - if($act == "conf" || $act == "confall") { - if ($act == "confall") { + if($act == "conf" || $act == "confzip") { + if ($act == "confzip") { $exp_name = urlencode($exp_name."-config.zip"); - $zipconf = true; + $expformat = "zip"; } else { $exp_name = urlencode($exp_name."-config.ovpn"); + $expformat = "baseconf"; } - $exp_path = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, $nokeys, $proxy, $zipconf, $password, false, false, $advancedoptions); + $exp_path = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, $nokeys, $proxy, $expformat, $password, false, false, $advancedoptions); } if($act == "visc") { @@ -373,7 +374,7 @@ function server_changed() { cell2.className = "listr"; cell2.innerHTML = "Configuration"; cell2.innerHTML += "
"; - cell2.innerHTML += "Configuration archive"; + cell2.innerHTML += "Configuration archive"; cell2.innerHTML += "
"; cell2.innerHTML += "Windows Installer"; cell2.innerHTML += "
"; @@ -395,7 +396,7 @@ function server_changed() { cell2.className = "listr"; cell2.innerHTML = "Configuration"; cell2.innerHTML += "
"; - cell2.innerHTML += "Configuration archive"; + cell2.innerHTML += "Configuration archive"; cell2.innerHTML += "
"; cell2.innerHTML += "Windows Installer"; cell2.innerHTML += "
"; @@ -413,7 +414,7 @@ function server_changed() { cell2.className = "listr"; cell2.innerHTML = "Configuration"; cell2.innerHTML += "
"; - cell2.innerHTML += "Configuration archive"; + cell2.innerHTML += "Configuration archive"; cell2.innerHTML += "
"; cell2.innerHTML += "Windows Installer"; cell2.innerHTML += "
"; -- cgit v1.2.3