From aedd7929dc40d49bd631cd0dc8c88d6ee96e911e Mon Sep 17 00:00:00 2001 From: jim-p Date: Sun, 3 May 2009 13:55:11 -0400 Subject: Don't display a fake time for a static DHCP lease begin/end. Since it has no beginning and ending, just display "n/a" instead. See ticket #1921. --- usr/local/www/diag_dhcp_leases.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/usr/local/www/diag_dhcp_leases.php b/usr/local/www/diag_dhcp_leases.php index 17b27e0..21a4f70 100755 --- a/usr/local/www/diag_dhcp_leases.php +++ b/usr/local/www/diag_dhcp_leases.php @@ -254,9 +254,8 @@ foreach($config['interfaces'] as $ifname => $ifarr) { $slease['ip'] = $static['ipaddr']; $slease['type'] = "static"; $slease['mac'] = $static['mac']; - $slease['start'] = gmdate("M d Y H:i:s", time()); - $slease['end'] = gmdate("M d Y H:i:s", time()); - $slease['end'] = gmdate("M d Y H:i:s", strtotime('+5 minutes')); + $slease['start'] = ""; + $slease['end'] = ""; $slease['hostname'] = htmlentities($static['hostname']); $slease['act'] = "static"; $online = exec("/usr/sbin/arp -an |/usr/bin/grep {$slease['mac']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'"); @@ -360,8 +359,13 @@ foreach ($leases as $data) { echo "{$fspans}{$data['mac']}{$fspane} \n"; } echo "{$fspans}" . htmlentities($data['hostname']) . "{$fspane} \n"; - echo "{$fspans}" . adjust_gmt($data['start']) . "{$fspane} \n"; - echo "{$fspans}" . adjust_gmt($data['end']) . "{$fspane} \n"; + if ($data['type'] != "static") { + echo "{$fspans}" . adjust_gmt($data['start']) . "{$fspane} \n"; + echo "{$fspans}" . adjust_gmt($data['end']) . "{$fspane} \n"; + } else { + echo "{$fspans} n/a {$fspane} \n"; + echo "{$fspans} n/a {$fspane} \n"; + } echo "{$fspans}{$data['online']}{$fspane} \n"; echo "{$fspans}{$data['act']}{$fspane} \n"; -- cgit v1.1