aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export/vpn_openvpn_export_shared.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/openvpn-client-export/vpn_openvpn_export_shared.php')
-rw-r--r--config/openvpn-client-export/vpn_openvpn_export_shared.php114
1 files changed, 59 insertions, 55 deletions
diff --git a/config/openvpn-client-export/vpn_openvpn_export_shared.php b/config/openvpn-client-export/vpn_openvpn_export_shared.php
index 630bb253..5810e97b 100644
--- a/config/openvpn-client-export/vpn_openvpn_export_shared.php
+++ b/config/openvpn-client-export/vpn_openvpn_export_shared.php
@@ -1,22 +1,22 @@
-<?php
+<?php
/*
vpn_openvpn_export_shared.php
part of pfSense (http://www.pfSense.org)
Copyright (C) 2008 Shrew Soft Inc.
Copyright (C) 2010 Ermal Luçi
Copyright (C) 2011-2015 ESF, LLC
- All rights reserved.
+ All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
+
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
@@ -44,7 +44,7 @@ if (!is_array($config['openvpn']['openvpn-server'])) {
$a_server = $config['openvpn']['openvpn-server'];
$ras_server = array();
-foreach($a_server as $sindex => $server) {
+foreach ($a_server as $sindex => $server) {
if (isset($server['disable'])) {
continue;
}
@@ -57,8 +57,7 @@ foreach($a_server as $sindex => $server) {
$port = $server['local_port'];
if ($server['description']) {
$name = "{$server['description']} {$prot}:{$port}";
- }
- else {
+ } else {
$name = "Shared Key Server {$prot}:{$port}";
}
$ras_serverent['index'] = $sindex;
@@ -79,7 +78,7 @@ if (isset($_POST['act'])) {
$error = false;
-if(($act == "skconf") || ($act == "skzipconf")) {
+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");
@@ -189,13 +188,15 @@ function download_begin(act) {
return;
}
useaddr = document.getElementById("useaddr_hostname").value;
- } else
+ } else {
useaddr = document.getElementById("useaddr").value;
+ }
var useproxy = 0;
var useproxypass = 0;
- if (document.getElementById("useproxy").checked)
+ if (document.getElementById("useproxy").checked) {
useproxy = 1;
+ }
var proxyaddr = document.getElementById("proxyaddr").value;
var proxyport = document.getElementById("proxyport").value;
@@ -205,8 +206,9 @@ function download_begin(act) {
return;
}
- if (document.getElementById("useproxypass").value != 'none')
+ if (document.getElementById("useproxypass").value != 'none') {
useproxypass = 1;
+ }
var proxytype = document.getElementById("useproxytype").value;
@@ -245,14 +247,15 @@ function download_begin(act) {
}
}
- window.open(dlurl,"_self");
+ window.open(dlurl, "_self");
}
function server_changed() {
var table = document.getElementById("clients");
- while (table.rows.length > 1 )
+ while (table.rows.length > 1 ) {
table.deleteRow(1);
+ }
var index = document.getElementById("server").selectedIndex;
@@ -271,17 +274,18 @@ function server_changed() {
function useaddr_changed(obj) {
- if (obj.value == "other")
+ if (obj.value == "other") {
$('HostName').show();
- else
+ } else {
$('HostName').hide();
-
+ }
+
}
function useproxy_changed(obj) {
if ((obj.id == "useproxy" && obj.checked) ||
- (obj.id == "useproxypass" && (obj.value != 'none'))) {
+ (obj.id == "useproxypass" && (obj.value != 'none'))) {
$(obj.id + '_opts').show();
} else {
$(obj.id + '_opts').hide();
@@ -298,9 +302,9 @@ function useproxy_changed(obj) {
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="openvpn export shared">
- <tr>
+ <tr>
<td>
- <?php
+ <?php
$tab_array = array();
$tab_array[] = array(gettext("Server"), false, "vpn_openvpn_server.php");
$tab_array[] = array(gettext("Client"), false, "vpn_openvpn_client.php");
@@ -320,7 +324,7 @@ function useproxy_changed(obj) {
<td width="22%" valign="top" class="vncellreq">Shared Key Server</td>
<td width="78%" class="vtable">
<select name="server" id="server" class="formselect" onchange="server_changed()">
- <?php foreach($ras_server as & $server): ?>
+ <?php foreach ($ras_server as & $server): ?>
<option value="<?=$server['sindex'];?>"><?=$server['name'];?></option>
<?php endforeach; ?>
</select>
@@ -406,7 +410,7 @@ function useproxy_changed(obj) {
</tr>
<tr>
<td width="25%">
- <br />
+ <br />
</td>
<td>
<select name="useproxypass" id="useproxypass" class="formselect" onchange="useproxy_changed(this)">
@@ -417,39 +421,39 @@ function useproxy_changed(obj) {
<span class="vexpl">
Choose proxy authentication if any.
</span>
- <br />
- <table border="0" cellpadding="2" cellspacing="0" id="useproxypass_opts" style="display:none" summary="name and password">
- <tr>
- <td align="right" width="25%">
- <span class="vexpl">
- &nbsp;Username :&nbsp;
- </span>
- </td>
- <td>
- <input name="proxyuser" id="proxyuser" class="formfld unknown" size="20" value="" />
- </td>
- </tr>
- <tr>
- <td align="right" width="25%">
- <span class="vexpl">
- &nbsp;Password :&nbsp;
- </span>
- </td>
- <td>
- <input name="proxypass" id="proxypass" type="password" class="formfld pwd" size="20" value="" />
- </td>
- </tr>
- <tr>
- <td align="right" width="25%">
- <span class="vexpl">
- &nbsp;Confirm :&nbsp;
- </span>
- </td>
- <td>
- <input name="proxyconf" id="proxyconf" type="password" class="formfld pwd" size="20" value="" />
- </td>
- </tr>
- </table>
+ <br />
+ <table border="0" cellpadding="2" cellspacing="0" id="useproxypass_opts" style="display:none" summary="name and password">
+ <tr>
+ <td align="right" width="25%">
+ <span class="vexpl">
+ &nbsp;Username :&nbsp;
+ </span>
+ </td>
+ <td>
+ <input name="proxyuser" id="proxyuser" class="formfld unknown" size="20" value="" />
+ </td>
+ </tr>
+ <tr>
+ <td align="right" width="25%">
+ <span class="vexpl">
+ &nbsp;Password :&nbsp;
+ </span>
+ </td>
+ <td>
+ <input name="proxypass" id="proxypass" type="password" class="formfld pwd" size="20" value="" />
+ </td>
+ </tr>
+ <tr>
+ <td align="right" width="25%">
+ <span class="vexpl">
+ &nbsp;Confirm :&nbsp;
+ </span>
+ </td>
+ <td>
+ <input name="proxyconf" id="proxyconf" type="password" class="formfld pwd" size="20" value="" />
+ </td>
+ </tr>
+ </table>
</td>
</tr>
</table>