aboutsummaryrefslogtreecommitdiffstats
path: root/config/autoconfigbackup/autoconfigbackup.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/autoconfigbackup/autoconfigbackup.php')
-rw-r--r--config/autoconfigbackup/autoconfigbackup.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/config/autoconfigbackup/autoconfigbackup.php b/config/autoconfigbackup/autoconfigbackup.php
index 5bf40736..9a7d67a1 100644
--- a/config/autoconfigbackup/autoconfigbackup.php
+++ b/config/autoconfigbackup/autoconfigbackup.php
@@ -82,6 +82,10 @@ if ($_REQUEST['download']) {
$pgtitle = "Diagnostics: Auto Configuration Backup";
}
+/* Set up time zones for conversion. See #5250 */
+$acbtz = new DateTimeZone('America/Chicago');
+$mytz = new DateTimeZone(date_default_timezone_get());
+
include("head.inc");
function get_hostnames() {
@@ -193,7 +197,9 @@ function get_hostnames() {
$savemsg = "An error occurred while trying to remove the item from portal.pfsense.org.";
} else {
curl_close($curl_session);
- $savemsg = "Backup revision {$_REQUEST['rmver']} has been removed.";
+ $budate = new DateTime($_REQUEST['rmver'], $acbtz);
+ $budate->setTimezone($mytz);
+ $savemsg = "Backup revision " . htmlspecialchars($budate->format(DATE_RFC2822)) . " has been removed.";
}
print_info_box($savemsg);
}
@@ -350,12 +356,19 @@ EOF;
// Loop through and create new confvers
$data_split = split("\n", $data);
$confvers = array();
+
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['localtime'] = $budate->format(DATE_RFC2822);
+
if ($ds_split[2] && $ds_split[0]) {
$confvers[] = $tmp_array;
}
@@ -398,16 +411,16 @@ EOF;
foreach ($confvers as $cv):
?>
<tr valign="top">
- <td class="listlr"> <?= $cv['time']; ?></td>
+ <td class="listlr"> <?= $cv['localtime']; ?></td>
<td class="listbg"> <?= $cv['reason']; ?></td>
<td colspan="2" valign="middle" class="list" nowrap="nowrap">
- <a title="Restore this revision" onclick="return confirm('Are you sure you want to restore <?= $cv['time']; ?>?')" href="autoconfigbackup.php?hostname=<?=urlencode($hostname)?>&newver=<?=urlencode($cv['time']);?>">
+ <a title="Restore this revision" onclick="return confirm('Are you sure you want to restore <?= $cv['localtime']; ?>?')" href="autoconfigbackup.php?hostname=<?=urlencode($hostname)?>&newver=<?=urlencode($cv['time']);?>">
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="" />
</a>
<a title="Show info" href="autoconfigbackup.php?download=<?=urlencode($cv['time']);?>&hostname=<?=urlencode($hostname)?>&reason=<?php echo urlencode($cv['reason']);?>">
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_down.gif" width="17" height="17" border="0" alt="" />
</a>
- <a title="Delete" onclick="return confirm('Are you sure you want to delete <?= $cv['time']; ?>?')"href="autoconfigbackup.php?hostname=<?=urlencode($hostname)?>&rmver=<?=urlencode($cv['time']);?>">
+ <a title="Delete" onclick="return confirm('Are you sure you want to delete <?= $cv['localtime']; ?>?')"href="autoconfigbackup.php?hostname=<?=urlencode($hostname)?>&rmver=<?=urlencode($cv['time']);?>">
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="" />
</a>
</td>