diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-12-07 03:28:15 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-12-07 03:28:15 +0000 |
commit | d6b4869af97281eb4bb0495716c61dbbda5467ae (patch) | |
tree | ae9c728ad647a583b272441c6cdb2a8a69633b10 /packages/autoconfigbackup | |
parent | ea608de3e71e1fcd86a311d387b25792e9e17227 (diff) | |
download | pfsense-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.php | 32 |
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(); |