aboutsummaryrefslogtreecommitdiffstats
path: root/packages/autoconfigbackup
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-12-07 03:28:15 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-12-07 03:28:15 +0000
commitd6b4869af97281eb4bb0495716c61dbbda5467ae (patch)
treeae9c728ad647a583b272441c6cdb2a8a69633b10 /packages/autoconfigbackup
parentea608de3e71e1fcd86a311d387b25792e9e17227 (diff)
downloadpfsense-packages-d6b4869af97281eb4bb0495716c61dbbda5467ae.tar.gz
pfsense-packages-d6b4869af97281eb4bb0495716c61dbbda5467ae.tar.bz2
pfsense-packages-d6b4869af97281eb4bb0495716c61dbbda5467ae.zip
Remove backup before asking server for backup revisions
Diffstat (limited to 'packages/autoconfigbackup')
-rw-r--r--packages/autoconfigbackup/autoconfigbackup.php32
1 files changed, 16 insertions, 16 deletions
diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php
index f3966fa4..43388bbe 100644
--- a/packages/autoconfigbackup/autoconfigbackup.php
+++ b/packages/autoconfigbackup/autoconfigbackup.php
@@ -158,6 +158,22 @@ EOF;
//unlink("/tmp/config_restore.xml");
}
+if($_REQUEST['rmver'] != "") {
+ $curl_session = curl_init();
+ curl_setopt($curl_session, CURLOPT_URL, $del_url);
+ curl_setopt($curl_session, CURLOPT_POST, 3);
+ curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($curl_session, CURLOPT_POSTFIELDS, "action=delete" .
+ "&hostname=" . urlencode($hostname) .
+ "&revision=" . urlencode($_REQUEST['rmver']));
+ $data = curl_exec($curl_session);
+ if (curl_errno($curl_session)) {
+ } else {
+ curl_close($curl_session);
+ }
+}
+
// Populate available backups
$curl_session = curl_init();
curl_setopt($curl_session, CURLOPT_URL, $get_url);
@@ -176,22 +192,6 @@ if (curl_errno($curl_session)) {
curl_close($curl_session);
}
-if($_REQUEST['rmver'] != "") {
- $curl_session = curl_init();
- curl_setopt($curl_session, CURLOPT_URL, $del_url);
- curl_setopt($curl_session, CURLOPT_POST, 3);
- curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl_session, CURLOPT_POSTFIELDS, "action=delete" .
- "&hostname=" . urlencode($hostname) .
- "&revision=" . urlencode($_REQUEST['rmver']));
- $data = curl_exec($curl_session);
- if (curl_errno($curl_session)) {
- } else {
- curl_close($curl_session);
- }
-}
-
// Loop through and create new confvers
$data_split = split("\n", $data);
$confvers = array();