Project

General

Profile

Download (39.1 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
require_once("filter.inc");
49

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

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

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

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

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

    
78
$iflist = get_configured_interface_with_descr();
79
$iflist = array_merge($iflist, get_configured_pppoe_server_interfaces());
80

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

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

    
131
$ifcfgip = get_interface_ipv6($if);
132
$ifcfgsn = get_interface_subnetv6($if);
133

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

    
139
$dhcrelay_enabled = false;
140
$dhcrelaycfg = $config['dhcrelay6'];
141

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

    
150
if ($_POST) {
151

    
152
	unset($input_errors);
153

    
154
	$old_dhcpdv6_enable = ($pconfig['enable'] == true);
155
	$new_dhcpdv6_enable = ($_POST['enable'] ? true : false);
156
	$dhcpdv6_enable_changed = ($old_dhcpdv6_enable != $new_dhcpdv6_enable);
157

    
158
	$pconfig = $_POST;
159

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

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

    
177
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
178

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

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

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

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

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

    
241
			if (is_ipaddrv6($ifcfgip)) {
242
				if ((! is_inrange_v6($_POST['range_from'], $subnet_start, $subnet_end)) ||
243
			   	 (! is_inrange_v6($_POST['range_to'], $subnet_start, $subnet_end))) {
244
					$input_errors[] = gettext("The specified range lies outside of the current subnet.");
245
				}
246
			}
247
			/* "from" cannot be higher than "to" */
248
			if (inet_pton($_POST['range_from']) > inet_pton($_POST['range_to']))
249
				$input_errors[] = gettext("The range is invalid (first element higher than second element).");
250

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

    
255

    
256
			/* Verify static mappings do not overlap:
257
			   - available DHCP range
258
			   - prefix delegation range (FIXME: still need to be completed) */
259
			$dynsubnet_start = inet_pton($_POST['range_from']);
260
			$dynsubnet_end = inet_pton($_POST['range_to']);
261

    
262
			if(is_array($a_maps)) {
263
				foreach ($a_maps as $map) {
264
					if (empty($map['ipaddrv6']))
265
						continue;
266
					if ((inet_pton($map['ipaddrv6']) > $dynsubnet_start) &&
267
						(inet_pton($map['ipaddrv6']) < $dynsubnet_end)) {
268
						$input_errors[] = sprintf(gettext("The DHCP range cannot overlap any static DHCP mappings."));
269
						break;
270
					}
271
				}
272
			}
273
		}
274
	}
275

    
276
	if (!$input_errors) {
277
		if (!is_array($config['dhcpdv6'][$if]))
278
			$config['dhcpdv6'][$if] = array();
279
		if (!is_array($config['dhcpdv6'][$if]['range']))
280
			$config['dhcpdv6'][$if]['range'] = array();
281
		if (!is_array($config['dhcpdv6'][$if]['prefixrange']))
282
			$config['dhcpdv6'][$if]['prefixrange'] = array();
283

    
284
		$config['dhcpdv6'][$if]['range']['from'] = $_POST['range_from'];
285
		$config['dhcpdv6'][$if]['range']['to'] = $_POST['range_to'];
286
		$config['dhcpdv6'][$if]['prefixrange']['from'] = $_POST['prefixrange_from'];
287
		$config['dhcpdv6'][$if]['prefixrange']['to'] = $_POST['prefixrange_to'];
288
		$config['dhcpdv6'][$if]['prefixrange']['prefixlength'] = $_POST['prefixrange_length'];
289
		$config['dhcpdv6'][$if]['defaultleasetime'] = $_POST['deftime'];
290
		$config['dhcpdv6'][$if]['maxleasetime'] = $_POST['maxtime'];
291
		$config['dhcpdv6'][$if]['netmask'] = $_POST['netmask'];
292

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

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

    
301
		$config['dhcpdv6'][$if]['domain'] = $_POST['domain'];
302
		$config['dhcpdv6'][$if]['domainsearchlist'] = $_POST['domainsearchlist'];
303
		$config['dhcpdv6'][$if]['enable'] = ($_POST['enable']) ? true : false;
304
		$config['dhcpdv6'][$if]['ddnsdomain'] = $_POST['ddnsdomain'];
305
		$config['dhcpdv6'][$if]['ddnsdomainprimary'] = $_POST['ddnsdomainprimary'];
306
		$config['dhcpdv6'][$if]['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname'];
307
		$config['dhcpdv6'][$if]['ddnsdomainkey'] = $_POST['ddnsdomainkey'];
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
		killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
337
		// dhcp_clean_leases();
338
		/* dnsmasq_configure calls dhcpd_configure */
339
		/* no need to restart dhcpd twice */
340
		if (isset($config['dnsmasq']['enable']) && 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 ($dhcpdv6_enable_changed)
352
			$retvalfc = filter_configure();
353
		if($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1)
354
			$retval = 1;
355
		$savemsg = get_std_save_message($retval);
356
	}
357
}
358

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

    
373
$pgtitle = array(gettext("Services"),gettext("DHCPv6 server"));
374
$shortcut_section = "dhcp6";
375

    
376
include("head.inc");
377

    
378
?>
379

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

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

    
392
<script type="text/javascript" language="JavaScript">
393
	function enable_change(enable_over) {
394
		var endis;
395
		endis = !(document.iform.enable.checked || enable_over);
396
		document.iform.range_from.disabled = endis;
397
		document.iform.range_to.disabled = endis;
398
		document.iform.prefixrange_from.disabled = endis;
399
		document.iform.prefixrange_to.disabled = endis;
400
		document.iform.prefixrange_length.disabled = endis;
401
		document.iform.dns1.disabled = endis;
402
		document.iform.dns2.disabled = endis;
403
		document.iform.deftime.disabled = endis;
404
		document.iform.maxtime.disabled = endis;
405
		//document.iform.gateway.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.ddnsdomainprimary.disabled = endis;
411
		document.iform.ddnsdomainkeyname.disabled = endis;
412
		document.iform.ddnsdomainkey.disabled = endis;
413
		document.iform.ddnsupdate.disabled = endis;
414
		document.iform.ntp1.disabled = endis;
415
		document.iform.ntp2.disabled = endis;
416
		//document.iform.tftp.disabled = endis;
417
		document.iform.ldap.disabled = endis;
418
		document.iform.netboot.disabled = endis;
419
		document.iform.nextserver.disabled = endis;
420
		document.iform.filename.disabled = endis;
421
		document.iform.rootpath.disabled = endis;
422
	}
423

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

    
430
	function show_ddns_config() {
431
		document.getElementById("showddnsbox").innerHTML='';
432
		aodiv = document.getElementById('showddns');
433
		aodiv.style.display = "block";
434
	}
435
	function show_ntp_config() {
436
		document.getElementById("showntpbox").innerHTML='';
437
		aodiv = document.getElementById('showntp');
438
		aodiv.style.display = "block";
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']) && (!is_linklocal($oc['ipaddrv6'])))) ||
487
			(!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($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
	/* tack on PPPoE or PPtP servers here */
497
	/* pppoe server */
498
	if (is_array($config['pppoes']['pppoe'])) {
499
		foreach($config['pppoes']['pppoe'] as $pppoe) {
500
			if ($pppoe['mode'] == "server") {
501
				$ifent = "poes". $pppoe['pppoeid'];
502
				$ifname = strtoupper($ifent);
503
				if ($ifent == $if)
504
					$active = true;
505
				else
506
					$active = false;
507
				$tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}");
508
				$tabscounter++;
509
			}
510
		}
511
	}
512
	if ($tabscounter == 0) {
513
		echo "</td></tr></table></form>";
514
		include("fend.inc");
515
		echo "</body>";
516
		echo "</html>";
517
		exit;
518
	}
519
	display_top_tabs($tab_array);
520
?>
521
</td></tr>
522
<tr><td class="tabnavtbl">
523
<?php
524
$tab_array = array();
525
$tab_array[] = array(gettext("DHCPv6 Server"),         true,  "services_dhcpv6.php?if={$if}");
526
$tab_array[] = array(gettext("Router Advertisements"), false, "services_router_advertisements.php?if={$if}");
527
display_top_tabs($tab_array);
528
?>
529
</td></tr>
530
<tr>
531
<td>
532
	<div id="mainarea">
533
		<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
534
		<tr>
535
			<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCPv6 Server");?></td>
536
			<td width="78%" class="vtable">
537
				<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false);">
538
			<strong><?php printf(gettext("Enable DHCPv6 server on " .
539
			"%s " .
540
			"interface"),htmlspecialchars($iflist[$if]));?></strong></td>
541
			</tr>
542
			<tr>
543
			<?php
544
			/* the PPPoE Server could well have no IPv6 address and operate fine with just link-local, just hide these */
545
			if(is_ipaddrv6($ifcfgip)) {
546
			?>
547
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet");?></td>
548
			<td width="78%" class="vtable">
549
				<?=gen_subnetv6($ifcfgip, $ifcfgsn);?>
550
			</td>
551
			</tr>
552
			<tr>
553
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet mask");?></td>
554
			<td width="78%" class="vtable">
555
				<?=$ifcfgsn;?> bits
556
			</td>
557
			</tr>
558
			<tr>
559
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Available range");?></td>
560
			<td width="78%" class="vtable">
561
			<?php
562
				$range_from = gen_subnetv6($ifcfgip, $ifcfgsn);
563
				$range_from++;
564
				echo $range_from;
565

    
566
			?>
567
			-
568
			<?php
569
				$range_to = gen_subnetv6_max($ifcfgip, $ifcfgsn);
570
				echo $range_to;
571
			?>
572
			</td>
573
			</tr>
574
			<?php } ?>
575

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

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