From ea608de3e71e1fcd86a311d387b25792e9e17227 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 7 Dec 2008 03:26:27 +0000 Subject: Add delete option --- packages/autoconfigbackup/autoconfigbackup.php | 59 ++++++++++++++++++-------- 1 file changed, 42 insertions(+), 17 deletions(-) (limited to 'packages') diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php index 403bd6f6..f3966fa4 100644 --- a/packages/autoconfigbackup/autoconfigbackup.php +++ b/packages/autoconfigbackup/autoconfigbackup.php @@ -52,6 +52,9 @@ $password = $config['installedpackages']['autoconfigbackup']['config'][0]['pas // URL to restore.php $get_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigbackups/restore.php"; +// URL to delete.php +$del_url = "https://{$username}:{$password}@portal.pfsense.org/pfSconfigbackups/delete.php"; + // Set hostname $hostname = $config['system']['hostname'] . "." . $config['system']['domain']; @@ -174,7 +177,19 @@ if (curl_errno($curl_session)) { } if($_REQUEST['rmver'] != "") { - // XXX: delete revision, or all backups from server. + $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 @@ -245,26 +260,36 @@ include("head.inc"); - - - - + + + + + + + - - - - - + + + + +
DateConfiguration Change
+
+ +
+
DateConfiguration Change
- - - - - - -
+ + + + + + + + + +