diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-03-26 11:08:33 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-03-26 11:08:33 -0300 |
commit | 5385a5e10b8ba8324d7b313c3cb0ef024b0956a9 (patch) | |
tree | d0caec613cdda8e6a7ee5e455ec1d76f80df4f81 /usr | |
parent | d5b28fcf94d5db726f8e5d9e1e80662df215b733 (diff) | |
parent | 39894ed4b4710d2d26412b4206b36f4cb424a765 (diff) | |
download | pfsense-5385a5e10b8ba8324d7b313c3cb0ef024b0956a9.zip pfsense-5385a5e10b8ba8324d7b313c3cb0ef024b0956a9.tar.gz |
Merge pull request #1559 from phil-davis/status-dhcp-leases
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/status_dhcp_leases.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php index 191d9f5..24c41b8 100644 --- a/usr/local/www/status_dhcp_leases.php +++ b/usr/local/www/status_dhcp_leases.php @@ -107,9 +107,12 @@ function adjust_gmt($dt) { } if ($dhcpleaseinlocaltime == "yes") { $ts = strtotime($dt . " GMT"); - return strftime("%Y/%m/%d %I:%M:%S%p", $ts); - } else - return $dt; + if ($ts !== false) { + return strftime("%Y/%m/%d %I:%M:%S%p", $ts); + } + } + /* If we did not need to convert to local time or the conversion failed, just return the input. */ + return $dt; } function remove_duplicate($array, $field) @@ -186,9 +189,16 @@ foreach($leases_content as $lease) { $f = $f+3; break; case "ends": - $leases[$l]['end'] = $data[$f+2]; - $leases[$l]['end'] .= " " . $data[$f+3]; - $f = $f+3; + if ($data[$f+1] == "never") { + // Quote from dhcpd.leases(5) man page: + // If a lease will never expire, date is never instead of an actual date. + $leases[$l]['end'] = gettext("Never"); + $f = $f+1; + } else { + $leases[$l]['end'] = $data[$f+2]; + $leases[$l]['end'] .= " " . $data[$f+3]; + $f = $f+3; + } break; case "tstp": $f = $f+3; |