diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-10-08 21:21:59 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-10-08 21:21:59 +0000 |
commit | 78e50e3dc90f4afb46d98690a479cf35de7e941a (patch) | |
tree | 4deb5f9103131649cb13ebffe0d7f9183452a7b2 | |
parent | cf384b6d75583fcf418f340a9ea002f3b8ca780d (diff) | |
download | pfsense-packages-78e50e3dc90f4afb46d98690a479cf35de7e941a.tar.gz pfsense-packages-78e50e3dc90f4afb46d98690a479cf35de7e941a.tar.bz2 pfsense-packages-78e50e3dc90f4afb46d98690a479cf35de7e941a.zip |
Cleanup success check
-rw-r--r-- | packages/autoconfigbackup/autoconfigbackup.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php index aadd0bcf..64d60d5b 100644 --- a/packages/autoconfigbackup/autoconfigbackup.php +++ b/packages/autoconfigbackup/autoconfigbackup.php @@ -63,11 +63,13 @@ if(!$username) { if($_REQUEST['newver'] != "") { // Phone home and obtain backups $curl_session = curl_init(); - curl_setopt($curl_session, CURLOPT_URL, $get_url . "?action=restore" . - "&hostname=" . urlencode($hostname) . - "&revision=" . urlencode($_REQUEST['newver'])); + 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['newver'])); $data = curl_exec($curl_session); if (!tagfile_deformat($data, $data, "config.xml")) $input_errors[] = "The downloaded file does not appear to contain an encrypted pfSense configuration."; @@ -84,10 +86,12 @@ if($_REQUEST['newver'] != "") { } else { curl_close($curl_session); } - if(!$input_errors && $data && config_restore("/tmp/config_restore.xml") == 0) { - $savemsg = "Successfully reverted the pfSense configuration to timestamp " . date("n/j/y H:i:s", $_REQUEST['newver']) . "."; - } else { - $savemsg = "Unable to revert to the selected configuration."; + if(!$input_errors && $data) { + if(config_restore("/tmp/config_restore.xml") == 0) { + $savemsg = "Successfully reverted the pfSense configuration to timestamp " . date("n/j/y H:i:s", $_REQUEST['newver']) . "."; + } else { + $savemsg = "Unable to revert to the selected configuration."; + } } unlink("/tmp/config_restore.xml"); } |