diff options
author | jim-p <jimp@pfsense.org> | 2015-11-12 14:05:31 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2015-11-12 14:05:31 -0500 |
commit | 683f9eced9675528b61558ed327be89168b5d33f (patch) | |
tree | 259c402c34bacc595394824c2abbe1c55018eb95 | |
parent | 6a9837c9abd3011d22eccb31175e56fc02b9f286 (diff) | |
download | pfsense-packages-683f9eced9675528b61558ed327be89168b5d33f.tar.gz pfsense-packages-683f9eced9675528b61558ed327be89168b5d33f.tar.bz2 pfsense-packages-683f9eced9675528b61558ed327be89168b5d33f.zip |
Add timezone conversion for ACB timestamps, server always returns time in US Central time, convert to locally set TZ. Fixes #5250
-rw-r--r-- | config/autoconfigbackup/autoconfigbackup.php | 11 | ||||
-rw-r--r-- | config/autoconfigbackup/autoconfigbackup.xml | 2 | ||||
-rw-r--r-- | pkg_config.10.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 2 |
5 files changed, 15 insertions, 4 deletions
diff --git a/config/autoconfigbackup/autoconfigbackup.php b/config/autoconfigbackup/autoconfigbackup.php index 5bf40736..d384e3dd 100644 --- a/config/autoconfigbackup/autoconfigbackup.php +++ b/config/autoconfigbackup/autoconfigbackup.php @@ -350,12 +350,23 @@ EOF; // Loop through and create new confvers $data_split = split("\n", $data); $confvers = array(); + + /* Set up time zones for conversion. See #5250 */ + $acbtz = new DateTimeZone('America/Chicago'); + $mytz = new DateTimeZone(date_default_timezone_get()); + foreach ($data_split as $ds) { $ds_split = split($oper_sep, $ds); $tmp_array = array(); $tmp_array['username'] = $ds_split[0]; $tmp_array['reason'] = $ds_split[1]; $tmp_array['time'] = $ds_split[2]; + + /* Convert the time from server time to local. See #5250 */ + $budate = new DateTime($tmp_array['time'], $acbtz); + $budate->setTimezone($mytz); + $tmp_array['time'] = $budate->format(DATE_RFC2822); + if ($ds_split[2] && $ds_split[0]) { $confvers[] = $tmp_array; } diff --git a/config/autoconfigbackup/autoconfigbackup.xml b/config/autoconfigbackup/autoconfigbackup.xml index dd83a9c7..93526a49 100644 --- a/config/autoconfigbackup/autoconfigbackup.xml +++ b/config/autoconfigbackup/autoconfigbackup.xml @@ -43,7 +43,7 @@ <description>Automatically backs up your pfSense configuration. All contents are encrypted before being sent to the server. Requires Gold Subscription from https://portal.pfsense.org</description> <requirements>pfSense Portal subscription</requirements> <name>AutoConfigBackup</name> - <version>1.29</version> + <version>1.30</version> <title>Diagnostics: Auto Configuration Backup</title> <savetext>Change</savetext> <include_file>/usr/local/pkg/autoconfigbackup.inc</include_file> diff --git a/pkg_config.10.xml b/pkg_config.10.xml index e3089783..efe0b45f 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -774,7 +774,7 @@ </descr> <website>https://portal.pfsense.org</website> <category>Services</category> - <version>1.29</version> + <version>1.30</version> <status>RELEASE</status> <required_version>2.2</required_version> <pkginfolink>https://doc.pfsense.org/index.php/AutoConfigBackup</pkginfolink> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index c4e1c8d4..76faf2fb 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -833,7 +833,7 @@ <descr>Automatically backs up your pfSense configuration. All contents are encrypted before being sent to the server. Requires Gold Subscription from https://portal.pfsense.org</descr> <website>https://portal.pfsense.org</website> <category>Services</category> - <version>1.29</version> + <version>1.30</version> <status>Stable</status> <required_version>1.2</required_version> <pkginfolink>https://doc.pfsense.org/index.php/AutoConfigBackup</pkginfolink> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 204e1e82..40ee1b39 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -820,7 +820,7 @@ <descr>Automatically backs up your pfSense configuration. All contents are encrypted before being sent to the server. Requires Gold Subscription from https://portal.pfsense.org</descr> <website>https://portal.pfsense.org</website> <category>Services</category> - <version>1.29</version> + <version>1.30</version> <status>Stable</status> <required_version>1.2</required_version> <pkginfolink>https://doc.pfsense.org/index.php/AutoConfigBackup</pkginfolink> |