diff options
author | Jim P <jim@pingle.org> | 2011-09-19 06:24:17 -0700 |
---|---|---|
committer | Jim P <jim@pingle.org> | 2011-09-19 06:24:17 -0700 |
commit | 5a52ab74cec4b96b2002b04ffcab200641351cfa (patch) | |
tree | 4d3e8de27da3b47afecfe6191083c2545c15ac2f /config/openvpn-client-export | |
parent | aab4b9b6da73e6dbc16e6b42b2a5f7c72a0bb7fa (diff) | |
parent | 73aa13182e340042642506fde0471b8b4cb96b37 (diff) | |
download | pfsense-packages-5a52ab74cec4b96b2002b04ffcab200641351cfa.tar.gz pfsense-packages-5a52ab74cec4b96b2002b04ffcab200641351cfa.tar.bz2 pfsense-packages-5a52ab74cec4b96b2002b04ffcab200641351cfa.zip |
Merge pull request #87 from namezero111111/master
Added functionality for advanced client export (2)
Diffstat (limited to 'config/openvpn-client-export')
-rwxr-xr-x | config/openvpn-client-export/openvpn-client-export.inc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc index 31565656..50113d89 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 @@ -95,7 +95,7 @@ function openvpn_client_pem_to_pk12($outpath, $outpass, $crtpath, $keypath, $cap unlink($capath); } -function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, $nokeys = false, $proxy, $zipconf = false, $outpass = "", $skiptls=false, $doslines=false) { +function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $usetoken, $nokeys = false, $proxy, $zipconf = false, $outpass = "", $skiptls=false, $doslines=false, $advancedoptions = "") { global $config, $input_errors, $g; $nl = ($doslines) ? "\r\n" : "\n"; @@ -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; |