Project

General

Profile

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

    
648
			<?php else: ?>
649

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

    
704
			<? endif; ?>
705

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

    
721
<?php
722

    
723
/* local utility functions */
724

    
725
function set_checked($var,& $chk) {
726
    if($var)
727
        $chk = 'checked';
728
    else
729
        $chk = '';
730
}
731

    
732
?>
733

    
(201-201/210)