Projet

Général

Profil

Télécharger (38,8 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / services_dhcpv6.php @ 6f3d2063

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 if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
343
			$retvaldns = services_unbound_configure();
344
			if ($retvaldns == 0)
345
				clear_subsystem_dirty('unbound');
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
$closehead = false;
374
$pgtitle = array(gettext("Services"),gettext("DHCPv6 server"));
375
$shortcut_section = "dhcp6";
376

    
377
include("head.inc");
378

    
379
?>
380

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

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

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

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

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

    
455
	function show_netboot_config() {
456
		document.getElementById("shownetbootbox").innerHTML='';
457
		aodiv = document.getElementById('shownetboot');
458
		aodiv.style.display = "block";
459
	}
460
//]]>
461
</script>
462
</head>
463

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

    
570
			?>
571
			-
572
			<?php
573
				$range_to = gen_subnetv6_max($ifcfgip, $ifcfgsn);
574
				echo $range_to;
575
			?>
576
			</td>
577
			</tr>
578
			<?php } ?>
579

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

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