summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-02-23 19:04:39 +0000
committerErmal Luçi <eri@pfsense.org>2010-02-23 19:04:39 +0000
commit762a24a382ca93d2b78c8917c6cfe9d271c098c9 (patch)
tree1e0cc5335124b0cf9385794610a9947a879e0cd6 /usr/local/www
parentcb074893080f9187587f5d6e9a9829eebc8491ef (diff)
downloadpfsense-762a24a382ca93d2b78c8917c6cfe9d271c098c9.zip
pfsense-762a24a382ca93d2b78c8917c6cfe9d271c098c9.tar.gz
Add proxy authentication capabilities to OpenVPN client.
Diffstat (limited to 'usr/local/www')
-rw-r--r--usr/local/www/vpn_openvpn_client.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php
index f1f48fd..0083fd2 100644
--- a/usr/local/www/vpn_openvpn_client.php
+++ b/usr/local/www/vpn_openvpn_client.php
@@ -90,6 +90,9 @@ if($_GET['act']=="edit"){
$pconfig['resolve_retry'] = $a_client[$id]['resolve_retry'];
$pconfig['proxy_addr'] = $a_client[$id]['proxy_addr'];
$pconfig['proxy_port'] = $a_client[$id]['proxy_port'];
+ $pconfig['proxy_user'] = $a_client[$id]['proxy_user'];
+ $pconfig['proxy_passwd'] = $a_client[$id]['proxy_passwd'];
+ $pconfig['proxy_authtype'] = $a_client[$id]['proxy_authtype'];
$pconfig['description'] = $a_client[$id]['description'];
$pconfig['custom_options'] = $a_client[$id]['custom_options'];
$pconfig['ns_cert_type'] = $a_client[$id]['ns_cert_type'];
@@ -156,6 +159,11 @@ if ($_POST) {
if ($result = openvpn_validate_port($pconfig['proxy_port'], 'Proxy port'))
$input_errors[] = $result;
+
+ if ($pconfig['proxy_authtype'] != "none") {
+ if (empty($pconfig['proxy_user']) || empty($pconfig['proxy_passwd']))
+ $input_errors[] = "User name and password are required for proxy with authentication.";
+ }
}
if($pconfig['tunnel_network'])
@@ -207,6 +215,9 @@ if ($_POST) {
$client['resolve_retry'] = $pconfig['resolve_retry'];
$client['proxy_addr'] = $pconfig['proxy_addr'];
$client['proxy_port'] = $pconfig['proxy_port'];
+ $client['proxy_authtype'] = $pconfig['proxy_authtype'];
+ $client['proxy_user'] = $pconfig['proxy_user'];
+ $client['proxy_passwd'] = $pconfig['proxy_passwd'];
$client['description'] = $pconfig['description'];
$client['mode'] = $pconfig['mode'];
$client['custom_options'] = $pconfig['custom_options'];
@@ -277,6 +288,15 @@ function autokey_change() {
document.getElementById("autokey_opts").style.display="";
}
+function useproxy_changed() {
+
+ if ($('proxy_authtype').value != 'none') {
+ $('proxy_authtype_opts').show();
+ } else {
+ $('proxy_authtype_opts').hide();
+ }
+}
+
function tlsauth_change() {
<?php if (!$pconfig['tls']): ?>
@@ -459,6 +479,50 @@ function autotls_change() {
</td>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Proxy authentication extra options");?></td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td align="right" width="25%">
+ <span class="vexpl">
+ &nbsp;Authentication method :&nbsp;
+ </span>
+ </td>
+ <td>
+ <select name="proxy_authtype" id="proxy_authtype" class="formfld select" onChange="useproxy_changed()">
+ <option value="none" <?php if ($pconfig['proxy_authtype'] == "none") echo "selected"; ?>>none</option>
+ <option value="basic" <?php if ($pconfig['proxy_authtype'] == "basic") echo "selected"; ?>>basic</option>
+ <option value="ntlm" <?php if ($pconfig['proxy_authtype'] == "ntlm") echo "selected"; ?>>ntlm</option>
+ </select>
+ </td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" cellpadding="2" cellspacing="0" id="proxy_authtype_opts" style="display:none">
+ <tr>
+ <td align="right" width="25%">
+ <span class="vexpl">
+ &nbsp;Username :&nbsp;
+ </span>
+ </td>
+ <td>
+ <input name="proxy_user" id="proxy_user" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['proxy_user']);?>" />
+ </td>
+ </tr>
+ <tr>
+ <td align="right" width="25%">
+ <span class="vexpl">
+ &nbsp;Password :&nbsp;
+ </span>
+ </td>
+ <td>
+ <input name="proxy_passwd" id="proxy_passwd" type="password" class="formfld pwd" size="20" value="<?=htmlspecialchars($pconfig['proxy_passwd']);?>" />
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
<td width="22%" valign="top" class="vncell">Server host name resolution</td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
@@ -797,6 +861,7 @@ function autotls_change() {
mode_change();
autokey_change();
tlsauth_change();
+useproxy_changed();
//-->
</script>
</body>
OpenPOWER on IntegriCloud