summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-05-16 00:35:42 +0000
committerBill Marquette <billm@pfsense.org>2005-05-16 00:35:42 +0000
commit32f11c0559c2c6f5c16789203fedd54750e21a04 (patch)
tree64533afe93521b545dcbd7215a612ddc0539f803 /usr/local
parent734edbdf0490506a041a7e9470d4c99566028b5d (diff)
downloadpfsense-32f11c0559c2c6f5c16789203fedd54750e21a04.zip
pfsense-32f11c0559c2c6f5c16789203fedd54750e21a04.tar.gz
Make config backup actually work
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/diag_confbak.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr/local/www/diag_confbak.php b/usr/local/www/diag_confbak.php
index 8b0ab69..3c7eccc 100755
--- a/usr/local/www/diag_confbak.php
+++ b/usr/local/www/diag_confbak.php
@@ -55,7 +55,7 @@ include("fbegin.inc");
<td class="tabcont">
<?php
if(file_exists("/conf/backup/backup.cache")) {
- $confvers = array_reverse(file("/conf/backup/backup.cache"));
+ $confvers = unserialize(file_get_contents("/cf/conf/backup/backup.cache"));
array_unshift($confvers, $confvers[0]);
} else {
print_info_box("No backups found.");
@@ -71,7 +71,6 @@ if(is_array($confvers)) { ?>
$curconfigs = array();
$i = 0;
foreach($confvers as $version) {
- $version = trim($version);
$changes = array();
if($version == $config['revision']['time'] and $i == 0) {
$i++;
@@ -79,9 +78,9 @@ if(is_array($confvers)) { ?>
$changes['time'] = $version;
$changes['date'] = "Current";
} else { // Use backup.cache to find the next usable backup.
- if(file_exists("/conf/backup/config-{$version}.xml")) {
- $curconfigs[] = file_get_contents("/conf/backup/config-{$version}.xml");
- $curconfig = parse_xml_config("/conf/backup/config-{$version}.xml", $g['xml_rootobj']);
+ if(file_exists("/conf/backup/config-{$version['time']}.xml")) {
+ $curconfigs[] = file_get_contents("/conf/backup/config-{$version['time']}.xml");
+ $curconfig = parse_xml_config("/conf/backup/config-{$version['time']}.xml", $g['xml_rootobj']);
if(file_exists("/conf/backup/config-{$curconfig['revision']['time']}.xml")) {
$changes['time'] = $curconfig['revision']['time'];
$changes['date'] = date("n/j H:i:s", $changes['time']);
OpenPOWER on IntegriCloud