summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-11-21 17:09:53 -0500
committerjim-p <jimp@pfsense.org>2011-11-22 11:55:42 -0500
commit92420c0a5b4ca34a6c087381635626bfb04f9b55 (patch)
tree40be0289b4d47325b0abda489f82160be7239e51
parent5e555f9e7159816cb31a9af95c436bb7dec81e3d (diff)
downloadpfsense-92420c0a5b4ca34a6c087381635626bfb04f9b55.zip
pfsense-92420c0a5b4ca34a6c087381635626bfb04f9b55.tar.gz
Also show the config version in the backup history.
-rw-r--r--etc/inc/config.lib.inc8
-rwxr-xr-xusr/local/www/diag_confbak.php8
2 files changed, 10 insertions, 6 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index f08cff8..8779068 100644
--- a/etc/inc/config.lib.inc
+++ b/etc/inc/config.lib.inc
@@ -760,7 +760,9 @@ function cleanup_backupcache($revisions = 30, $lock = false) {
}
if($newxml['revision']['description'] == "")
$newxml['revision']['description'] = "Unknown";
- $tocache[$tocheck] = array('description' => $newxml['revision']['description']);
+ if($newxml['version'] == "")
+ $newxml['version'] = "?";
+ $tocache[$tocheck] = array('description' => $newxml['revision']['description'], 'version' => $newxml['version']);
}
}
foreach($backups as $checkbak) {
@@ -771,7 +773,7 @@ function cleanup_backupcache($revisions = 30, $lock = false) {
if($g['booting']) print " " . $tocheck . "r";
}
}
- foreach($newbaks as $todo) $tocache[$todo['time']] = array('description' => $todo['description']);
+ foreach($newbaks as $todo) $tocache[$todo['time']] = array('description' => $todo['description'], 'version' => $todo['version']);
if(is_int($revisions) and (count($tocache) > $revisions)) {
$toslice = array_slice(array_keys($tocache), 0, $revisions);
foreach($toslice as $sliced)
@@ -802,7 +804,7 @@ function get_backups() {
sort($bakvers);
// $bakvers = array_reverse($bakvers);
foreach(array_reverse($bakvers) as $bakver)
- $toreturn[] = array('time' => $bakver, 'description' => $confvers[$bakver]['description']);
+ $toreturn[] = array('time' => $bakver, 'description' => $confvers[$bakver]['description'], 'version' => $confvers[$bakver]['version']);
} else {
return false;
}
diff --git a/usr/local/www/diag_confbak.php b/usr/local/www/diag_confbak.php
index f02d2de..daa036f 100755
--- a/usr/local/www/diag_confbak.php
+++ b/usr/local/www/diag_confbak.php
@@ -150,7 +150,8 @@ include("head.inc");
<?php if (is_array($confvers)): ?>
<tr>
<td colspan="2" valign="middle" align="center" class="list" nowrap><input type="submit" name="diff" value="<?=gettext("Diff"); ?>"></td>
- <td width="30%" class="listhdrr"><?=gettext("Date");?></td>
+ <td width="22%" class="listhdrr"><?=gettext("Date");?></td>
+ <td width="8%" class="listhdrr"><?=gettext("Version");?></td>
<td width="70%" class="listhdrr"><?=gettext("Configuration Change");?></td>
</tr>
<tr valign="top">
@@ -159,6 +160,7 @@ include("head.inc");
<input type="radio" name="newtime" value="current">
</td>
<td class="listlr"> <?= date(gettext("n/j/y H:i:s"), $config['revision']['time']) ?></td>
+ <td class="listr"> <?= $config['version'] ?></td>
<td class="listr"> <?= $config['revision']['description'] ?></td>
<td colspan="3" valign="middle" class="list" nowrap><b><?=gettext("Current");?></b></td>
</tr>
@@ -169,7 +171,6 @@ include("head.inc");
$date = date(gettext("n/j/y H:i:s"), $version['time']);
else
$date = gettext("Unknown");
- $desc = $version['description'];
?>
<tr valign="top">
<td class="list">
@@ -184,7 +185,8 @@ include("head.inc");
$c++; ?>
</td>
<td class="listlr"> <?= $date ?></td>
- <td class="listr"> <?= $desc ?></td>
+ <td class="listr"> <?= $version['version'] ?></td>
+ <td class="listr"> <?= $version['description'] ?></td>
<td valign="middle" class="list" nowrap>
<a href="diag_confbak.php?newver=<?=$version['time'];?>" onclick="return confirm('<?=gettext("Revert to this configuration?");?>'")>
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="<?=gettext("Revert to this configuration");?>" title="<?=gettext("Revert to this configuration");?>">
OpenPOWER on IntegriCloud