Projet

Général

Profil

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

univnautes / usr / local / www / status_dhcpv6_leases.php @ 0fab7eb1

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

    
108
	$dhcpv6leaseinlocaltime == "no";
109
	if (is_array($config['dhcpdv6'])) {
110
		$dhcpdv6 = $config['dhcpdv6'];
111
		foreach ($dhcpdv6 as $dhcpv6leaseinlocaltime) {
112
			$dhcpv6leaseinlocaltime = $dhcpv6leaseinlocaltime['dhcpv6leaseinlocaltime'];
113
			if ($dhcpv6leaseinlocaltime == "yes")
114
				break;
115
		}
116
	}
117

    
118
	$timezone = $config['system']['timezone'];
119
	$ts = strtotime($dt . " GMT");
120
	if ($dhcpv6leaseinlocaltime == "yes") {
121
		$this_tz = new DateTimeZone($timezone);
122
		$dhcp_lt = new DateTime(strftime("%I:%M:%S%p", $ts), $this_tz);
123
		$offset = $this_tz->getOffset($dhcp_lt);
124
		$ts = $ts + $offset;
125
		return strftime("%Y/%m/%d %I:%M:%S%p", $ts);
126
	}
127
	else
128
		return strftime("%Y/%m/%d %H:%M:%S", $ts);
129
}
130

    
131
function remove_duplicate($array, $field) {
132
	foreach ($array as $sub)
133
		$cmp[] = $sub[$field];
134
	$unique = array_unique(array_reverse($cmp,true));
135
	foreach ($unique as $k => $rien)
136
		$new[] = $array[$k];
137
	return $new;
138
}
139

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

    
161
$awk = "/usr/bin/awk";
162

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

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

    
184
$pools = array();
185
$leases = array();
186
$prefixes = array();
187
$mappings = array();
188
$i = 0;
189
$l = 0;
190
$p = 0;
191

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

    
340
if(count($leases) > 0) {
341
	$leases = remove_duplicate($leases,"ip");
342
}
343

    
344
if(count($prefixes) > 0) {
345
	$prefixes = remove_duplicate($prefixes,"prefix");
346
}
347

    
348
if(count($pools) > 0) {
349
	$pools = remove_duplicate($pools,"name");
350
	asort($pools);
351
}
352

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

    
371
			$leases[] = $slease;
372
		}
373
	}
374
}
375

    
376
if ($_GET['order'])
377
	usort($leases, "leasecmp");
378

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

    
403
?>
404
</table>
405

    
406
<?php
407
/* only print pool status when we have one */
408
}
409
?>
410

    
411
<p>
412

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

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

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

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

    
478
		if ($data['type'] == "dynamic") {
479
			echo "<td valign=\"middle\"><a href=\"services_dhcpv6_edit.php?if={$data['if']}&duid={$data['duid']}&hostname={$data['hostname']}\">";
480
			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";
481
		} else {
482
			echo "<td class=\"list\" valign=\"middle\">";
483
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\"></td>\n";
484
		}
485

    
486
		/* Only show the button for offline dynamic leases */
487
		if (($data['type'] == "dynamic") && ($data['online'] != "online")) {
488
			echo "<td class=\"list\" valign=\"middle\"><a href=\"status_dhcpv6_leases.php?deleteip={$data['ip']}&all=" . htmlspecialchars($_GET['all']) . "\">";
489
			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";
490
		}
491
		echo "</tr>\n";
492
	}
493
}
494
?>
495
</table>
496
<p>
497
<h3>Delegated Prefixes</h3>
498
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
499
	<tr>
500
		<td class="listhdrr"><a href="#"><?=gettext("IPv6 Prefix"); ?></a></td>
501
		<td class="listhdrr"><a href="#"><?=gettext("IAID"); ?></a></td>
502
		<td class="listhdrr"><a href="#"><?=gettext("DUID"); ?></a></td>
503
		<td class="listhdrr"><a href="#"><?=gettext("Start"); ?></a></td>
504
		<td class="listhdrr"><a href="#"><?=gettext("End"); ?></a></td>
505
		<td class="listhdrr"><a href="#"><?=gettext("State"); ?></a></td>
506
	</tr>
507
<?php
508
foreach ($prefixes as $data) {
509
	if (($data['act'] == "active") || ($data['act'] == "static") || ($_GET['all'] == 1)) {
510
		if ($data['act'] != "active" && $data['act'] != "static") {
511
			$fspans = "<span class=\"gray\">";
512
			$fspane = "</span>";
513
		} else {
514
			$fspans = $fspane = "";
515
		}
516

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

    
569
<?php include("fend.inc"); ?>
570
</body>
571
</html>
(184-184/254)