Project

General

Profile

Download (17.4 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
include("head.inc");
91

    
92
?>
93

    
94
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
95
<?php include("fbegin.inc"); ?>
96
<?php
97

    
98
function leasecmp($a, $b) {
99
	return strcmp($a[$_GET['order']], $b[$_GET['order']]);
100
}
101

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

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

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

    
153
$awk = "/usr/bin/awk";
154

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

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

    
176
$pools = array();
177
$leases = array();
178
$prefixes = array();
179
$mappings = array();
180
$i = 0;
181
$l = 0;
182
$p = 0;
183

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

    
332
if(count($leases) > 0) {
333
	$leases = remove_duplicate($leases,"ip");
334
}
335

    
336
if(count($prefixes) > 0) {
337
	$prefixes = remove_duplicate($prefixes,"prefix");
338
}
339

    
340
if(count($pools) > 0) {
341
	$pools = remove_duplicate($pools,"name");
342
	asort($pools);
343
}
344

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

    
363
			$leases[] = $slease;
364
		}
365
	}
366
}
367

    
368
if ($_GET['order'])
369
	usort($leases, "leasecmp");
370

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

    
395
?>
396
</table>
397

    
398
<?php
399
/* only print pool status when we have one */
400
}
401
?>
402

    
403
<p>
404

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

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

    
463
		if ($data['type'] == "dynamic") {
464
			echo "<td valign=\"middle\"><a href=\"services_dhcpv6_edit.php?if={$data['if']}&duid={$data['duid']}&hostname={$data['hostname']}\">";
465
			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";
466
		} else {
467
			echo "<td class=\"list\" valign=\"middle\">";
468
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\"></td>\n";
469
		}
470

    
471
		/* Only show the button for offline dynamic leases */
472
		if (($data['type'] == "dynamic") && ($data['online'] != "online")) {
473
			echo "<td class=\"list\" valign=\"middle\"><a href=\"status_dhcpv6_leases.php?deleteip={$data['ip']}&all=" . htmlspecialchars($_GET['all']) . "\">";
474
			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";
475
		}
476
		echo "</tr>\n";
477
	}
478
}
479
?>
480
</table>
481
<p>
482
<h3>Delegated Prefixes</h3>
483
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
484
	<tr>
485
		<td class="listhdrr"><a href="#"><?=gettext("IPv6 Prefix"); ?></a></td>
486
		<td class="listhdrr"><a href="#"><?=gettext("IAID"); ?></a></td>
487
		<td class="listhdrr"><a href="#"><?=gettext("DUID"); ?></a></td>
488
		<td class="listhdrr"><a href="#"><?=gettext("Start"); ?></a></td>
489
		<td class="listhdrr"><a href="#"><?=gettext("End"); ?></a></td>
490
		<td class="listhdrr"><a href="#"><?=gettext("State"); ?></a></td>
491
	</tr>
492
<?php
493
foreach ($prefixes as $data) {
494
	if (($data['act'] == "active") || ($data['act'] == "static") || ($_GET['all'] == 1)) {
495
		if ($data['act'] != "active" && $data['act'] != "static") {
496
			$fspans = "<span class=\"gray\">";
497
			$fspane = "</span>";
498
		} else {
499
			$fspans = $fspane = "";
500
		}
501

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

    
554
<?php include("fend.inc"); ?>
555
</body>
556
</html>
(177-177/246)