Project

General

Profile

Download (17.7 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	status_dhcpv6_leases.php
5
	Copyright (C) 2004-2009 Scott Ullrich
6
	Copyright (C) 2011 Seth Mos
7
	All rights reserved.
8

    
9
	originially part of m0n0wall (http://m0n0.ch/wall)
10
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
11
	All rights reserved.
12

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

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

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

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

    
35
/*
36
	pfSense_BUILDER_BINARIES:	/usr/bin/awk	/bin/cat	/usr/sbin/ndp	/usr/bin/wc	/usr/bin/grep
37
	pfSense_MODULE:	dhcpserver
38
*/
39

    
40
##|+PRIV
41
##|*IDENT=page-status-dhcpv6leases
42
##|*NAME=Status: DHCPv6 leases page
43
##|*DESCR=Allow access to the 'Status: DHCPv6 leases' page.
44
##|*MATCH=status_dhcpv6_leases.php*
45
##|-PRIV
46

    
47
require("guiconfig.inc");
48
require_once("config.inc");
49

    
50
$pgtitle = array(gettext("Status"),gettext("DHCPv6 leases"));
51
$shortcut_section = "dhcp6";
52

    
53
$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd6.leases";
54

    
55
if (($_GET['deleteip']) && (is_ipaddr($_GET['deleteip']))) {
56
	/* Stop DHCPD */
57
	killbyname("dhcpd");
58

    
59
	/* Read existing leases */
60
	$leases_contents = explode("\n", file_get_contents($leasesfile));
61
	$newleases_contents = array();
62
	$i=0;
63
	while ($i < count($leases_contents)) {
64
		/* Find the lease(s) we want to delete */
65
		if ($leases_contents[$i] == "  iaaddr {$_GET['deleteip']} {") {
66
			/* The iaaddr line is two lines down from the start of the lease, so remove those two lines. */
67
			array_pop($newleases_contents);
68
			array_pop($newleases_contents);
69
			/* Skip to the end of the lease declaration */
70
			do {
71
				$i++;
72
			} while ($leases_contents[$i] != "}");
73
		} else {
74
			/* It's a line we want to keep, copy it over. */
75
			$newleases_contents[] = $leases_contents[$i];
76
		}
77
		$i++;
78
	}
79

    
80
	/* Write out the new leases file */
81
	$fd = fopen($leasesfile, 'w');
82
	fwrite($fd, implode("\n", $newleases_contents));
83
	fclose($fd);
84

    
85
	/* Restart DHCP Service */
86
	services_dhcpd_configure();
87
	header("Location: status_dhcpv6_leases.php?all={$_GET['all']}");
88
}
89

    
90
// Load MAC-Manufacturer table
91
$mac_man = load_mac_manufacturer_table();
92

    
93
include("head.inc");
94

    
95
?>
96

    
97
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
98
<?php include("fbegin.inc"); ?>
99
<?php
100

    
101
function leasecmp($a, $b) {
102
	return strcmp($a[$_GET['order']], $b[$_GET['order']]);
103
}
104

    
105
function adjust_gmt($dt) {
106
	global $config;
107
	$dhcpdv6 = $config['dhcpdv6'];
108
	foreach ($dhcpdv6 as $dhcpv6leaseinlocaltime) {
109
		$dhcpv6leaseinlocaltime = $dhcpv6leaseinlocaltime['dhcpv6leaseinlocaltime'];
110
		if ($dhcpv6leaseinlocaltime == "yes")
111
			break;
112
	}
113
	$timezone = $config['system']['timezone'];
114
	$ts = strtotime($dt . " GMT");
115
	if ($dhcpv6leaseinlocaltime == "yes") {
116
		$this_tz = new DateTimeZone($timezone);
117
		$dhcp_lt = new DateTime(strftime("%I:%M:%S%p", $ts), $this_tz);
118
		$offset = $this_tz->getOffset($dhcp_lt);
119
		$ts = $ts + $offset;
120
		return strftime("%Y/%m/%d %I:%M:%S%p", $ts);
121
	}
122
	else
123
		return strftime("%Y/%m/%d %H:%M:%S", $ts);
124
}
125

    
126
function remove_duplicate($array, $field) {
127
	foreach ($array as $sub)
128
		$cmp[] = $sub[$field];
129
	$unique = array_unique(array_reverse($cmp,true));
130
	foreach ($unique as $k => $rien)
131
		$new[] = $array[$k];
132
	return $new;
133
}
134

    
135
function parse_duid($duid_string) {
136
	$parsed_duid = array();
137
	for ($i=0; $i < strlen($duid_string); $i++) {
138
		$s = substr($duid_string, $i, 1);
139
		if ($s == '\\') {
140
			$n = substr($duid_string, $i+1, 1);
141
			if (($n == '\\') || ($n == '"')) {
142
				$parsed_duid[] = sprintf("%02x", ord($n));
143
			} elseif (is_numeric($n)) {
144
				$parsed_duid[] = sprintf("%02x", octdec(substr($duid_string, $i+1, 3)));
145
				$i += 3;
146
			}
147
		} else {
148
			$parsed_duid[] = sprintf("%02x", ord($s));
149
		}
150
	}
151
	$iaid = array_slice($parsed_duid, 0, 4);
152
	$duid = array_slice($parsed_duid, 4);
153
	return array($iaid, $duid);
154
}
155

    
156
$awk = "/usr/bin/awk";
157

    
158
/* this pattern sticks comments into a single array item */
159
$cleanpattern = "'{ gsub(\"^#.*\", \"\");} { gsub(\"^server-duid.*\", \"\");} { gsub(\";$\", \"\"); print;}'";
160
/* We then split the leases file by } */
161
$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
162

    
163
/* stuff the leases file in a proper format into a array by line */
164
exec("/bin/cat {$leasesfile} | {$awk} {$cleanpattern} | {$awk} {$splitpattern} | /usr/bin/grep '^ia-.. '", $leases_content);
165
$leases_count = count($leases_content);
166
exec("/usr/sbin/ndp -an", $rawdata);
167
$ndpdata = array();
168
foreach ($rawdata as $line) {
169
	$elements = preg_split('/\s+/ ',$line);
170
	if ($elements[1] != "(incomplete)") {
171
		$ndpent = array();
172
		$ip = trim(str_replace(array('(',')'),'',$elements[0]));
173
		$ndpent['mac'] = trim($elements[1]);
174
		$ndpent['interface'] = trim($elements[2]);
175
		$ndpdata[$ip] = $ndpent;
176
	}
177
}
178

    
179
$pools = array();
180
$leases = array();
181
$prefixes = array();
182
$mappings = array();
183
$i = 0;
184
$l = 0;
185
$p = 0;
186

    
187
// Put everything together again
188
while($i < $leases_count) {
189
	$entry = array();
190
	/* split the line by space */
191
	$duid_split = array();
192
	preg_match('/ia-.. "(.*)" { (.*)/ ', $leases_content[$i], $duid_split);
193
	if (!empty($duid_split[1])) {
194
		$iaid_duid = parse_duid($duid_split[1]);
195
		$entry['iaid'] = hexdec(implode("", array_reverse($iaid_duid[0])));
196
		$entry['duid'] = implode(":", $iaid_duid[1]);
197
		$data = explode(" ", $duid_split[2]);
198
	} else {
199
		$data = explode(" ", $leases_content[$i]);
200
	}
201
	/* walk the fields */
202
	$f = 0;
203
	$fcount = count($data);
204
	/* with less then 12 fields there is nothing useful */
205
	if($fcount < 12) {
206
		$i++;
207
		continue;
208
	}
209
	while($f < $fcount) {
210
		switch($data[$f]) {
211
			case "failover":
212
				$pools[$p]['name'] = $data[$f+2];
213
				$pools[$p]['mystate'] = $data[$f+7];
214
				$pools[$p]['peerstate'] = $data[$f+14];
215
				$pools[$p]['mydate'] = $data[$f+10];
216
				$pools[$p]['mydate'] .= " " . $data[$f+11];
217
				$pools[$p]['peerdate'] = $data[$f+17];
218
				$pools[$p]['peerdate'] .= " " . $data[$f+18];
219
				$p++;
220
				$i++;
221
				continue 3;
222
			case "ia-pd":
223
				$is_prefix = true;
224
			case "ia-na":
225
				$entry['iaid'] = $tmp_iaid;
226
				$entry['duid'] = $tmp_duid;
227
				if ($data[$f+1][0] == '"') {
228
					$duid = "";
229
					/* FIXME: This needs a safety belt to prevent an infinite loop */
230
					while ($data[$f][strlen($data[$f])-1] != '"') {
231
						$duid .= " " . $data[$f+1];
232
						$f++;
233
					}
234
					$entry['duid'] = $duid;
235
				} else {
236
					$entry['duid'] = $data[$f+1];
237
				}
238
				$entry['type'] = "dynamic";
239
				$f = $f+2;
240
				break;
241
			case "iaaddr":
242
				$entry['ip'] = $data[$f+1];
243
				$entry['type'] = "dynamic";
244
				if (in_array($entry['ip'], array_keys($ndpdata))) {
245
					$entry['online'] = 'online';
246
				} else {
247
					$entry['online'] = 'offline';
248
				}
249
				$f = $f+2;
250
				break;
251
			case "iaprefix":
252
				$is_prefix = true;
253
				$entry['prefix'] = $data[$f+1];
254
				$entry['type'] = "dynamic";
255
				$f = $f+2;
256
				break;
257
			case "starts":
258
				$entry['start'] = $data[$f+2];
259
				$entry['start'] .= " " . $data[$f+3];
260
				$f = $f+3;
261
				break;
262
			case "ends":
263
				$entry['end'] = $data[$f+2];
264
				$entry['end'] .= " " . $data[$f+3];
265
				$f = $f+3;
266
				break;
267
			case "tstp":
268
				$f = $f+3;
269
				break;
270
			case "tsfp":
271
				$f = $f+3;
272
				break;
273
			case "atsfp":
274
				$f = $f+3;
275
				break;
276
			case "cltt":
277
				$entry['start'] = $data[$f+2];
278
				$entry['start'] .= " " . $data[$f+3];
279
				$f = $f+3;
280
				break;
281
			case "binding":
282
				switch($data[$f+2]) {
283
					case "active":
284
						$entry['act'] = "active";
285
						break;
286
					case "free":
287
						$entry['act'] = "expired";
288
						$entry['online'] = "offline";
289
						break;
290
					case "backup":
291
						$entry['act'] = "reserved";
292
						$entry['online'] = "offline";
293
						break;
294
					case "released":
295
						$entry['act'] = "released";
296
						$entry['online'] = "offline";
297
				}
298
				$f = $f+1;
299
				break;
300
			case "next":
301
				/* skip the next binding statement */
302
				$f = $f+3;
303
				break;
304
			case "hardware":
305
				$f = $f+2;
306
				break;
307
			case "client-hostname":
308
				if($data[$f+1] <> "") {
309
					$entry['hostname'] = preg_replace('/"/','',$data[$f+1]);
310
				} else {
311
					$hostname = gethostbyaddr($entry['ip']);
312
					if($hostname <> "") {
313
						$entry['hostname'] = $hostname;
314
					}
315
				}
316
				$f = $f+1;
317
				break;
318
			case "uid":
319
				$f = $f+1;
320
				break;
321
		}
322
		$f++;
323
	}
324
	if ($is_prefix) {
325
		$prefixes[] = $entry;
326
	} else {
327
		$leases[] = $entry;
328
		$mappings[$entry['iaid'] . $entry['duid']] = $entry['ip'];
329
	}
330
	$l++;
331
	$i++;
332
	$is_prefix = false;
333
}
334

    
335
if(count($leases) > 0) {
336
	$leases = remove_duplicate($leases,"ip");
337
}
338

    
339
if(count($prefixes) > 0) {
340
	$prefixes = remove_duplicate($prefixes,"prefix");
341
}
342

    
343
if(count($pools) > 0) {
344
	$pools = remove_duplicate($pools,"name");
345
	asort($pools);
346
}
347

    
348
foreach($config['interfaces'] as $ifname => $ifarr) {
349
	if (is_array($config['dhcpdv6'][$ifname]) &&
350
		is_array($config['dhcpdv6'][$ifname]['staticmap'])) {
351
		foreach($config['dhcpdv6'][$ifname]['staticmap'] as $static) {
352
			$slease = array();
353
			$slease['ip'] = $static['ipaddrv6'];
354
			$slease['type'] = "static";
355
			$slease['duid'] = $static['duid'];
356
			$slease['start'] = "";
357
			$slease['end'] = "";
358
			$slease['hostname'] = htmlentities($static['hostname']);
359
			$slease['act'] = "static";
360
			if (in_array($slease['ip'], array_keys($ndpdata))) {
361
				$slease['online'] = 'online';
362
			} else {
363
				$slease['online'] = 'offline';
364
			}
365

    
366
			$leases[] = $slease;
367
		}
368
	}
369
}
370

    
371
if ($_GET['order'])
372
	usort($leases, "leasecmp");
373

    
374
/* only print pool status when we have one */
375
if(count($pools) > 0) {
376
?>
377
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
378
	<tr>
379
		<td class="listhdrr"><?=gettext("Failover Group"); ?></a></td>
380
		<td class="listhdrr"><?=gettext("My State"); ?></a></td>
381
		<td class="listhdrr"><?=gettext("Since"); ?></a></td>
382
		<td class="listhdrr"><?=gettext("Peer State"); ?></a></td>
383
		<td class="listhdrr"><?=gettext("Since"); ?></a></td>
384
	</tr>
385
<?php
386
foreach ($pools as $data) {
387
	echo "<tr>\n";
388
	echo "<td class=\"listlr\">{$fspans}{$data['name']}{$fspane}&nbsp;</td>\n";
389
	echo "<td class=\"listr\">{$fspans}{$data['mystate']}{$fspane}&nbsp;</td>\n";
390
	echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['mydate']) . "{$fspane}&nbsp;</td>\n";
391
	echo "<td class=\"listr\">{$fspans}{$data['peerstate']}{$fspane}&nbsp;</td>\n";
392
	echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['peerdate']) . "{$fspane}&nbsp;</td>\n";
393
	echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
394
	echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
395
	echo "</tr>\n";
396
}
397

    
398
?>
399
</table>
400

    
401
<?php
402
/* only print pool status when we have one */
403
}
404
?>
405

    
406
<p>
407

    
408
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
409
  <tr>
410
    <td class="listhdrr"><a href="#"><?=gettext("IPv6 address"); ?></a></td>
411
    <td class="listhdrr"><a href="#"><?=gettext("IAID"); ?></a></td>
412
    <td class="listhdrr"><a href="#"><?=gettext("DUID"); ?></a></td>
413
    <td class="listhdrr"><a href="#"><?=gettext("Hostname/MAC"); ?></a></td>
414
    <td class="listhdrr"><a href="#"><?=gettext("Start"); ?></a></td>
415
    <td class="listhdrr"><a href="#"><?=gettext("End"); ?></a></td>
416
    <td class="listhdrr"><a href="#"><?=gettext("Online"); ?></a></td>
417
    <td class="listhdrr"><a href="#"><?=gettext("Lease Type"); ?></a></td>
418
	</tr>
419
<?php
420
foreach ($leases as $data) {
421
	if (($data['act'] == "active") || ($data['act'] == "static") || ($_GET['all'] == 1)) {
422
		if ($data['act'] != "active" && $data['act'] != "static") {
423
			$fspans = "<span class=\"gray\">";
424
			$fspane = "</span>";
425
		} else {
426
			$fspans = $fspane = "";
427
		}
428

    
429
		if ($data['act'] == "static") {
430
			foreach ($config['dhcpdv6'] as $dhcpif => $dhcpifconf) {
431
				if(is_array($dhcpifconf['staticmap'])) {
432
					foreach ($dhcpifconf['staticmap'] as $staticent) {
433
						if ($data['ip'] == $staticent['ipaddr']) {
434
							$data['if'] = $dhcpif;
435
							break;
436
						}
437
					}
438
				}
439
				/* exit as soon as we have an interface */
440
				if ($data['if'] != "")
441
					break;
442
			}
443
		} else {
444
			$data['if'] = convert_real_interface_to_friendly_interface_name(guess_interface_from_ip($data['ip']));
445
		}
446
		echo "<tr>\n";
447
		echo "<td class=\"listlr\">{$fspans}{$data['ip']}{$fspane}&nbsp;</td>\n";
448
		echo "<td class=\"listr\">{$fspans}{$data['iaid']}{$fspane}&nbsp;</td>\n";
449
		echo "<td class=\"listr\">{$fspans}{$data['duid']}{$fspane}&nbsp;</td>\n";
450
		echo "<td class=\"listr\">{$fspans}";
451
		if (!empty($data['hostname'])) {
452
			echo htmlentities($data['hostname']) . "<br/>";
453
		}
454

    
455
		$mac=trim($ndpdata[$data['ip']]['mac']);
456
		if (!empty($mac)) {
457
			$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
458
			print htmlentities($mac);
459
			if(isset($mac_man[$mac_hi])){ print "<br/><font size=\"-2\"><i>{$mac_man[$mac_hi]}</i></font>"; }
460
		}
461

    
462
		echo "{$fspane}&nbsp;</td>\n";
463
		if ($data['type'] != "static") {
464
			echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}&nbsp;</td>\n";
465
			echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}&nbsp;</td>\n";
466
		} else {
467
			echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
468
			echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
469
		}
470
		echo "<td class=\"listr\">{$fspans}{$data['online']}{$fspane}&nbsp;</td>\n";
471
		echo "<td class=\"listr\">{$fspans}{$data['act']}{$fspane}&nbsp;</td>\n";
472

    
473
		if ($data['type'] == "dynamic") {
474
			echo "<td valign=\"middle\"><a href=\"services_dhcpv6_edit.php?if={$data['if']}&duid={$data['duid']}&hostname={$data['hostname']}\">";
475
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a static mapping for this MAC address") ."\"></a></td>\n";
476
		} else {
477
			echo "<td class=\"list\" valign=\"middle\">";
478
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\"></td>\n";
479
		}
480

    
481
		/* Only show the button for offline dynamic leases */
482
		if (($data['type'] == "dynamic") && ($data['online'] != "online")) {
483
			echo "<td class=\"list\" valign=\"middle\"><a href=\"status_dhcpv6_leases.php?deleteip={$data['ip']}&all=" . htmlspecialchars($_GET['all']) . "\">";
484
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_x.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("delete this DHCP lease") . "\"></a></td>\n";
485
		}
486
		echo "</tr>\n";
487
	}
488
}
489
?>
490
</table>
491
<p>
492
<h3>Delegated Prefixes</h3>
493
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
494
	<tr>
495
		<td class="listhdrr"><a href="#"><?=gettext("IPv6 Prefix"); ?></a></td>
496
		<td class="listhdrr"><a href="#"><?=gettext("IAID"); ?></a></td>
497
		<td class="listhdrr"><a href="#"><?=gettext("DUID"); ?></a></td>
498
		<td class="listhdrr"><a href="#"><?=gettext("Start"); ?></a></td>
499
		<td class="listhdrr"><a href="#"><?=gettext("End"); ?></a></td>
500
		<td class="listhdrr"><a href="#"><?=gettext("State"); ?></a></td>
501
	</tr>
502
<?php
503
foreach ($prefixes as $data) {
504
	if (($data['act'] == "active") || ($data['act'] == "static") || ($_GET['all'] == 1)) {
505
		if ($data['act'] != "active" && $data['act'] != "static") {
506
			$fspans = "<span class=\"gray\">";
507
			$fspane = "</span>";
508
		} else {
509
			$fspans = $fspane = "";
510
		}
511

    
512
		if ($data['act'] == "static") {
513
			foreach ($config['dhcpdv6'] as $dhcpif => $dhcpifconf) {
514
				if(is_array($dhcpifconf['staticmap'])) {
515
					foreach ($dhcpifconf['staticmap'] as $staticent) {
516
						if ($data['ip'] == $staticent['ipaddr']) {
517
							$data['if'] = $dhcpif;
518
							break;
519
						}
520
					}
521
				}
522
				/* exit as soon as we have an interface */
523
				if ($data['if'] != "")
524
					break;
525
			}
526
		} else {
527
			$data['if'] = convert_real_interface_to_friendly_interface_name(guess_interface_from_ip($data['ip']));
528
		}
529
		echo "<tr>\n";
530
		if ($mappings[$data['iaid'] . $data['duid']]) {
531
			$dip = "<br/>Routed To: {$mappings[$data['iaid'] . $data['duid']]}";
532
		}
533
		echo "<td class=\"listlr\">{$fspans}{$data['prefix']}{$dip}{$fspane}&nbsp;</td>\n";
534
		echo "<td class=\"listr\">{$fspans}{$data['iaid']}{$fspane}&nbsp;</td>\n";
535
		echo "<td class=\"listr\">{$fspans}{$data['duid']}{$fspane}&nbsp;</td>\n";
536
		if ($data['type'] != "static") {
537
			echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}&nbsp;</td>\n";
538
			echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}&nbsp;</td>\n";
539
		} else {
540
			echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
541
			echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
542
		}
543
		echo "<td class=\"listr\">{$fspans}{$data['act']}{$fspane}&nbsp;</td>\n";
544
		echo "</tr>\n";
545
	}
546
}
547
?>
548
</table>
549
<p>
550
<form action="status_dhcpv6_leases.php" method="GET">
551
<input type="hidden" name="order" value="<?=htmlspecialchars($_GET['order']);?>">
552
<?php if ($_GET['all']): ?>
553
<input type="hidden" name="all" value="0">
554
<input type="submit" class="formbtn" value="<?=gettext("Show active and static leases only"); ?>">
555
<?php else: ?>
556
<input type="hidden" name="all" value="1">
557
<input type="submit" class="formbtn" value="<?=gettext("Show all configured leases"); ?>">
558
<?php endif; ?>
559
</form>
560
<?php if($leases == 0): ?>
561
<p><strong><?=gettext("No leases file found. Is the DHCP server active"); ?>?</strong></p>
562
<?php endif; ?>
563

    
564
<?php include("fend.inc"); ?>
565
</body>
566
</html>
(177-177/246)