aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-06-30 22:45:30 -0400
committerjim-p <jimp@pfsense.org>2012-06-30 22:45:30 -0400
commite27c484b01b55b6d1198f46aefb84ac6fc23afb0 (patch)
treea0fd5ccce998c9ce3449bd71edc3be9e01a35b37 /config/openvpn-client-export
parent0ee1b513a3fbb0fffa5460ec04065b2568b6da27 (diff)
downloadpfsense-packages-e27c484b01b55b6d1198f46aefb84ac6fc23afb0.tar.gz
pfsense-packages-e27c484b01b55b6d1198f46aefb84ac6fc23afb0.tar.bz2
pfsense-packages-e27c484b01b55b6d1198f46aefb84ac6fc23afb0.zip
Generalize this variable name
Diffstat (limited to 'config/openvpn-client-export')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc8
-rwxr-xr-xconfig/openvpn-client-export/vpn_openvpn_export.php15
2 files changed, 12 insertions, 11 deletions
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 = "<a href='javascript:download_begin(\"conf\"," + i + ", -1)'>Configuration</a>";
cell2.innerHTML += "<br/>";
- cell2.innerHTML += "<a href='javascript:download_begin(\"confall\"," + i + ", -1)'>Configuration archive</a>";
+ cell2.innerHTML += "<a href='javascript:download_begin(\"confzip\"," + i + ", -1)'>Configuration archive</a>";
cell2.innerHTML += "<br/>";
cell2.innerHTML += "<a href='javascript:download_begin(\"inst\"," + i + ", -1)'>Windows Installer</a>";
cell2.innerHTML += "<br/>";
@@ -395,7 +396,7 @@ function server_changed() {
cell2.className = "listr";
cell2.innerHTML = "<a href='javascript:download_begin(\"conf\", -1," + j + ")'>Configuration</a>";
cell2.innerHTML += "<br/>";
- cell2.innerHTML += "<a href='javascript:download_begin(\"confall\", -1," + j + ")'>Configuration archive</a>";
+ cell2.innerHTML += "<a href='javascript:download_begin(\"confzip\", -1," + j + ")'>Configuration archive</a>";
cell2.innerHTML += "<br/>";
cell2.innerHTML += "<a href='javascript:download_begin(\"inst\", -1," + j + ")'>Windows Installer</a>";
cell2.innerHTML += "<br/>";
@@ -413,7 +414,7 @@ function server_changed() {
cell2.className = "listr";
cell2.innerHTML = "<a href='javascript:download_begin(\"conf\"," + i + ")'>Configuration</a>";
cell2.innerHTML += "<br/>";
- cell2.innerHTML += "<a href='javascript:download_begin(\"confall\"," + i + ")'>Configuration archive</a>";
+ cell2.innerHTML += "<a href='javascript:download_begin(\"confzip\"," + i + ")'>Configuration archive</a>";
cell2.innerHTML += "<br/>";
cell2.innerHTML += "<a href='javascript:download_begin(\"inst\"," + i + ")'>Windows Installer</a>";
cell2.innerHTML += "<br/>";