"; } 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['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"; } $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['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($csc); write_config(); header("Location: vpn_openvpn_csc.php"); exit; } } include("head.inc"); ?> ">
General information
Disabled
/>   Disable this override
Set this option to disable this client-specific override without removing it from the list.
Common name
Enter the client's X.509 common name here.
Description
You may enter a description here for your reference (not parsed).
Connection blocking
/> Block this client connection based on its common name.
Don't use this option to permanently disable a client due to a compromised key or password. Use a CRL (certificate revocation list) instead.
Tunnel Settings
Tunnel Network
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.
Redirect Gateway
/> Force all client generated traffic through the tunnel.
Client Settings
Server Definitions
/> Prevent this client from receiving any server-defined client settings.
DNS Default Domain
onClick="dns_domain_change()"> Provide a default domain name to clients
DNS Servers
onClick="dns_server_change()"> Provide a DNS server list to clients
Server #1: 
Server #2: 
Server #3: 
Server #4: 
NTP Servers
onClick="ntp_server_change()"> Provide a NTP server list to clients
Server #1: 
Server #2: 
NetBIOS Options
onClick="netbios_change()"> Enable NetBIOS over TCP/IP
If this option is not set, all NetBIOS-over-TCP/IP options (includeing WINS) will be disabled.

Node Type: 
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).

Scope ID: 
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.
WINS Servers
onClick="wins_server_change()"> Provide a WINS server list to clients
Server #1: 
Server #2: 
Advanced

Enter any additional options you would like to add for this client specific override, separated by a semicolon
EXAMPLE: push "route 10.0.0.0 255.255.255.0";
 
Disabled Common Name Description