diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-10-20 21:47:46 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-10-20 21:47:46 +0000 |
commit | 93fd7f563b910fc211a6f6167fc968a90d1fa13b (patch) | |
tree | 6996757ba9f910018fe926f477041628af02b231 | |
parent | 49bb55df85ac1c4aaa7d034877a1a34b6080720f (diff) | |
download | pfsense-packages-93fd7f563b910fc211a6f6167fc968a90d1fa13b.tar.gz pfsense-packages-93fd7f563b910fc211a6f6167fc968a90d1fa13b.tar.bz2 pfsense-packages-93fd7f563b910fc211a6f6167fc968a90d1fa13b.zip |
Add download config option which outputs the encrypted configuration.
-rw-r--r-- | packages/autoconfigbackup/autoconfigbackup.php | 23 |
1 files changed, 23 insertions, 0 deletions
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"); <a href="autoconfigbackup.php?newver=<?=urlencode($cv['time']);?>"> <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"> </a> + <a href="autoconfigbackup.php?download=<?=urlencode($cv['time']);?>"> + <img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"> + </a> </td> </tr> <?php |