summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_dhcp_leases.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-03-17 17:44:51 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-03-17 17:44:51 +0000
commit14cf741d18b20fda44fc17d48de9805de947523e (patch)
treefefa3151f6deb389b0e649f5239be842ba4ce23c /usr/local/www/diag_dhcp_leases.php
parent63f247b62728856caaa9d005f6ec5907cbd5f6de (diff)
downloadpfsense-14cf741d18b20fda44fc17d48de9805de947523e.zip
pfsense-14cf741d18b20fda44fc17d48de9805de947523e.tar.gz
MFC 10431
updated leases are appended to the end of the lease file. if we aren't showing everything just show the most current lease in the list.
Diffstat (limited to 'usr/local/www/diag_dhcp_leases.php')
-rwxr-xr-xusr/local/www/diag_dhcp_leases.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr/local/www/diag_dhcp_leases.php b/usr/local/www/diag_dhcp_leases.php
index b3b0338..b81c1b7 100755
--- a/usr/local/www/diag_dhcp_leases.php
+++ b/usr/local/www/diag_dhcp_leases.php
@@ -163,8 +163,22 @@ while ($data = array_shift($return)) {
break;
}
}
- } else if (($data[0] == "}") && ($data[1] == 1)) // End of group
+ } else if (($data[0] == "}") && ($data[1] == 1)) { // End of group
+
+ //updated leases are appended to the end of the lease file. if we aren't
+ //showing everything just show the most current lease in the list
+ if(!$_GET['all']) {
+ $l = $leases[$i]['ip'];
+ for($k = 0; $k < $i; $k++) {
+ if($leases[$k]['ip'] == $l) {
+ array_splice($leases, $k, 1);
+ --$i;
+ break;
+ }
+ }
+ }
$i++;
+ }
}
foreach($config['interfaces'] as $ifname => $ifarr) {
if (is_array($config['dhcpd'][$ifname]['staticmap'])) {
OpenPOWER on IntegriCloud