Commit be9b4a37 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) refactor/cleanup vpn_openvpn_client.php

parent f1f331b9
...@@ -32,10 +32,6 @@ require_once("openvpn.inc"); ...@@ -32,10 +32,6 @@ require_once("openvpn.inc");
require_once("services.inc"); require_once("services.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
error_reporting(E_ALL);
$pgtitle = array(gettext("OpenVPN"), gettext("Client")); $pgtitle = array(gettext("OpenVPN"), gettext("Client"));
$shortcut_section = "openvpn"; $shortcut_section = "openvpn";
...@@ -46,28 +42,6 @@ if (!isset($config['openvpn']['openvpn-client'])) { ...@@ -46,28 +42,6 @@ if (!isset($config['openvpn']['openvpn-client'])) {
$a_client = &$config['openvpn']['openvpn-client']; $a_client = &$config['openvpn']['openvpn-client'];
if (!is_array($config['ca'])) {
$config['ca'] = array();
}
$a_ca =& $config['ca'];
if (!is_array($config['cert'])) {
$config['cert'] = array();
}
$a_cert =& $config['cert'];
if (!isset($config['crl']) || !is_array($config['crl'])) {
$config['crl'] = array();
}
$a_crl =& $config['crl'];
$vpnid = 0; $vpnid = 0;
$act = null; $act = null;
if ($_SERVER['REQUEST_METHOD'] === 'GET') { if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...@@ -153,6 +127,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -153,6 +127,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
if ($act == "del") { if ($act == "del") {
// remove client
if (!isset($id) || !isset($a_client[$id])) { if (!isset($id) || !isset($a_client[$id])) {
redirectHeader("vpn_openvpn_client.php"); redirectHeader("vpn_openvpn_client.php");
exit; exit;
...@@ -164,6 +139,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -164,6 +139,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
$savemsg = gettext("Client successfully deleted")."<br />"; $savemsg = gettext("Client successfully deleted")."<br />";
} else { } else {
// update client (after validation)
$pconfig = $_POST; $pconfig = $_POST;
$input_errors = array(); $input_errors = array();
...@@ -300,7 +276,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -300,7 +276,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} else { } else {
$client['vpnid'] = openvpn_vpnid_next(); $client['vpnid'] = openvpn_vpnid_next();
} }
if ($_POST['disable'] == "yes") { if (isset($pconfig['disable']) && $pconfig['disable'] == "yes") {
$client['disable'] = true; $client['disable'] = true;
} }
...@@ -312,8 +288,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -312,8 +288,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if ($tls_mode) { if ($tls_mode) {
$client['caref'] = $pconfig['caref']; $client['caref'] = $pconfig['caref'];
$client['certref'] = $pconfig['certref']; $client['certref'] = $pconfig['certref'];
if ($pconfig['tlsauth_enable']) { if (!empty($pconfig['tlsauth_enable'])) {
if ($pconfig['autotls_enable']) { if (!empty($pconfig['autotls_enable'])) {
$pconfig['tls'] = openvpn_create_key(); $pconfig['tls'] = openvpn_create_key();
} }
$client['tls'] = base64_encode($pconfig['tls']); $client['tls'] = base64_encode($pconfig['tls']);
...@@ -353,6 +329,7 @@ $main_buttons = array( ...@@ -353,6 +329,7 @@ $main_buttons = array(
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
$( document ).ready(function() { $( document ).ready(function() {
// init form (old stuff)
if (document.iform != undefined) { if (document.iform != undefined) {
mode_change(); mode_change();
autokey_change(); autokey_change();
...@@ -418,7 +395,7 @@ function dev_mode_change() { ...@@ -418,7 +395,7 @@ function dev_mode_change() {
} }
function autokey_change() { function autokey_change() {
if (document.iform.autokey_enable.checked) if (document.iform.autokey_enable != undefined && document.iform.autokey_enable.checked)
document.getElementById("autokey_opts").style.display="none"; document.getElementById("autokey_opts").style.display="none";
else else
document.getElementById("autokey_opts").style.display=""; document.getElementById("autokey_opts").style.display="";
...@@ -467,9 +444,6 @@ endif; ?> ...@@ -467,9 +444,6 @@ endif; ?>
//]]> //]]>
</script> </script>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
...@@ -501,13 +475,13 @@ endif; ?> ...@@ -501,13 +475,13 @@ endif; ?>
?> ?>
<form action="vpn_openvpn_client.php" method="post" name="iform" id="iform"> <form action="vpn_openvpn_client.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped">
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("General information"); ?></td> <td colspan="2"><?=gettext("General information"); ?></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><a id="help_for_disable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a><?=gettext("Disabled"); ?></td> <td width="22%"><a id="help_for_disable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a><?=gettext("Disabled"); ?></td>
<td width="78%" class="vtable"> <td width="78%">
<input name="disable" type="checkbox" value="yes" <?= !empty($pconfig['disable']) ? "checked=\"checked\"" : "";?> /> <input name="disable" type="checkbox" value="yes" <?= !empty($pconfig['disable']) ? "checked=\"checked\"" : "";?> />
<div class="hidden" for="help_for_disable"> <div class="hidden" for="help_for_disable">
<small><?=gettext("Set this option to disable this client without removing it from the list"); ?>.</small> <small><?=gettext("Set this option to disable this client without removing it from the list"); ?>.</small>
...@@ -515,8 +489,8 @@ endif; ?> ...@@ -515,8 +489,8 @@ endif; ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Server Mode");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Server Mode");?></td>
<td width="78%" class="vtable"> <td>
<select name="mode" id="mode" class="form-control" onchange="mode_change()"> <select name="mode" id="mode" class="form-control" onchange="mode_change()">
<?php <?php
$openvpn_client_modes = array( $openvpn_client_modes = array(
...@@ -535,8 +509,8 @@ endif; ?> ...@@ -535,8 +509,8 @@ endif; ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Protocol");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Protocol");?></td>
<td width="78%" class="vtable"> <td>
<select name='protocol' class="form-control"> <select name='protocol' class="form-control">
<?php <?php
foreach (array("UDP", "UDP6", "TCP", "TCP6") as $prot) : foreach (array("UDP", "UDP6", "TCP", "TCP6") as $prot) :
...@@ -546,35 +520,33 @@ endif; ?> ...@@ -546,35 +520,33 @@ endif; ?>
} }
?> ?>
<option value="<?=$prot;?>" <?=$selected;?>><?=$prot;?></option> <option value="<?=$prot;?>" <?=$selected;?>><?=$prot;?></option>
<?php <?php
endforeach; ?> endforeach; ?>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Device mode");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Device mode");?></td>
<td width="78%" class="vtable"> <td>
<select name='dev_mode' class="form-control" onchange="dev_mode_change()"> <select name='dev_mode' class="form-control" onchange="dev_mode_change()">
<?php <?php
foreach ($openvpn_dev_mode as $mode) : foreach (array("tun", "tap") as $mode) :
$selected = ""; $selected = "";
if ($pconfig['dev_mode'] == $mode) { if ($pconfig['dev_mode'] == $mode) {
$selected = "selected=\"selected\""; $selected = "selected=\"selected\"";
} }
?> ?>
<option value="<?=$mode; <option value="<?=$mode;?>" <?=$selected;?>><?=$mode;?></option>
?>" <?=$selected; <?php
?>><?=$mode;?></option>
<?php
endforeach; ?> endforeach; ?>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Interface"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Interface"); ?></td>
<td width="78%" class="vtable"> <td>
<select name="interface" class="form-control"> <select name="interface" class="form-control">
<?php <?php
$interfaces = get_configured_interface_with_descr(); $interfaces = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list(); $carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip) { foreach ($carplist as $cif => $carpip) {
...@@ -604,308 +576,205 @@ endif; ?> ...@@ -604,308 +576,205 @@ endif; ?>
$selected = "selected=\"selected\""; $selected = "selected=\"selected\"";
} }
?> ?>
<option value="<?=$iface; <option value="<?=$iface;?>" <?=$selected;?>><?=htmlspecialchars($ifacename);?></option>
?>" <?=$selected;?>> <?php
<?=htmlspecialchars($ifacename);?>
</option>
<?php
endforeach; ?> endforeach; ?>
</select> <br /> </select> <br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Local port");?></td> <td class="vncell"><a id="help_for_local_port" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Local port");?></td>
<td width="78%" class="vtable"> <td>
<input name="local_port" type="text" class="form-control unknown" size="5" value="<?=htmlspecialchars($pconfig['local_port']);?>" /> <input name="local_port" type="text" class="form-control unknown" size="5" value="<?=$pconfig['local_port'];?>" />
<p class="text-muted"><em><small><?=gettext("Set this option if you would like to bind to a specific port. Leave this blank or enter 0 for a random dynamic port."); ?></small></em></p> <div class="hidden" for="help_for_local_port">
<em><small><?=gettext("Set this option if you would like to bind to a specific port. Leave this blank or enter 0 for a random dynamic port."); ?></small></em>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Server host or address");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Server host or address");?></td>
<td width="78%" class="vtable"> <td>
<input name="server_addr" type="text" class="form-control unknown" size="30" value="<?=htmlspecialchars($pconfig['server_addr']);?>" /> <input name="server_addr" type="text" class="form-control unknown" size="30" value="<?=$pconfig['server_addr'];?>" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Server port");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Server port");?></td>
<td width="78%" class="vtable"> <td>
<input name="server_port" type="text" class="form-control unknown" size="5" value="<?=htmlspecialchars($pconfig['server_port']);?>" /> <input name="server_port" type="text" class="form-control unknown" size="5" value="<?=$pconfig['server_port'];?>" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Proxy host or address");?></td> <td class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Proxy host or address");?></td>
<td width="78%" class="vtable"> <td>
<input name="proxy_addr" type="text" class="form-control unknown" size="30" value="<?=htmlspecialchars($pconfig['proxy_addr']);?>" /> <input name="proxy_addr" type="text" class="form-control unknown" size="30" value="<?=$pconfig['proxy_addr'];?>" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Proxy port");?></td> <td class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Proxy port");?></td>
<td width="78%" class="vtable"> <td>
<input name="proxy_port" type="text" class="form-control unknown" size="5" value="<?=htmlspecialchars($pconfig['proxy_port']);?>" /> <input name="proxy_port" type="text" class="form-control unknown" size="5" value="<?=$pconfig['proxy_port'];?>" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Proxy authentication extra options");?></td> <td class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Proxy authentication extra options");?></td>
<td width="78%" class="vtable"> <td>
<table border="0" cellpadding="2" cellspacing="0" summary="proxy authentication"> <?=gettext("Authentication method"); ?>
<tr> <select name="proxy_authtype" id="proxy_authtype" class="form-control select" onchange="useproxy_changed()">
<td align="right" width="25%"> <option value="none" <?=$pconfig['proxy_authtype'] == "none" ? "selected=\"selected\"" : "" ?> > <?=gettext("none"); ?></option>
<span class="vexpl"> <option value="basic" <?=$pconfig['proxy_authtype'] == "basic" ? "selected=\"selected\"" : "" ?> > <?=gettext("basic"); ?></option>
&nbsp;<?=gettext("Authentication method"); ?> :&nbsp; <option value="basic" <?=$pconfig['proxy_authtype'] == "ntlm" ? "selected=\"selected\"" : "" ?> > <?=gettext("ntlm"); ?></option>
</span> </select>
</td> <div style="display:none" id="proxy_authtype_opts">
<td> <div><?=gettext("Username"); ?> <br/></div
<select name="proxy_authtype" id="proxy_authtype" class="form-control select" onchange="useproxy_changed()"> <div><input name="proxy_user" id="proxy_user" class="form-control unknown" size="20" value="<?=$pconfig['proxy_user'];?>" /></div>
<option value="none" <?php if ($pconfig['proxy_authtype'] == "none") { <div><?=gettext("Password"); ?> </div>
echo "selected=\"selected\""; <div><input name="proxy_passwd" id="proxy_passwd" type="password" class="form-control pwd" size="20" value="<?=$pconfig['proxy_passwd'];?>" /></div>
</div>
} ?>><?=gettext("none"); ?></option>
<option value="basic" <?php if ($pconfig['proxy_authtype'] == "basic") {
echo "selected=\"selected\"";
} ?>><?=gettext("basic"); ?></option>
<option value="ntlm" <?php if ($pconfig['proxy_authtype'] == "ntlm") {
echo "selected=\"selected\"";
} ?>><?=gettext("ntlm"); ?></option>
</select>
</td>
</tr>
</table>
<br />
<table border="0" cellpadding="2" cellspacing="0" id="proxy_authtype_opts" style="display:none" summary="proxy authentication options">
<tr>
<td align="right" width="25%">
<span class="vexpl">
&nbsp;<?=gettext("Username"); ?> :&nbsp;
</span>
</td>
<td>
<input name="proxy_user" id="proxy_user" class="form-control unknown" size="20" value="<?=htmlspecialchars($pconfig['proxy_user']);?>" />
</td>
</tr>
<tr>
<td align="right" width="25%">
<span class="vexpl">
&nbsp;<?=gettext("Password"); ?> :&nbsp;
</span>
</td>
<td>
<input name="proxy_passwd" id="proxy_passwd" type="password" class="form-control pwd" size="20" value="<?=htmlspecialchars($pconfig['proxy_passwd']);?>" />
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Server host name resolution"); ?></td> <td class="vncell"><a id="help_for_resolve_retry" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Server host name resolution"); ?></td>
<td width="78%" class="vtable"> <td>
<table border="0" cellpadding="2" cellspacing="0" summary="server host name resolution"> <input name="resolve_retry" type="checkbox" value="yes" <?= !empty($pconfig['resolve_retry']) ? "checked=\"checked\"" : "";?> />
<tr> <div class="hidden" for="help_for_resolve_retry">
<td> <div><?=gettext("Infinitely resolve server"); ?></div>
<?php set_checked($pconfig['resolve_retry'], $chk); ?> <div><small><?=gettext("Continuously attempt to resolve the server host name. Useful when communicating with a server that is not permanently connected to the Internet"); ?></small></div>
<input name="resolve_retry" type="checkbox" value="yes" <?=$chk;?> /> </div>
</td>
<td>
<span class="vexpl">
<?=gettext("Infinitely resolve server"); ?>
</span>
</td>
</tr>
</table>
<p class="text-muted"><em><small><?=gettext("Continuously attempt to resolve the server host " .
"name. Useful when communicating with a server " .
"that is not permanently connected to the Internet"); ?>.</small></em></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Description"); ?></td> <td class="vncell"><a id="help_for_description" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="description" type="text" class="form-control unknown" size="30" value="<?=htmlspecialchars($pconfig['description']);?>" /> <input name="description" type="text" class="form-control unknown" size="30" value="<?=$pconfig['description'];?>" />
<p class="text-muted"><em><small><?=gettext("You may enter a description here for your reference (not parsed)"); ?>.</small></em></p> <div class="hidden" for="help_for_description">
<small><?=gettext("You may enter a description here for your reference (not parsed)"); ?>.</small>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="list" height="12"></td> <td colspan="2" class="list" height="12"></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("User Authentication Settings"); ?></td> <td colspan="2"><?=gettext("User Authentication Settings"); ?></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("User name/pass"); ?></td> <td class="vncell"><a id="help_for_auth_user_pass" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("User name/pass"); ?></td>
<td width="78%" class="vtable"> <td>
<?=gettext("Leave empty when no user name and password are needed."); ?> <div><?=gettext("Username"); ?></div>
<div><input name="auth_user" id="auth_user" class="form-control unknown" size="20" value="<?=htmlspecialchars($pconfig['auth_user']);?>" /></div>
<div><?=gettext("Password"); ?></div>
<div><input name="auth_pass" id="auth_pass" type="password" class="form-control pwd" size="20" value="<?=htmlspecialchars($pconfig['auth_pass']);?>" /></div>
<div class="hidden" for="help_for_auth_user_pass">
<?=gettext("Leave empty when no user name and password are needed."); ?>
</div>
<br/> <br/>
<table border="0" cellpadding="2" cellspacing="0" summary="user name password">
<tr>
<td align="right" width="25%">
<span class="vexpl">
&nbsp;<?=gettext("Username"); ?> :&nbsp;
</span>
</td>
<td>
<input name="auth_user" id="auth_user" class="form-control unknown" size="20" value="<?=htmlspecialchars($pconfig['auth_user']);?>" />
</td>
</tr>
<tr>
<td align="right" width="25%">
<span class="vexpl">
&nbsp;<?=gettext("Password"); ?> :&nbsp;
</span>
</td>
<td>
<input name="auth_pass" id="auth_pass" type="password" class="form-control pwd" size="20" value="<?=htmlspecialchars($pconfig['auth_pass']);?>" />
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Cryptographic Settings"); ?></td> <td colspan="2"><?=gettext("Cryptographic Settings"); ?></td>
</tr> </tr>
<tr id="tls"> <tr id="tls">
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("TLS Authentication"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("TLS Authentication"); ?></td>
<td width="78%" class="vtable"> <td>
<table border="0" cellpadding="2" cellspacing="0" summary="tls authentication"> <input name="tlsauth_enable" id="tlsauth_enable" type="checkbox" value="yes" <?= !empty($pconfig['tlsauth_enable']) ? "checked=\"checked\"" : "";?> onclick="tlsauth_change()" />
<tr> <?=gettext("Enable authentication of TLS packets"); ?>.
<td>
<?php set_checked($pconfig['tlsauth_enable'], $chk); ?> <?php if (empty($pconfig['tls'])) :
<input name="tlsauth_enable" id="tlsauth_enable" type="checkbox" value="yes" <?=$chk;?> onclick="tlsauth_change()" />
</td>
<td>
<span class="vexpl">
<?=gettext("Enable authentication of TLS packets"); ?>.
</span>
</td>
</tr>
</table>
<?php if (!$pconfig['tls']) :
?> ?>
<table border="0" cellpadding="2" cellspacing="0" id="tlsauth_opts" summary="tls authentication options"> <div id="tlsauth_opts">
<tr> <input name="autotls_enable" id="autotls_enable" type="checkbox" value="yes"<?= !empty($pconfig['autotls_enable']) ? "checked=\"checked\"" : "";?> onclick="autotls_change()" />
<td> <?=gettext("Automatically generate a shared TLS authentication key"); ?>.
<?php set_checked($pconfig['autotls_enable'], $chk); ?> </div>
<input name="autotls_enable" id="autotls_enable" type="checkbox" value="yes" <?=$chk;?> onclick="autotls_change()" />
</td>
<td>
<span class="vexpl">
<?=gettext("Automatically generate a shared TLS authentication key"); ?>.
</span>
</td>
</tr>
</table>
<?php <?php
endif; ?> endif; ?>
<table border="0" cellpadding="2" cellspacing="0" id="autotls_opts" summary="tls authentication options"> <div id="autotls_opts">
<tr> <textarea name="tls" cols="65" rows="7" class="formpre"><?=isset($pconfig['tls'])?$pconfig['tls']:"";?></textarea>
<td>
<textarea name="tls" cols="65" rows="7" class="formpre"><?=htmlspecialchars($pconfig['tls']);?></textarea>
<p class="text-muted"><em><small><?=gettext("Paste your shared key here"); ?>.</small></em></p> <p class="text-muted"><em><small><?=gettext("Paste your shared key here"); ?>.</small></em></p>
</td> </div>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr id="tls_ca"> <tr id="tls_ca">
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Peer Certificate Authority"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Peer Certificate Authority"); ?></td>
<td width="78%" class="vtable"> <td>
<?php if (count($a_ca)) : <?php if (isset($config['ca'])) :
?> ?>
<select name='caref' class="form-control"> <select name='caref' class="form-control">
<?php <?php
foreach ($a_ca as $ca) : foreach ($config['ca'] as $ca) :
$selected = ""; $selected = "";
if ($pconfig['caref'] == $ca['refid']) { if (isset($pconfig['caref']) && $pconfig['caref'] == $ca['refid']) {
$selected = "selected=\"selected\""; $selected = "selected=\"selected\"";
} }
?> ?>
<option value="<?=$ca['refid']; <option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['descr'];?></option>
?>" <?=$selected; <?php
?>><?=$ca['descr'];?></option>
<?php
endforeach; ?> endforeach; ?>
</select> </select>
<?php <?php
else : else :
?> ?>
<b>No Certificate Authorities defined.</b> <br />Create one under <a href="system_camanager.php">System: Certificates</a>. <b><?=gettext("No Certificate Authorities defined.");?></b> <br /><?=gettext("Create one under");?> <a href="system_camanager.php"><?=gettext("System: Certificates");?></a>.
<?php <?php
endif; ?> endif; ?>
</td> </td>
</tr> </tr>
<tr id="tls_cert"> <tr id="tls_cert">
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Client Certificate"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Client Certificate"); ?></td>
<td width="78%" class="vtable"> <td>
<select name='certref' class="form-control"> <select name='certref' class="form-control">
<?php <?php
foreach ($a_cert as $cert) : foreach (isset($config['cert']) ? $config['cert'] : array() as $cert) :
$selected = ""; $selected = "";
$caname = ""; $caname = "";
$inuse = ""; $inuse = "";
$revoked = ""; $revoked = "";
$ca = lookup_ca($cert['caref']); if (isset($cert['caref'])) {
if ($ca) { $ca = lookup_ca($cert['caref']);
$caname = " (CA: {$ca['descr']})"; if (!empty($ca)) {
} $caname = " (CA: {$ca['descr']})";
if ($pconfig['certref'] == $cert['refid']) { }
}
if (isset($pconfig['certref']) && $pconfig['certref'] == $cert['refid']) {
$selected = "selected=\"selected\""; $selected = "selected=\"selected\"";
} }
if (cert_in_use($cert['refid'])) { if (isset($cert['refid']) && cert_in_use($cert['refid'])) {
$inuse = " *In Use"; $inuse = " *In Use";
} }
if (is_cert_revoked($cert)) { if (is_cert_revoked($cert)) {
$revoked = " *Revoked"; $revoked = " *Revoked";
} }
?> ?>
<option value="<?=$cert['refid']; <option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'] . $caname . $inuse . $revoked;?></option>
?>" <?=$selected;
?>><?=$cert['descr'] . $caname . $inuse . $revoked;?></option>
<?php <?php
endforeach; ?> endforeach; ?>
<option value="" <?PHP if (empty($pconfig['certref'])) { <option value="" <?=empty($pconfig['certref'])? "selected=\"selected\"" : "";?>> <?=gettext("None");?> <?=gettext("(Username and Password required)");?></option>
echo "selected=\"selected\"";
} ?>>None (Username and Password required)</option>
</select> </select>
<?php if (!count($a_cert)) : <?php if (!isset($config['cert']) || count($config['cert']) == 0) :
?> ?>
<b>No Certificates defined.</b> <br />Create one under <a href="system_certmanager.php">System: Certificates</a> if one is required for this connection. <b><?=gettext("No Certificates defined.");?></b> <br /><?=gettext("Create one under");?> <a href="system_certmanager.php"><?=gettext("System: Certificates");?></a> <?=gettext("if one is required for this connection.");?>
<?php <?php
endif; ?> endif; ?>
</td> </td>
</tr> </tr>
<tr id="psk"> <tr id="psk">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Shared Key"); ?></td> <td><?=gettext("Shared Key"); ?></td>
<td width="78%" class="vtable"> <td>
<?php if (!$pconfig['shared_key']) : <?php if (empty($pconfig['shared_key'])) :
?> ?>
<table border="0" cellpadding="2" cellspacing="0" summary="shared key"> <input name="autokey_enable" id="autokey_enable" type="checkbox" value="yes" <?= !empty($pconfig['autokey_enable']) ? "checked=\"checked\"" : "";?> onclick="autokey_change()" />
<tr> <?=gettext("Automatically generate a shared key"); ?>.
<td>
<?php set_checked($pconfig['autokey_enable'], $chk); ?>
<input name="autokey_enable" type="checkbox" value="yes" <?=$chk;?> onclick="autokey_change()" />
</td>
<td>
<span class="vexpl">
<?=gettext("Automatically generate a shared key"); ?>.
</span>
</td>
</tr>
</table>
<?php <?php
endif; ?> endif; ?>
<table border="0" cellpadding="2" cellspacing="0" id="autokey_opts" summary="shared key options"> <div id="autokey_opts">
<tr> <textarea name="shared_key" cols="65" rows="7" class="formpre"><?=isset($pconfig['shared_key']) ? $pconfig['shared_key'] : "";?></textarea>
<td> <em><small><?=gettext("Paste your shared key here"); ?>.</small></em>
<textarea name="shared_key" cols="65" rows="7" class="formpre"><?=htmlspecialchars($pconfig['shared_key']);?></textarea> </div>
<p class="text-muted"><em><small><?=gettext("Paste your shared key here"); ?>.</small></em></p>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Encryption algorithm"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Encryption algorithm"); ?></td>
<td width="78%" class="vtable"> <td>
<select name="crypto" class="form-control"> <select name="crypto" class="form-control">
<?php <?php
$cipherlist = openvpn_get_cipherlist(); $cipherlist = openvpn_get_cipherlist();
...@@ -915,50 +784,46 @@ endif; ?> ...@@ -915,50 +784,46 @@ endif; ?>
$selected = " selected=\"selected\""; $selected = " selected=\"selected\"";
} }
?> ?>
<option value="<?=$name;?>"<?=$selected?>> <option value="<?=$name;?>"<?=$selected?>><?=htmlspecialchars($desc);?></option>
<?=htmlspecialchars($desc);?>
</option>
<?php <?php
endforeach; ?> endforeach; ?>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Auth Digest Algorithm"); ?></td> <td><a id="help_for_digest" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Auth Digest Algorithm"); ?></td>
<td width="78%" class="vtable"> <td>
<select name="digest" class="form-control"> <select name="digest" class="form-control">
<?php <?php
$digestlist = openvpn_get_digestlist(); $digestlist = openvpn_get_digestlist();
foreach ($digestlist as $name => $desc) : foreach ($digestlist as $name => $desc) :
$selected = ""; $selected = "";
if ($name == $pconfig['digest']) { if ($name == $pconfig['digest']) {
$selected = " selected=\"selected\""; $selected = " selected=\"selected\"";
} }
?> ?>
<option value="<?=$name;?>"<?=$selected?>> <option value="<?=$name;?>"<?=$selected?>><?=htmlspecialchars($desc);?></option>
<?=htmlspecialchars($desc);?>
</option>
<?php <?php
endforeach; ?> endforeach; ?>
</select> </select>
<p class="text-muted"><em><small><?PHP echo gettext("NOTE: Leave this set to SHA1 unless the server is set to match. SHA1 is the default for OpenVPN."); ?></small></em></p> <div class="hidden" for="help_for_digest">
<?=gettext("NOTE: Leave this set to SHA1 unless the server is set to match. SHA1 is the default for OpenVPN."); ?>
</div>
</td> </td>
</tr> </tr>
<tr id="engine"> <tr id="engine">
<td width="22%" valign="top" class="vncellreq"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Hardware Crypto"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Hardware Crypto"); ?></td>
<td width="78%" class="vtable"> <td>
<select name="engine" class="form-control"> <select name="engine" class="form-control">
<?php <?php
$engines = openvpn_get_engines(); $engines = openvpn_get_engines();
foreach ($engines as $name => $desc) : foreach ($engines as $name => $desc) :
$selected = ""; $selected = "";
if ($name == $pconfig['engine']) { if ($name == $pconfig['engine']) {
$selected = " selected=\"selected\""; $selected = " selected=\"selected\"";
} }
?> ?>
<option value="<?=$name;?>"<?=$selected?>> <option value="<?=$name;?>"<?=$selected?>><?=htmlspecialchars($desc);?></option>
<?=htmlspecialchars($desc);?>
</option>
<?php <?php
endforeach; ?> endforeach; ?>
</select> </select>
...@@ -968,73 +833,83 @@ endif; ?> ...@@ -968,73 +833,83 @@ endif; ?>
<td colspan="2" class="list" height="12"></td> <td colspan="2" class="list" height="12"></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Tunnel Settings"); ?></td> <td colspan="2"><?=gettext("Tunnel Settings"); ?></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("IPv4 Tunnel Network"); ?></td> <td class="vncell"><a id="help_for_tunnel_network" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv4 Tunnel Network"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="tunnel_network" type="text" class="form-control unknown" size="20" value="<?=htmlspecialchars($pconfig['tunnel_network']);?>" /> <input name="tunnel_network" type="text" class="form-control unknown" size="20" value="<?=$pconfig['tunnel_network'];?>" />
<p class="text-muted"><em><small><?=gettext("This is the virtual network used for private " . <div class="hidden" for="help_for_tunnel_network">
"communications between this client and the " . <?=gettext("This is the virtual network used for private " .
"server expressed using CIDR (eg. 10.0.8.0/24). " . "communications between this client and the " .
"The first network address is assumed to be the " . "server expressed using CIDR (eg. 10.0.8.0/24). " .
"server address and the second network address " . "The first network address is assumed to be the " .
"will be assigned to the client virtual " . "server address and the second network address " .
"interface"); ?>.</small></em></p> "will be assigned to the client virtual " .
"interface"); ?>.
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("IPv6 Tunnel Network"); ?></td> <td class="vncell"><a id="help_for_tunnel_networkv6" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv6 Tunnel Network"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="tunnel_networkv6" type="text" class="form-control unknown" size="20" value="<?=htmlspecialchars($pconfig['tunnel_networkv6']);?>" /> <input name="tunnel_networkv6" type="text" class="form-control unknown" size="20" value="<?=$pconfig['tunnel_networkv6'];?>" />
<p class="text-muted"><em><small><?=gettext("This is the IPv6 virtual network used for private " . <div class="hidden" for="help_for_tunnel_networkv6">
"communications between this client and the " . <?=gettext("This is the IPv6 virtual network used for private " .
"server expressed using CIDR (eg. fe80::/64). " . "communications between this client and the " .
"The first network address is assumed to be the " . "server expressed using CIDR (eg. fe80::/64). " .
"server address and the second network address " . "The first network address is assumed to be the " .
"will be assigned to the client virtual " . "server address and the second network address " .
"interface"); ?>.</small></em></p> "will be assigned to the client virtual " .
"interface"); ?>.
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("IPv4 Remote Network/s"); ?></td> <td class="vncell"><a id="help_for_remote_network" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv4 Remote Network/s"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="remote_network" type="text" class="form-control unknown" size="40" value="<?=htmlspecialchars($pconfig['remote_network']);?>" /> <input name="remote_network" type="text" class="form-control unknown" size="40" value="<?=$pconfig['remote_network'];?>" />
<p class="text-muted"><em><small><?=gettext("These are the IPv4 networks that will be routed through " . <div class="hidden" for="help_for_remote_network">
<?=gettext("These are the IPv4 networks that will be routed through " .
"the tunnel, so that a site-to-site VPN can be " . "the tunnel, so that a site-to-site VPN can be " .
"established without manually changing the routing tables. " . "established without manually changing the routing tables. " .
"Expressed as a comma-separated list of one or more CIDR ranges. " . "Expressed as a comma-separated list of one or more CIDR ranges. " .
"If this is a site-to-site VPN, enter the " . "If this is a site-to-site VPN, enter the " .
"remote LAN/s here. You may leave this blank to " . "remote LAN/s here. You may leave this blank to " .
"only communicate with other clients"); ?>.</small></em></p> "only communicate with other clients"); ?>.
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("IPv6 Remote Network/s"); ?></td> <td class="vncell"><a id="help_for_remote_networkv6" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv6 Remote Network/s"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="remote_networkv6" type="text" class="form-control unknown" size="40" value="<?=htmlspecialchars($pconfig['remote_networkv6']);?>" /> <input name="remote_networkv6" type="text" class="form-control unknown" size="40" value="<?=$pconfig['remote_networkv6'];?>" />
<p class="text-muted"><em><small><?=gettext("These are the IPv6 networks that will be routed through " . <div class="hidden" for="help_for_remote_networkv6">
<?=gettext("These are the IPv6 networks that will be routed through " .
"the tunnel, so that a site-to-site VPN can be " . "the tunnel, so that a site-to-site VPN can be " .
"established without manually changing the routing tables. " . "established without manually changing the routing tables. " .
"Expressed as a comma-separated list of one or more IP/PREFIX. " . "Expressed as a comma-separated list of one or more IP/PREFIX. " .
"If this is a site-to-site VPN, enter the " . "If this is a site-to-site VPN, enter the " .
"remote LAN/s here. You may leave this blank to " . "remote LAN/s here. You may leave this blank to " .
"only communicate with other clients"); ?>.</small></em></p> "only communicate with other clients"); ?>.
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Limit outgoing bandwidth");?></td> <td class="vncell"><a id="help_for_use_shaper" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Limit outgoing bandwidth");?></td>
<td width="78%" class="vtable"> <td>
<input name="use_shaper" type="text" class="form-control unknown" size="5" value="<?=htmlspecialchars($pconfig['use_shaper']);?>" /> <input name="use_shaper" type="text" class="form-control unknown" size="5" value="<?=$pconfig['use_shaper'];?>" />
<p class="text-muted"><em><small><?=gettext("Maximum outgoing bandwidth for this tunnel. " . <div class="hidden" for="help_for_use_shaper">
<?=gettext("Maximum outgoing bandwidth for this tunnel. " .
"Leave empty for no limit. The input value has " . "Leave empty for no limit. The input value has " .
"to be something between 100 bytes/sec and 100 " . "to be something between 100 bytes/sec and 100 " .
"Mbytes/sec (entered as bytes per second)"); ?>.</small></em></p> "Mbytes/sec (entered as bytes per second)"); ?>.
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Compression"); ?></td> <td class="vncell"><a id="help_for_compression" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Compression"); ?></td>
<td width="78%" class="vtable"> <td>
<select name="compression" class="form-control"> <select name="compression" class="form-control">
<?php <?php
foreach ($openvpn_compression_modes as $cmode => $cmodedesc) : foreach ($openvpn_compression_modes as $cmode => $cmodedesc) :
...@@ -1047,112 +922,67 @@ endif; ?> ...@@ -1047,112 +922,67 @@ endif; ?>
<?php <?php
endforeach; ?> endforeach; ?>
</select> </select>
<p class="text-muted"><em><small><?=gettext("Compress tunnel packets using the LZO algorithm. Adaptive compression will dynamically disable compression for a period of time if OpenVPN detects that the data in the packets is not being compressed efficiently."); ?>.</small></em></p> <div class="hidden" for="help_for_compression">
<?=gettext("Compress tunnel packets using the LZO algorithm. Adaptive compression will dynamically disable compression for a period of time if OpenVPN detects that the data in the packets is not being compressed efficiently."); ?>.
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Type-of-Service"); ?></td> <td class="vncell"><a id="help_for_passtos" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Type-of-Service"); ?></td>
<td width="78%" class="vtable"> <td>
<table border="0" cellpadding="2" cellspacing="0" summary="type-of-service"> <input name="passtos" type="checkbox" value="yes" <?=!empty($pconfig['passtos']) ? "checked=\"checked\"" : "" ;?> />
<tr> <div class="hidden" for="help_for_passtos">
<td> <?=gettext("Set the TOS IP header value of tunnel packets to match the encapsulated packet value"); ?>.
<?php set_checked($pconfig['passtos'], $chk); ?> </div>
<input name="passtos" type="checkbox" value="yes" <?=$chk;?> />
</td>
<td>
<span class="vexpl">
<?=gettext("Set the TOS IP header value of tunnel packets to match the encapsulated packet value"); ?>.
</span>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr id="chkboxNoTunIPv6"> <tr id="chkboxNoTunIPv6">
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Disable IPv6"); ?></td> <td class="vncell"><a id="help_for_no_tun_ipv6" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Disable IPv6"); ?></td>
<td width="78%" class="vtable"> <td>
<table border="0" cellpadding="2" cellspacing="0" summary="disable-ipv6"> <input name="no_tun_ipv6" type="checkbox" value="yes" <?=!empty($pconfig['no_tun_ipv6']) ? "checked=\"checked\"" : "" ;?> />
<tr> <div class="hidden" for="help_for_no_tun_ipv6">
<td> <?=gettext("Don't forward IPv6 traffic"); ?>.
<?php set_checked($pconfig['no_tun_ipv6'], $chk); ?> </div>
<input name="no_tun_ipv6" type="checkbox" value="yes" <?=$chk;?> />
</td>
<td>
<span class="vexpl">
<?=gettext("Don't forward IPv6 traffic"); ?>.
</span>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr id="chkboxRouteNoPull"> <tr id="chkboxRouteNoPull">
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Don't pull routes"); ?></td> <td class="vncell"><a id="help_for_route_no_pull" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Don't pull routes"); ?></td>
<td width="78%" class="vtable"> <td>
<table border="0" cellpadding="2" cellspacing="0" summary="dont-pull-routes"> <input name="route_no_pull" type="checkbox" value="yes" <?=!empty($pconfig['route_no_pull']) ? "checked=\"checked\"" : "" ;?> />
<tr> <div class="hidden" for="help_for_route_no_pull">
<td> <?=gettext("Don't add or remove routes automatically. Instead pass routes to ");?>
<?php set_checked($pconfig['route_no_pull'], $chk); ?> <strong>--route-up</strong> <?=gettext("script using environmental variables"); ?>.
<input name="route_no_pull" type="checkbox" value="yes" <?=$chk;?> /> </div>
</td>
<td>
<span class="vexpl">
<?=gettext("Don't add or remove routes automatically. Instead pass routes to ");
?> <strong>--route-up</strong> <?=gettext("script using environmental variables"); ?>.
</span>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr id="chkboxRouteNoExec"> <tr id="chkboxRouteNoExec">
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Don't add/remove routes"); ?></td> <td class="vncell"><a id="help_for_route_no_exec" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Don't add/remove routes"); ?></td>
<td width="78%" class="vtable"> <td>
<table border="0" cellpadding="2" cellspacing="0" summary="dont-exec-routes"> <input name="route_no_exec" type="checkbox" value="yes" <?=!empty($pconfig['route_no_exec']) ? "checked=\"checked\"" : "" ;?> />
<tr> <div class="hidden" for="help_for_route_no_exec">
<td> <?=gettext("This option effectively bars the server from adding routes to the client's routing table, however note that this option still allows the server to set the TCP/IP properties of the client's TUN/TAP interface"); ?>.
<?php set_checked($pconfig['route_no_exec'], $chk); ?> </div>
<input name="route_no_exec" type="checkbox" value="yes" <?=$chk;?> />
</td>
<td>
<span class="vexpl">
<?=gettext("This option effectively bars the server from adding routes to the client's routing table, however note that this option still allows the server to set the TCP/IP properties of the client's TUN/TAP interface"); ?>.
</span>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
</table>
<table width="100%" border="0" cellpadding="6" cellspacing="0" id="client_opts" summary="advance configuration">
<tr> <tr>
<td colspan="2" class="list" height="12"></td> <td colspan="2" class="list" height="12"></td>
</tr> </tr>
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Advanced configuration"); ?></td> <td colspan="2"><?=gettext("Advanced configuration"); ?></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Advanced"); ?></td> <td class="vncell"><a id="help_for_custom_options" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Advanced"); ?></td>
<td width="78%" class="vtable"> <td>
<table border="0" cellpadding="2" cellspacing="0" summary="advance configuration"> <textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=$pconfig['custom_options'];?></textarea><br />
<tr> <div class="hidden" for="help_for_custom_options">
<td> <?=gettext("Enter any additional options you would like to add to the OpenVPN client configuration here, separated by a semicolon"); ?><br />
<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=htmlspecialchars($pconfig['custom_options']);?></textarea><br /> <?=gettext("EXAMPLE:"); ?> <strong>remote server.mysite.com 1194;</strong> or <strong>remote 1.2.3.4 1194;</strong>
<p class="text-muted"><em><small><?=gettext("Enter any additional options you would like to add to the OpenVPN client configuration here, separated by a semicolon"); ?><br /> </div>
<?=gettext("EXAMPLE:"); ?> <strong>remote server.mysite.com 1194;</strong> or <strong>remote 1.2.3.4 1194;</strong></small></em></p>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr id="comboboxVerbosityLevel"> <tr id="comboboxVerbosityLevel">
<td width="22%" valign="top" class="vncell"><i class="fa fa-info-circle text-muted"></i> <?=gettext("Verbosity level");?></td> <td class="vncell"><a id="help_for_verbosity_level" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Verbosity level");?></td>
<td width="78%" class="vtable"> <td>
<select name="verbosity_level" class="form-control"> <select name="verbosity_level" class="form-control">
<?php <?php
foreach ($openvpn_verbosity_level as $verb_value => $verb_desc) : foreach ($openvpn_verbosity_level as $verb_value => $verb_desc) :
...@@ -1167,11 +997,13 @@ endif; ?> ...@@ -1167,11 +997,13 @@ endif; ?>
<?php <?php
endforeach; ?> endforeach; ?>
</select> </select>
<p class="text-muted"><em><small><?=gettext("Each level shows all info from the previous levels. Level 3 is recommended if you want a good summary of what's happening without being swamped by output"); ?>.<br /> <br /> <div class="hidden" for="help_for_verbosity_level">
<strong>none</strong> -- <?=gettext("No output except fatal errors"); ?>. <br /> <?=gettext("Each level shows all info from the previous levels. Level 3 is recommended if you want a good summary of what's happening without being swamped by output"); ?>.<br /> <br />
<strong>default</strong>-<strong>4</strong> -- <?=gettext("Normal usage range"); ?>. <br /> <strong>none</strong> -- <?=gettext("No output except fatal errors"); ?>. <br />
<strong>5</strong> -- <?=gettext("Output R and W characters to the console for each packet read and write, uppercase is used for TCP/UDP packets and lowercase is used for TUN/TAP packets"); ?>. <br /> <strong>default</strong>-<strong>4</strong> -- <?=gettext("Normal usage range"); ?>. <br />
<strong>6</strong>-<strong>11</strong> -- <?=gettext("Debug info range"); ?>.</small></em></p> <strong>5</strong> -- <?=gettext("Output R and W characters to the console for each packet read and write, uppercase is used for TCP/UDP packets and lowercase is used for TUN/TAP packets"); ?>. <br />
<strong>6</strong>-<strong>11</strong> -- <?=gettext("Debug info range"); ?>.
</div>
</td> </td>
</tr> </tr>
...@@ -1180,7 +1012,7 @@ endif; ?> ...@@ -1180,7 +1012,7 @@ endif; ?>
<br /> <br />
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="icons"> <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="icons">
<tr> <tr>
<td width="22%" valign="top">&nbsp;</td> <td>&nbsp;</td>
<td width="78%"> <td width="78%">
<input name="save" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> <input name="save" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<input name="act" type="hidden" value="<?=$act;?>" /> <input name="act" type="hidden" value="<?=$act;?>" />
...@@ -1254,24 +1086,4 @@ endif; ?> ...@@ -1254,24 +1086,4 @@ endif; ?>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
<?php
/* local utility functions */
function set_checked($var, & $chk)
{
if ($var) {
$chk = "checked=\"checked\"";
} else {
$chk = "";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment