Commit 50e27fc8 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) refactor/cleanup vpn_openvpn_csc.php

parent fc81da17
...@@ -25,258 +25,179 @@ ...@@ -25,258 +25,179 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("openvpn.inc"); require_once("openvpn.inc");
require_once("services.inc"); require_once("services.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
function openvpn_cleanup_csc($common_name)
{
@unlink('/var/etc/openvpn-csc/' . basename($common_name));
}
function openvpn_delete_csc(&$settings)
{
@unlink("/var/etc/openvpn-csc/{$settings['common_name']}");
}
$pgtitle = array(gettext("OpenVPN"), gettext("Client Specific Override")); $pgtitle = array(gettext("OpenVPN"), gettext("Client Specific Override"));
$shortcut_section = "openvpn"; $shortcut_section = "openvpn";
// define all fields used in this form
$all_form_fields = "custom_options,disable,common_name,block,description
,tunnel_network,local_network,local_networkv6,remote_network
,remote_networkv6,gwredir,push_reset,dns_domain,dns_server1
,dns_server2,dns_server3,dns_server4,ntp_server1,ntp_server2
,netbios_enable,netbios_ntype,netbios_scope,wins_server1
,wins_server2";
// read config.
if (!isset($config['openvpn']['openvpn-csc'])) { if (!isset($config['openvpn']['openvpn-csc'])) {
$config['openvpn']['openvpn-csc'] = array(); $config['openvpn']['openvpn-csc'] = array();
} }
$a_csc = &$config['openvpn']['openvpn-csc']; $a_csc = &$config['openvpn']['openvpn-csc'];
if (is_numericint($_GET['id'])) { $vpnid = 0;
$id = $_GET['id']; $act=null;
} if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (isset($_POST['id']) && is_numericint($_POST['id'])) { $pconfig = array();
$id = $_POST['id']; if (isset($_GET['act'])) {
$act = $_GET['act'];
}
if (isset($_GET['id']) && is_numericint($_GET['id'])) {
$id = $_GET['id'];
}
if ($act=="edit" && isset($id) && isset($a_csc[$id])) {
// 1 on 1 copy of config attributes
foreach (explode(",",$all_form_fields) as $fieldname) {
$fieldname = trim($fieldname);
if(isset($a_csc[$id][$fieldname])) {
$pconfig[$fieldname] = $a_csc[$id][$fieldname];
} elseif (!isset($pconfig[$fieldname])) {
// initialize element
$pconfig[$fieldname] = null;
}
}
} else {
// init all form attributes
foreach (explode(",",$all_form_fields) as $fieldname) {
$fieldname = trim($fieldname);
if (!isset($pconfig[$fieldname])) {
$pconfig[$fieldname] = null;
}
}
}
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
$input_errors = array();
$pconfig = $_POST;
if (isset($_POST['act'])) {
$act = $_POST['act'];
}
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
$id = $_POST['id'];
}
if ($act == "del") {
if (!isset($a_csc[$id])) {
redirectHeader("vpn_openvpn_csc.php");
exit;
}
@unlink("/var/etc/openvpn-csc/{$a_csc[$id]['common_name']}");
unset($a_csc[$id]);
write_config();
} else {
/* perform validations */
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'Tunnel network')) {
$input_errors[] = $result;
}
if ($result = openvpn_validate_cidr($pconfig['local_network'], 'IPv4 Local Network', true, "ipv4")) {
$input_errors[] = $result;
}
if ($result = openvpn_validate_cidr($pconfig['local_networkv6'], 'IPv6 Local Network', true, "ipv6")) {
$input_errors[] = $result;
}
if ($result = openvpn_validate_cidr($pconfig['remote_network'], 'IPv4 Remote Network', true, "ipv4")) {
$input_errors[] = $result;
}
if ($result = openvpn_validate_cidr($pconfig['remote_networkv6'], 'IPv6 Remote Network', true, "ipv6")) {
$input_errors[] = $result;
}
if (!empty($pconfig['dns_server_enable'])) {
if (!empty($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1']))) {
$input_errors[] = gettext("The field 'DNS Server #1' must contain a valid IP address");
}
if (!empty($pconfig['dns_server2']) && !is_ipaddr(trim($pconfig['dns_server2']))) {
$input_errors[] = gettext("The field 'DNS Server #2' must contain a valid IP address");
}
if (!empty($pconfig['dns_server3']) && !is_ipaddr(trim($pconfig['dns_server3']))) {
$input_errors[] = gettext("The field 'DNS Server #3' must contain a valid IP address");
}
if (!empty($pconfig['dns_server4']) && !is_ipaddr(trim($pconfig['dns_server4']))) {
$input_errors[] = gettext("The field 'DNS Server #4' must contain a valid IP address");
}
}
if (!empty($pconfig['ntp_server_enable'])) {
if (!empty($pconfig['ntp_server1']) && !is_ipaddr(trim($pconfig['ntp_server1']))) {
$input_errors[] = gettext("The field 'NTP Server #1' must contain a valid IP address");
}
if (!empty($pconfig['ntp_server2']) && !is_ipaddr(trim($pconfig['ntp_server2']))) {
$input_errors[] = gettext("The field 'NTP Server #2' must contain a valid IP address");
}
if (!empty($pconfig['ntp_server3']) && !is_ipaddr(trim($pconfig['ntp_server3']))) {
$input_errors[] = gettext("The field 'NTP Server #3' must contain a valid IP address");
}
if (!empty($pconfig['ntp_server4']) && !is_ipaddr(trim($pconfig['ntp_server4']))) {
$input_errors[] = gettext("The field 'NTP Server #4' must contain a valid IP address");
}
}
if (!empty($pconfig['netbios_enable'])) {
if ($pconfig['wins_server_enable']) {
if (!empty($pconfig['wins_server1']) && !is_ipaddr(trim($pconfig['wins_server1']))) {
$input_errors[] = gettext("The field 'WINS Server #1' must contain a valid IP address");
}
if (!empty($pconfig['wins_server2']) && !is_ipaddr(trim($pconfig['wins_server2']))) {
$input_errors[] = gettext("The field 'WINS Server #2' must contain a valid IP address");
}
}
}
$reqdfields[] = 'common_name';
$reqdfieldsn[] = 'Common name';
do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
if (count($input_errors) == 0) {
$csc = array();
// 1 on 1 copy of config attributes
foreach (explode(",",$all_form_fields) as $fieldname) {
$fieldname = trim($fieldname);
if(isset($pconfig[$fieldname])) {
$csc[$fieldname] = $pconfig[$fieldname];
}
}
// handle fields with some kind of logic
if (!empty($pconfig['disable']) && $pconfig['disable'] == "yes") {
$csc['disable'] = true;
}
if (isset($id) && $a_csc[$id]) {
$old_csc_cn = $a_csc[$id]['common_name'];
$a_csc[$id] = $csc;
} else {
$a_csc[] = $csc;
}
if (!empty($old_csc_cn)) {
@unlink('/var/etc/openvpn-csc/' . basename($old_csc_cn));
}
openvpn_resync_csc($csc);
write_config();
header("Location: vpn_openvpn_csc.php");
exit;
}
}
} }
$act = $_GET['act']; // escape form output before processing
if (isset($_POST['act'])) { legacy_html_escape_form_data($pconfig);
$act = $_POST['act'];
}
if ($_GET['act'] == "del") {
if (!$a_csc[$id]) {
redirectHeader("vpn_openvpn_csc.php");
exit;
}
openvpn_delete_csc($a_csc[$id]);
unset($a_csc[$id]);
write_config();
$savemsg = gettext("Client Specific Override successfully deleted")."<br />";
}
if ($_GET['act']=="edit") {
if (isset($id) && $a_csc[$id]) {
$pconfig['custom_options'] = $a_csc[$id]['custom_options'];
$pconfig['disable'] = isset($a_csc[$id]['disable']);
$pconfig['common_name'] = $a_csc[$id]['common_name'];
$pconfig['block'] = $a_csc[$id]['block'];
$pconfig['description'] = $a_csc[$id]['description'];
$pconfig['tunnel_network'] = $a_csc[$id]['tunnel_network'];
$pconfig['local_network'] = $a_csc[$id]['local_network'];
$pconfig['local_networkv6'] = $a_csc[$id]['local_networkv6'];
$pconfig['remote_network'] = $a_csc[$id]['remote_network'];
$pconfig['remote_networkv6'] = $a_csc[$id]['remote_networkv6'];
$pconfig['gwredir'] = $a_csc[$id]['gwredir'];
$pconfig['push_reset'] = $a_csc[$id]['push_reset'];
$pconfig['dns_domain'] = $a_csc[$id]['dns_domain'];
if ($pconfig['dns_domain']) {
$pconfig['dns_domain_enable'] = true;
}
$pconfig['dns_server1'] = $a_csc[$id]['dns_server1'];
$pconfig['dns_server2'] = $a_csc[$id]['dns_server2'];
$pconfig['dns_server3'] = $a_csc[$id]['dns_server3'];
$pconfig['dns_server4'] = $a_csc[$id]['dns_server4'];
if ($pconfig['dns_server1'] ||
$pconfig['dns_server2'] ||
$pconfig['dns_server3'] ||
$pconfig['dns_server4']) {
$pconfig['dns_server_enable'] = true;
}
$pconfig['ntp_server1'] = $a_csc[$id]['ntp_server1'];
$pconfig['ntp_server2'] = $a_csc[$id]['ntp_server2'];
if ($pconfig['ntp_server1'] ||
$pconfig['ntp_server2']) {
$pconfig['ntp_server_enable'] = true;
}
$pconfig['netbios_enable'] = $a_csc[$id]['netbios_enable'];
$pconfig['netbios_ntype'] = $a_csc[$id]['netbios_ntype'];
$pconfig['netbios_scope'] = $a_csc[$id]['netbios_scope'];
$pconfig['wins_server1'] = $a_csc[$id]['wins_server1'];
$pconfig['wins_server2'] = $a_csc[$id]['wins_server2'];
if ($pconfig['wins_server1'] ||
$pconfig['wins_server2']) {
$pconfig['wins_server_enable'] = true;
}
$pconfig['nbdd_server1'] = $a_csc[$id]['nbdd_server1'];
if ($pconfig['nbdd_server1']) {
$pconfig['nbdd_server_enable'] = true;
}
}
}
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
/* input validation */
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'Tunnel network')) {
$input_errors[] = $result;
}
if ($result = openvpn_validate_cidr($pconfig['local_network'], 'IPv4 Local Network', true, "ipv4")) {
$input_errors[] = $result;
}
if ($result = openvpn_validate_cidr($pconfig['local_networkv6'], 'IPv6 Local Network', true, "ipv6")) {
$input_errors[] = $result;
}
if ($result = openvpn_validate_cidr($pconfig['remote_network'], 'IPv4 Remote Network', true, "ipv4")) {
$input_errors[] = $result;
}
if ($result = openvpn_validate_cidr($pconfig['remote_networkv6'], 'IPv6 Remote Network', true, "ipv6")) {
$input_errors[] = $result;
}
if ($pconfig['dns_server_enable']) {
if (!empty($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1']))) {
$input_errors[] = gettext("The field 'DNS Server #1' must contain a valid IP address");
}
if (!empty($pconfig['dns_server2']) && !is_ipaddr(trim($pconfig['dns_server2']))) {
$input_errors[] = gettext("The field 'DNS Server #2' must contain a valid IP address");
}
if (!empty($pconfig['dns_server3']) && !is_ipaddr(trim($pconfig['dns_server3']))) {
$input_errors[] = gettext("The field 'DNS Server #3' must contain a valid IP address");
}
if (!empty($pconfig['dns_server4']) && !is_ipaddr(trim($pconfig['dns_server4']))) {
$input_errors[] = gettext("The field 'DNS Server #4' must contain a valid IP address");
}
}
if ($pconfig['ntp_server_enable']) {
if (!empty($pconfig['ntp_server1']) && !is_ipaddr(trim($pconfig['ntp_server1']))) {
$input_errors[] = gettext("The field 'NTP Server #1' must contain a valid IP address");
}
if (!empty($pconfig['ntp_server2']) && !is_ipaddr(trim($pconfig['ntp_server2']))) {
$input_errors[] = gettext("The field 'NTP Server #2' must contain a valid IP address");
}
if (!empty($pconfig['ntp_server3']) && !is_ipaddr(trim($pconfig['ntp_server3']))) {
$input_errors[] = gettext("The field 'NTP Server #3' must contain a valid IP address");
}
if (!empty($pconfig['ntp_server4']) && !is_ipaddr(trim($pconfig['ntp_server4']))) {
$input_errors[] = gettext("The field 'NTP Server #4' must contain a valid IP address");
}
}
if ($pconfig['netbios_enable']) {
if ($pconfig['wins_server_enable']) {
if (!empty($pconfig['wins_server1']) && !is_ipaddr(trim($pconfig['wins_server1']))) {
$input_errors[] = gettext("The field 'WINS Server #1' must contain a valid IP address");
}
if (!empty($pconfig['wins_server2']) && !is_ipaddr(trim($pconfig['wins_server2']))) {
$input_errors[] = gettext("The field 'WINS Server #2' must contain a valid IP address");
}
}
if ($pconfig['nbdd_server_enable']) {
if (!empty($pconfig['nbdd_server1']) && !is_ipaddr(trim($pconfig['nbdd_server1']))) {
$input_errors[] = gettext("The field 'NetBIOS Data Distribution Server #1' must contain a valid IP address");
}
}
}
$reqdfields[] = 'common_name';
$reqdfieldsn[] = 'Common name';
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (!$input_errors) {
$csc = array();
$csc['custom_options'] = $pconfig['custom_options'];
if ($_POST['disable'] == "yes") {
$csc['disable'] = true;
}
$csc['common_name'] = $pconfig['common_name'];
$csc['block'] = $pconfig['block'];
$csc['description'] = $pconfig['description'];
$csc['tunnel_network'] = $pconfig['tunnel_network'];
$csc['local_network'] = $pconfig['local_network'];
$csc['local_networkv6'] = $pconfig['local_networkv6'];
$csc['remote_network'] = $pconfig['remote_network'];
$csc['remote_networkv6'] = $pconfig['remote_networkv6'];
$csc['gwredir'] = $pconfig['gwredir'];
$csc['push_reset'] = $pconfig['push_reset'];
if ($pconfig['dns_domain_enable']) {
$csc['dns_domain'] = $pconfig['dns_domain'];
}
if ($pconfig['dns_server_enable']) {
$csc['dns_server1'] = $pconfig['dns_server1'];
$csc['dns_server2'] = $pconfig['dns_server2'];
$csc['dns_server3'] = $pconfig['dns_server3'];
$csc['dns_server4'] = $pconfig['dns_server4'];
}
if ($pconfig['ntp_server_enable']) {
$csc['ntp_server1'] = $pconfig['ntp_server1'];
$csc['ntp_server2'] = $pconfig['ntp_server2'];
}
$csc['netbios_enable'] = $pconfig['netbios_enable'];
$csc['netbios_ntype'] = $pconfig['netbios_ntype'];
$csc['netbios_scope'] = $pconfig['netbios_scope'];
if ($pconfig['netbios_enable']) {
if ($pconfig['wins_server_enable']) {
$csc['wins_server1'] = $pconfig['wins_server1'];
$csc['wins_server2'] = $pconfig['wins_server2'];
}
if ($pconfig['dns_server_enable']) {
$csc['nbdd_server1'] = $pconfig['nbdd_server1'];
}
}
if (isset($id) && $a_csc[$id]) {
$old_csc_cn = $a_csc[$id]['common_name'];
$a_csc[$id] = $csc;
} else {
$a_csc[] = $csc;
}
if (!empty($old_csc_cn)) {
openvpn_cleanup_csc($old_csc_cn);
}
openvpn_resync_csc($csc);
write_config();
header("Location: vpn_openvpn_csc.php");
exit;
}
}
include("head.inc"); include("head.inc");
...@@ -287,6 +208,41 @@ include("head.inc"); ...@@ -287,6 +208,41 @@ include("head.inc");
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
$( document ).ready(function() {
// link delete buttons
$(".act_delete").click(function(){
var id = $(this).attr("id").split('_').pop(-1);
BootstrapDialog.show({
type:BootstrapDialog.TYPE_INFO,
title: "<?= gettext("OpenVPN");?>",
message: "<?= gettext("Do you really want to delete this csc?"); ?>",
buttons: [{
label: "<?= gettext("No");?>",
action: function(dialogRef) {
dialogRef.close();
}}, {
label: "<?= gettext("Yes");?>",
action: function(dialogRef) {
$.post(window.location, {act: 'del', id:id}, function(data) {
location.reload();
});
dialogRef.close();
}
}]
});
});
// init form (old stuff)
if (document.iform != undefined) {
dns_domain_change();
dns_server_change();
wins_server_change();
ntp_server_change();
netbios_change();
}
});
function dns_domain_change() { function dns_domain_change() {
if (document.iform.dns_domain_enable.checked) if (document.iform.dns_domain_enable.checked)
...@@ -377,66 +333,52 @@ if ($act!="new" && $act!="edit") { ...@@ -377,66 +333,52 @@ if ($act!="new" && $act!="edit") {
<?php if ($act=="new" || $act=="edit") : <?php if ($act=="new" || $act=="edit") :
?> ?>
<form action="vpn_openvpn_csc.php" method="post" name="iform" id="iform" onsubmit="presubmit()"> <form action="vpn_openvpn_csc.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("General information"); ?></td> <td width="22%"><?=gettext("General information"); ?></td>
<td width="78%" align="right">
<small><?=gettext("full help"); ?> </small>
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_opnvpn_server" type="button"></i></a>
</td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td> <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="78%" class="vtable"> <td width="78%" class="vtable">
<table border="0" cellpadding="0" cellspacing="0" summary="enable disable"> <input name="disable" type="checkbox" value="yes" <?= !empty($pconfig['disable']) ? "checked=\"checked\"" : "";?> />
<tr> <div class="hidden" for="help_for_disable">
<td> <?=gettext("Set this option to disable this client-specific override without removing it from the list"); ?>
<?php set_checked($pconfig['disable'], $chk); ?> </div>
<input name="disable" type="checkbox" value="yes" <?=$chk;?> />
</td>
<td>
&nbsp;
<span class="vexpl">
<strong><?=gettext("Disable this override"); ?></strong><br />
</span>
</td>
</tr>
</table>
<p class="text-muted"><em><small><?=gettext("Set this option to disable this client-specific override without removing it from the list"); ?>.</small></em></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Common name"); ?></td> <td width="22%" valign="top" class="vncellreq"><a id="help_for_common_name" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Common name"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="common_name" type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($pconfig['common_name']);?>" /> <input name="common_name" type="text" class="formfld unknown" size="30" value="<?=$pconfig['common_name'];?>" />
<p class="text-muted"><em><small><?=gettext("Enter the client's X.509 common name here"); ?>.</small></em></p> <div class="hidden" for="help_for_common_name">
<?=gettext("Enter the client's X.509 common name here"); ?>.
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="22%" valign="top" 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 width="78%" class="vtable">
<input name="description" type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($pconfig['description']);?>" /> <input name="description" type="text" class="formfld 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">
<?=gettext("You may enter a description here for your reference (not parsed)"); ?>.
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Connection blocking"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_block" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Connection blocking"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0" summary="connection blocking"> <input name="block" type="checkbox" value="yes" <?= !empty($pconfig['block']) ? "checked=\"checked\"" : "";?> />
<tr> <div class="hidden" for="help_for_block">
<td> <?=gettext("Block this client connection based on its common name"); ?>.<br/>
<?php set_checked($pconfig['block'], $chk); ?> <?=gettext("Don't use this option to permanently disable a " .
<input name="block" type="checkbox" value="yes" <?=$chk;?> /> "client due to a compromised key or password. " .
</td> "Use a CRL (certificate revocation list) instead"); ?>.
<td> </div>
<span class="vexpl">
<?=gettext("Block this client connection based on its common name"); ?>.
</span>
</td>
</tr>
</table>
<p class="text-muted"><em><small><?=gettext("Don't use this option to permanently disable a " .
"client due to a compromised key or password. " .
"Use a CRL (certificate revocation list) instead"); ?>.</small></em></p>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -446,82 +388,83 @@ if ($act!="new" && $act!="edit") { ...@@ -446,82 +388,83 @@ if ($act!="new" && $act!="edit") {
<td colspan="2" valign="top" class="listtopic"><?=gettext("Tunnel Settings"); ?></td> <td colspan="2" valign="top" class="listtopic"><?=gettext("Tunnel Settings"); ?></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Tunnel Network"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_tunnel_network" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Tunnel Network"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="tunnel_network" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['tunnel_network']);?>" /> <input name="tunnel_network" type="text" class="formfld 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 id="local_optsv4"> <tr id="local_optsv4">
<td width="22%" valign="top" class="vncell"><?=gettext("IPv4 Local Network/s"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_local_network" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv4 Local Network/s"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="local_network" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['local_network']);?>" /> <input name="local_network" type="text" class="formfld unknown" size="40" value="<?=$pconfig['local_network'];?>" />
<p class="text-muted"><em><small><?=gettext("These are the IPv4 networks that will be accessible " . <div class="hidden" for="help_for_local_network">
"from this particular client. Expressed as a comma-separated list of one or more CIDR ranges."); ?> <?=gettext("These are the IPv4 networks that will be accessible " .
<br /><?=gettext("NOTE: You do not need to specify networks here if they have " . "from this particular client. Expressed as a comma-separated list of one or more CIDR ranges."); ?>
"already been defined on the main server configuration.");?></small></em></p> <br /><?=gettext("NOTE: You do not need to specify networks here if they have " .
"already been defined on the main server configuration.");?>
</div>
</td> </td>
</tr> </tr>
<tr id="local_optsv6"> <tr id="local_optsv6">
<td width="22%" valign="top" class="vncell"><?=gettext("IPv6 Local Network/s"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_local_networkv6" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPv6 Local Network/s"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<input name="local_networkv6" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['local_networkv6']);?>" /> <input name="local_networkv6" type="text" class="formfld unknown" size="40" value="<?=$pconfig['local_networkv6'];?>" />
<p class="text-muted"><em><small><?=gettext("These are the IPv6 networks that will be accessible " . <div class="hidden" for="help_for_local_networkv6">
"from this particular client. Expressed as a comma-separated list of one or more IP/PREFIX networks."); ?> <?=gettext("These are the IPv6 networks that will be accessible " .
<br /><?=gettext("NOTE: You do not need to specify networks here if they have " . "from this particular client. Expressed as a comma-separated list of one or more IP/PREFIX networks."); ?><br />
"already been defined on the main server configuration.");?></small></em></p> <?=gettext("NOTE: You do not need to specify networks here if they have " .
"already been defined on the main server configuration.");?>
</div>
</td> </td>
</tr> </tr>
<tr id="remote_optsv4"> <tr id="remote_optsv4">
<td width="22%" valign="top" class="vncell"><?=gettext("IPv4 Remote Network/s"); ?></td> <td width="22%" valign="top" 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 width="78%" class="vtable">
<input name="remote_network" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['remote_network']);?>" /> <input name="remote_network" type="text" class="formfld unknown" size="40" value="<?=$pconfig['remote_network'];?>" />
<p class="text-muted"><em><small><?=gettext("These are the IPv4 networks that will be routed " . <div class="hidden" for="help_for_remote_network">
"to this client specifically using iroute, so that a site-to-site " . <?=gettext("These are the IPv4 networks that will be routed " .
"VPN can be established. " . "to this client specifically using iroute, so that a site-to-site " .
"Expressed as a comma-separated list of one or more CIDR ranges. " . "VPN can be established. " .
"You may leave this blank if there are no client-side networks to " . "Expressed as a comma-separated list of one or more CIDR ranges. " .
"be routed"); ?>. "You may leave this blank if there are no client-side networks to " .
<br /><?=gettext("NOTE: Remember to add these subnets to the " . "be routed"); ?>.<br />
"IPv4 Remote Networks list on the corresponding OpenVPN server settings.");?></small></em></p> <?=gettext("NOTE: Remember to add these subnets to the " .
"IPv4 Remote Networks list on the corresponding OpenVPN server settings.");?>
</div>
</td> </td>
</tr> </tr>
<tr id="remote_optsv6"> <tr id="remote_optsv6">
<td width="22%" valign="top" class="vncell"><?=gettext("IPv6 Remote Network/s"); ?></td> <td width="22%" valign="top" 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 width="78%" class="vtable">
<input name="remote_networkv6" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['remote_networkv6']);?>" /> <input name="remote_networkv6" type="text" class="formfld unknown" size="40" value="<?=$pconfig['remote_networkv6'];?>" />
<p class="text-muted"><em><small><?=gettext("These are the IPv6 networks that will be routed " . <div class="hidden" for="help_for_remote_networkv6">
"to this client specifically using iroute, so that a site-to-site " . <?=gettext("These are the IPv6 networks that will be routed " .
"VPN can be established. " . "to this client specifically using iroute, so that a site-to-site " .
"Expressed as a comma-separated list of one or more IP/PREFIX networks. " . "VPN can be established. " .
"You may leave this blank if there are no client-side networks to " . "Expressed as a comma-separated list of one or more IP/PREFIX networks. " .
"be routed"); ?>. "You may leave this blank if there are no client-side networks to " .
<br /><?=gettext("NOTE: Remember to add these subnets to the " . "be routed"); ?>.<br />
"IPv6 Remote Networks list on the corresponding OpenVPN server settings.");?></small></em></p> <?=gettext("NOTE: Remember to add these subnets to the " .
"IPv6 Remote Networks list on the corresponding OpenVPN server settings.");?>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Redirect Gateway"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_gwredir" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Redirect Gateway"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0" summary="redirect gateway"> <input name="gwredir" type="checkbox" value="yes" <?= !empty($pconfig['gwredir']) ? "checked=\"checked\"" : "";?> />
<tr> <div class="hidden" for="help_for_gwredir">
<td> <?=gettext("Force all client generated traffic through the tunnel"); ?>.
<?php set_checked($pconfig['gwredir'], $chk); ?> </div>
<input name="gwredir" type="checkbox" value="yes" <?=$chk;?> />
</td>
<td>
<span class="vexpl">
<?=gettext("Force all client generated traffic through the tunnel"); ?>.
</span>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -531,247 +474,127 @@ if ($act!="new" && $act!="edit") { ...@@ -531,247 +474,127 @@ if ($act!="new" && $act!="edit") {
<td colspan="2" valign="top" class="listtopic"><?=gettext("Client Settings"); ?></td> <td colspan="2" valign="top" class="listtopic"><?=gettext("Client Settings"); ?></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Server Definitions"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_push_reset" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Server Definitions"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0" summary="server definitions"> <input name="push_reset" type="checkbox" value="yes" <?= !empty($pconfig['push_reset']) ? "checked=\"checked\"" : "";?> />
<tr> <div class="hidden" for="help_for_push_reset">
<td> <?=gettext("Prevent this client from receiving any server-defined client settings"); ?>.
<?php set_checked($pconfig['push_reset'], $chk); ?> </div>
<input name="push_reset" type="checkbox" value="yes" <?=$chk;?> />
</td>
<td>
<span class="vexpl">
<?=gettext("Prevent this client from receiving any server-defined client settings"); ?>.
</span>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_dns_domain" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("DNS Default Domain"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0" summary="dns default domain"> <input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?= !empty($pconfig['dns_domain']) ? "checked=\"checked\"" : "";?> onclick="dns_domain_change()" />
<tr> <div id="dns_domain_data">
<td> <input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=$pconfig['dns_domain'];?>" />
<?php set_checked($pconfig['dns_domain_enable'], $chk); ?> </div>
<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onclick="dns_domain_change()" /> <div class="hidden" for="help_for_dns_domain">
</td> <?=gettext("Provide a default domain name to clients"); ?><br />
<td> </div>
<span class="vexpl">
<?=gettext("Provide a default domain name to clients"); ?><br />
</span>
</td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="0" id="dns_domain_data" summary="dns domain data">
<tr>
<td>
<input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>" />
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_dns_server" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("DNS Servers"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0" summary="dns servers"> <input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=!empty($pconfig['dns_server1']) || !empty($pconfig['dns_server2']) || !empty($pconfig['dns_server3']) || !empty($pconfig['dns_server4']) ? "checked=\"checked\"" : "" ;?> onclick="dns_server_change()" />
<tr> <div id="dns_server_data">
<td> <?=gettext("Server"); ?> #1:&nbsp;
<?php set_checked($pconfig['dns_server_enable'], $chk); ?> <input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>" />
<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onclick="dns_server_change()" /> <?=gettext("Server"); ?> #2:&nbsp;
</td> <input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>" />
<td> <?=gettext("Server"); ?> #3:&nbsp;
<span class="vexpl"> <input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>" />
<?=gettext("Provide a DNS server list to clients"); ?><br /> <?=gettext("Server"); ?> #4:&nbsp;
</span> <input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>" />
</td> </div>
</tr> <div class="hidden" for="help_for_dns_server">
</table> <?=gettext("Provide a DNS server list to clients"); ?>
<table border="0" cellpadding="2" cellspacing="0" id="dns_server_data" summary="dns server list"> </div>
<tr>
<td>
<span class="vexpl">
<?=gettext("Server"); ?> #1:&nbsp;
</span>
<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>" />
</td>
</tr>
<tr>
<td>
<span class="vexpl">
<?=gettext("Server"); ?> #2:&nbsp;
</span>
<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>" />
</td>
</tr>
<tr>
<td>
<span class="vexpl">
<?=gettext("Server"); ?> #3:&nbsp;
</span>
<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>" />
</td>
</tr>
<tr>
<td>
<span class="vexpl">
<?=gettext("Server"); ?> #4:&nbsp;
</span>
<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>" />
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("NTP Servers"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_ntp_server" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("NTP Servers"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0" summary="ntp servers"> <input name="ntp_server_enable" type="checkbox" id="ntp_server_enable" value="yes" <?=!empty($pconfig['ntp_server1']) || !empty($pconfig['ntp_server2']) ? "checked=\"checked\"" : "" ;?> onclick="ntp_server_change()" />
<tr> <div id="ntp_server_data">
<td> <?=gettext("Server"); ?> #1:&nbsp;
<?php set_checked($pconfig['ntp_server_enable'], $chk); ?> <input name="ntp_server1" type="text" class="formfld unknown" id="ntp_server1" size="20" value="<?=$pconfig['ntp_server1'];?>" />
<input name="ntp_server_enable" type="checkbox" id="ntp_server_enable" value="yes" <?=$chk;?> onclick="ntp_server_change()" /> <?=gettext("Server"); ?> #2:&nbsp;
</td> <input name="ntp_server2" type="text" class="formfld unknown" id="ntp_server2" size="20" value="<?=$pconfig['ntp_server2'];?>" />
<td> </div>
<span class="vexpl"> <div class="hidden" for="help_for_ntp_server">
<?=gettext("Provide a NTP server list to clients"); ?><br /> <?=gettext("Provide a NTP server list to clients"); ?>
</span> </div>
</td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="0" id="ntp_server_data" summary="ntp server list">
<tr>
<td>
<span class="vexpl">
<?=gettext("Server"); ?> #1:&nbsp;
</span>
<input name="ntp_server1" type="text" class="formfld unknown" id="ntp_server1" size="20" value="<?=$pconfig['ntp_server1'];?>" />
</td>
</tr>
<tr>
<td>
<span class="vexpl">
<?=gettext("Server"); ?> #2:&nbsp;
</span>
<input name="ntp_server2" type="text" class="formfld unknown" id="ntp_server2" size="20" value="<?=$pconfig['ntp_server2'];?>" />
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("NetBIOS Options"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_netbios_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("NetBIOS Options"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0" summary="netbios options"> <input name="netbios_enable" type="checkbox" id="netbios_enable" value="yes" <?=!empty($pconfig['netbios_enable']) ? "checked=\"checked\"" : "" ;?> onclick="netbios_change()" />
<tr> <?=gettext("Enable NetBIOS over TCP/IP");?>
<td> <div class="hidden" for="help_for_netbios_enable">
<?php set_checked($pconfig['netbios_enable'], $chk); ?> <?=gettext("If this option is not set, all NetBIOS-over-TCP/IP options (including WINS) will be disabled"); ?>.
<input name="netbios_enable" type="checkbox" id="netbios_enable" value="yes" <?=$chk;?> onclick="netbios_change()" /> </div>
</td>
<td> <div id="netbios_data">
<span class="vexpl"> <?=gettext("Node Type"); ?>:&nbsp;
<?=gettext("Enable NetBIOS over TCP/IP"); ?><br /> <select name='netbios_ntype' class="formselect">
</span> <?php
</td> foreach ($netbios_nodetypes as $type => $name) :
</tr> $selected = "";
</table> if ($pconfig['netbios_ntype'] == $type) {
<?=gettext("If this option is not set, all NetBIOS-over-TCP/IP options (including WINS) will be disabled"); ?>. $selected = "selected=\"selected\"";
<br /> }
<table border="0" cellpadding="2" cellspacing="0" id="netbios_data" summary="netbios options"> ?>
<tr> <option value="<?=$type;
<td>
<br />
<span class="vexpl">
<?=gettext("Node Type"); ?>:&nbsp;
</span>
<select name='netbios_ntype' class="formselect">
<?php
foreach ($netbios_nodetypes as $type => $name) :
$selected = "";
if ($pconfig['netbios_ntype'] == $type) {
$selected = "selected=\"selected\"";
}
?>
<option value="<?=$type;
?>" <?=$selected; ?>" <?=$selected;
?>><?=$name;?></option> ?>><?=$name;?></option>
<?php <?php
endforeach; ?> endforeach; ?>
</select> </select>
<p class="text-muted"><em><small><?=gettext("Possible options: b-node (broadcasts), p-node " .
"(point-to-point name queries to a WINS server), " . <div class="hidden" for="help_for_netbios_enable">
"m-node (broadcast then query name server), and " . <?=gettext("Possible options: b-node (broadcasts), p-node " .
"h-node (query name server, then broadcast)"); ?>.</small></em></p> "(point-to-point name queries to a WINS server), " .
</td> "m-node (broadcast then query name server), and " .
</tr> "h-node (query name server, then broadcast)"); ?>.
<tr> </div>
<td> Scope ID:&nbsp;
<br /> <input name="netbios_scope" type="text" class="formfld unknown" id="netbios_scope" size="30" value="<?=$pconfig['netbios_scope'];?>" />
<span class="vexpl"> <div class="hidden" for="help_for_netbios_enable">
Scope ID:&nbsp; <?=gettext("A NetBIOS Scope ID provides an extended naming " .
</span> "service for NetBIOS over TCP/IP. The NetBIOS " .
<input name="netbios_scope" type="text" class="formfld unknown" id="netbios_scope" size="30" value="<?=htmlspecialchars($pconfig['netbios_scope']);?>" /> "scope ID isolates NetBIOS traffic on a single " .
<br /> "network to only those nodes with the same " .
<p class="text-muted"><em><small><?=gettext("A NetBIOS Scope ID provides an extended naming " . "NetBIOS scope ID"); ?>.
"service for NetBIOS over TCP/IP. The NetBIOS " . </div>
"scope ID isolates NetBIOS traffic on a single " . </div>
"network to only those nodes with the same " .
"NetBIOS scope ID"); ?>.</small></em></p>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr id="wins_opts"> <tr id="wins_opts">
<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td> <td width="22%" valign="top" class="vncell"><a id="help_for_wins_server" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("WINS Servers"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0" summary="wins servers"> <input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=!empty($pconfig['wins_server1']) || !empty($pconfig['wins_server2']) ? "checked=\"checked\"" : "" ;?> onclick="wins_server_change()" />
<tr> <div id="wins_server_data">
<td> <?=gettext("Server"); ?> #1:
<?php set_checked($pconfig['wins_server_enable'], $chk); ?> <input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=$pconfig['wins_server1'];?>" />
<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onclick="wins_server_change()" /> <?=gettext("Server"); ?> #2:
</td> <input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=$pconfig['wins_server2'];?>" />
<td> </div>
<span class="vexpl"> <div class="hidden" for="help_for_wins_server">
<?=gettext("Provide a WINS server list to clients"); ?><br /> <?=gettext("Provide a WINS server list to clients"); ?>
</span> </div>
</td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="0" id="wins_server_data" summary="wins server list">
<tr>
<td>
<span class="vexpl">
<?=gettext("Server"); ?> #1:&nbsp;
</span>
<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=$pconfig['wins_server1'];?>" />
</td>
</tr>
<tr>
<td>
<span class="vexpl">
<?=gettext("Server"); ?> #2:&nbsp;
</span>
<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=$pconfig['wins_server2'];?>" />
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Advanced"); ?></td> <td width="22%" valign="top" 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 width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0" summary="advanced"> <textarea rows="6" cols="70" name="custom_options" id="custom_options"><?=$pconfig['custom_options'];?></textarea>
<tr> <div class="hidden" for="help_for_custom_options">
<td> <?=gettext("Enter any additional options you would like to add for this client specific override, separated by a semicolon"); ?><br />
<textarea rows="6" cols="70" name="custom_options" id="custom_options"><?=$pconfig['custom_options']; <?=gettext("EXAMPLE: push \"route 10.0.0.0 255.255.255.0\""); ?>;
?></textarea> <p class="text-muted"><em><small><?=gettext("Enter any additional options you would like to add for this client specific override, separated by a semicolon"); ?><br /> </div>
<?=gettext("EXAMPLE: push \"route 10.0.0.0 255.255.255.0\""); ?>;</small></em></p>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -795,7 +618,7 @@ else : ...@@ -795,7 +618,7 @@ else :
?> ?>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped">
<tr> <tr>
<td width="10%" class="listhdrr"><?=gettext("Disabled"); ?></td> <td width="10%" class="listhdrr"><?=gettext("Disabled"); ?></td>
...@@ -822,16 +645,8 @@ else : ...@@ -822,16 +645,8 @@ else :
<?=htmlspecialchars($csc['description']);?> <?=htmlspecialchars($csc['description']);?>
</td> </td>
<td valign="middle" class="list nowrap"> <td valign="middle" class="list nowrap">
<a href="vpn_openvpn_csc.php?act=edit&amp;id=<?=$i;?>"> <a href="vpn_openvpn_csc.php?act=edit&amp;id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<img src="./themes/<?=$g['theme']; <a id="del_<?=$i;?>" title="<?=gettext("delete csc"); ?>" class="act_delete btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
?>/images/icons/icon_e.gif" title="<?=gettext("edit csc"); ?>" width="17" height="17" border="0" alt="edit" />
</a>
&nbsp;
<a href="vpn_openvpn_csc.php?act=del&amp;id=<?=$i;
?>" onclick="return confirm('<?=gettext("Do you really want to delete this csc?"); ?>')">
<img src="/themes/<?=$g['theme'];
?>/images/icons/icon_x.gif" title="<?=gettext("delete csc"); ?>" width="17" height="17" border="0" alt="delete" />
</a>
</td> </td>
</tr> </tr>
<?php <?php
...@@ -840,7 +655,7 @@ else : ...@@ -840,7 +655,7 @@ else :
?> ?>
<tr> <tr>
<td colspan="3"> <td colspan="4">
<p> <p>
<?=gettext("Additional OpenVPN client specific overrides can be added here.");?> <?=gettext("Additional OpenVPN client specific overrides can be added here.");?>
</p> </p>
...@@ -857,26 +672,4 @@ endif; ?> ...@@ -857,26 +672,4 @@ endif; ?>
</div> </div>
</section> </section>
<script type="text/javascript">
//<![CDATA[
dns_domain_change();
dns_server_change();
wins_server_change();
ntp_server_change();
netbios_change();
//]]>
</script>
<?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