From d6b4869af97281eb4bb0495716c61dbbda5467ae Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 7 Dec 2008 03:28:15 +0000 Subject: Remove backup before asking server for backup revisions --- packages/autoconfigbackup/autoconfigbackup.php | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'packages') 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(); -- cgit v1.2.3