Project

General

Profile

Download (38.6 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 (https://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 = gettext("The DHCPv6 Server can only be enabled on interfaces configured with static IP addresses") .
76
		   gettext("Only interfaces configured with a static IP will be shown") . ".";
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['bootfile_url'] = $config['dhcpdv6'][$if]['bootfile_url'];
121
	$pconfig['netmask'] = $config['dhcpdv6'][$if]['netmask'];
122
	$pconfig['numberoptions'] = $config['dhcpdv6'][$if]['numberoptions'];
123
	$pconfig['dhcpv6leaseinlocaltime'] = $config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'];
124
	if (!is_array($config['dhcpdv6'][$if]['staticmap']))
125
		$config['dhcpdv6'][$if]['staticmap'] = array();
126
	$a_maps = &$config['dhcpdv6'][$if]['staticmap'];
127
}
128

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

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

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

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

    
148
if ($_POST) {
149

    
150
	unset($input_errors);
151

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

    
156
	$pconfig = $_POST;
157

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

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

    
175
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
176

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

    
190
		if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
191
			$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
192
		if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime'])))
193
			$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time.");
194
		if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain'])))
195
			$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration.");
196
		if (($_POST['ddnsdomain'] && !is_ipaddrv4($_POST['ddnsdomainprimary'])))
197
			$input_errors[] = gettext("A valid primary domain name server IPv4 address must be specified for the dynamic domain name.");
198
		if (($_POST['ddnsdomainkey'] && !$_POST['ddnsdomainkeyname']) ||
199
			($_POST['ddnsdomainkeyname'] && !$_POST['ddnsdomainkey']))
200
			$input_errors[] = gettext("You must specify both a valid domain key and key name.");
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['bootfile_url'] && !is_URL($_POST['bootfile_url'])))
218
			$input_errors[] = gettext("A valid URL must be specified for the network bootfile.");
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_v6($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
			$subnet_start = gen_subnetv6($ifcfgip, $ifcfgsn);
237
			$subnet_end = gen_subnetv6_max($ifcfgip, $ifcfgsn);
238

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

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

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

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

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

    
291
		unset($config['dhcpdv6'][$if]['winsserver']);
292

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

    
299
		$config['dhcpdv6'][$if]['domain'] = $_POST['domain'];
300
		$config['dhcpdv6'][$if]['domainsearchlist'] = $_POST['domainsearchlist'];
301
		$config['dhcpdv6'][$if]['enable'] = ($_POST['enable']) ? true : false;
302
		$config['dhcpdv6'][$if]['ddnsdomain'] = $_POST['ddnsdomain'];
303
		$config['dhcpdv6'][$if]['ddnsdomainprimary'] = $_POST['ddnsdomainprimary'];
304
		$config['dhcpdv6'][$if]['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname'];
305
		$config['dhcpdv6'][$if]['ddnsdomainkey'] = $_POST['ddnsdomainkey'];
306
		$config['dhcpdv6'][$if]['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
307

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

    
314
		$config['dhcpdv6'][$if]['tftp'] = $_POST['tftp'];
315
		$config['dhcpdv6'][$if]['ldap'] = $_POST['ldap'];
316
		$config['dhcpdv6'][$if]['netboot'] = ($_POST['netboot']) ? true : false;
317
		$config['dhcpdv6'][$if]['bootfile_url'] = $_POST['bootfile_url'];
318
		$config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'] = $_POST['dhcpv6leaseinlocaltime'];
319

    
320
		// Handle the custom options rowhelper
321
		if(isset($config['dhcpdv6'][$if]['numberoptions']['item']))
322
			unset($config['dhcpdv6'][$if]['numberoptions']['item']);
323

    
324
		$config['dhcpdv6'][$if]['numberoptions'] = $numberoptions;
325

    
326
		write_config();
327

    
328
		$retval = 0;
329
		$retvaldhcp = 0;
330
		$retvaldns = 0;
331
		/* Stop DHCPv6 so we can cleanup leases */
332
		killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
333
		// dhcp_clean_leases();
334
		/* dnsmasq_configure calls dhcpd_configure */
335
		/* no need to restart dhcpd twice */
336
		if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic']))	{
337
			$retvaldns = services_dnsmasq_configure();
338
			if ($retvaldns == 0) {
339
				clear_subsystem_dirty('hosts');
340
				clear_subsystem_dirty('staticmaps');
341
			}
342
		} else {
343
			$retvaldhcp = services_dhcpd_configure();
344
			if ($retvaldhcp == 0)
345
				clear_subsystem_dirty('staticmaps');
346
		}
347
		if ($dhcpdv6_enable_changed)
348
			$retvalfc = filter_configure();
349
		if($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1)
350
			$retval = 1;
351
		$savemsg = get_std_save_message($retval);
352
	}
353
}
354

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

    
369
$closehead = false;
370
$pgtitle = array(gettext("Services"),gettext("DHCPv6 server"));
371
$shortcut_section = "dhcp6";
372

    
373
include("head.inc");
374

    
375
?>
376

    
377
<script type="text/javascript" src="/javascript/row_helper.js">
378
</script>
379

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

    
391
<script type="text/javascript">
392
//<![CDATA[
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.bootfile_url.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
	function show_ntp_config() {
434
		document.getElementById("showntpbox").innerHTML='';
435
		aodiv = document.getElementById('showntp');
436
		aodiv.style.display = "block";
437
	}
438
	/*
439
	function show_tftp_config() {
440
		document.getElementById("showtftpbox").innerHTML='';
441
		aodiv = document.getElementById('showtftp');
442
		aodiv.style.display = "block";
443
	}
444
	*/
445
	function show_ldap_config() {
446
		document.getElementById("showldapbox").innerHTML='';
447
		aodiv = document.getElementById('showldap');
448
		aodiv.style.display = "block";
449
	}
450

    
451
	function show_netboot_config() {
452
		document.getElementById("shownetbootbox").innerHTML='';
453
		aodiv = document.getElementById('shownetboot');
454
		aodiv.style.display = "block";
455
	}
456
//]]>
457
</script>
458
</head>
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" summary="dhcpv6 server">
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" summary="main area">
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=\"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=\"selected\""; ?>>48</option>
608
					<option value="52" <?php if($pconfig['prefixrange_length'] == 52) echo "selected=\"selected\""; ?>>52</option>
609
					<option value="56" <?php if($pconfig['prefixrange_length'] == 56) echo "selected=\"selected\""; ?>>56</option>
610
					<option value="60" <?php if($pconfig['prefixrange_length'] == 60) echo "selected=\"selected\""; ?>>60</option>
611
					<option value="62" <?php if($pconfig['prefixrange_length'] == 62) echo "selected=\"selected\""; ?>>62</option>
612
					<option value="63" <?php if($pconfig['prefixrange_length'] == 63) echo "selected=\"selected\""; ?>>63</option>
613
					<option value="64" <?php if($pconfig['prefixrange_length'] == 64) echo "selected=\"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 summary="time format change">
665
					<tr>
666
					<td>
667
						<input name="dhcpv6leaseinlocaltime" type="checkbox" id="dhcpv6leaseinlocaltime" value="yes" <?php if ($pconfig['dhcpv6leaseinlocaltime']) echo "checked=\"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");?>" /> - <?=gettext("Show Dynamic DNS");?>
691
				</div>
692
				<div id="showddns" style="display:none">
693
					<input style="vertical-align:middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo " checked=\"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
					</p>
706
				</div>
707
			</td>
708
			</tr>
709
			<tr>
710
			<td width="22%" valign="top" class="vncell"><?=gettext("NTP servers");?></td>
711
			<td width="78%" class="vtable">
712
				<div id="showntpbox">
713
					<input type="button" onclick="show_ntp_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show NTP configuration");?>
714
				</div>
715
				<div id="showntp" style="display:none">
716
					<input name="ntp1" type="text" class="formfld unknown" id="ntp1" size="28" value="<?=htmlspecialchars($pconfig['ntp1']);?>" /><br />
717
					<input name="ntp2" type="text" class="formfld unknown" id="ntp2" size="28" value="<?=htmlspecialchars($pconfig['ntp2']);?>" />
718
				</div>
719
			</td>
720
			</tr>
721
			<!-- ISC dhcpd does not support tftp for ipv6 yet. See redmine #2016
722
			<tr>
723
			<td width="22%" valign="top" class="vncell"><?=gettext("TFTP server");?></td>
724
			<td width="78%" class="vtable">
725
			<div id="showtftpbox">
726
				<input type="button" onclick="show_tftp_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show TFTP configuration");?>
727
			</div>
728
			<div id="showtftp" style="display:none">
729
				<input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>" /><br />
730
				<?=gettext("Leave blank to disable.  Enter a full hostname or IP for the TFTP server.");?>
731
			</div>
732
			</td>
733
			</tr>
734
			-->
735
			<tr>
736
			<td width="22%" valign="top" class="vncell"><?=gettext("LDAP URI");?></td>
737
			<td width="78%" class="vtable">
738
				<div id="showldapbox">
739
					<input type="button" onclick="show_ldap_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show LDAP configuration");?>
740
				</div>
741
				<div id="showldap" style="display:none">
742
					<input name="ldap" type="text" class="formfld unknown" id="ldap" size="80" value="<?=htmlspecialchars($pconfig['ldap']);?>" /><br />
743
					<?=gettext("Leave blank to disable.  Enter a full URI for the LDAP server in the form ldap://ldap.example.com/dc=example,dc=com");?>
744
				</div>
745
			</td>
746
			</tr>
747
			<tr>
748
			<td width="22%" valign="top" class="vncell"><?=gettext("Enable network booting");?></td>
749
			<td width="78%" class="vtable">
750
				<div id="shownetbootbox">
751
					<input type="button" onclick="show_netboot_config()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show Network booting");?>
752
				</div>
753
				<div id="shownetboot" style="display:none">
754
					<input style="vertical-align:middle" type="checkbox" value="yes" name="netboot" id="netboot" <?php if($pconfig['netboot']) echo " checked=\"checked\""; ?> />&nbsp;
755
					<b><?=gettext("Enables network booting.");?></b>
756
					<p>
757
					<?=gettext("Enter the Bootfile URL");?>
758
					<input name="bootfile_url" type="text" class="formfld unknown" id="bootfile_url" size="28" value="<?=htmlspecialchars($pconfig['bootfile_url']);?>" />
759
				</div>
760
			</td>
761
			</tr>
762
			<tr>
763
			<td width="22%" valign="top" class="vncell"><?=gettext("Additional BOOTP/DHCP Options");?></td>
764
			<td width="78%" class="vtable">
765
				<div id="shownumbervaluebox">
766
					<input type="button" onclick="show_shownumbervalue()" value="<?=gettext("Advanced");?>" /> - <?=gettext("Show Additional BOOTP/DHCP Options");?>
767
				</div>
768
				<div id="shownumbervalue" style="display:none">
769
				<table id="maintable" summary="bootp-dhcp options">
770
				<tbody>
771
				<tr>
772
				<td colspan="3">
773
					<div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;" id="itemhelp">
774
					<?=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="_blank"><?=gettext("URL"); ?></a>
775
					</div>
776
				</td>
777
				</tr>
778
				<tr>
779
				<td><div id="onecolumn"><?=gettext("Number");?></div></td>
780
				<td><div id="twocolumn"><?=gettext("Value");?></div></td>
781
				</tr>
782
				<?php $counter = 0; ?>
783
				<?php
784
					if($pconfig['numberoptions'])
785
						foreach($pconfig['numberoptions']['item'] as $item):
786
				?>
787
					<?php
788
						$number = $item['number'];
789
						$value = $item['value'];
790
					?>
791
				<tr>
792
				<td>
793
					<input autocomplete="off" name="number<?php echo $counter; ?>" type="text" class="formfld" id="number<?php echo $counter; ?>" size="10" value="<?=htmlspecialchars($number);?>" />
794
				</td>
795
				<td>
796
					<input autocomplete="off" name="value<?php echo $counter; ?>" type="text" class="formfld" id="value<?php echo $counter; ?>" size="55" value="<?=htmlspecialchars($value);?>" />
797
				</td>
798
				<td>
799
					<input type="image" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="<?=gettext("Delete");?>" />
800
				</td>
801
				</tr>
802
				<?php $counter++; ?>
803
				<?php endforeach; ?>
804
				</tbody>
805
				</table>
806
				<a onclick="javascript:addRowTo('maintable', 'formfldalias'); return false;" href="#">
807
					<img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="<?=gettext("add another entry");?>" />
808
				</a>
809
				<script type="text/javascript">
810
				//<![CDATA[
811
					field_counter_js = 2;
812
					rows = 1;
813
					totalrows = <?php echo $counter; ?>;
814
					loaded = <?php echo $counter; ?>;
815
				//]]>
816
				</script>
817
				</div>
818

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