From 93fd7f563b910fc211a6f6167fc968a90d1fa13b Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 20 Oct 2008 21:47:46 +0000 Subject: Add download config option which outputs the encrypted configuration. --- packages/autoconfigbackup/autoconfigbackup.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'packages') diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php index e1ab6d71..c8dfb0c3 100644 --- a/packages/autoconfigbackup/autoconfigbackup.php +++ b/packages/autoconfigbackup/autoconfigbackup.php @@ -75,6 +75,26 @@ if($_POST['backup']) { if($_REQUEST['savemsg']) $savemsg = htmlentities($_REQUEST['savemsg']); +if($_REQUEST['download']) { + // Phone home and obtain backups + $curl_session = curl_init(); + curl_setopt($curl_session, CURLOPT_URL, $get_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=restore" . + "&hostname=" . urlencode($hostname) . + "&revision=" . urlencode($_REQUEST['download'])); + $data = curl_exec($curl_session); + if (!tagfile_deformat($data, $data1, "config.xml")) + $input_errors[] = "The downloaded file does not appear to contain an encrypted pfSense configuration."; + if ($input_errors) + print_input_errors($input_errors); + else + echo $data; + exit; +} + if($_REQUEST['newver'] != "") { // Phone home and obtain backups $curl_session = curl_init(); @@ -224,6 +244,9 @@ include("head.inc"); + + +