summaryrefslogtreecommitdiffstats
path: root/usr/local/www/vpn_openvpn_csc.php
diff options
context:
space:
mode:
authorMatthew Grooms <mgrooms@pfsense.org>2008-08-26 04:48:04 +0000
committerMatthew Grooms <mgrooms@pfsense.org>2008-08-26 04:48:04 +0000
commitd799787e49e0a535acbc881b8e8944b860e25e47 (patch)
treecb1036a4ae588bc7e7312262d53596ff0e246400 /usr/local/www/vpn_openvpn_csc.php
parent667725cea8c2b64ce6603aa93320e39f73bff8f3 (diff)
downloadpfsense-d799787e49e0a535acbc881b8e8944b860e25e47.zip
pfsense-d799787e49e0a535acbc881b8e8944b860e25e47.tar.gz
Rework most of the OpenVPN support. The interfaces have been updated to
not use the pkg system and the configuration has been migrated to an openvpn prefix. The centralized user and certificate manager is now used to support the openvpn configurations. Most of the files removed in this commit were not being referenced. This commit also splits out the certificate management components into a new system menu item.
Diffstat (limited to 'usr/local/www/vpn_openvpn_csc.php')
-rw-r--r--usr/local/www/vpn_openvpn_csc.php730
1 files changed, 730 insertions, 0 deletions
diff --git a/usr/local/www/vpn_openvpn_csc.php b/usr/local/www/vpn_openvpn_csc.php
new file mode 100644
index 0000000..1866f75
--- /dev/null
+++ b/usr/local/www/vpn_openvpn_csc.php
@@ -0,0 +1,730 @@
+<?php
+/*
+ vpn_openvpn_csc.php
+
+ Copyright (C) 2008 Shrew Soft Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+##|+PRIV
+##|*IDENT=page-openvpn-csc
+##|*NAME=OpenVPN: Client Specific Override page
+##|*DESCR=Allow access to the 'OpenVPN: Client Specific Override' page.
+##|*MATCH=vpn_openvpn_csc.php*
+##|-PRIV
+
+
+require("guiconfig.inc");
+
+$pgtitle = array("OpenVPN", "Client Specific Override");
+
+if (!is_array($config['openvpn']['openvpn-csc']))
+ $config['openvpn']['openvpn-csc'] = array();
+
+$a_csc = &$config['openvpn']['openvpn-csc'];
+
+$id = $_GET['id'];
+if (isset($_POST['id']))
+ $id = $_POST['id'];
+
+$act = $_GET['act'];
+if (isset($_POST['act']))
+ $act = $_POST['act'];
+
+if ($_GET['act'] == "del") {
+
+ if (!$a_csc[$id]) {
+ pfSenseHeader("vpn_openvpn_csc.php");
+ exit;
+ }
+
+ openvpn_delete_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['disable'] = $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['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 ($pconfig['dns_server_enable']) {
+ if (!empty($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1'])))
+ $input_errors[] = "The field 'DNS Server #1' must contain a valid IP address";
+ if (!empty($pconfig['dns_server2']) && !is_ipaddr(trim($pconfig['dns_server2'])))
+ $input_errors[] = "The field 'DNS Server #2' must contain a valid IP address";
+ if (!empty($pconfig['dns_server3']) && !is_ipaddr(trim($pconfig['dns_server3'])))
+ $input_errors[] = "The field 'DNS Server #3' must contain a valid IP address";
+ if (!empty($pconfig['dns_server4']) && !is_ipaddr(trim($pconfig['dns_server4'])))
+ $input_errors[] = "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[] = "The field 'NTP Server #1' must contain a valid IP address";
+ if (!empty($pconfig['ntp_server2']) && !is_ipaddr(trim($pconfig['ntp_server2'])))
+ $input_errors[] = "The field 'NTP Server #2' must contain a valid IP address";
+ if (!empty($pconfig['ntp_server3']) && !is_ipaddr(trim($pconfig['ntp_server3'])))
+ $input_errors[] = "The field 'NTP Server #3' must contain a valid IP address";
+ if (!empty($pconfig['ntp_server4']) && !is_ipaddr(trim($pconfig['ntp_server4'])))
+ $input_errors[] = "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[] = "The field 'WINS Server #1' must contain a valid IP address";
+ if (!empty($pconfig['wins_server2']) && !is_ipaddr(trim($pconfig['wins_server2'])))
+ $input_errors[] = "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[] = "The field 'NetBIOS Data Distribution Server #1' must contain a valid IP address";
+ }
+
+ $reqfields[] = 'common_name';
+ $reqfieldsn[] = 'Common name';
+
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+
+ if (!$input_errors) {
+
+ $csc = array();
+
+ $csc['disable'] = $pconfig['disable'];
+ $csc['common_name'] = $pconfig['common_name'];
+ $csc['block'] = $pconfig['block'];
+ $csc['description'] = $pconfig['description'];
+
+ $csc['tunnel_network'] = $pconfig['tunnel_network'];
+ $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])
+ $a_csc[$id] = $csc;
+ else
+ $a_csc[] = $csc;
+
+ openvpn_resync_csc($id);
+ write_config();
+
+ header("Location: vpn_openvpn_csc.php");
+ exit;
+ }
+}
+
+include("head.inc");
+
+?>
+
+<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
+<?php include("fbegin.inc"); ?>
+<script language="JavaScript">
+<!--
+
+function dns_domain_change() {
+
+ if (document.iform.dns_domain_enable.checked)
+ document.getElementById("dns_domain_data").style.display="";
+ else
+ document.getElementById("dns_domain_data").style.display="none";
+}
+
+function dns_server_change() {
+
+ if (document.iform.dns_server_enable.checked)
+ document.getElementById("dns_server_data").style.display="";
+ else
+ document.getElementById("dns_server_data").style.display="none";
+}
+
+function wins_server_change() {
+
+ if (document.iform.wins_server_enable.checked)
+ document.getElementById("wins_server_data").style.display="";
+ else
+ document.getElementById("wins_server_data").style.display="none";
+}
+
+function ntp_server_change() {
+
+ if (document.iform.ntp_server_enable.checked)
+ document.getElementById("ntp_server_data").style.display="";
+ else
+ document.getElementById("ntp_server_data").style.display="none";
+}
+
+function netbios_change() {
+
+ if (document.iform.netbios_enable.checked) {
+ document.getElementById("netbios_data").style.display="";
+ document.getElementById("wins_opts").style.display="";
+ } else {
+ document.getElementById("netbios_data").style.display="none";
+ document.getElementById("wins_opts").style.display="none";
+ }
+}
+
+//-->
+</script>
+<?php
+ if ($input_errors)
+ print_input_errors($input_errors);
+ if ($savemsg)
+ print_info_box($savemsg);
+?>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabnavtbl">
+ <ul id="tabnav">
+ <?php
+ $tab_array = array();
+ $tab_array[] = array(gettext("Server"), false, "vpn_openvpn_server.php");
+ $tab_array[] = array(gettext("Client"), false, "vpn_openvpn_client.php");
+ $tab_array[] = array(gettext("Client Specific Overrides"), true, "vpn_openvpn_csc.php");
+ display_top_tabs($tab_array);
+ ?>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td class="tabcont">
+
+ <?php if($act=="new" || $act=="edit"): ?>
+
+ <form action="vpn_openvpn_csc.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Disabled</td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['disable'],$chk); ?>
+ <input name="disable" type="checkbox" value="yes" <?=$chk;?>/>
+ </td>
+ <td>
+ &nbsp;
+ <span class="vexpl">
+ <strong>Disable this override</strong><br>
+ </span>
+ </td>
+ </tr>
+ </table>
+ Set this option to disable this client specific override without removing it from the list.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Common name</td>
+ <td width="78%" class="vtable">
+ <input name="common_name" type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($pconfig['common_name']);?>">
+ <br>
+ Enter the client's X.509 common name here.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Description</td>
+ <td width="78%" class="vtable">
+ <input name="description" type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($pconfig['description']);?>">
+ <br>
+ You may enter a description here for your reference (not parsed).
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Connection blocking</td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['block'],$chk); ?>
+ <input name="block" type="checkbox" value="yes" <?=$chk;?>/>
+ </td>
+ <td>
+ <span class="vexpl">
+ Block this client connection based on its common name.
+ </span>
+ </td>
+ </tr>
+ </table>
+ Don't use this option to permenently disable a
+ client due to a compromised key or password.
+ Use a CRL (certificate revocation list) instead.
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" class="list" height="12"></td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Tunnel Settings</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Tunnel Network</td>
+ <td width="78%" class="vtable">
+ <input name="tunnel_network" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['tunnel_network']);?>">
+ <br>
+ This is the virtual network used for private
+ communications between this client and the
+ server expressed using CIDR (eg. 10.0.8.0/24).
+ The first network address is assumed to be the
+ server address and the second network address
+ will be assigned to the client virtual
+ interface.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Redirect Gateway</td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['gwredir'],$chk); ?>
+ <input name="gwredir" type="checkbox" value="yes" <?=$chk;?>/>
+ </td>
+ <td>
+ <span class="vexpl">
+ Force all client generated traffic through the tunnel.
+ </span>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" class="list" height="12"></td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Client Settings</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Server Definitions</td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['push_reset'],$chk); ?>
+ <input name="push_reset" type="checkbox" value="yes" <?=$chk;?>/>
+ </td>
+ <td>
+ <span class="vexpl">
+ Prevent this client from receiving any server defined client settings.
+ </span>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">DNS Default Domain</td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['dns_domain_enable'],$chk); ?>
+ <input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onClick="dns_domain_change()">
+ </td>
+ <td>
+ <span class="vexpl">
+ Provide a default domain name to clients<br>
+ </span>
+ </td>
+ </tr>
+ </table>
+ <table border="0" cellpadding="2" cellspacing="0" id="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>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">DNS Servers</td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['dns_server_enable'],$chk); ?>
+ <input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onClick="dns_server_change()">
+ </td>
+ <td>
+ <span class="vexpl">
+ Provide a DNS server list to clients<br>
+ </span>
+ </td>
+ </tr>
+ </table>
+ <table border="0" cellpadding="2" cellspacing="0" id="dns_server_data">
+ <tr>
+ <td>
+ <span class="vexpl">
+ Server #1:&nbsp;
+ </span>
+ <input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=$pconfig['dns_server1'];?>">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span class="vexpl">
+ Server #2:&nbsp;
+ </span>
+ <input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=$pconfig['dns_server2'];?>">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span class="vexpl">
+ Server #3:&nbsp;
+ </span>
+ <input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=$pconfig['dns_server3'];?>">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span class="vexpl">
+ Server #4:&nbsp;
+ </span>
+ <input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=$pconfig['dns_server4'];?>">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">NTP Servers</td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['ntp_server_enable'],$chk); ?>
+ <input name="ntp_server_enable" type="checkbox" id="ntp_server_enable" value="yes" <?=$chk;?> onClick="ntp_server_change()">
+ </td>
+ <td>
+ <span class="vexpl">
+ Provide a NTP server list to clients<br>
+ </span>
+ </td>
+ </tr>
+ </table>
+ <table border="0" cellpadding="2" cellspacing="0" id="ntp_server_data">
+ <tr>
+ <td>
+ <span class="vexpl">
+ 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">
+ 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>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">NetBIOS Options</td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['netbios_enable'],$chk); ?>
+ <input name="netbios_enable" type="checkbox" id="netbios_enable" value="yes" <?=$chk;?> onClick="netbios_change()">
+ </td>
+ <td>
+ <span class="vexpl">
+ Enable NetBIOS over TCP/IP<br>
+ </span>
+ </td>
+ </tr>
+ </table>
+ If this option is not set, all Netbios-over-TCP/IP options (includeing WINS) will be disabled.
+ <br/>
+ <table border="0" cellpadding="2" cellspacing="0" id="netbios_data">
+ <tr>
+ <td>
+ <br/>
+ <span class="vexpl">
+ 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";
+ ?>
+ <option value="<?=$type;?>" <?=$selected;?>><?=$name;?></option>
+ <?php endforeach; ?>
+ </select>
+ <br/>
+ Possible options: b-node (broadcasts), p-node
+ (point-to-point name queries to a WINS server),
+ m-node (broadcast then query name server), and
+ h-node (query name server, then broadcast).
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <br/>
+ <span class="vexpl">
+ Scope ID:&nbsp;
+ </span>
+ <input name="netbios_scope" type="text" class="formfld unknown" id="netbios_scope" size="30" value="<?=htmlspecialchars($pconfig['netbios_scope']);?>">
+ <br/>
+ A NetBIOS Scope ID provides an extended naming
+ service for NetBIOS over TCP/IP. The NetBIOS
+ scope ID isolates NetBIOS traffic on a single
+ network to only those nodes with the same
+ NetBIOS scope ID.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr id="wins_opts">
+ <td width="22%" valign="top" class="vncell">WINS Servers</td>
+ <td width="78%" class="vtable">
+ <table border="0" cellpadding="2" cellspacing="0">
+ <tr>
+ <td>
+ <?php set_checked($pconfig['wins_server_enable'],$chk); ?>
+ <input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onClick="wins_server_change()">
+ </td>
+ <td>
+ <span class="vexpl">
+ Provide a WINS server list to clients<br>
+ </span>
+ </td>
+ </tr>
+ </table>
+ <table border="0" cellpadding="2" cellspacing="0" id="wins_server_data">
+ <tr>
+ <td>
+ <span class="vexpl">
+ 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">
+ 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>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="save" type="submit" class="formbtn" value="Save">
+ <input name="act" type="hidden" value="<?=$act;?>">
+ <?php if (isset($id) && $a_csc[$id]): ?>
+ <input name="id" type="hidden" value="<?=$id;?>">
+ <?php endif; ?>
+ </td>
+ </tr>
+ </table>
+ </form>
+
+ <?php else: ?>
+
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="10%" class="listhdrr">Disabled</td>
+ <td width="40%" class="listhdrr">Common Name</td>
+ <td width="40%" class="listhdrr">Description</td>
+ <td width="10%" class="list"></td>
+ </tr>
+ <?php
+ $i = 0;
+ foreach($a_csc as $csc):
+ $disabled = "NO";
+ if ($csc['disable'])
+ $disabled = "YES";
+ ?>
+ <tr>
+ <td class="listlr">
+ <?=$disabled;?>
+ </td>
+ <td class="listr">
+ <?=htmlspecialchars($csc['common_name']);?>
+ </td>
+ <td class="listr">
+ <?=htmlspecialchars($csc['description']);?>
+ </td>
+ <td valign="middle" nowrap class="list">
+ <a href="vpn_openvpn_csc.php?act=edit&id=<?=$i;?>">
+ <img src="./themes/<?=$g['theme'];?>/images/icons/icon_e.gif" title="edit csc" width="17" height="17" border="0">
+ </a>
+ &nbsp;
+ <a href="vpn_openvpn_csc.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this csc?')">
+ <img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" title="delete csc" width="17" height="17" border="0">
+ </a>
+ </td>
+ </tr>
+ <?php
+ $i++;
+ endforeach;
+ ?>
+ <tr>
+ <td class="list" colspan="3"></td>
+ <td class="list">
+ <a href="vpn_openvpn_csc.php?act=new"><img src="./themes/<?=$g['theme'];?>/images/icons/icon_plus.gif" title="add csc" width="17" height="17" border="0">
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3">
+ <p>
+ <?=gettext("Additional OpenVPN client specific overrides can be added here.");?>
+ </p>
+ </td>
+ </tr>
+ </table>
+
+ <? endif; ?>
+
+ </td>
+ </tr>
+</table>
+<script language="JavaScript">
+<!--
+dns_domain_change();
+dns_server_change();
+wins_server_change();
+ntp_server_change();
+netbios_change();
+//-->
+</script>
+</body>
+<?php include("fend.inc"); ?>
+
+<?php
+
+/* local utility functions */
+
+function set_checked($var,& $chk) {
+ if($var)
+ $chk = 'checked';
+ else
+ $chk = '';
+}
+
+?>
+
OpenPOWER on IntegriCloud