diff options
author | Joecowboy <i7wasn7m3@gmail.com> | 2012-02-25 18:38:19 -0600 |
---|---|---|
committer | Joecowboy <i7wasn7m3@gmail.com> | 2012-02-25 18:38:19 -0600 |
commit | e085eba5898fa6f351d2b07ed30acece9de8bfc3 (patch) | |
tree | d399fbc1dcb6fd4c4380b3d2c4fb7732427c333a /usr/local/www/status_dhcp_leases.php | |
parent | 138208bf779d341f427cdfbb319d479343c80152 (diff) | |
download | pfsense-e085eba5898fa6f351d2b07ed30acece9de8bfc3.zip pfsense-e085eba5898fa6f351d2b07ed30acece9de8bfc3.tar.gz |
I now parses the xml tags in the dhcpd to check if an interface for DHCP lease is using local time if not defaults to UTC time.
Diffstat (limited to 'usr/local/www/status_dhcp_leases.php')
-rwxr-xr-x | usr/local/www/status_dhcp_leases.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php index a00c94e..5b65cc9 100755 --- a/usr/local/www/status_dhcp_leases.php +++ b/usr/local/www/status_dhcp_leases.php @@ -95,18 +95,19 @@ function leasecmp($a, $b) { } function adjust_gmt($dt) { - global $config; - $sysctl = $config['system']; - $timezone = $sysctl['timezone']; - $timeformatchange = $sysctl['timeformatchange']; + global $config; + $dhcpd = $config['dhcpd']; + foreach ($dhcpd as $dhcpleaseinlocaltime) + $dhcpleaseinlocaltime = $dhcpleaseinlocaltime['dhcpleaseinlocaltime']; + $timezone = $config['system']['timezone']; $ts = strtotime($dt . " GMT"); - if ($timeformatchange == "yes") { + if ($dhcpleaseinlocaltime == "yes") { $this_tz = new DateTimeZone($timezone); $dhcp_lt = new DateTime(strftime("%I:%M:%S%p", $ts), $this_tz); $offset = $this_tz->getOffset($dhcp_lt); $ts = $ts + $offset; return strftime("%Y/%m/%d %I:%M:%S%p", $ts); - } + } else return strftime("%Y/%m/%d %H:%M:%S", $ts); } |