Project

General

Profile

Download (23.4 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

    
38
require("guiconfig.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

    
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
	$reqfields[] = 'common_name';
162
	$reqfieldsn[] = 'Common name';
163

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

    
166
	if (!$input_errors) {
167

    
168
		$csc = array();
169

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

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

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

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

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

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

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

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

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

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

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

    
223
include("head.inc");
224

    
225
?>
226

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

    
232
function dns_domain_change() {
233

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

    
240
function dns_server_change() {
241

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

    
248
function wins_server_change() {
249

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

    
256
function ntp_server_change() {
257

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

    
264
function netbios_change() {
265

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

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

    
300
			<?php if($act=="new" || $act=="edit"): ?>
301

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

    
645
			<?php else: ?>
646

    
647
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
648
				<tr>
649
					<td width="10%" class="listhdrr">Disabled</td>
650
					<td width="40%" class="listhdrr">Common Name</td>
651
					<td width="40%" class="listhdrr">Description</td>
652
					<td width="10%" class="list"></td>
653
				</tr>
654
				<?php
655
					$i = 0;
656
					foreach($a_csc as $csc):
657
						$disabled = "NO";
658
						if ($csc['disable'])
659
							$disabled = "YES";
660
				?>
661
				<tr>
662
					<td class="listlr">
663
						<?=$disabled;?>
664
					</td>
665
					<td class="listr">
666
						<?=htmlspecialchars($csc['common_name']);?>
667
					</td>
668
					<td class="listr">
669
						<?=htmlspecialchars($csc['description']);?>
670
					</td>
671
					<td valign="middle" nowrap class="list">
672
						<a href="vpn_openvpn_csc.php?act=edit&id=<?=$i;?>">
673
							<img src="./themes/<?=$g['theme'];?>/images/icons/icon_e.gif" title="edit csc" width="17" height="17" border="0">
674
						</a>
675
						&nbsp;
676
						<a href="vpn_openvpn_csc.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this csc?')">
677
							<img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" title="delete csc" width="17" height="17" border="0">
678
						</a>
679
					</td>
680
				</tr>
681
				<?php
682
					$i++;
683
					endforeach;
684
				?>
685
				<tr>
686
					<td class="list" colspan="3"></td>
687
					<td class="list">
688
						<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">
689
						</a>
690
					</td>
691
				</tr>
692
				<tr>
693
					<td colspan="3">
694
						<p>
695
							<?=gettext("Additional OpenVPN client specific overrides can be added here.");?>
696
						</p>
697
					</td>
698
				</tr>
699
			</table>
700

    
701
			<? endif; ?>
702

    
703
		</td>
704
	</tr>
705
</table>
706
<script language="JavaScript">
707
<!--
708
dns_domain_change();
709
dns_server_change();
710
wins_server_change();
711
ntp_server_change();
712
netbios_change();
713
//-->
714
</script>
715
</body>
716
<?php include("fend.inc"); ?>
717

    
718
<?php
719

    
720
/* local utility functions */
721

    
722
function set_checked($var,& $chk) {
723
    if($var)
724
        $chk = 'checked';
725
    else
726
        $chk = '';
727
}
728

    
729
?>
730

    
(196-196/205)