aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export/vpn_openvpn_export.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-03-01 11:40:52 -0500
committerjim-p <jimp@pfsense.org>2011-03-01 12:12:08 -0500
commitbe1443e6c4d1b982d9ddee8843616dbad841debd (patch)
treeed860d21d5938f809ac415b0d6dfa8f7fc2197e4 /config/openvpn-client-export/vpn_openvpn_export.php
parent4b0dc757fd9b3f0d89f95dfd5f4517d61575aebf (diff)
downloadpfsense-packages-be1443e6c4d1b982d9ddee8843616dbad841debd.tar.gz
pfsense-packages-be1443e6c4d1b982d9ddee8843616dbad841debd.tar.bz2
pfsense-packages-be1443e6c4d1b982d9ddee8843616dbad841debd.zip
Moving this code to its own file
Diffstat (limited to 'config/openvpn-client-export/vpn_openvpn_export.php')
-rwxr-xr-xconfig/openvpn-client-export/vpn_openvpn_export.php73
1 files changed, 0 insertions, 73 deletions
diff --git a/config/openvpn-client-export/vpn_openvpn_export.php b/config/openvpn-client-export/vpn_openvpn_export.php
index c0c2838c..73833fbe 100755
--- a/config/openvpn-client-export/vpn_openvpn_export.php
+++ b/config/openvpn-client-export/vpn_openvpn_export.php
@@ -327,79 +327,6 @@ if($act == "inst") {
}
}
-if(($act == "skconf") || ($act == "skzipconf")) {
- $srvid = $_GET['srvid'];
- if (($srvid === false) || ($config['openvpn']['openvpn-server'][$srvid]['mode'] != "p2p_shared_key")) {
- pfSenseHeader("vpn_openvpn_export.php");
- exit;
- }
-
- if (empty($_GET['useaddr'])) {
- $error = true;
- $input_errors[] = "You need to specify an IP or hostname.";
- } else
- $useaddr = $_GET['useaddr'];
-
- $proxy = "";
- if (!empty($_GET['proxy_addr']) || !empty($_GET['proxy_port'])) {
- $proxy = array();
- if (empty($_GET['proxy_addr'])) {
- $error = true;
- $input_errors[] = "You need to specify an address for the proxy port.";
- } else
- $proxy['ip'] = $_GET['proxy_addr'];
- if (empty($_GET['proxy_port'])) {
- $error = true;
- $input_errors[] = "You need to specify a port for the proxy ip.";
- } else
- $proxy['port'] = $_GET['proxy_port'];
- $proxy['proxy_authtype'] = $_GET['proxy_authtype'];
- if ($_GET['proxy_authtype'] != "none") {
- if (empty($_GET['proxy_user'])) {
- $error = true;
- $input_errors[] = "You need to specify a username with the proxy config.";
- } else
- $proxy['user'] = $_GET['proxy_user'];
- if (!empty($_GET['proxy_user']) && empty($_GET['proxy_password'])) {
- $error = true;
- $input_errors[] = "You need to specify a password with the proxy user.";
- } else
- $proxy['password'] = $_GET['proxy_password'];
- }
- }
-
- $exp_name = openvpn_client_export_prefix($srvid);
- if ($act == "skzipconf")
- $zipconf = true;
- $exp_data = openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipconf);
- if (!$exp_data) {
- $input_errors[] = "Failed to export config files!";
- $error = true;
- }
- if (!$error) {
- if ($zipconf) {
- $exp_name = urlencode($exp_data);
- $exp_size = filesize("{$g['tmp_path']}/{$exp_data}");
- } else {
- $exp_name = urlencode($exp_name."-config.ovpn");
- $exp_size = strlen($exp_data);
- }
-
- header('Pragma: ');
- header('Cache-Control: ');
- header("Content-Type: application/octet-stream");
- header("Content-Disposition: attachment; filename={$exp_name}");
- header("Content-Length: $exp_size");
- if ($zipconf)
- readfile("{$g['tmp_path']}/{$exp_data}");
- else
- echo $exp_data;
-
- @unlink("{$g['tmp_path']}/{$exp_data}");
- exit;
- }
-}
-
include("head.inc");
?>