Project

General

Profile

Download (38.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 (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 = "<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['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
$pgtitle = array(gettext("Services"),gettext("DHCPv6 server"));
370
$shortcut_section = "dhcp6";
371

    
372
include("head.inc");
373

    
374
?>
375

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

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

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

    
418
	function show_shownumbervalue() {
419
		document.getElementById("shownumbervaluebox").innerHTML='';
420
		aodiv = document.getElementById('shownumbervalue');
421
		aodiv.style.display = "block";
422
	}
423

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

    
447
	function show_netboot_config() {
448
		document.getElementById("shownetbootbox").innerHTML='';
449
		aodiv = document.getElementById('shownetboot');
450
		aodiv.style.display = "block";
451
	}
452
</script>
453

    
454
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
455
<?php include("fbegin.inc"); ?>
456
<form action="services_dhcpv6.php" method="post" name="iform" id="iform">
457
<?php if ($input_errors) print_input_errors($input_errors); ?>
458
<?php if ($savemsg) print_info_box($savemsg); ?>
459
<?php
460
	if ($dhcrelay_enabled) {
461
		echo gettext("DHCP Relay is currently enabled. Cannot enable the DHCP Server service while the DHCP Relay is enabled on any interface.");
462
		include("fend.inc");
463
		echo "</body>";
464
		echo "</html>";
465
		exit;
466
	}
467
?>
468
<?php if (is_subsystem_dirty('staticmaps')): ?><p>
469
<?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 />
470
<?php endif; ?>
471
<table width="100%" border="0" cellpadding="0" cellspacing="0">
472
<tr><td>
473
<?php
474
	/* active tabs */
475
	$tab_array = array();
476
	$tabscounter = 0;
477
	$i = 0;
478
	foreach ($iflist as $ifent => $ifname) {
479
		$oc = $config['interfaces'][$ifent];
480
		if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6'])))) ||
481
			(!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6'])))))
482
			continue;
483
		if ($ifent == $if)
484
			$active = true;
485
		else
486
			$active = false;
487
		$tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}");
488
		$tabscounter++;
489
	}
490
	/* tack on PPPoE or PPtP servers here */
491
	/* pppoe server */
492
	if (is_array($config['pppoes']['pppoe'])) {
493
		foreach($config['pppoes']['pppoe'] as $pppoe) {
494
			if ($pppoe['mode'] == "server") {
495
				$ifent = "poes". $pppoe['pppoeid'];
496
				$ifname = strtoupper($ifent);
497
				if ($ifent == $if)
498
					$active = true;
499
				else
500
					$active = false;
501
				$tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}");
502
				$tabscounter++;
503
			}
504
		}
505
	}
506
	if ($tabscounter == 0) {
507
		echo "</td></tr></table></form>";
508
		include("fend.inc");
509
		echo "</body>";
510
		echo "</html>";
511
		exit;
512
	}
513
	display_top_tabs($tab_array);
514
?>
515
</td></tr>
516
<tr><td class="tabnavtbl">
517
<?php
518
$tab_array = array();
519
$tab_array[] = array(gettext("DHCPv6 Server"),         true,  "services_dhcpv6.php?if={$if}");
520
$tab_array[] = array(gettext("Router Advertisements"), false, "services_router_advertisements.php?if={$if}");
521
display_top_tabs($tab_array);
522
?>
523
</td></tr>
524
<tr>
525
<td>
526
	<div id="mainarea">
527
		<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
528
		<tr>
529
			<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCPv6 Server");?></td>
530
			<td width="78%" class="vtable">
531
				<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false);">
532
			<strong><?php printf(gettext("Enable DHCPv6 server on " .
533
			"%s " .
534
			"interface"),htmlspecialchars($iflist[$if]));?></strong></td>
535
			</tr>
536
			<tr>
537
			<?php
538
			/* the PPPoE Server could well have no IPv6 address and operate fine with just link-local, just hide these */
539
			if(is_ipaddrv6($ifcfgip)) {
540
			?>
541
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet");?></td>
542
			<td width="78%" class="vtable">
543
				<?=gen_subnetv6($ifcfgip, $ifcfgsn);?>
544
			</td>
545
			</tr>
546
			<tr>
547
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet mask");?></td>
548
			<td width="78%" class="vtable">
549
				<?=$ifcfgsn;?> bits
550
			</td>
551
			</tr>
552
			<tr>
553
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Available range");?></td>
554
			<td width="78%" class="vtable">
555
			<?php
556
				$range_from = gen_subnetv6($ifcfgip, $ifcfgsn);
557
				$range_from++;
558
				echo $range_from;
559

    
560
			?>
561
			-
562
			<?php
563
				$range_to = gen_subnetv6_max($ifcfgip, $ifcfgsn);
564
				echo $range_to;
565
			?>
566
			</td>
567
			</tr>
568
			<?php } ?>
569

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

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