Project

General

Profile

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

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

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

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

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

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

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

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

    
47
require("guiconfig.inc");
48

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

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

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

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

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

    
76
$iflist = get_configured_interface_with_descr();
77

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

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

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

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

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

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

    
147
function is_inrange($test, $start, $end) {
148
	if ( (inet_pton($test) < inet_pton($end)) && (inet_pton($test) > inet_pton($start)) )
149
		return true;
150
	else
151
		return false;
152
}
153

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

    
156
if ($_POST) {
157

    
158
	unset($input_errors);
159

    
160
	$pconfig = $_POST;
161

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

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

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

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

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

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

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

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

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

    
243
			/* "from" cannot be higher than "to" */
244
			if (inet_pton($_POST['range_from']) > inet_pton($_POST['range_to']))
245
				$input_errors[] = gettext("The range is invalid (first element higher than second element).");
246

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

    
251

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

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

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

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

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

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

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

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

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

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

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

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

    
331
		write_config();
332

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

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

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

    
376
include("head.inc");
377

    
378
?>
379

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

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

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

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

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

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

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

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

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