diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-12-07 03:33:26 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-12-07 03:33:26 +0000 |
commit | 685354461ee6bf075be8b397d84a220cf9574c66 (patch) | |
tree | 428c79b601c16ea872f96e05bca5dcd69f255cae /packages/autoconfigbackup | |
parent | d6b4869af97281eb4bb0495716c61dbbda5467ae (diff) | |
download | pfsense-packages-685354461ee6bf075be8b397d84a220cf9574c66.tar.gz pfsense-packages-685354461ee6bf075be8b397d84a220cf9574c66.tar.bz2 pfsense-packages-685354461ee6bf075be8b397d84a220cf9574c66.zip |
* Add save message
* Rename each debugging file to follow its action
Diffstat (limited to 'packages/autoconfigbackup')
-rw-r--r-- | packages/autoconfigbackup/autoconfigbackup.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php index 43388bbe..db87e610 100644 --- a/packages/autoconfigbackup/autoconfigbackup.php +++ b/packages/autoconfigbackup/autoconfigbackup.php @@ -131,7 +131,7 @@ if($_REQUEST['newver'] != "") { $input_errors[] = "SHA256 does not match, cannot restore. ({$sha256}) - ({$ondisksha256})"; if (curl_errno($curl_session)) { /* If an error occured, log the error in /tmp/ */ - $fd = fopen("/tmp/backupdebug.txt", "w"); + $fd = fopen("/tmp/acb_restoredebug.txt", "w"); fwrite($fd, $get_url . "" . "action=restore&hostname={$hostname}&revision=" . urlencode($_REQUEST['newver']) . "\n\n"); fwrite($fd, $data); fwrite($fd, curl_error($curl_session)); @@ -169,8 +169,16 @@ if($_REQUEST['rmver'] != "") { "&revision=" . urlencode($_REQUEST['rmver'])); $data = curl_exec($curl_session); if (curl_errno($curl_session)) { + $fd = fopen("/tmp/acb_deletedebug.txt", "w"); + fwrite($fd, $get_url . "" . "action=delete&hostname=" . + urlencode($hostname) . "&revision=" . + urlencode($_REQUEST['rmver']) . "\n\n"); + fwrite($fd, $data); + fwrite($fd, curl_error($curl_session)); + fclose($fd); } else { curl_close($curl_session); + $savemsg = "Backup revision {$_REQUEST['rmver']} has been removed."; } } @@ -183,7 +191,7 @@ curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_session, CURLOPT_POSTFIELDS, "action=showbackups&hostname={$hostname}"); $data = curl_exec($curl_session); if (curl_errno($curl_session)) { - $fd = fopen("/tmp/backupdebug.txt", "w"); + $fd = fopen("/tmp/acb_backupdebug.txt", "w"); fwrite($fd, $get_url . "" . "action=showbackups" . "\n\n"); fwrite($fd, $data); fwrite($fd, curl_error($curl_session)); @@ -242,7 +250,7 @@ include("head.inc"); echo "<div id='savemsg'>"; print_info_box($savemsg); echo "</div>"; - } + } if ($input_errors) print_input_errors($input_errors); |