Project

General

Profile

Download (38.4 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	services_dhcpv6.php
5
	parts of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9

    
10
	part of pfSense (http://www.pfsense.org)
11
	Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
12
	All rights reserved.
13

    
14
	Redistribution and use in source and binary forms, with or without
15
	modification, are permitted provided that the following conditions are met:
16

    
17
	1. Redistributions of source code must retain the above copyright notice,
18
	   this list of conditions and the following disclaimer.
19

    
20
	2. Redistributions in binary form must reproduce the above copyright
21
	   notice, this list of conditions and the following disclaimer in the
22
	   documentation and/or other materials provided with the distribution.
23

    
24
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
25
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
	POSSIBILITY OF SUCH DAMAGE.
34
*/
35
/*
36
	pfSense_BUILDER_BINARIES:	/bin/rm
37
	pfSense_MODULE:	interfaces
38
*/
39

    
40
##|+PRIV
41
##|*IDENT=page-services-dhcpv6server
42
##|*NAME=Services: DHCPv6 server page
43
##|*DESCR=Allow access to the 'Services: DHCPv6 server' page.
44
##|*MATCH=services_dhcpv6.php*
45
##|-PRIV
46

    
47
require("guiconfig.inc");
48

    
49
if(!$g['services_dhcp_server_enable']) {
50
	Header("Location: /");
51
	exit;
52
}
53

    
54
/*  Fix failover DHCP problem
55
 *  http://article.gmane.org/gmane.comp.security.firewalls.pfsense.support/18749
56
 */
57
ini_set("memory_limit","64M");
58

    
59
$if = $_GET['if'];
60
if ($_POST['if'])
61
	$if = $_POST['if'];
62

    
63
/* if OLSRD is enabled, allow WAN to house DHCP. */
64
if($config['installedpackages']['olsrd']) {
65
	foreach($config['installedpackages']['olsrd']['config'] as $olsrd) {
66
			if($olsrd['enable']) {
67
				$is_olsr_enabled = true;
68
				break;
69
			}
70
	}
71
}
72

    
73
if (!$_GET['if'])
74
	$savemsg = "<b>" . gettext("The DHCPv6 Server can only be enabled on interfaces configured with static IP addresses") . ".<p>" . gettext("Only interfaces configured with a static IP will be shown") . ".</p></b>";
75

    
76
$iflist = get_configured_interface_with_descr();
77

    
78
/* set the starting interface */
79
if (!$if || !isset($iflist[$if])) {
80
	foreach ($iflist as $ifent => $ifname) {
81
		$oc = $config['interfaces'][$ifent];
82
		if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && (!is_ipaddrv6($oc['ipaddrv6']))) ||
83
			(!is_array($config['dhcpdv6'][$ifent]) && (!is_ipaddrv6($oc['ipaddrv6']))))
84
			continue;
85
		$if = $ifent;
86
		break;
87
	}
88
}
89

    
90
if (is_array($config['dhcpdv6'][$if])){
91
	if (is_array($config['dhcpdv6'][$if]['range'])) {
92
		$pconfig['range_from'] = $config['dhcpdv6'][$if]['range']['from'];
93
		$pconfig['range_to'] = $config['dhcpdv6'][$if]['range']['to'];
94
	}
95
	if (is_array($config['dhcpdv6'][$if]['prefixrange'])) {
96
		$pconfig['prefixrange_from'] = $config['dhcpdv6'][$if]['prefixrange']['from'];
97
		$pconfig['prefixrange_to'] = $config['dhcpdv6'][$if]['prefixrange']['to'];
98
		$pconfig['prefixrange_length'] = $config['dhcpdv6'][$if]['prefixrange']['prefixlength'];
99
	}
100
	$pconfig['mode'] = $config['dhcpdv6'][$if]['mode'];
101
	$pconfig['deftime'] = $config['dhcpdv6'][$if]['defaultleasetime'];
102
	$pconfig['maxtime'] = $config['dhcpdv6'][$if]['maxleasetime'];
103
	$pconfig['gateway'] = $config['dhcpdv6'][$if]['gateway'];
104
	$pconfig['domain'] = $config['dhcpdv6'][$if]['domain'];
105
	$pconfig['domainsearchlist'] = $config['dhcpdv6'][$if]['domainsearchlist'];
106
	list($pconfig['wins1'],$pconfig['wins2']) = $config['dhcpdv6'][$if]['winsserver'];
107
	list($pconfig['dns1'],$pconfig['dns2']) = $config['dhcpdv6'][$if]['dnsserver'];
108
	$pconfig['enable'] = isset($config['dhcpdv6'][$if]['enable']);
109
	$pconfig['denyunknown'] = isset($config['dhcpdv6'][$if]['denyunknown']);
110
	$pconfig['ddnsdomain'] = $config['dhcpdv6'][$if]['ddnsdomain'];
111
	$pconfig['ddnsupdate'] = isset($config['dhcpdv6'][$if]['ddnsupdate']);
112
	list($pconfig['ntp1'],$pconfig['ntp2']) = $config['dhcpdv6'][$if]['ntpserver'];
113
	$pconfig['tftp'] = $config['dhcpdv6'][$if]['tftp'];
114
	$pconfig['ldap'] = $config['dhcpdv6'][$if]['ldap'];
115
	$pconfig['netboot'] = isset($config['dhcpdv6'][$if]['netboot']);
116
	$pconfig['nextserver'] = $config['dhcpdv6'][$if]['nextserver'];
117
	$pconfig['filename'] = $config['dhcpdv6'][$if]['filename'];
118
	$pconfig['rootpath'] = $config['dhcpdv6'][$if]['rootpath'];
119
	$pconfig['failover_peerip'] = $config['dhcpdv6'][$if]['failover_peerip'];
120
	$pconfig['netmask'] = $config['dhcpdv6'][$if]['netmask'];
121
	$pconfig['numberoptions'] = $config['dhcpdv6'][$if]['numberoptions'];
122
	$pconfig['dhcpv6leaseinlocaltime'] = $config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'];
123
	if (!is_array($config['dhcpdv6'][$if]['staticmap']))
124
		$config['dhcpdv6'][$if]['staticmap'] = array();
125
	$a_maps = &$config['dhcpdv6'][$if]['staticmap'];
126
}
127

    
128
$ifcfgip = get_interface_ipv6($if);
129
$ifcfgsn = get_interface_subnetv6($if);
130

    
131
/*   set the enabled flag which will tell us if DHCP relay is enabled
132
 *   on any interface. We will use this to disable DHCP server since
133
 *   the two are not compatible with each other.
134
 */
135

    
136
$dhcrelay_enabled = false;
137
$dhcrelaycfg = $config['dhcrelay6'];
138

    
139
if(is_array($dhcrelaycfg)) {
140
	foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
141
		if (isset($dhcrelayifconf['enable']) && isset($iflist[$dhcrelayif]) &&
142
			(!link_interface_to_bridge($dhcrelayif)))
143
			$dhcrelay_enabled = true;
144
	}
145
}
146

    
147
/* FIXME needs v6 code, use in subnet v6? */
148
function is_inrange($test, $start, $end) {
149
	if ( (ip2ulong($test) < ip2ulong($end)) && (ip2ulong($test) > ip2ulong($start)) )
150
		return true;
151
	else
152
		return false;
153
}
154

    
155
$advertise_modes = array("disabled" => "Disabled", "router" => "Router Only", "unmanaged" => "Unmanaged", "managed" => "Managed", "assist" => "Assisted");
156

    
157
if ($_POST) {
158

    
159
	unset($input_errors);
160

    
161
	$pconfig = $_POST;
162

    
163
	$numberoptions = array();
164
	for($x=0; $x<99; $x++) {
165
		if(isset($_POST["number{$x}"]) && ctype_digit($_POST["number{$x}"])) {
166
			$numbervalue = array();
167
			$numbervalue['number'] = htmlspecialchars($_POST["number{$x}"]);
168
			$numbervalue['value'] = htmlspecialchars($_POST["value{$x}"]);
169
			$numberoptions['item'][] = $numbervalue;
170
		}
171
	}
172
	// Reload the new pconfig variable that the forum uses.
173
	$pconfig['numberoptions'] = $numberoptions;
174

    
175
	/* input validation */
176
	if ($_POST['enable']) {
177
		$reqdfields = explode(" ", "range_from range_to");
178
		$reqdfieldsn = array(gettext("Range begin"),gettext("Range end"));
179

    
180
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
181

    
182
		if (($_POST['prefixrange_from'] && !is_ipaddrv6($_POST['prefixrange_from'])))
183
			$input_errors[] = gettext("A valid range must be specified.");
184
		if (($_POST['prefixrange_to'] && !is_ipaddrv6($_POST['prefixrange_to'])))
185
			$input_errors[] = gettext("A valid prefix range must be specified.");
186
		if (($_POST['range_from'] && !is_ipaddrv6($_POST['range_from'])))
187
			$input_errors[] = gettext("A valid range must be specified.");
188
		if (($_POST['range_to'] && !is_ipaddrv6($_POST['range_to'])))
189
			$input_errors[] = gettext("A valid range must be specified.");
190
		if (($_POST['gateway'] && !is_ipaddrv6($_POST['gateway'])))
191
			$input_errors[] = gettext("A valid IPv6 address must be specified for the gateway.");
192
		if (($_POST['dns1'] && !is_ipaddrv6($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv6($_POST['dns2'])))
193
			$input_errors[] = gettext("A valid IPv6 address must be specified for the primary/secondary DNS servers.");
194

    
195
		if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
196
			$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
197
		if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime'])))
198
			$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time.");
199
		if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain'])))
200
			$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration.");
201
		if ($_POST['domainsearchlist']) {
202
			$domain_array=preg_split("/[ ;]+/",$_POST['domainsearchlist']);
203
			foreach ($domain_array as $curdomain) {
204
				if (!is_domain($curdomain)) {
205
					$input_errors[] = gettext("A valid domain search list must be specified.");
206
					break;
207
				}
208
			}
209
		}
210

    
211
		if (($_POST['ntp1'] && !is_ipaddrv6($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddrv6($_POST['ntp2'])))
212
			$input_errors[] = gettext("A valid IPv6 address must be specified for the primary/secondary NTP servers.");
213
		if (($_POST['domain'] && !is_domain($_POST['domain'])))
214
			$input_errors[] = gettext("A valid domain name must be specified for the DNS domain.");
215
		if ($_POST['tftp'] && !is_ipaddr($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp']))
216
			$input_errors[] = gettext("A valid IPv6 address or hostname must be specified for the TFTP server.");
217
		if (($_POST['nextserver'] && !is_ipaddrv6($_POST['nextserver'])))
218
			$input_errors[] = gettext("A valid IPv6 address must be specified for the network boot server.");
219

    
220
		// Disallow a range that includes the virtualip
221
		if (is_array($config['virtualip']['vip'])) {
222
			foreach($config['virtualip']['vip'] as $vip) {
223
				if($vip['interface'] == $if)
224
					if($vip['subnetv6'] && is_inrange($vip['subnetv6'], $_POST['range_from'], $_POST['range_to']))
225
						$input_errors[] = sprintf(gettext("The subnet range cannot overlap with virtual IPv6 address %s."),$vip['subnetv6']);
226
			}
227
		}
228

    
229
		$noip = false;
230
		if(is_array($a_maps))
231
			foreach ($a_maps as $map)
232
				if (empty($map['ipaddrv6']))
233
					$noip = true;
234
		if (!$input_errors) {
235
			/* make sure the range lies within the current subnet */
236
			/* FIXME change for ipv6 subnet */
237
			$subnet_start = gen_subnetv6($ifcfgip, $ifcfgsn);
238
			$subnet_end = gen_subnetv6_max($ifcfgip, $ifcfgsn);
239

    
240
			if((! ip_in_subnet($_POST['range_from'], $subnet_start)) || (! ip_in_subnet($_POST['range_to'], $subnet_start))) {
241
				$input_errors[] = gettext("The specified range lies outside of the current subnet.");
242
			}
243

    
244
			/* no idea how to do this yet 
245
			if (ip2ulong($_POST['range_from']) > ip2ulong($_POST['range_to']))
246
				$input_errors[] = gettext("The range is invalid (first element higher than second element).");
247
			*/
248

    
249
			/* make sure that the DHCP Relay isn't enabled on this interface */
250
			if (isset($config['dhcrelay'][$if]['enable']))
251
				$input_errors[] = sprintf(gettext("You must disable the DHCP relay on the %s interface before enabling the DHCP server."),$iflist[$if]);
252

    
253
			// $dynsubnet_start = ip2ulong($_POST['range_from']);
254
			// $dynsubnet_end = ip2ulong($_POST['range_to']);
255
			/* FIX later. Also applies to prefix delegation
256
			if(is_array($a_maps)) {
257
				foreach ($a_maps as $map) {
258
					if (empty($map['ipaddrv6']))
259
						continue;
260
					if ((ip2ulong($map['ipaddrv6']) > $dynsubnet_start) &&
261
						(ip2ulong($map['ipaddr']) < $dynsubnet_end)) {
262
						$input_errors[] = sprintf(gettext("The DHCP range cannot overlap any static DHCP mappings."));
263
						break;
264
					}
265
				}
266
			}
267
			*/
268
		}
269
	}
270

    
271
	if (!$input_errors) {
272
		if (!is_array($config['dhcpdv6'][$if]))
273
			$config['dhcpdv6'][$if] = array();
274
		if (!is_array($config['dhcpdv6'][$if]['range']))
275
			$config['dhcpdv6'][$if]['range'] = array();
276
		if (!is_array($config['dhcpdv6'][$if]['prefixrange']))
277
			$config['dhcpdv6'][$if]['prefixrange'] = array();
278

    
279
		$config['dhcpdv6'][$if]['mode'] = $_POST['mode'];
280
		$config['dhcpdv6'][$if]['range']['from'] = $_POST['range_from'];
281
		$config['dhcpdv6'][$if]['range']['to'] = $_POST['range_to'];
282
		$config['dhcpdv6'][$if]['prefixrange']['from'] = $_POST['prefixrange_from'];
283
		$config['dhcpdv6'][$if]['prefixrange']['to'] = $_POST['prefixrange_to'];
284
		$config['dhcpdv6'][$if]['prefixrange']['prefixlength'] = $_POST['prefixrange_length'];
285
		$config['dhcpdv6'][$if]['defaultleasetime'] = $_POST['deftime'];
286
		$config['dhcpdv6'][$if]['maxleasetime'] = $_POST['maxtime'];
287
		$config['dhcpdv6'][$if]['netmask'] = $_POST['netmask'];
288
		$previous = $config['dhcpdv6'][$if]['failover_peerip'];
289
		if($previous <> $_POST['failover_peerip'])
290
			mwexec("/bin/rm -rf /var/dhcpd/var/db/*");
291

    
292
		$config['dhcpdv6'][$if]['failover_peerip'] = $_POST['failover_peerip'];
293

    
294
		unset($config['dhcpdv6'][$if]['winsserver']);
295

    
296
		unset($config['dhcpdv6'][$if]['dnsserver']);
297
		if ($_POST['dns1'])
298
			$config['dhcpdv6'][$if]['dnsserver'][] = $_POST['dns1'];
299
		if ($_POST['dns2'])
300
			$config['dhcpdv6'][$if]['dnsserver'][] = $_POST['dns2'];
301

    
302
		$config['dhcpdv6'][$if]['gateway'] = $_POST['gateway'];
303
		$config['dhcpdv6'][$if]['domain'] = $_POST['domain'];
304
		$config['dhcpdv6'][$if]['domainsearchlist'] = $_POST['domainsearchlist'];
305
		$config['dhcpdv6'][$if]['denyunknown'] = ($_POST['denyunknown']) ? true : false;
306
		$config['dhcpdv6'][$if]['enable'] = ($_POST['enable']) ? true : false;
307
		$config['dhcpdv6'][$if]['ddnsdomain'] = $_POST['ddnsdomain'];
308
		$config['dhcpdv6'][$if]['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
309

    
310
		unset($config['dhcpdv6'][$if]['ntpserver']);
311
		if ($_POST['ntp1'])
312
			$config['dhcpdv6'][$if]['ntpserver'][] = $_POST['ntp1'];
313
		if ($_POST['ntp2'])
314
			$config['dhcpdv6'][$if]['ntpserver'][] = $_POST['ntp2'];
315

    
316
		$config['dhcpdv6'][$if]['tftp'] = $_POST['tftp'];
317
		$config['dhcpdv6'][$if]['ldap'] = $_POST['ldap'];
318
		$config['dhcpdv6'][$if]['netboot'] = ($_POST['netboot']) ? true : false;
319
		$config['dhcpdv6'][$if]['nextserver'] = $_POST['nextserver'];
320
		$config['dhcpdv6'][$if]['filename'] = $_POST['filename'];
321
		$config['dhcpdv6'][$if]['rootpath'] = $_POST['rootpath'];
322
		$config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'] = $_POST['dhcpv6leaseinlocaltime'];
323

    
324
		// Handle the custom options rowhelper
325
		if(isset($config['dhcpdv6'][$if]['numberoptions']['item']))
326
			unset($config['dhcpdv6'][$if]['numberoptions']['item']);
327

    
328
		$config['dhcpdv6'][$if]['numberoptions'] = $numberoptions;
329

    
330
		write_config();
331

    
332
		$retval = 0;
333
		$retvaldhcp = 0;
334
		$retvaldns = 0;
335
		/* Stop DHCPv6 so we can cleanup leases */
336
		killbyname("dhcpd -6");
337
		// dhcp_clean_leases();
338
		/* dnsmasq_configure calls dhcpd_configure */
339
		/* no need to restart dhcpd twice */
340
		if (isset($config['dnsmasq']['regdhcpstatic']))	{
341
			$retvaldns = services_dnsmasq_configure();
342
			if ($retvaldns == 0) {
343
				clear_subsystem_dirty('hosts');
344
				clear_subsystem_dirty('staticmaps');
345
			}
346
		} else {
347
			$retvaldhcp = services_dhcpd_configure();
348
			if ($retvaldhcp == 0)
349
				clear_subsystem_dirty('staticmaps');
350
		}
351
		if($retvaldhcp == 1 || $retvaldns == 1)
352
			$retval = 1;
353
		$savemsg = get_std_save_message($retval);
354
	}
355
}
356

    
357
if ($_GET['act'] == "del") {
358
	if ($a_maps[$_GET['id']]) {
359
		unset($a_maps[$_GET['id']]);
360
		write_config();
361
		if(isset($config['dhcpdv6'][$if]['enable'])) {
362
			mark_subsystem_dirty('staticmapsv6');
363
			if (isset($config['dnsmasq']['regdhcpstaticv6']))
364
				mark_subsystem_dirty('hosts');
365
		}
366
		header("Location: services_dhcpv6.php?if={$if}");
367
		exit;
368
	}
369
}
370

    
371
$pgtitle = array(gettext("Services"),gettext("DHCPv6 server"));
372
$statusurl = "status_dhcpv6_leases.php";
373
$logurl = "diag_logs_dhcp.php";
374

    
375
include("head.inc");
376

    
377
?>
378

    
379
<script type="text/javascript" src="/javascript/row_helper.js">
380
</script>
381

    
382
<script type="text/javascript">
383
	rowname[0] = "number";
384
	rowtype[0] = "textbox";
385
	rowsize[0] = "10";
386
	rowname[1] = "value";
387
	rowtype[1] = "textbox";
388
	rowsize[1] = "55";
389
</script>
390

    
391
<script type="text/javascript" language="JavaScript">
392
	function enable_change(enable_over) {
393
		var endis;
394
		endis = !(document.iform.enable.checked || enable_over);
395
		document.iform.range_from.disabled = endis;
396
		document.iform.range_to.disabled = endis;
397
		document.iform.prefixrange_from.disabled = endis;
398
		document.iform.prefixrange_to.disabled = endis;
399
		document.iform.prefixrange_length.disabled = endis;
400
		document.iform.dns1.disabled = endis;
401
		document.iform.dns2.disabled = endis;
402
		document.iform.deftime.disabled = endis;
403
		document.iform.maxtime.disabled = endis;
404
		document.iform.gateway.disabled = endis;
405
		document.iform.failover_peerip.disabled = endis;
406
		document.iform.dhcpv6leaseinlocaltime.disabled = endis;
407
		document.iform.domain.disabled = endis;
408
		document.iform.domainsearchlist.disabled = endis;
409
		document.iform.ddnsdomain.disabled = endis;
410
		document.iform.ddnsupdate.disabled = endis;
411
		document.iform.ntp1.disabled = endis;
412
		document.iform.ntp2.disabled = endis;
413
		document.iform.tftp.disabled = endis;
414
		document.iform.ldap.disabled = endis;
415
		document.iform.netboot.disabled = endis;
416
		document.iform.nextserver.disabled = endis;
417
		document.iform.filename.disabled = endis;
418
		document.iform.rootpath.disabled = endis;
419
		document.iform.denyunknown.disabled = endis;
420
	}
421

    
422
	function show_shownumbervalue() {
423
		document.getElementById("shownumbervaluebox").innerHTML='';
424
		aodiv = document.getElementById('shownumbervalue');
425
		aodiv.style.display = "block";
426
	}
427

    
428
	function show_ddns_config() {
429
		document.getElementById("showddnsbox").innerHTML='';
430
		aodiv = document.getElementById('showddns');
431
		aodiv.style.display = "block";
432
	}
433
	/*
434
	function show_ntp_config() {
435
		document.getElementById("showntpbox").innerHTML='';
436
		aodiv = document.getElementById('showntp');
437
		aodiv.style.display = "block";
438
	}
439
	*/
440
	/*
441
	function show_tftp_config() {
442
		document.getElementById("showtftpbox").innerHTML='';
443
		aodiv = document.getElementById('showtftp');
444
		aodiv.style.display = "block";
445
	}
446
	*/
447
	function show_ldap_config() {
448
		document.getElementById("showldapbox").innerHTML='';
449
		aodiv = document.getElementById('showldap');
450
		aodiv.style.display = "block";
451
	}
452

    
453
	function show_netboot_config() {
454
		document.getElementById("shownetbootbox").innerHTML='';
455
		aodiv = document.getElementById('shownetboot');
456
		aodiv.style.display = "block";
457
	}
458
</script>
459

    
460
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
461
<?php include("fbegin.inc"); ?>
462
<form action="services_dhcpv6.php" method="post" name="iform" id="iform">
463
<?php if ($input_errors) print_input_errors($input_errors); ?>
464
<?php if ($savemsg) print_info_box($savemsg); ?>
465
<?php
466
	if ($dhcrelay_enabled) {
467
		echo gettext("DHCP Relay is currently enabled. Cannot enable the DHCP Server service while the DHCP Relay is enabled on any interface.");
468
		include("fend.inc");
469
		echo "</body>";
470
		echo "</html>";
471
		exit;
472
	}
473
?>
474
<?php if (is_subsystem_dirty('staticmaps')): ?><p>
475
<?php print_info_box_np(gettext("The static mapping configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect."));?><br>
476
<?php endif; ?>
477
<table width="100%" border="0" cellpadding="0" cellspacing="0">
478
<tr><td>
479
<?php
480
	/* active tabs */
481
	$tab_array = array();
482
	$tabscounter = 0;
483
	$i = 0;
484
	foreach ($iflist as $ifent => $ifname) {
485
		$oc = $config['interfaces'][$ifent];
486
		if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && (!is_ipaddrv6($oc['ipaddrv6']))) ||
487
			(!is_array($config['dhcpdv6'][$ifent]) && (!is_ipaddrv6($oc['ipaddrv6']))))
488
			continue;
489
		if ($ifent == $if)
490
			$active = true;
491
		else
492
			$active = false;
493
		$tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}");
494
		$tabscounter++;
495
	}
496
	if ($tabscounter == 0) {
497
		echo "</td></tr></table></form>";
498
		include("fend.inc");
499
		echo "</body>";
500
		echo "</html>";
501
		exit;
502
	}
503
	display_top_tabs($tab_array);
504
?>
505
</td></tr>
506
<tr>
507
<td>
508
	<div id="mainarea">
509
		<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
510
			<tr>
511
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Router Advertisements");?></td>
512
			<td width="78%" class="vtable">
513
				<select name="mode" id="mode">
514
					<?php foreach($advertise_modes as $name => $value) { ?>
515
					<option value="<?=$name ?>" <?php if ($pconfig['mode'] == $name) echo "selected"; ?> > <?=$value ?></option>
516
					<?php } ?>
517
				</select><br />
518
			<strong><?php printf(gettext("Select the Operating Mode for the router advertisement Daemon."))?></strong>
519
			<?php printf(gettext("Use \"Router Only\" to only advertise this router, \"Unmanaged\" for Router Advertising with Stateless Autoconfig, \"Managed\" for assignment through (a) DHCPv6 Server, \"Assisted\" for DHCPv6 Server assignment combined with Stateless Autoconfig"));?>
520
			<?php printf(gettext("It is not required to activate this DHCPv6 server when set to \"Managed\", this can be another host on the network")); ?>
521
			</td>
522
			</tr>
523
			<tr>
524
			<td width="22%" valign="top" class="vtable">&nbsp;</td>
525
			<td width="78%" class="vtable">
526
				<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false);">
527
			<strong><?php printf(gettext("Enable DHCPv6 server on " .
528
			"%s " .
529
			"interface"),htmlspecialchars($iflist[$if]));?></strong></td>
530
			</tr>
531
			<tr>
532
			<td width="22%" valign="top" class="vtable">&nbsp;</td>
533
			<td width="78%" class="vtable">
534
				<input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
535
				<strong><?=gettext("Deny unknown clients");?></strong><br>
536
				<?=gettext("If this is checked, only the clients defined below will get DHCP leases from this server. ");?></td>
537
			</tr>
538
			<tr>
539
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet");?></td>
540
			<td width="78%" class="vtable">
541
				<?=gen_subnetv6($ifcfgip, $ifcfgsn);?>
542
			</td>
543
			</tr>
544
			<tr>
545
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet mask");?></td>
546
			<td width="78%" class="vtable">
547
				<?=$ifcfgsn;?> bits
548
			</td>
549
			</tr>
550
			<tr>
551
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Available range");?></td>
552
			<td width="78%" class="vtable">
553
			<?php
554
				$range_from = gen_subnetv6($ifcfgip, $ifcfgsn);
555
				$range_from++;
556
				echo $range_from;
557

    
558
			?>
559
			-
560
			<?php
561
				/* FIXME end of subnet calculation here */
562
				$range_to = gen_subnetv6_max($ifcfgip, $ifcfgsn);;
563
				echo $range_to;
564
			?>
565
			</td>
566
			</tr>
567
			<?php if($is_olsr_enabled): ?>
568
			<tr>
569
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet Mask");?></td>
570
			<td width="78%" class="vtable">
571
				<select name="netmask" class="formselect" id="netmask">
572
				<?php
573
				for ($i = 128; $i > 0; $i--) {
574
					if($i <> 127) {
575
						echo "<option value=\"{$i}\" ";
576
						if ($i == $pconfig['netmask']) echo "selected";
577
						echo ">" . $i . "</option>";
578
					}
579
				}
580
				?>
581
				</select>
582
			</td>
583
			</tr>
584
			<?php endif; ?>
585
			<tr>
586
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Range");?></td>
587
			<td width="78%" class="vtable">
588
				<input name="range_from" type="text" class="formfld unknown" id="range_from" size="28" value="<?=htmlspecialchars($pconfig['range_from']);?>">
589
				&nbsp;<?=gettext("to"); ?>&nbsp; <input name="range_to" type="text" class="formfld unknown" id="range_to" size="28" value="<?=htmlspecialchars($pconfig['range_to']);?>">
590
			</td>
591
			</tr>
592
			<tr>
593
			<td width="22%" valign="top" class="vncell"><?=gettext("Prefix Delegation Range");?></td>
594
			<td width="78%" class="vtable">
595
				<input name="prefixrange_from" type="text" class="formfld unknown" id="prefixrange_from" size="28" value="<?=htmlspecialchars($pconfig['prefixrange_from']);?>">
596
				&nbsp;<?=gettext("to"); ?>&nbsp; <input name="prefixrange_to" type="text" class="formfld unknown" id="prefixrange_to" size="28" value="<?=htmlspecialchars($pconfig['prefixrange_to']);?>">
597
				&nbsp;<?=gettext("prefix length"); ?>&nbsp; <select name="prefixrange_length" class="formselect" id="prefixrange_length">
598
					<option value="48" <?php if($pconfig['prefixrange_length'] == 48) echo "selected"; ?>>48</option>
599
					<option value="56" <?php if($pconfig['prefixrange_length'] == 56) echo "selected"; ?>>56</option>
600
					<option value="60" <?php if($pconfig['prefixrange_length'] == 60) echo "selected"; ?>>60</option>
601
				</select> <br/>
602
				<?php echo gettext("You can define a Prefix range here for DHCP Prefix Delegation. This allows for 
603
					assigning networks to subrouters"); ?>
604
			</td>
605
			</tr>
606
			<tr>
607
			<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers");?></td>
608
			<td width="78%" class="vtable">
609
				<input name="dns1" type="text" class="formfld unknown" id="dns1" size="28" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
610
				<input name="dns2" type="text" class="formfld unknown" id="dns2" size="28" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
611
				<?=gettext("NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.");?>
612
			</td>
613
			</tr>
614
			<!--
615
			<tr>
616
			<td width="22%" valign="top" class="vncell"><?=gettext("Gateway");?></td>
617
			<td width="78%" class="vtable">
618
				<input name="gateway" type="text" class="formfld host" id="gateway" size="28" value="<?=htmlspecialchars($pconfig['gateway']);?>"><br>
619
			 	 <?=gettext("The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.");?>
620
			</td>
621
			</tr>
622
			-->
623
			<tr>
624
			<td width="22%" valign="top" class="vncell"><?=gettext("Domain name");?></td>
625
			<td width="78%" class="vtable">
626
				<input name="domain" type="text" class="formfld unknown" id="domain" size="28" value="<?=htmlspecialchars($pconfig['domain']);?>"><br>
627
				 <?=gettext("The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here.");?>
628
			 </td>
629
			</tr>
630
			<tr>
631
			<td width="22%" valign="top" class="vncell"><?=gettext("Domain search list");?></td>
632
			<td width="78%" class="vtable">
633
				<input name="domainsearchlist" type="text" class="formfld unknown" id="domainsearchlist" size="28" value="<?=htmlspecialchars($pconfig['domainsearchlist']);?>"><br>
634
				<?=gettext("The DHCP server can optionally provide a domain search list. Use the semicolon character as seperator");?>
635
			</td>
636
			</tr>
637
			<tr>
638
			<td width="22%" valign="top" class="vncell"><?=gettext("Default lease time");?></td>
639
			<td width="78%" class="vtable">
640
				<input name="deftime" type="text" class="formfld unknown" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
641
				<?=gettext("seconds");?><br>
642
				<?=gettext("This is used for clients that do not ask for a specific " .
643
				"expiration time."); ?><br>
644
				<?=gettext("The default is 7200 seconds.");?>
645
			</td>
646
			</tr>
647
			<tr>
648
			<td width="22%" valign="top" class="vncell"><?=gettext("Maximum lease time");?></td>
649
			<td width="78%" class="vtable">
650
				<input name="maxtime" type="text" class="formfld unknown" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
651
				<?=gettext("seconds");?><br>
652
				<?=gettext("This is the maximum lease time for clients that ask".
653
				" for a specific expiration time."); ?><br>
654
				<?=gettext("The default is 86400 seconds.");?>
655
			</td>
656
			</tr>
657
			<tr>
658
			<td width="22%" valign="top" class="vncell"><?=gettext("Failover peer IP:");?></td>
659
			<td width="78%" class="vtable">
660
				<input name="failover_peerip" type="text" class="formfld host" id="failover_peerip" size="28" value="<?=htmlspecialchars($pconfig['failover_peerip']);?>"><br>
661
				<?=gettext("Leave blank to disable.  Enter the interface IP address of the other machine.  Machines must be using CARP.");?>
662
			</td>
663
			</tr>
664
			<tr>
665
				<td width="22%" valign="top" class="vncell"><?=gettext("Time format change"); ?></td>
666
				<td width="78%" class="vtable">
667
				<table>
668
					<tr>
669
					<td>
670
						<input name="dhcpv6leaseinlocaltime" type="checkbox" id="dhcpv6leaseinlocaltime" value="yes" <?php if ($pconfig['dhcpv6leaseinlocaltime']) echo "checked"; ?>>
671
					</td>
672
					<td>
673
						<strong>
674
							<?=gettext("Change DHCPv6 display lease time from UTC to local time."); ?>
675
						</strong>
676
					</td>
677
					</tr>
678
					<tr>
679
					<td>&nbsp;</td>
680
					<td>
681
						<span class="red"><strong><?=gettext("Note:");?></strong></span> <?=gettext("By default DHCPv6 leases are displayed in UTC time.  By checking this 
682
						box DHCPv6 lease time will be displayed in local time and set to time zone selected.  This will be used for all DHCPv6 interfaces lease time."); ?>
683
					
684
					</td>
685
					</tr>
686
				</table>
687
				</td>
688
			</tr>
689
			<tr>
690
			<td width="22%" valign="top" class="vncell"><?=gettext("Dynamic DNS");?></td>
691
			<td width="78%" class="vtable">
692
				<div id="showddnsbox">
693
					<input type="button" onClick="show_ddns_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show Dynamic DNS");?></a>
694
				</div>
695
				<div id="showddns" style="display:none">
696
					<input valign="middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo " checked"; ?>>&nbsp;
697
					<b><?=gettext("Enable registration of DHCP client names in DNS.");?></b><br />
698
					<p>
699
					<input name="ddnsdomain" type="text" class="formfld unknown" id="ddnsdomain" size="28" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>"><br />
700
					<?=gettext("Note: Leave blank to disable dynamic DNS registration.");?><br />
701
					<?=gettext("Enter the dynamic DNS domain which will be used to register client names in the DNS server.");?>
702
				</div>
703
			</td>
704
			</tr>
705
			<!-- ISC dhcpd does not support ntp for ipv6 yet. See redmine #2016
706
			<tr>
707
			<td width="22%" valign="top" class="vncell"><?=gettext("NTP servers");?></td>
708
			<td width="78%" class="vtable">
709
				<div id="showntpbox">
710
					<input type="button" onClick="show_ntp_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show NTP configuration");?></a>
711
				</div>
712
				<div id="showntp" style="display:none">
713
					<input name="ntp1" type="text" class="formfld unknown" id="ntp1" size="28" value="<?=htmlspecialchars($pconfig['ntp1']);?>"><br>
714
					<input name="ntp2" type="text" class="formfld unknown" id="ntp2" size="28" value="<?=htmlspecialchars($pconfig['ntp2']);?>">
715
				</div>
716
			</td>
717
			</tr>
718
			-->
719
			<!-- ISC dhcpd does not support tftp for ipv6 yet. See redmine #2016
720
			<tr>
721
			<td width="22%" valign="top" class="vncell"><?=gettext("TFTP server");?></td>
722
			<td width="78%" class="vtable">
723
			<div id="showtftpbox">
724
				<input type="button" onClick="show_tftp_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show TFTP configuration");?></a>
725
			</div>
726
			<div id="showtftp" style="display:none">
727
				<input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>"><br>
728
				<?=gettext("Leave blank to disable.  Enter a full hostname or IP for the TFTP server.");?>
729
			</div>
730
			</td>
731
			</tr>
732
			-->
733
			<tr>
734
			<td width="22%" valign="top" class="vncell"><?=gettext("LDAP URI");?></td>
735
			<td width="78%" class="vtable">
736
				<div id="showldapbox">
737
					<input type="button" onClick="show_ldap_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show LDAP configuration");?></a>
738
				</div>
739
				<div id="showldap" style="display:none">
740
					<input name="ldap" type="text" class="formfld unknown" id="ldap" size="80" value="<?=htmlspecialchars($pconfig['ldap']);?>"><br>
741
					<?=gettext("Leave blank to disable.  Enter a full URI for the LDAP server in the form ldap://ldap.example.com/dc=example,dc=com");?>
742
				</div>
743
			</td>
744
			</tr>
745
			<tr>
746
			<td width="22%" valign="top" class="vncell"><?=gettext("Enable network booting");?></td>
747
			<td width="78%" class="vtable">
748
				<div id="shownetbootbox">
749
					<input type="button" onClick="show_netboot_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show Network booting");?></a>
750
				</div>
751
				<div id="shownetboot" style="display:none">
752
					<input valign="middle" type="checkbox" value="yes" name="netboot" id="netboot" <?php if($pconfig['netboot']) echo " checked"; ?>>&nbsp;
753
					<b><?=gettext("Enables network booting.");?></b>
754
					<p>
755
					<?=gettext("Enter the IP of the"); ?> <b><?=gettext("next-server"); ?></b>
756
					<input name="nextserver" type="text" class="formfld unknown" id="nextserver" size="28" value="<?=htmlspecialchars($pconfig['nextserver']);?>">
757
					<?=gettext("and the filename");?>
758
					<input name="filename" type="text" class="formfld unknown" id="filename" size="28" value="<?=htmlspecialchars($pconfig['filename']);?>"><br>
759
					<?=gettext("Note: You need both a filename and a boot server configured for this to work!");?>
760
					<p>
761
					<?=gettext("Enter the"); ?> <b><?=gettext("root-path"); ?></b>-<?=gettext("string");?>
762
					<input name="rootpath" type="text" class="formfld unknown" id="rootpath" size="90" value="<?=htmlspecialchars($pconfig['rootpath']);?>"><br>
763
					<?=gettext("Note: string-format: iscsi:(servername):(protocol):(port):(LUN):targetname");?>
764
				</div>
765
			</td>
766
			</tr>
767
			<tr>
768
			<td width="22%" valign="top" class="vncell"><?=gettext("Additional BOOTP/DHCP Options");?></td>
769
			<td width="78%" class="vtable">
770
				<div id="shownumbervaluebox">
771
					<input type="button" onClick="show_shownumbervalue()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show Additional BOOTP/DHCP Options");?></a>
772
				</div>
773
				<div id="shownumbervalue" style="display:none">
774
				<table id="maintable">
775
				<tbody>
776
				<tr>
777
				<td colspan="3">
778
					<div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;" id="itemhelp">
779
					<?=gettext("Enter the DHCP option number and the value for each item you would like to include in the DHCP lease information.  For a list of available options please visit this"); ?> <a href="http://www.iana.org/assignments/bootp-dhcp-parameters/" target="_new"><?=gettext("URL"); ?></a>
780
					</div>
781
				</td>
782
				</tr>
783
				<tr>
784
				<td><div id="onecolumn"><?=gettext("Number");?></div></td>
785
				<td><div id="twocolumn"><?=gettext("Value");?></div></td>
786
				</tr>
787
				<?php $counter = 0; ?>
788
				<?php
789
					if($pconfig['numberoptions'])
790
						foreach($pconfig['numberoptions']['item'] as $item):
791
				?>
792
					<?php
793
						$number = $item['number'];
794
						$value = $item['value'];
795
					?>
796
				<tr>
797
				<td>
798
					<input autocomplete="off" name="number<?php echo $counter; ?>" type="text" class="formfld" id="number<?php echo $counter; ?>" size="10" value="<?=htmlspecialchars($number);?>" />
799
				</td>
800
				<td>
801
					<input autocomplete="off" name="value<?php echo $counter; ?>" type="text" class="formfld" id="value<?php echo $counter; ?>" size="55" value="<?=htmlspecialchars($value);?>" />
802
				</td>
803
				<td>
804
					<input type="image" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="<?=gettext("Delete");?>" />
805
				</td>
806
				</tr>
807
				<?php $counter++; ?>
808
				<?php endforeach; ?>
809
				</tbody>
810
				<tfoot>
811
				</tfoot>
812
				</table>
813
				<a onclick="javascript:addRowTo('maintable', 'formfldalias'); return false;" href="#">
814
					<img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="<?=gettext("add another entry");?>" />
815
				</a>
816
				<script type="text/javascript">
817
					field_counter_js = 2;
818
					rows = 1;
819
					totalrows = <?php echo $counter; ?>;
820
					loaded = <?php echo $counter; ?>;
821
				</script>
822
				</div>
823

    
824
				</td>
825
			</tr>
826
			<tr>
827
			<td width="22%" valign="top">&nbsp;</td>
828
			<td width="78%">
829
				<input name="if" type="hidden" value="<?=$if;?>">
830
				<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)">
831
			</td>
832
			</tr>
833
			<tr>
834
			<td width="22%" valign="top">&nbsp;</td>
835
			<td width="78%"> <p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br>
836
				</strong></span><?=gettext("The DNS servers entered in"); ?> <a href="system.php"><?=gettext("System: " .
837
				"General setup"); ?></a> <?=gettext("(or the"); ?> <a href="services_dnsmasq.php"><?=gettext("DNS " .
838
				"forwarder"); ?></a>, <?=gettext("if enabled)"); ?> </span><span class="vexpl"><?=gettext("will " .
839
				"be assigned to clients by the DHCP server."); ?><br>
840
				<br>
841
				<?=gettext("The DHCP lease table can be viewed on the"); ?> <a href="status_dhcp_leases.php"><?=gettext("Status: " .
842
				"DHCP leases"); ?></a> <?=gettext("page."); ?><br>
843
				</span></p>
844
			</td>
845
			</tr>
846
		</table>
847
		<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
848
		<tr>
849
			<td width="25%" class="listhdrr"><?=gettext("DUID");?></td>
850
			<td width="15%" class="listhdrr"><?=gettext("IPv6 address");?></td>
851
			<td width="20%" class="listhdrr"><?=gettext("Hostname");?></td>
852
			<td width="30%" class="listhdr"><?=gettext("Description");?></td>
853
			<td width="10%" class="list">
854
			<table border="0" cellspacing="0" cellpadding="1">
855
			<tr>
856
			<td valign="middle" width="17"></td>
857
			<td valign="middle"><a href="services_dhcpv6_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
858
			</tr>
859
			</table>
860
			</td>
861
		</tr>
862
			<?php if(is_array($a_maps)): ?>
863
			<?php $i = 0; foreach ($a_maps as $mapent): ?>
864
			<?php if($mapent['duid'] <> "" or $mapent['ipaddrv6'] <> ""): ?>
865
		<tr>
866
		<td class="listlr" ondblclick="document.location='services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
867
			<?=htmlspecialchars($mapent['duid']);?>
868
		</td>
869
		<td class="listr" ondblclick="document.location='services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
870
			<?=htmlspecialchars($mapent['ipaddrv6']);?>&nbsp;
871
		</td>
872
		<td class="listr" ondblclick="document.location='services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
873
			<?=htmlspecialchars($mapent['hostname']);?>&nbsp;
874
		</td>
875
		<td class="listbg" ondblclick="document.location='services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
876
			<?=htmlspecialchars($mapent['descr']);?>&nbsp;
877
		</td>
878
		<td valign="middle" nowrap class="list">
879
			<table border="0" cellspacing="0" cellpadding="1">
880
			<tr>
881
			<td valign="middle"><a href="services_dhcpv6_edit.php?if=<?=$if;?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
882
			<td valign="middle"><a href="services_dhcpv6.php?if=<?=$if;?>&act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this mapping?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
883
			</tr>
884
			</table>
885
		</td>
886
		</tr>
887
		<?php endif; ?>
888
		<?php $i++; endforeach; ?>
889
		<?php endif; ?>
890
		<tr>
891
		<td class="list" colspan="4"></td>
892
		<td class="list">
893
			<table border="0" cellspacing="0" cellpadding="1">
894
			<tr>
895
			<td valign="middle" width="17"></td>
896
			<td valign="middle"><a href="services_dhcpv6_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
897
			</tr>
898
			</table>
899
		</td>
900
		</tr>
901
		</table>
902
	</div>
903
</td>
904
</tr>
905
</table>
906
</form>
907
<script language="JavaScript">
908
<!--
909
enable_change(false);
910
//-->
911
</script>
912
<?php include("fend.inc"); ?>
913
</body>
914
</html>
(149-149/239)