Project

General

Profile

Download (39.2 KB) Statistics
| Branch: | Tag: | Revision:
1 d799787e Matthew Grooms
<?php 
2
/*
3
	vpn_openvpn_server.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-server
32
##|*NAME=OpenVPN: Server page
33
##|*DESCR=Allow access to the 'OpenVPN: Server' page.
34
##|*MATCH=vpn_openvpn_server.php*
35
##|-PRIV
36
37
38
require("guiconfig.inc");
39
40
$pgtitle = array("OpenVPN", "Server");
41
42
if (!is_array($config['openvpn']['openvpn-server']))
43
	$config['openvpn']['openvpn-server'] = array();
44
45
$a_server = &$config['openvpn']['openvpn-server'];
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_server[$id]) {
58
		pfSenseHeader("vpn_openvpn_server.php");
59
		exit;
60
	}
61
62 dc408939 Matthew Grooms
	openvpn_delete('server', $a_server[$id]);
63 d799787e Matthew Grooms
	unset($a_server[$id]);
64
	write_config();
65
	$savemsg = gettext("Server successfully deleted")."<br/>";
66
}
67
68 f432e364 Matthew Grooms
if($_GET['act']=="new"){
69 3c11bd3c Matthew Grooms
	$pconfig['autokey_enable'] = "yes";
70
	$pconfig['tlsauth_enable'] = "yes";
71
	$pconfig['autotls_enable'] = "yes";
72 fe787fc7 Matthew Grooms
	$pconfig['dh_length'] = 1024;
73 f432e364 Matthew Grooms
	$pconfig['interface'] = "wan";
74
	$pconfig['local_port'] = openvpn_port_next('UDP');
75
	$pconfig['pool_enable'] = "yes";
76
}
77
78 d799787e Matthew Grooms
if($_GET['act']=="edit"){
79
80
	if (isset($id) && $a_server[$id]) {
81
82
		$pconfig['disable'] = $a_server[$id]['disable'];
83 3c11bd3c Matthew Grooms
		$pconfig['mode'] = $a_server[$id]['mode'];
84 d799787e Matthew Grooms
		$pconfig['protocol'] = $a_server[$id]['protocol'];
85
		$pconfig['interface'] = $a_server[$id]['interface'];
86
		$pconfig['local_port'] = $a_server[$id]['local_port'];
87
		$pconfig['description'] = $a_server[$id]['description'];
88
89 3c11bd3c Matthew Grooms
		if ($pconfig['mode'] != "p2p_shared_key") {
90
			if ($a_server[$id]['tls']) {
91
				$pconfig['tlsauth_enable'] = "yes";
92
				$pconfig['tls'] = base64_decode($a_server[$id]['tls']);
93
			}
94 fe787fc7 Matthew Grooms
			$pconfig['caref'] = $a_server[$id]['caref'];
95
			$pconfig['certref'] = $a_server[$id]['certref'];
96
			$pconfig['dh_length'] = $a_server[$id]['dh_length'];
97 3c11bd3c Matthew Grooms
		} else
98
			$pconfig['shared_key'] = base64_decode($a_server[$id]['shared_key']);
99 d799787e Matthew Grooms
		$pconfig['crypto'] = $a_server[$id]['crypto'];
100
101
		$pconfig['tunnel_network'] = $a_server[$id]['tunnel_network'];
102
		$pconfig['remote_network'] = $a_server[$id]['remote_network'];
103
		$pconfig['gwredir'] = $a_server[$id]['gwredir'];
104
		$pconfig['local_network'] = $a_server[$id]['local_network'];
105
		$pconfig['maxclients'] = $a_server[$id]['maxclients'];
106
		$pconfig['compression'] = $a_server[$id]['compression'];
107 1cb0b40a Matthew Grooms
		$pconfig['passtos'] = $a_server[$id]['passtos'];
108 d799787e Matthew Grooms
		$pconfig['client2client'] = $a_server[$id]['client2client'];
109
110
		$pconfig['pool_enable'] = $a_server[$id]['pool_enable'];
111
112
		$pconfig['dns_domain'] = $a_server[$id]['dns_domain'];
113
		if ($pconfig['dns_domain'])
114
			$pconfig['dns_domain_enable'] = true;
115
116
		$pconfig['dns_server1'] = $a_server[$id]['dns_server1'];
117
		$pconfig['dns_server2'] = $a_server[$id]['dns_server2'];
118
		$pconfig['dns_server3'] = $a_server[$id]['dns_server3'];
119
		$pconfig['dns_server4'] = $a_server[$id]['dns_server4'];
120
		if ($pconfig['dns_server1'] ||
121
			$pconfig['dns_server2'] ||
122
			$pconfig['dns_server3'] ||
123
			$pconfig['dns_server4'])
124
			$pconfig['dns_server_enable'] = true;
125
126
		$pconfig['ntp_server1'] = $a_server[$id]['ntp_server1'];
127
		$pconfig['ntp_server2'] = $a_server[$id]['ntp_server2'];
128
		if ($pconfig['ntp_server1'] ||
129
			$pconfig['ntp_server2'])
130
			$pconfig['ntp_server_enable'] = true;
131
132
		$pconfig['netbios_enable'] = $a_server[$id]['netbios_enable'];
133
		$pconfig['netbios_ntype'] = $a_server[$id]['netbios_ntype'];
134
		$pconfig['netbios_scope'] = $a_server[$id]['netbios_scope'];
135
136
		$pconfig['wins_server1'] = $a_server[$id]['wins_server1'];
137
		$pconfig['wins_server2'] = $a_server[$id]['wins_server2'];
138
		if ($pconfig['wins_server1'] ||
139
			$pconfig['wins_server2'])
140
			$pconfig['wins_server_enable'] = true;
141
142
		$pconfig['nbdd_server1'] = $a_server[$id]['nbdd_server1'];
143
		if ($pconfig['nbdd_server1'])
144
			$pconfig['nbdd_server_enable'] = true;
145 3c11bd3c Matthew Grooms
146
		// just in case the modes switch
147
		$pconfig['autokey_enable'] = "yes";
148
		$pconfig['autotls_enable'] = "yes";
149 d799787e Matthew Grooms
	}
150
}
151
152
if ($_POST) {
153
154
	unset($input_errors);
155
	$pconfig = $_POST;
156
157 f432e364 Matthew Grooms
	if (isset($id) && $a_server[$id])
158
		$vpnid = $a_server[$id]['vpnid'];
159
	else
160
		$vpnid = 0;
161
162 3c11bd3c Matthew Grooms
	if ($server['mode'] != "p2p_shared_key")
163
		$tls_mode = true;
164
	else
165
		$tls_mode = false;
166
167 d799787e Matthew Grooms
	/* input validation */
168
	if ($result = openvpn_validate_port($pconfig['local_port'], 'Local port'))
169
		$input_errors[] = $result;
170
171
	if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'Tunnel network'))
172
		$input_errors[] = $result;
173
174
	if ($result = openvpn_validate_cidr($pconfig['remote_network'], 'Remote network'))
175
		$input_errors[] = $result;
176
177
	if ($result = openvpn_validate_cidr($pconfig['local_network'], 'Local network'))
178
		$input_errors[] = $result;
179
180 f432e364 Matthew Grooms
	if (openvpn_port_used($pconfig['protocol'], $pconfig['local_port']) != $vpnid)
181
		$input_errors[] = "The specified 'Local port' is in use. Please select another value";
182
183 3c11bd3c Matthew Grooms
	if (!$tls_mode && !$pconfig['autokey_enable'])
184 d799787e Matthew Grooms
		if (!strstr($pconfig['shared_key'], "-----BEGIN OpenVPN Static key V1-----") ||
185
			!strstr($pconfig['shared_key'], "-----END OpenVPN Static key V1-----"))
186 3c11bd3c Matthew Grooms
			$input_errors[] = "The field 'Shared Key' does not appear to be valid";
187
188
	if ($tls_mode && $pconfig['tlsauth_enable'] && !$pconfig['autotls_enable'])
189
		if (!strstr($pconfig['tls'], "-----BEGIN OpenVPN Static key V1-----") ||
190
			!strstr($pconfig['tls'], "-----END OpenVPN Static key V1-----"))
191
			$input_errors[] = "The field 'TLS Authentication Key' does not appear to be valid";
192 d799787e Matthew Grooms
193
	if ($pconfig['dns_server_enable']) {
194
		if (!empty($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1'])))
195
			$input_errors[] = "The field 'DNS Server #1' must contain a valid IP address";
196
		if (!empty($pconfig['dns_server2']) && !is_ipaddr(trim($pconfig['dns_server2'])))
197
			$input_errors[] = "The field 'DNS Server #2' must contain a valid IP address";
198
		if (!empty($pconfig['dns_server3']) && !is_ipaddr(trim($pconfig['dns_server3'])))
199
			$input_errors[] = "The field 'DNS Server #3' must contain a valid IP address";
200
		if (!empty($pconfig['dns_server4']) && !is_ipaddr(trim($pconfig['dns_server4'])))
201
			$input_errors[] = "The field 'DNS Server #4' must contain a valid IP address";
202
	}
203
204
	if ($pconfig['ntp_server_enable']) {
205
		if (!empty($pconfig['ntp_server1']) && !is_ipaddr(trim($pconfig['ntp_server1'])))
206
			$input_errors[] = "The field 'NTP Server #1' must contain a valid IP address";
207
		if (!empty($pconfig['ntp_server2']) && !is_ipaddr(trim($pconfig['ntp_server2'])))
208
			$input_errors[] = "The field 'NTP Server #2' must contain a valid IP address";
209
		if (!empty($pconfig['ntp_server3']) && !is_ipaddr(trim($pconfig['ntp_server3'])))
210
			$input_errors[] = "The field 'NTP Server #3' must contain a valid IP address";
211
		if (!empty($pconfig['ntp_server4']) && !is_ipaddr(trim($pconfig['ntp_server4'])))
212
			$input_errors[] = "The field 'NTP Server #4' must contain a valid IP address";
213
	}
214
215
	if ($pconfig['netbios_enable']) {
216
		if ($pconfig['wins_server_enable']) {
217
			if (!empty($pconfig['wins_server1']) && !is_ipaddr(trim($pconfig['wins_server1'])))
218
				$input_errors[] = "The field 'WINS Server #1' must contain a valid IP address";
219
			if (!empty($pconfig['wins_server2']) && !is_ipaddr(trim($pconfig['wins_server2'])))
220
				$input_errors[] = "The field 'WINS Server #2' must contain a valid IP address";
221
		}
222
		if ($pconfig['nbdd_server_enable'])
223
			if (!empty($pconfig['nbdd_server1']) && !is_ipaddr(trim($pconfig['nbdd_server1'])))
224
				$input_errors[] = "The field 'NetBIOS Data Distribution Server #1' must contain a valid IP address";
225
	}
226
227
	if ($pconfig['maxclients'] && !is_numeric($pconfig['maxclients']))
228
		$input_errors[] = "The field 'Concurrent connections' must be numeric.";
229
230 3c11bd3c Matthew Grooms
	if (!$tls_mode) {
231 872d9195 Matthew Grooms
		$reqdfields = array('shared_key');
232
		$reqfieldsn = array('Shared key');
233 d799787e Matthew Grooms
    } else {
234 872d9195 Matthew Grooms
		$reqdfields = explode(" ", "caref certref");
235
		$reqdfieldsn = explode(",", "Certificate Authority,Certificate");;
236 d799787e Matthew Grooms
	}
237
238 872d9195 Matthew Grooms
	$reqdfields[] = 'tunnel_network';
239
	$reqdfieldsn[] = 'Tunnel network';
240
241 d799787e Matthew Grooms
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
242
	
243
	if (!$input_errors) {
244
245
		$server = array();
246
247 f432e364 Matthew Grooms
		if ($vpnid)
248
			$server['vpnid'] = $vpnid;
249 e28120e5 Matthew Grooms
		else
250 d799787e Matthew Grooms
			$server['vpnid'] = openvpn_vpnid_next();
251
252
		$server['disable'] = $pconfig['disable'];
253 3c11bd3c Matthew Grooms
		$server['mode'] = $pconfig['mode'];
254 d799787e Matthew Grooms
		$server['protocol'] = $pconfig['protocol'];
255
		$server['interface'] = $pconfig['interface'];
256
		$server['local_port'] = $pconfig['local_port'];
257
		$server['description'] = $pconfig['description'];
258
259 3c11bd3c Matthew Grooms
		if ($tls_mode) {
260
			if ($pconfig['tlsauth_enable']) {
261
				if ($pconfig['autotls_enable'])
262
					$pconfig['tls'] = openvpn_create_key();
263
				$server['tls'] = base64_encode($pconfig['tls']);
264
			}
265 fe787fc7 Matthew Grooms
			$server['caref'] = $pconfig['caref'];
266
			$server['certref'] = $pconfig['certref'];
267
			$server['dh_length'] = $pconfig['dh_length'];
268 3c11bd3c Matthew Grooms
		} else {
269
			if ($pconfig['autokey_enable'])
270
				$pconfig['shared_key'] = openvpn_create_key();
271
			$server['shared_key'] = base64_encode($pconfig['shared_key']);
272 d799787e Matthew Grooms
		}
273
		$server['crypto'] = $pconfig['crypto'];
274
275
		$server['tunnel_network'] = $pconfig['tunnel_network'];
276
		$server['remote_network'] = $pconfig['remote_network'];
277
		$server['gwredir'] = $pconfig['gwredir'];
278
		$server['local_network'] = $pconfig['local_network'];
279
		$server['maxclients'] = $pconfig['maxclients'];
280
		$server['compression'] = $pconfig['compression'];
281 1cb0b40a Matthew Grooms
		$server['passtos'] = $pconfig['passtos'];
282 d799787e Matthew Grooms
		$server['client2client'] = $pconfig['client2client'];
283
284
		$server['pool_enable'] = $pconfig['pool_enable'];
285
286
		if ($pconfig['dns_domain_enable'])
287
			$server['dns_domain'] = $pconfig['dns_domain'];
288
289
		if ($pconfig['dns_server_enable']) {
290
			$server['dns_server1'] = $pconfig['dns_server1'];
291
			$server['dns_server2'] = $pconfig['dns_server2'];
292
			$server['dns_server3'] = $pconfig['dns_server3'];
293
			$server['dns_server4'] = $pconfig['dns_server4'];
294
		}
295
296
		if ($pconfig['ntp_server_enable']) {
297
			$server['ntp_server1'] = $pconfig['ntp_server1'];
298
			$server['ntp_server2'] = $pconfig['ntp_server2'];
299
		}
300
301
		$server['netbios_enable'] = $pconfig['netbios_enable'];
302
		$server['netbios_ntype'] = $pconfig['netbios_ntype'];
303
		$server['netbios_scope'] = $pconfig['netbios_scope'];
304
305
		if ($pconfig['netbios_enable']) {
306
307
			if ($pconfig['wins_server_enable']) {
308
				$server['wins_server1'] = $pconfig['wins_server1'];
309
				$server['wins_server2'] = $pconfig['wins_server2'];
310
			}
311
312
			if ($pconfig['dns_server_enable'])
313
				$server['nbdd_server1'] = $pconfig['nbdd_server1'];
314
		}
315
	
316
		if (isset($id) && $a_server[$id])
317
			$a_server[$id] = $server;
318
		else
319
			$a_server[] = $server;
320
321 dc408939 Matthew Grooms
		openvpn_resync('server', $server);
322 d799787e Matthew Grooms
		write_config();
323
		
324
		header("Location: vpn_openvpn_server.php");
325
		exit;
326
	}
327
}
328
329
include("head.inc");
330
331
?>
332
333
<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
334
<?php include("fbegin.inc"); ?>
335
<script language="JavaScript">
336
<!--
337
338 3c11bd3c Matthew Grooms
function mode_change() {
339
	index = document.iform.mode.selectedIndex;
340
	value = document.iform.mode.options[index].value;
341 d799787e Matthew Grooms
	switch(value) {
342 3c11bd3c Matthew Grooms
		case "p2p_tls":
343
		case "server_tls":
344
		case "server_user":
345
		case "server_tls_user":
346
			document.getElementById("tls").style.display="";
347
			document.getElementById("tls_ca").style.display="";
348
			document.getElementById("tls_cert").style.display="";
349 fe787fc7 Matthew Grooms
			document.getElementById("tls_dh").style.display="";
350 d799787e Matthew Grooms
			document.getElementById("psk").style.display="none";
351
			break;
352 3c11bd3c Matthew Grooms
		case "p2p_shared_key":
353
			document.getElementById("tls").style.display="none";
354
			document.getElementById("tls_ca").style.display="none";
355
			document.getElementById("tls_cert").style.display="none";
356 fe787fc7 Matthew Grooms
			document.getElementById("tls_dh").style.display="none";
357 d799787e Matthew Grooms
			document.getElementById("psk").style.display="";
358
			break;
359
	}
360 3c11bd3c Matthew Grooms
	switch(value) {
361
		case "p2p_tls":
362
		case "p2p_shared_key":
363
			document.getElementById("client_opts").style.display="none";
364
			document.getElementById("remote_opts").style.display="";
365
			break;
366
		default:
367
			document.getElementById("client_opts").style.display="";
368
			document.getElementById("remote_opts").style.display="none";
369
			break;
370
	}
371
}
372
373
function autokey_change() {
374
375
	if (document.iform.autokey_enable.checked)
376
		document.getElementById("autokey_opts").style.display="none";
377
	else
378
		document.getElementById("autokey_opts").style.display="";
379
}
380
381
function tlsauth_change() {
382
383
<?php if (!$pconfig['tls']): ?>
384
	if (document.iform.tlsauth_enable.checked)
385
		document.getElementById("tlsauth_opts").style.display="";
386
	else
387
		document.getElementById("tlsauth_opts").style.display="none";
388
<?php endif; ?>
389
390
	autotls_change();
391
}
392
393
function autotls_change() {
394
395
<?php if (!$pconfig['tls']): ?>
396
	autocheck = document.iform.autotls_enable.checked;
397
<?php else: ?>
398
	autocheck = false;
399
<?php endif; ?>
400
401
	if (document.iform.tlsauth_enable.checked && !autocheck)
402
		document.getElementById("autotls_opts").style.display="";
403
	else
404
		document.getElementById("autotls_opts").style.display="none";
405 d799787e Matthew Grooms
}
406
407
function gwredir_change() {
408
409
	if (document.iform.gwredir.checked)
410
		document.getElementById("local_opts").style.display="none";
411
	else
412
		document.getElementById("local_opts").style.display="";
413
}
414
415
function dns_domain_change() {
416
417
	if (document.iform.dns_domain_enable.checked)
418
		document.getElementById("dns_domain_data").style.display="";
419
	else
420
		document.getElementById("dns_domain_data").style.display="none";
421
}
422
423
function dns_server_change() {
424
425
	if (document.iform.dns_server_enable.checked)
426
		document.getElementById("dns_server_data").style.display="";
427
	else
428
		document.getElementById("dns_server_data").style.display="none";
429
}
430
431
function wins_server_change() {
432
433
	if (document.iform.wins_server_enable.checked)
434
		document.getElementById("wins_server_data").style.display="";
435
	else
436
		document.getElementById("wins_server_data").style.display="none";
437
}
438
439
function ntp_server_change() {
440
441
	if (document.iform.ntp_server_enable.checked)
442
		document.getElementById("ntp_server_data").style.display="";
443
	else
444
		document.getElementById("ntp_server_data").style.display="none";
445
}
446
447
function netbios_change() {
448
449
	if (document.iform.netbios_enable.checked) {
450
		document.getElementById("netbios_data").style.display="";
451
		document.getElementById("wins_opts").style.display="";
452
	} else {
453
		document.getElementById("netbios_data").style.display="none";
454
		document.getElementById("wins_opts").style.display="none";
455
	}
456
}
457
458
//-->
459
</script>
460
<?php
461
	if ($input_errors)
462
		print_input_errors($input_errors);
463
	if ($savemsg)
464
		print_info_box($savemsg);
465
?>
466
<table width="100%" border="0" cellpadding="0" cellspacing="0">
467
 	<tr>
468
		<td class="tabnavtbl">
469
			<ul id="tabnav">
470
			<?php 
471
				$tab_array = array();
472
				$tab_array[] = array(gettext("Server"), true, "vpn_openvpn_server.php");
473
				$tab_array[] = array(gettext("Client"), false, "vpn_openvpn_client.php");
474
				$tab_array[] = array(gettext("Client Specific Overrides"), false, "vpn_openvpn_csc.php");
475
				display_top_tabs($tab_array);
476
			?>
477
			</ul>
478
		</td>
479
	</tr>    
480
	<tr>
481
		<td class="tabcont">
482
483
			<?php if($act=="new" || $act=="edit"): ?>
484
485
			<form action="vpn_openvpn_server.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
486
				<table width="100%" border="0" cellpadding="6" cellspacing="0">
487 47c00c09 Scott Ullrich
					<tr>
488
						<td colspan="2" valign="top" class="listtopic">General information</td>
489
					</tr>	
490 d799787e Matthew Grooms
					<tr>
491
						<td width="22%" valign="top" class="vncellreq">Disabled</td>
492
						<td width="78%" class="vtable">
493
							<table border="0" cellpadding="0" cellspacing="0">
494
								<tr>
495
									<td>
496
										<?php set_checked($pconfig['disable'],$chk); ?>
497
										<input name="disable" type="checkbox" value="yes" <?=$chk;?>/>
498
									</td>
499
									<td>
500
										&nbsp;
501
										<span class="vexpl">
502
											<strong>Disable this server</strong><br>
503
										</span>
504
									</td>
505
								</tr>
506
							</table>
507
							Set this option to disable this server without removing it from the list.
508
						</td>
509
					</tr>
510 3c11bd3c Matthew Grooms
					<tr>
511
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Server Mode");?></td>
512
							<td width="78%" class="vtable">
513
							<select name='mode' id='mode' class="formselect" onchange='mode_change()'>
514
							<?php
515
								foreach ($openvpn_server_modes as $name => $desc):
516
									$selected = "";
517
									if ($pconfig['mode'] == $name)
518
										$selected = "selected";
519
							?>
520
								<option value="<?=$name;?>" <?=$selected;?>><?=$desc;?></option>
521
							<?php endforeach; ?>
522
							</select>
523
						</td>
524
					</tr>
525 d799787e Matthew Grooms
					<tr>
526
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol");?></td>
527
							<td width="78%" class="vtable">
528
							<select name='protocol' class="formselect">
529
							<?php
530
								foreach ($openvpn_prots as $prot):
531
									$selected = "";
532
									if ($pconfig['protocol'] == $prot)
533
										$selected = "selected";
534
							?>
535
								<option value="<?=$prot;?>" <?=$selected;?>><?=$prot;?></option>
536
							<?php endforeach; ?>
537
							</select>
538
							</td>
539
					</tr>
540
					<tr>
541
						<td width="22%" valign="top" class="vncellreq">Interface</td>
542
						<td width="78%" class="vtable">
543
							<select name="interface" class="formselect">
544
								<?php
545
									$interfaces = get_configured_interface_with_descr();
546
									$carpips = find_number_of_needed_carp_interfaces();
547
									for ($i=0; $i<$carpips; $i++) {
548
										$carpip = find_interface_ip("carp" . $i);
549
										$interfaces['carp' . $i] = "CARP{$i} ({$carpip})";
550
									}
551
									foreach ($interfaces as $iface => $ifacename):
552
								?>
553
								<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
554
									<?=htmlspecialchars($ifacename);?>
555
								</option>
556
								<?php endforeach; ?>
557
							</select> <br>
558
						</td>
559
					</tr>
560
					<tr>
561
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Local port");?></td>
562
						<td width="78%" class="vtable">
563
							<input name="local_port" type="text" class="formfld unknown" size="5" value="<?=htmlspecialchars($pconfig['local_port']);?>"/>
564
						</td>
565
					</tr>
566
					<tr> 
567
						<td width="22%" valign="top" class="vncell">Description</td>
568
						<td width="78%" class="vtable"> 
569
							<input name="description" type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($pconfig['description']);?>">
570
							<br>
571
							You may enter a description here for your reference (not parsed).
572
						</td>
573
					</tr>
574
					<tr>
575
						<td colspan="2" class="list" height="12"></td>
576
					</tr>
577
					<tr>
578
						<td colspan="2" valign="top" class="listtopic">Cryptographic Settings</td>
579
					</tr>
580 3c11bd3c Matthew Grooms
					<tr id="tls">
581
						<td width="22%" valign="top" class="vncellreq">TLS Authentication</td>
582
						<td width="78%" class="vtable">
583
							<table border="0" cellpadding="2" cellspacing="0">
584
								<tr>
585
									<td>
586
										<?php set_checked($pconfig['tlsauth_enable'],$chk); ?>
587
										<input name="tlsauth_enable" id="tlsauth_enable" type="checkbox" value="yes" <?=$chk;?> onClick="tlsauth_change()">
588
									</td>
589
									<td>
590
										<span class="vexpl">
591
											Enable authentication of TLS packets.
592
										</span>
593
									</td>
594
								</tr>
595
							</table>
596
							<?php if (!$pconfig['tls']): ?>
597
							<table border="0" cellpadding="2" cellspacing="0" id='tlsauth_opts'>
598
								<tr>
599
									<td>
600
										<?php set_checked($pconfig['autotls_enable'],$chk); ?>
601
										<input name="autotls_enable" id="autotls_enable" type="checkbox" value="yes" <?=$chk;?> onClick="autotls_change()">
602
									</td>
603
									<td>
604
										<span class="vexpl">
605
											Automatically generate a shared TLS authentication key.
606
										</span>
607
									</td>
608
								</tr>
609
							</table>
610
							<?php endif; ?>
611
							<table border="0" cellpadding="2" cellspacing="0" id='autotls_opts'>
612
								<tr>
613
									<td>
614
										<textarea name="tls" cols="65" rows="7" class="formpre"><?=htmlspecialchars($pconfig['tls']);?></textarea>
615
										<br/>
616
										Paste your shared key here.
617
									</td>
618
								</tr>
619
							</table>
620
						</td>
621 d799787e Matthew Grooms
					</tr>
622 3c11bd3c Matthew Grooms
					<tr id="tls_ca">
623
						<td width="22%" valign="top" class="vncellreq">Peer Certificate Authority</td>
624 d799787e Matthew Grooms
							<td width="78%" class="vtable">
625
							<select name='caref' class="formselect">
626
							<?php
627
								foreach ($config['system']['ca'] as $ca):
628
									$selected = "";
629
									if ($pconfig['caref'] == $ca['refid'])
630
										$selected = "selected";
631
							?>
632
								<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['name'];?></option>
633
							<?php endforeach; ?>
634
							</select>
635
							</td>
636
					</tr>
637 3c11bd3c Matthew Grooms
					<tr id="tls_cert">
638
						<td width="22%" valign="top" class="vncellreq">Server Certificate</td>
639 d799787e Matthew Grooms
							<td width="78%" class="vtable">
640
							<select name='certref' class="formselect">
641
							<?php
642
								foreach ($config['system']['cert'] as $cert):
643
									$selected = "";
644
									if ($pconfig['certref'] == $cert['refid'])
645
										$selected = "selected";
646
							?>
647
								<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['name'];?></option>
648
							<?php endforeach; ?>
649
							</select>
650
						</td>
651
					</tr>
652 fe787fc7 Matthew Grooms
					<tr id="tls_dh">
653
						<td width="22%" valign="top" class="vncellreq">DH Parameters Length</td>
654
						<td width="78%" class="vtable">
655
							<select name="dh_length" class="formselect">
656
								<?php
657
									foreach ($openvpn_dh_lengths as $length):
658
									$selected = '';
659
									if ($length == $pconfig['dh_length'])
660
										$selected = ' selected';
661
								?>
662
								<option<?=$selected?>><?=$length;?></option>
663
								<?php endforeach; ?>
664
							</select>
665
							<span class="vexpl">
666
								bits
667
							</span>
668
						</td>
669
					</tr>
670 d799787e Matthew Grooms
					<tr id="psk">
671
						<td width="22%" valign="top" class="vncellreq">Shared Key</td>
672 3c11bd3c Matthew Grooms
						<td width="78%" class="vtable">
673
							<?php if (!$pconfig['shared_key']): ?>
674
							<table border="0" cellpadding="2" cellspacing="0">
675
								<tr>
676
									<td>
677
										<?php set_checked($pconfig['autokey_enable'],$chk); ?>
678
										<input name="autokey_enable" type="checkbox" value="yes" <?=$chk;?> onClick="autokey_change()">
679
									</td>
680
									<td>
681
										<span class="vexpl">
682
											Automatically generate a shared key.
683
										</span>
684
									</td>
685
								</tr>
686
							</table>
687
							<?php endif; ?>
688
							<table border="0" cellpadding="2" cellspacing="0" id='autokey_opts'>
689
								<tr>
690
									<td>
691
										<textarea name="shared_key" cols="65" rows="7" class="formpre"><?=htmlspecialchars($pconfig['shared_key']);?></textarea>
692
										<br/>
693
										Paste your shared key here.
694
									</td>
695
								</tr>
696
							</table>
697 d799787e Matthew Grooms
						</td>
698
					</tr>
699
					<tr>
700
						<td width="22%" valign="top" class="vncellreq">Encryption algorithm</td>
701
						<td width="78%" class="vtable">
702
							<select name="crypto" class="formselect">
703
								<?php
704
									$cipherlist = openvpn_get_cipherlist();
705
									foreach ($cipherlist as $name => $desc):
706
									$selected = '';
707
									if ($name == $pconfig['crypto'])
708
										$selected = ' selected';
709
								?>
710
								<option value="<?=$name;?>"<?=$selected?>>
711
									<?=htmlspecialchars($desc);?>
712
								</option>
713
								<?php endforeach; ?>
714
							</select>
715
						</td>
716
					</tr>
717
					<tr>
718
						<td colspan="2" class="list" height="12"></td>
719
					</tr>
720
					<tr>
721
						<td colspan="2" valign="top" class="listtopic">Tunnel Settings</td>
722
					</tr>
723
					<tr>
724
						<td width="22%" valign="top" class="vncellreq">Tunnel Network</td>
725
						<td width="78%" class="vtable">
726
							<input name="tunnel_network" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['tunnel_network']);?>">
727
							<br>
728
							This is the virtual network used for private
729
							communications between this server and client
730
							hosts expressed using CIDR (eg. 10.0.8.0/24).
731
							The first network address will be assigned to
732
							the	server virtual interface. The remaining
733
							network addresses can optionally be assigned
734
							to connecting clients. (see Address Pool)
735
						</td>
736
					</tr>
737
					<tr>
738
						<td width="22%" valign="top" class="vncell">Redirect Gateway</td>
739
						<td width="78%" class="vtable">
740
							<table border="0" cellpadding="2" cellspacing="0">
741
								<tr>
742
									<td>
743
										<?php set_checked($pconfig['gwredir'],$chk); ?>
744
										<input name="gwredir" type="checkbox" value="yes" <?=$chk;?> onClick="gwredir_change()"/>
745
									</td>
746
									<td>
747
										<span class="vexpl">
748
											Force all client generated traffic through the tunnel.
749
										</span>
750
									</td>
751
								</tr>
752
							</table>
753
						</td>
754
					</tr>
755
					<tr id="local_opts">
756
						<td width="22%" valign="top" class="vncell">Local Network</td>
757
						<td width="78%" class="vtable">
758
							<input name="local_network" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['local_network']);?>">
759
							<br>
760
							This is the network that will be accessable
761
							from the remote endpoint. Expressed as a CIDR
762
							range. You may leave this blank if you don't
763
							want to add a route to the local network
764
							through this tunnel on the remote machine.
765
							This is generally set to your LAN network.
766
						</td>
767
					</tr>
768 3c11bd3c Matthew Grooms
					<tr id="remote_opts">
769
						<td width="22%" valign="top" class="vncell">Remote Network</td>
770
						<td width="78%" class="vtable">
771
							<input name="remote_network" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['remote_network']);?>">
772
							<br>
773
							This is a network that will be routed through
774
							the tunnel, so that a site-to-site VPN can be
775
							established without manually changing the
776
							routing tables. Expressed as a CIDR range. If
777
							this is a site-to-site VPN, enter here the
778
							remote LAN here. You may leave this blank if
779
							you don't want a site-to-site VPN.
780
						</td>
781
					</tr>
782 d799787e Matthew Grooms
					<tr>
783
						<td width="22%" valign="top" class="vncell"><?=gettext("Concurrent connections");?></td>
784
						<td width="78%" class="vtable">
785
							<input name="maxclients" type="text" class="formfld unknown" size="5" value="<?=htmlspecialchars($pconfig['maxclients']);?>"/>
786
							<br/>
787
							Specify the maximum number of clients allowed to concurrently connect to this server.
788
						</td>
789
					</tr>
790
					<tr>
791
						<td width="22%" valign="top" class="vncell">Compression</td>
792
						<td width="78%" class="vtable">
793
							<table border="0" cellpadding="2" cellspacing="0">
794
								<tr>
795
									<td>
796
										<?php set_checked($pconfig['compression'],$chk); ?>
797
										<input name="compression" type="checkbox" value="yes" <?=$chk;?>>
798
									</td>
799
									<td>
800
										<span class="vexpl">
801
											Compress tunnel packets using the LZO algorithm.
802
										</span>
803
									</td>
804
								</tr>
805
							</table>
806
						</td>
807
					</tr>
808
					<tr>
809
						<td width="22%" valign="top" class="vncell">Type-of-Service</td>
810
						<td width="78%" class="vtable">
811
							<table border="0" cellpadding="2" cellspacing="0">
812
								<tr>
813
									<td>
814 1cb0b40a Matthew Grooms
										<?php set_checked($pconfig['passtos'],$chk); ?>
815
										<input name="passtos" type="checkbox" value="yes" <?=$chk;?>>
816 d799787e Matthew Grooms
									</td>
817
									<td>
818
										<span class="vexpl">
819
											Set the TOS IP header value of tunnel packets to match the encapsulated packet value.
820
										</span>
821
									</td>
822
								</tr>
823
							</table>
824
						</td>
825
					</tr>
826
					<tr>
827
						<td width="22%" valign="top" class="vncell">Inter-client communication</td>
828
						<td width="78%" class="vtable">
829
							<table border="0" cellpadding="2" cellspacing="0">
830
								<tr>
831
									<td>
832
										<?php set_checked($pconfig['client2client'],$chk); ?>
833
										<input name="client2client" type="checkbox" value="yes" <?=$chk;?>/>
834
									</td>
835
									<td>
836
										<span class="vexpl">
837
											Allow communication between clients connected to this server
838
										</span>
839
									</td>
840
								</tr>
841
							</table>
842
						</td>
843
					</tr>
844 3c11bd3c Matthew Grooms
				</table>
845
846
				<table width="100%" border="0" cellpadding="6" cellspacing="0" id="client_opts">
847 d799787e Matthew Grooms
					<tr>
848
						<td colspan="2" class="list" height="12"></td>
849
					</tr>
850
					<tr>
851
						<td colspan="2" valign="top" class="listtopic">Client Settings</td>
852
					</tr>
853
					<tr>
854
						<td width="22%" valign="top" class="vncell">Address Pool</td>
855
						<td width="78%" class="vtable">
856
							<table border="0" cellpadding="2" cellspacing="0">
857
								<tr>
858
									<td>
859
										<?php set_checked($pconfig['pool_enable'],$chk); ?>
860
										<input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?>">
861
									</td>
862
									<td>
863
										<span class="vexpl">
864
											Provide a virtual adapter IP address to clients (see Tunnel Network)<br>
865
										</span>
866
									</td>
867
								</tr>
868
							</table>
869
						</td>
870
					</tr>
871
					<tr>
872
						<td width="22%" valign="top" class="vncell">DNS Default Domain</td>
873
						<td width="78%" class="vtable">
874
							<table border="0" cellpadding="2" cellspacing="0">
875
								<tr>
876
									<td>
877
										<?php set_checked($pconfig['dns_domain_enable'],$chk); ?>
878
										<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onClick="dns_domain_change()">
879
									</td>
880
									<td>
881
										<span class="vexpl">
882
	                                        Provide a default domain name to clients<br>
883
										</span>
884
									</td>
885
								</tr>
886
							</table>
887
							<table border="0" cellpadding="2" cellspacing="0" id="dns_domain_data">
888
								<tr>
889
									<td>
890
										<input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>">
891
									</td>
892
								</tr>
893
							</table>
894
						</td>
895
					</tr>
896
					<tr>
897
						<td width="22%" valign="top" class="vncell">DNS Servers</td>
898
						<td width="78%" class="vtable">
899
							<table border="0" cellpadding="2" cellspacing="0">
900
								<tr>
901
									<td>
902
										<?php set_checked($pconfig['dns_server_enable'],$chk); ?>
903
										<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onClick="dns_server_change()">
904
									</td>
905
									<td>
906
										<span class="vexpl">
907
											Provide a DNS server list to clients<br>
908
										</span>
909
									</td>
910
								</tr>
911
							</table>
912
							<table border="0" cellpadding="2" cellspacing="0" id="dns_server_data">
913
								<tr>
914
									<td>
915
										<span class="vexpl">
916
											Server #1:&nbsp;
917
										</span>
918
										<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=$pconfig['dns_server1'];?>">
919
									</td>
920
								</tr>
921
								<tr>
922
									<td>
923
										<span class="vexpl">
924
											Server #2:&nbsp;
925
										</span>
926
										<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=$pconfig['dns_server2'];?>">
927
									</td>
928
								</tr>
929
								<tr>
930
									<td>
931
										<span class="vexpl">
932
											Server #3:&nbsp;
933
										</span>
934
										<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=$pconfig['dns_server3'];?>">
935
									</td>
936
								</tr>
937
								<tr>
938
									<td>
939
										<span class="vexpl">
940
											Server #4:&nbsp;
941
										</span>
942
										<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=$pconfig['dns_server4'];?>">
943
									</td>
944
								</tr>
945
							</table>
946
						</td>
947
					</tr>
948
					<tr>
949
						<td width="22%" valign="top" class="vncell">NTP Servers</td>
950
						<td width="78%" class="vtable">
951
							<table border="0" cellpadding="2" cellspacing="0">
952
								<tr>
953
									<td>
954
										<?php set_checked($pconfig['ntp_server_enable'],$chk); ?>
955
										<input name="ntp_server_enable" type="checkbox" id="ntp_server_enable" value="yes" <?=$chk;?> onClick="ntp_server_change()">
956
									</td>
957
									<td>
958
										<span class="vexpl">
959
											Provide a NTP server list to clients<br>
960
										</span>
961
									</td>
962
								</tr>
963
							</table>
964
							<table border="0" cellpadding="2" cellspacing="0" id="ntp_server_data">
965
								<tr>
966
									<td>
967
										<span class="vexpl">
968
											Server #1:&nbsp;
969
										</span>
970
										<input name="ntp_server1" type="text" class="formfld unknown" id="ntp_server1" size="20" value="<?=$pconfig['ntp_server1'];?>">
971
									</td>
972
								</tr>
973
								<tr>
974
									<td>
975
										<span class="vexpl">
976
											Server #2:&nbsp;
977
										</span>
978
										<input name="ntp_server2" type="text" class="formfld unknown" id="ntp_server2" size="20" value="<?=$pconfig['ntp_server2'];?>">
979
									</td>
980
								</tr>
981
							</table>
982
						</td>
983
					</tr>
984
					<tr>
985
						<td width="22%" valign="top" class="vncell">NetBIOS Options</td>
986
						<td width="78%" class="vtable">
987
							<table border="0" cellpadding="2" cellspacing="0">
988
								<tr>
989
									<td>
990
										<?php set_checked($pconfig['netbios_enable'],$chk); ?>
991
										<input name="netbios_enable" type="checkbox" id="netbios_enable" value="yes" <?=$chk;?> onClick="netbios_change()">
992
									</td>
993
									<td>
994
										<span class="vexpl">
995
											Enable NetBIOS over TCP/IP<br>
996
										</span>
997
									</td>
998
								</tr>
999
							</table>
1000
							If this option is not set, all Netbios-over-TCP/IP options (includeing WINS) will be disabled.
1001
							<br/>
1002
							<table border="0" cellpadding="2" cellspacing="0" id="netbios_data">
1003
								<tr>
1004
									<td>
1005
										<br/>
1006
										<span class="vexpl">
1007
											Node Type:&nbsp;
1008
										</span>
1009
										<select name='netbios_ntype' class="formselect">
1010
										<?php
1011
											foreach ($netbios_nodetypes as $type => $name):
1012
												$selected = "";
1013
												if ($pconfig['netbios_ntype'] == $type)
1014
													$selected = "selected";
1015
										?>
1016
											<option value="<?=$type;?>" <?=$selected;?>><?=$name;?></option>
1017
										<?php endforeach; ?>
1018
										</select>
1019
										<br/>
1020
										Possible options: b-node (broadcasts), p-node
1021
										(point-to-point name queries to a WINS server),
1022
										m-node (broadcast then query name server), and
1023
										h-node (query name server, then broadcast).
1024
									</td>
1025
								</tr>
1026
								<tr>
1027
									<td>
1028
										<br/>
1029
										<span class="vexpl">
1030
											Scope ID:&nbsp;
1031
										</span>
1032
										<input name="netbios_scope" type="text" class="formfld unknown" id="netbios_scope" size="30" value="<?=htmlspecialchars($pconfig['netbios_scope']);?>">
1033
										<br/>
1034
										A NetBIOS Scope	ID provides an extended naming
1035
										service for	NetBIOS over TCP/IP. The NetBIOS
1036
										scope ID isolates NetBIOS traffic on a single
1037
										network to only those nodes with the same
1038
										NetBIOS scope ID.
1039
									</td>
1040
								</tr>
1041
							</table>
1042
						</td>
1043
					</tr>
1044
					<tr id="wins_opts">
1045
						<td width="22%" valign="top" class="vncell">WINS Servers</td>
1046
						<td width="78%" class="vtable">
1047
							<table border="0" cellpadding="2" cellspacing="0">
1048
								<tr>
1049
									<td>
1050
										<?php set_checked($pconfig['wins_server_enable'],$chk); ?>
1051
										<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onClick="wins_server_change()">
1052
									</td>
1053
									<td>
1054
										<span class="vexpl">
1055
											Provide a WINS server list to clients<br>
1056
										</span>
1057
									</td>
1058
								</tr>
1059
							</table>
1060
							<table border="0" cellpadding="2" cellspacing="0" id="wins_server_data">
1061
								<tr>
1062
									<td>
1063
										<span class="vexpl">
1064
											Server #1:&nbsp;
1065
										</span>
1066
										<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=$pconfig['wins_server1'];?>">
1067
									</td>
1068
								</tr>
1069
								<tr>
1070
									<td>
1071
										<span class="vexpl">
1072
											Server #2:&nbsp;
1073
										</span>
1074
										<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=$pconfig['wins_server2'];?>">
1075
									</td>
1076
								</tr>
1077
							</table>
1078
						</td>
1079
					</tr>
1080 3c11bd3c Matthew Grooms
				</table>
1081
1082
				<table width="100%" border="0" cellpadding="6" cellspacing="0" id="client_opts">
1083 d799787e Matthew Grooms
					<tr>
1084
						<td width="22%" valign="top">&nbsp;</td>
1085
						<td width="78%"> 
1086
							<input name="save" type="submit" class="formbtn" value="Save"> 
1087
							<input name="act" type="hidden" value="<?=$act;?>">
1088
							<?php if (isset($id) && $a_server[$id]): ?>
1089
							<input name="id" type="hidden" value="<?=$id;?>">
1090
							<?php endif; ?>
1091
						</td>
1092
					</tr>
1093
				</table>
1094
			</form>
1095
1096
			<?php else: ?>
1097
1098
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
1099
				<tr>
1100
					<td width="10%" class="listhdrr">Disabled</td>
1101
					<td width="10%" class="listhdrr">Protocol</td>
1102
					<td width="30%" class="listhdrr">Tunnel Network</td>
1103
					<td width="40%" class="listhdrr">Description</td>
1104
					<td width="10%" class="list"></td>
1105
				</tr>
1106
				<?php
1107
					$i = 0;
1108
					foreach($a_server as $server):
1109
						$disabled = "NO";
1110
						if ($server['disable'])
1111
							$disabled = "YES";
1112
				?>
1113
				<tr>
1114
					<td class="listlr">
1115
						<?=$disabled;?>
1116
					</td>
1117
					<td class="listr">
1118
						<?=htmlspecialchars($server['protocol']);?>
1119
					</td>
1120
					<td class="listr">
1121
						<?=htmlspecialchars($server['tunnel_network']);?>
1122
					</td>
1123
					<td class="listr">
1124
						<?=htmlspecialchars($server['description']);?>
1125
					</td>
1126
					<td valign="middle" nowrap class="list">
1127
						<a href="vpn_openvpn_server.php?act=edit&id=<?=$i;?>">
1128
							<img src="./themes/<?=$g['theme'];?>/images/icons/icon_e.gif" title="edit server" width="17" height="17" border="0">
1129
						</a>
1130
						&nbsp;
1131
						<a href="vpn_openvpn_server.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this server?')">
1132
							<img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" title="delete server" width="17" height="17" border="0">
1133
						</a>
1134
					</td>
1135
				</tr>
1136
				<?php
1137
					$i++;
1138
					endforeach;
1139
				?>
1140
				<tr>
1141
					<td class="list" colspan="4"></td>
1142
					<td class="list">
1143
						<a href="vpn_openvpn_server.php?act=new"><img src="./themes/<?=$g['theme'];?>/images/icons/icon_plus.gif" title="add server" width="17" height="17" border="0">
1144
						</a>
1145
					</td>
1146
				</tr>
1147
				<tr>
1148
					<td colspan="4">
1149
						<p>
1150
							<?=gettext("Additional OpenVPN servers can be added here.");?>
1151
						</p>
1152
					</td>
1153
				</tr>
1154
			</table>
1155
1156
			<? endif; ?>
1157
1158
		</td>
1159
	</tr>
1160
</table>
1161
<script language="JavaScript">
1162
<!--
1163 3c11bd3c Matthew Grooms
mode_change();
1164
autokey_change();
1165
tlsauth_change();
1166 d799787e Matthew Grooms
gwredir_change();
1167
dns_domain_change();
1168
dns_server_change();
1169
wins_server_change();
1170
ntp_server_change();
1171
netbios_change();
1172
//-->
1173
</script>
1174
</body>
1175
<?php include("fend.inc"); ?>
1176
1177
<?php
1178
1179
/* local utility functions */
1180
1181
function set_checked($var,& $chk) {
1182
    if($var)
1183
        $chk = 'checked';
1184
    else
1185
        $chk = '';
1186
}
1187
1188
?>