aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export
diff options
context:
space:
mode:
Diffstat (limited to 'config/openvpn-client-export')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc15
1 files changed, 10 insertions, 5 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc
index 31565656..cff52d56 100755
--- a/config/openvpn-client-export/openvpn-client-export.inc
+++ b/config/openvpn-client-export/openvpn-client-export.inc
@@ -3,7 +3,7 @@
openvpn-client-export.inc
Copyright (C) 2009 Scott Ullrich <sullrich@gmail.com>
Copyright (C) 2008 Shrew Soft Inc
- Copyright (C) 2010 Ermal Luçi
+ Copyright (C) 2010 Ermal Lu�i
All rights reserved.
Parts of this code was originally based on vpn_ipsec_sad.php
@@ -231,6 +231,11 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoke
$conf .= "comp-lzo{$nl}";
if ($settings['passtos'])
$conf .= "passtos{$nl}";
+
+ // add advanced options
+ $advancedoptions = str_replace(";", $nl, $advancedoptions);
+ $conf .= $advancedoptions;
+ $conf .= $nl;
if ($zipconf == true) {
// create template directory
@@ -270,7 +275,7 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoke
return $conf;
}
-function openvpn_client_export_installer($srvid, $usrid, $crtid, $useaddr, $usetoken, $outpass, $proxy) {
+function openvpn_client_export_installer($srvid, $usrid, $crtid, $useaddr, $usetoken, $outpass, $proxy, $advancedoptions) {
global $config, $g, $input_errors;
$ovpndir = "/usr/local/share/openvpn";
@@ -344,7 +349,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, $doslines=true);
+ $conf = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, $nokeys, $proxy, false, "", false, $doslines=true, $advancedoptions);
if (!$conf) {
$input_errors[] = "Could not create a config to export.";
return false;
@@ -400,7 +405,7 @@ function openvpn_client_export_installer($srvid, $usrid, $crtid, $useaddr, $uset
return $outfile;
}
-function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $useaddr, $usetoken, $outpass, $proxy) {
+function viscosity_openvpn_client_config_exporter($srvid, $usrid, $crtid, $useaddr, $usetoken, $outpass, $proxy, $advancedoptions) {
global $config, $g;
$ovpndir = "/usr/local/share/openvpn/";
@@ -461,7 +466,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);
+ $conf = openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, true, $proxy, false, "", true, $advancedoptions);
if (!$conf)
return false;