diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-03-17 17:44:51 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-03-17 17:44:51 +0000 |
commit | 14cf741d18b20fda44fc17d48de9805de947523e (patch) | |
tree | fefa3151f6deb389b0e649f5239be842ba4ce23c /usr/local/www | |
parent | 63f247b62728856caaa9d005f6ec5907cbd5f6de (diff) | |
download | pfsense-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')
-rwxr-xr-x | usr/local/www/diag_dhcp_leases.php | 16 |
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'])) { |