Project

General

Profile

Download (24.2 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php 
2
/*
3
	vpn_openvpn_csc.php
4

    
5
	Copyright (C) 2008 Shrew Soft Inc.
6
	All rights reserved. 
7

    
8
	Redistribution and use in source and binary forms, with or without
9
	modification, are permitted provided that the following conditions are met:
10
	
11
	1. Redistributions of source code must retain the above copyright notice,
12
	   this list of conditions and the following disclaimer.
13
	
14
	2. Redistributions in binary form must reproduce the above copyright
15
	   notice, this list of conditions and the following disclaimer in the
16
	   documentation and/or other materials provided with the distribution.
17
	
18
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
22
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
	POSSIBILITY OF SUCH DAMAGE.
28
*/
29

    
30
##|+PRIV
31
##|*IDENT=page-openvpn-csc
32
##|*NAME=OpenVPN: Client Specific Override page
33
##|*DESCR=Allow access to the 'OpenVPN: Client Specific Override' page.
34
##|*MATCH=vpn_openvpn_csc.php*
35
##|-PRIV
36

    
37
require("guiconfig.inc");
38
require_once("openvpn.inc");
39

    
40
$pgtitle = array("OpenVPN", "Client Specific Override");
41

    
42
if (!is_array($config['openvpn']['openvpn-csc']))
43
	$config['openvpn']['openvpn-csc'] = array();
44

    
45
$a_csc = &$config['openvpn']['openvpn-csc'];
46

    
47
$id = $_GET['id'];
48
if (isset($_POST['id']))
49
	$id = $_POST['id'];
50

    
51
$act = $_GET['act'];
52
if (isset($_POST['act']))
53
	$act = $_POST['act'];
54

    
55
if ($_GET['act'] == "del") {
56

    
57
	if (!$a_csc[$id]) {
58
		pfSenseHeader("vpn_openvpn_csc.php");
59
		exit;
60
	}
61

    
62
	openvpn_delete_csc($$a_csc[$id]);
63
	unset($a_csc[$id]);
64
	write_config();
65
	$savemsg = gettext("Client Specific Override successfully deleted")."<br/>";
66
}
67

    
68
if($_GET['act']=="edit"){
69

    
70
	if (isset($id) && $a_csc[$id]) {
71
		$pconfig['custom_options'] = $a_csc[$id]['custom_options'];
72
		$pconfig['disable'] = $a_csc[$id]['disable'];
73
		$pconfig['common_name'] = $a_csc[$id]['common_name'];
74
		$pconfig['block'] = $a_csc[$id]['block'];
75
		$pconfig['description'] = $a_csc[$id]['description'];
76

    
77
		$pconfig['tunnel_network'] = $a_csc[$id]['tunnel_network'];
78
		$pconfig['gwredir'] = $a_csc[$id]['gwredir'];
79

    
80
		$pconfig['push_reset'] = $a_csc[$id]['push_reset'];
81

    
82
		$pconfig['dns_domain'] = $a_csc[$id]['dns_domain'];
83
		if ($pconfig['dns_domain'])
84
			$pconfig['dns_domain_enable'] = true;
85

    
86
		$pconfig['dns_server1'] = $a_csc[$id]['dns_server1'];
87
		$pconfig['dns_server2'] = $a_csc[$id]['dns_server2'];
88
		$pconfig['dns_server3'] = $a_csc[$id]['dns_server3'];
89
		$pconfig['dns_server4'] = $a_csc[$id]['dns_server4'];
90
		if ($pconfig['dns_server1'] ||
91
			$pconfig['dns_server2'] ||
92
			$pconfig['dns_server3'] ||
93
			$pconfig['dns_server4'])
94
			$pconfig['dns_server_enable'] = true;
95

    
96
		$pconfig['ntp_server1'] = $a_csc[$id]['ntp_server1'];
97
		$pconfig['ntp_server2'] = $a_csc[$id]['ntp_server2'];
98
		if ($pconfig['ntp_server1'] ||
99
			$pconfig['ntp_server2'])
100
			$pconfig['ntp_server_enable'] = true;
101

    
102
		$pconfig['netbios_enable'] = $a_csc[$id]['netbios_enable'];
103
		$pconfig['netbios_ntype'] = $a_csc[$id]['netbios_ntype'];
104
		$pconfig['netbios_scope'] = $a_csc[$id]['netbios_scope'];
105

    
106
		$pconfig['wins_server1'] = $a_csc[$id]['wins_server1'];
107
		$pconfig['wins_server2'] = $a_csc[$id]['wins_server2'];
108
		if ($pconfig['wins_server1'] ||
109
			$pconfig['wins_server2'])
110
			$pconfig['wins_server_enable'] = true;
111

    
112
		$pconfig['nbdd_server1'] = $a_csc[$id]['nbdd_server1'];
113
		if ($pconfig['nbdd_server1'])
114
			$pconfig['nbdd_server_enable'] = true;
115
	}
116
}
117

    
118
if ($_POST) {
119

    
120
	unset($input_errors);
121
	$pconfig = $_POST;
122

    
123
	/* input validation */
124
	if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'Tunnel network'))
125
		$input_errors[] = $result;
126

    
127
	if ($pconfig['dns_server_enable']) {
128
		if (!empty($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1'])))
129
			$input_errors[] = "The field 'DNS Server #1' must contain a valid IP address";
130
		if (!empty($pconfig['dns_server2']) && !is_ipaddr(trim($pconfig['dns_server2'])))
131
			$input_errors[] = "The field 'DNS Server #2' must contain a valid IP address";
132
		if (!empty($pconfig['dns_server3']) && !is_ipaddr(trim($pconfig['dns_server3'])))
133
			$input_errors[] = "The field 'DNS Server #3' must contain a valid IP address";
134
		if (!empty($pconfig['dns_server4']) && !is_ipaddr(trim($pconfig['dns_server4'])))
135
			$input_errors[] = "The field 'DNS Server #4' must contain a valid IP address";
136
	}
137

    
138
	if ($pconfig['ntp_server_enable']) {
139
		if (!empty($pconfig['ntp_server1']) && !is_ipaddr(trim($pconfig['ntp_server1'])))
140
			$input_errors[] = "The field 'NTP Server #1' must contain a valid IP address";
141
		if (!empty($pconfig['ntp_server2']) && !is_ipaddr(trim($pconfig['ntp_server2'])))
142
			$input_errors[] = "The field 'NTP Server #2' must contain a valid IP address";
143
		if (!empty($pconfig['ntp_server3']) && !is_ipaddr(trim($pconfig['ntp_server3'])))
144
			$input_errors[] = "The field 'NTP Server #3' must contain a valid IP address";
145
		if (!empty($pconfig['ntp_server4']) && !is_ipaddr(trim($pconfig['ntp_server4'])))
146
			$input_errors[] = "The field 'NTP Server #4' must contain a valid IP address";
147
	}
148

    
149
	if ($pconfig['netbios_enable']) {
150
		if ($pconfig['wins_server_enable']) {
151
			if (!empty($pconfig['wins_server1']) && !is_ipaddr(trim($pconfig['wins_server1'])))
152
				$input_errors[] = "The field 'WINS Server #1' must contain a valid IP address";
153
			if (!empty($pconfig['wins_server2']) && !is_ipaddr(trim($pconfig['wins_server2'])))
154
				$input_errors[] = "The field 'WINS Server #2' must contain a valid IP address";
155
		}
156
		if ($pconfig['nbdd_server_enable'])
157
			if (!empty($pconfig['nbdd_server1']) && !is_ipaddr(trim($pconfig['nbdd_server1'])))
158
				$input_errors[] = "The field 'NetBIOS Data Distribution Server #1' must contain a valid IP address";
159
	}
160

    
161
	$reqdfields[] = 'common_name';
162
	$reqdfieldsn[] = 'Common name';
163

    
164
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
165

    
166
	if (!$input_errors) {
167

    
168
		$csc = array();
169

    
170
		$csc['custom_options'] = $pconfig['custom_options'];
171
		$csc['disable'] = $pconfig['disable'];
172
		$csc['common_name'] = $pconfig['common_name'];
173
		$csc['block'] = $pconfig['block'];
174
		$csc['description'] = $pconfig['description'];
175

    
176
		$csc['tunnel_network'] = $pconfig['tunnel_network'];
177
		$csc['gwredir'] = $pconfig['gwredir'];
178

    
179
		$csc['push_reset'] = $pconfig['push_reset'];
180

    
181
		if ($pconfig['dns_domain_enable'])
182
			$csc['dns_domain'] = $pconfig['dns_domain'];
183

    
184
		if ($pconfig['dns_server_enable']) {
185
			$csc['dns_server1'] = $pconfig['dns_server1'];
186
			$csc['dns_server2'] = $pconfig['dns_server2'];
187
			$csc['dns_server3'] = $pconfig['dns_server3'];
188
			$csc['dns_server4'] = $pconfig['dns_server4'];
189
		}
190

    
191
		if ($pconfig['ntp_server_enable']) {
192
			$csc['ntp_server1'] = $pconfig['ntp_server1'];
193
			$csc['ntp_server2'] = $pconfig['ntp_server2'];
194
		}
195

    
196
		$csc['netbios_enable'] = $pconfig['netbios_enable'];
197
		$csc['netbios_ntype'] = $pconfig['netbios_ntype'];
198
		$csc['netbios_scope'] = $pconfig['netbios_scope'];
199

    
200
		if ($pconfig['netbios_enable']) {
201

    
202
			if ($pconfig['wins_server_enable']) {
203
				$csc['wins_server1'] = $pconfig['wins_server1'];
204
				$csc['wins_server2'] = $pconfig['wins_server2'];
205
			}
206

    
207
			if ($pconfig['dns_server_enable'])
208
				$csc['nbdd_server1'] = $pconfig['nbdd_server1'];
209
		}
210
	
211
		if (isset($id) && $a_csc[$id])
212
			$a_csc[$id] = $csc;
213
		else
214
			$a_csc[] = $csc;
215

    
216
		openvpn_resync_csc($csc);
217
		write_config();
218
		
219
		header("Location: vpn_openvpn_csc.php");
220
		exit;
221
	}
222
}
223

    
224
include("head.inc");
225

    
226
?>
227

    
228
<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
229
<?php include("fbegin.inc"); ?>
230
<script language="JavaScript">
231
<!--
232

    
233
function dns_domain_change() {
234

    
235
	if (document.iform.dns_domain_enable.checked)
236
		document.getElementById("dns_domain_data").style.display="";
237
	else
238
		document.getElementById("dns_domain_data").style.display="none";
239
}
240

    
241
function dns_server_change() {
242

    
243
	if (document.iform.dns_server_enable.checked)
244
		document.getElementById("dns_server_data").style.display="";
245
	else
246
		document.getElementById("dns_server_data").style.display="none";
247
}
248

    
249
function wins_server_change() {
250

    
251
	if (document.iform.wins_server_enable.checked)
252
		document.getElementById("wins_server_data").style.display="";
253
	else
254
		document.getElementById("wins_server_data").style.display="none";
255
}
256

    
257
function ntp_server_change() {
258

    
259
	if (document.iform.ntp_server_enable.checked)
260
		document.getElementById("ntp_server_data").style.display="";
261
	else
262
		document.getElementById("ntp_server_data").style.display="none";
263
}
264

    
265
function netbios_change() {
266

    
267
	if (document.iform.netbios_enable.checked) {
268
		document.getElementById("netbios_data").style.display="";
269
		document.getElementById("wins_opts").style.display="";
270
	} else {
271
		document.getElementById("netbios_data").style.display="none";
272
		document.getElementById("wins_opts").style.display="none";
273
	}
274
}
275

    
276
//-->
277
</script>
278
<?php
279
	if ($input_errors)
280
		print_input_errors($input_errors);
281
	if ($savemsg)
282
		print_info_box($savemsg);
283
?>
284
<table width="100%" border="0" cellpadding="0" cellspacing="0">
285
 	<tr>
286
		<td class="tabnavtbl">
287
			<ul id="tabnav">
288
			<?php 
289
				$tab_array = array();
290
				$tab_array[] = array(gettext("Server"), false, "vpn_openvpn_server.php");
291
				$tab_array[] = array(gettext("Client"), false, "vpn_openvpn_client.php");
292
				$tab_array[] = array(gettext("Client Specific Overrides"), true, "vpn_openvpn_csc.php");
293
				add_package_tabs("OpenVPN", $tab_array);
294
				display_top_tabs($tab_array);
295
			?>
296
			</ul>
297
		</td>
298
	</tr>    
299
	<tr>
300
		<td class="tabcont">
301

    
302
			<?php if($act=="new" || $act=="edit"): ?>
303

    
304
			<form action="vpn_openvpn_csc.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
305
				<table width="100%" border="0" cellpadding="6" cellspacing="0">
306
					<tr>
307
						<td colspan="2" valign="top" class="listtopic">General information</td>
308
					</tr>	
309
					<tr>
310
						<td width="22%" valign="top" class="vncellreq">Disabled</td>
311
						<td width="78%" class="vtable">
312
							<table border="0" cellpadding="0" cellspacing="0">
313
								<tr>
314
									<td>
315
										<?php set_checked($pconfig['disable'],$chk); ?>
316
										<input name="disable" type="checkbox" value="yes" <?=$chk;?>/>
317
									</td>
318
									<td>
319
										&nbsp;
320
										<span class="vexpl">
321
											<strong>Disable this override</strong><br>
322
										</span>
323
									</td>
324
								</tr>
325
							</table>
326
							Set this option to disable this client specific override without removing it from the list.
327
						</td>
328
					</tr>
329
					<tr> 
330
						<td width="22%" valign="top" class="vncellreq">Common name</td>
331
						<td width="78%" class="vtable"> 
332
							<input name="common_name" type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($pconfig['common_name']);?>">
333
							<br>
334
							Enter the client's X.509 common name here.
335
						</td>
336
					</tr>
337
					<tr> 
338
						<td width="22%" valign="top" class="vncell">Description</td>
339
						<td width="78%" class="vtable"> 
340
							<input name="description" type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($pconfig['description']);?>">
341
							<br>
342
							You may enter a description here for your reference (not parsed).
343
						</td>
344
					</tr>
345
					<tr>
346
						<td width="22%" valign="top" class="vncell">Connection blocking</td>
347
						<td width="78%" class="vtable">
348
							<table border="0" cellpadding="2" cellspacing="0">
349
								<tr>
350
									<td>
351
										<?php set_checked($pconfig['block'],$chk); ?>
352
										<input name="block" type="checkbox" value="yes" <?=$chk;?>/>
353
									</td>
354
									<td>
355
										<span class="vexpl">
356
											Block this client connection based on its common name.
357
										</span>
358
									</td>
359
								</tr>
360
							</table>
361
							Don't use this option to permenently disable a
362
							client due to a compromised key or password.
363
							Use a CRL (certificate revocation list) instead.
364
						</td>
365
					</tr>
366
					<tr>
367
						<td colspan="2" class="list" height="12"></td>
368
					</tr>
369
					<tr>
370
						<td colspan="2" valign="top" class="listtopic">Tunnel Settings</td>
371
					</tr>
372
					<tr>
373
						<td width="22%" valign="top" class="vncell">Tunnel Network</td>
374
						<td width="78%" class="vtable">
375
							<input name="tunnel_network" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['tunnel_network']);?>">
376
							<br>
377
							This is the virtual network used for private
378
							communications between this client and the
379
							server expressed using CIDR (eg. 10.0.8.0/24).
380
							The first network address is assumed to be the
381
							server address and the second network address
382
							will be assigned to the client virtual
383
							interface.
384
						</td>
385
					</tr>
386
					<tr>
387
						<td width="22%" valign="top" class="vncell">Redirect Gateway</td>
388
						<td width="78%" class="vtable">
389
							<table border="0" cellpadding="2" cellspacing="0">
390
								<tr>
391
									<td>
392
										<?php set_checked($pconfig['gwredir'],$chk); ?>
393
										<input name="gwredir" type="checkbox" value="yes" <?=$chk;?>/>
394
									</td>
395
									<td>
396
										<span class="vexpl">
397
											Force all client generated traffic through the tunnel.
398
										</span>
399
									</td>
400
								</tr>
401
							</table>
402
						</td>
403
					</tr>
404
					<tr>
405
						<td colspan="2" class="list" height="12"></td>
406
					</tr>
407
					<tr>
408
						<td colspan="2" valign="top" class="listtopic">Client Settings</td>
409
					</tr>
410
					<tr>
411
						<td width="22%" valign="top" class="vncell">Server Definitions</td>
412
						<td width="78%" class="vtable">
413
							<table border="0" cellpadding="2" cellspacing="0">
414
								<tr>
415
									<td>
416
										<?php set_checked($pconfig['push_reset'],$chk); ?>
417
										<input name="push_reset" type="checkbox" value="yes" <?=$chk;?>/>
418
									</td>
419
									<td>
420
										<span class="vexpl">
421
											Prevent this client from receiving any server defined client settings.
422
										</span>
423
									</td>
424
								</tr>
425
							</table>
426
						</td>
427
					</tr>
428
					<tr>
429
						<td width="22%" valign="top" class="vncell">DNS Default Domain</td>
430
						<td width="78%" class="vtable">
431
							<table border="0" cellpadding="2" cellspacing="0">
432
								<tr>
433
									<td>
434
										<?php set_checked($pconfig['dns_domain_enable'],$chk); ?>
435
										<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onClick="dns_domain_change()">
436
									</td>
437
									<td>
438
										<span class="vexpl">
439
	                                        Provide a default domain name to clients<br>
440
										</span>
441
									</td>
442
								</tr>
443
							</table>
444
							<table border="0" cellpadding="2" cellspacing="0" id="dns_domain_data">
445
								<tr>
446
									<td>
447
										<input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>">
448
									</td>
449
								</tr>
450
							</table>
451
						</td>
452
					</tr>
453
					<tr>
454
						<td width="22%" valign="top" class="vncell">DNS Servers</td>
455
						<td width="78%" class="vtable">
456
							<table border="0" cellpadding="2" cellspacing="0">
457
								<tr>
458
									<td>
459
										<?php set_checked($pconfig['dns_server_enable'],$chk); ?>
460
										<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onClick="dns_server_change()">
461
									</td>
462
									<td>
463
										<span class="vexpl">
464
											Provide a DNS server list to clients<br>
465
										</span>
466
									</td>
467
								</tr>
468
							</table>
469
							<table border="0" cellpadding="2" cellspacing="0" id="dns_server_data">
470
								<tr>
471
									<td>
472
										<span class="vexpl">
473
											Server #1:&nbsp;
474
										</span>
475
										<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=$pconfig['dns_server1'];?>">
476
									</td>
477
								</tr>
478
								<tr>
479
									<td>
480
										<span class="vexpl">
481
											Server #2:&nbsp;
482
										</span>
483
										<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=$pconfig['dns_server2'];?>">
484
									</td>
485
								</tr>
486
								<tr>
487
									<td>
488
										<span class="vexpl">
489
											Server #3:&nbsp;
490
										</span>
491
										<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=$pconfig['dns_server3'];?>">
492
									</td>
493
								</tr>
494
								<tr>
495
									<td>
496
										<span class="vexpl">
497
											Server #4:&nbsp;
498
										</span>
499
										<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=$pconfig['dns_server4'];?>">
500
									</td>
501
								</tr>
502
							</table>
503
						</td>
504
					</tr>
505
					<tr>
506
						<td width="22%" valign="top" class="vncell">NTP Servers</td>
507
						<td width="78%" class="vtable">
508
							<table border="0" cellpadding="2" cellspacing="0">
509
								<tr>
510
									<td>
511
										<?php set_checked($pconfig['ntp_server_enable'],$chk); ?>
512
										<input name="ntp_server_enable" type="checkbox" id="ntp_server_enable" value="yes" <?=$chk;?> onClick="ntp_server_change()">
513
									</td>
514
									<td>
515
										<span class="vexpl">
516
											Provide a NTP server list to clients<br>
517
										</span>
518
									</td>
519
								</tr>
520
							</table>
521
							<table border="0" cellpadding="2" cellspacing="0" id="ntp_server_data">
522
								<tr>
523
									<td>
524
										<span class="vexpl">
525
											Server #1:&nbsp;
526
										</span>
527
										<input name="ntp_server1" type="text" class="formfld unknown" id="ntp_server1" size="20" value="<?=$pconfig['ntp_server1'];?>">
528
									</td>
529
								</tr>
530
								<tr>
531
									<td>
532
										<span class="vexpl">
533
											Server #2:&nbsp;
534
										</span>
535
										<input name="ntp_server2" type="text" class="formfld unknown" id="ntp_server2" size="20" value="<?=$pconfig['ntp_server2'];?>">
536
									</td>
537
								</tr>
538
							</table>
539
						</td>
540
					</tr>
541
					<tr>
542
						<td width="22%" valign="top" class="vncell">NetBIOS Options</td>
543
						<td width="78%" class="vtable">
544
							<table border="0" cellpadding="2" cellspacing="0">
545
								<tr>
546
									<td>
547
										<?php set_checked($pconfig['netbios_enable'],$chk); ?>
548
										<input name="netbios_enable" type="checkbox" id="netbios_enable" value="yes" <?=$chk;?> onClick="netbios_change()">
549
									</td>
550
									<td>
551
										<span class="vexpl">
552
											Enable NetBIOS over TCP/IP<br>
553
										</span>
554
									</td>
555
								</tr>
556
							</table>
557
							If this option is not set, all Netbios-over-TCP/IP options (includeing WINS) will be disabled.
558
							<br/>
559
							<table border="0" cellpadding="2" cellspacing="0" id="netbios_data">
560
								<tr>
561
									<td>
562
										<br/>
563
										<span class="vexpl">
564
											Node Type:&nbsp;
565
										</span>
566
										<select name='netbios_ntype' class="formselect">
567
										<?php
568
											foreach ($netbios_nodetypes as $type => $name):
569
												$selected = "";
570
												if ($pconfig['netbios_ntype'] == $type)
571
													$selected = "selected";
572
										?>
573
											<option value="<?=$type;?>" <?=$selected;?>><?=$name;?></option>
574
										<?php endforeach; ?>
575
										</select>
576
										<br/>
577
										Possible options: b-node (broadcasts), p-node
578
										(point-to-point name queries to a WINS server),
579
										m-node (broadcast then query name server), and
580
										h-node (query name server, then broadcast).
581
									</td>
582
								</tr>
583
								<tr>
584
									<td>
585
										<br/>
586
										<span class="vexpl">
587
											Scope ID:&nbsp;
588
										</span>
589
										<input name="netbios_scope" type="text" class="formfld unknown" id="netbios_scope" size="30" value="<?=htmlspecialchars($pconfig['netbios_scope']);?>">
590
										<br/>
591
										A NetBIOS Scope	ID provides an extended naming
592
										service for	NetBIOS over TCP/IP. The NetBIOS
593
										scope ID isolates NetBIOS traffic on a single
594
										network to only those nodes with the same
595
										NetBIOS scope ID.
596
									</td>
597
								</tr>
598
							</table>
599
						</td>
600
					</tr>
601
					<tr id="wins_opts">
602
						<td width="22%" valign="top" class="vncell">WINS Servers</td>
603
						<td width="78%" class="vtable">
604
							<table border="0" cellpadding="2" cellspacing="0">
605
								<tr>
606
									<td>
607
										<?php set_checked($pconfig['wins_server_enable'],$chk); ?>
608
										<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onClick="wins_server_change()">
609
									</td>
610
									<td>
611
										<span class="vexpl">
612
											Provide a WINS server list to clients<br>
613
										</span>
614
									</td>
615
								</tr>
616
							</table>
617
							<table border="0" cellpadding="2" cellspacing="0" id="wins_server_data">
618
								<tr>
619
									<td>
620
										<span class="vexpl">
621
											Server #1:&nbsp;
622
										</span>
623
										<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=$pconfig['wins_server1'];?>">
624
									</td>
625
								</tr>
626
								<tr>
627
									<td>
628
										<span class="vexpl">
629
											Server #2:&nbsp;
630
										</span>
631
										<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=$pconfig['wins_server2'];?>">
632
									</td>
633
								</tr>
634
							</table>
635
						</td>
636
					</tr>
637
					<tr>
638
						<td width="22%" valign="top" class="vncell">Advanced</td>
639
						<td width="78%" class="vtable">
640
							<table border="0" cellpadding="2" cellspacing="0">
641
								<tr>
642
									<td>
643
										<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=$pconfig['custom_options'];?></textarea><br/>
644
										Paste any additional options you would like to pass through to the OpenVPN server here seperated by a semicolon<br/>
645
										EXAMPLE: push "route 10.0.0.0 255.255.255.0";
646
									</td>
647
								</tr>
648
							</table>
649
						</td>
650
					</tr>
651
					<tr>
652
						<td width="22%" valign="top">&nbsp;</td>
653
						<td width="78%"> 
654
							<input name="save" type="submit" class="formbtn" value="Save"> 
655
							<input name="act" type="hidden" value="<?=$act;?>">
656
							<?php if (isset($id) && $a_csc[$id]): ?>
657
							<input name="id" type="hidden" value="<?=$id;?>">
658
							<?php endif; ?>
659
						</td>
660
					</tr>
661
				</table>
662
			</form>
663

    
664
			<?php else: ?>
665

    
666
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
667
				<tr>
668
					<td width="10%" class="listhdrr">Disabled</td>
669
					<td width="40%" class="listhdrr">Common Name</td>
670
					<td width="40%" class="listhdrr">Description</td>
671
					<td width="10%" class="list"></td>
672
				</tr>
673
				<?php
674
					$i = 0;
675
					foreach($a_csc as $csc):
676
						$disabled = "NO";
677
						if ($csc['disable'])
678
							$disabled = "YES";
679
				?>
680
				<tr>
681
					<td class="listlr">
682
						<?=$disabled;?>
683
					</td>
684
					<td class="listr">
685
						<?=htmlspecialchars($csc['common_name']);?>
686
					</td>
687
					<td class="listbg">
688
						<?=htmlspecialchars($csc['description']);?>
689
					</td>
690
					<td valign="middle" nowrap class="list">
691
						<a href="vpn_openvpn_csc.php?act=edit&id=<?=$i;?>">
692
							<img src="./themes/<?=$g['theme'];?>/images/icons/icon_e.gif" title="edit csc" width="17" height="17" border="0">
693
						</a>
694
						&nbsp;
695
						<a href="vpn_openvpn_csc.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this csc?')">
696
							<img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" title="delete csc" width="17" height="17" border="0">
697
						</a>
698
					</td>
699
				</tr>
700
				<?php
701
					$i++;
702
					endforeach;
703
				?>
704
				<tr>
705
					<td class="list" colspan="3"></td>
706
					<td class="list">
707
						<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">
708
						</a>
709
					</td>
710
				</tr>
711
				<tr>
712
					<td colspan="3">
713
						<p>
714
							<?=gettext("Additional OpenVPN client specific overrides can be added here.");?>
715
						</p>
716
					</td>
717
				</tr>
718
			</table>
719

    
720
			<? endif; ?>
721

    
722
		</td>
723
	</tr>
724
</table>
725
<script language="JavaScript">
726
<!--
727
dns_domain_change();
728
dns_server_change();
729
wins_server_change();
730
ntp_server_change();
731
netbios_change();
732
//-->
733
</script>
734
</body>
735
<?php include("fend.inc"); ?>
736

    
737
<?php
738

    
739
/* local utility functions */
740

    
741
function set_checked($var,& $chk) {
742
    if($var)
743
        $chk = 'checked';
744
    else
745
        $chk = '';
746
}
747

    
748
?>
749

    
(205-205/214)