diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-12-07 06:08:08 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-12-07 06:08:08 +0000 |
commit | 030ba241683a66a08772300b63f45d7f21d3514c (patch) | |
tree | f627d123d9a78c8c1a9716b4136ee39a6e605600 /packages/autoconfigbackup/autoconfigbackup.php | |
parent | 06898368dfab968eef180203a99f7e60834f3caf (diff) | |
download | pfsense-packages-030ba241683a66a08772300b63f45d7f21d3514c.tar.gz pfsense-packages-030ba241683a66a08772300b63f45d7f21d3514c.tar.bz2 pfsense-packages-030ba241683a66a08772300b63f45d7f21d3514c.zip |
load items from portal.pfsense.org after displaying the loading indicator
Diffstat (limited to 'packages/autoconfigbackup/autoconfigbackup.php')
-rw-r--r-- | packages/autoconfigbackup/autoconfigbackup.php | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php index 3415a8b8..e87557a9 100644 --- a/packages/autoconfigbackup/autoconfigbackup.php +++ b/packages/autoconfigbackup/autoconfigbackup.php @@ -157,37 +157,6 @@ if($_REQUEST['rmver'] != "") { } } -// Populate available backups -$curl_session = curl_init(); -curl_setopt($curl_session, CURLOPT_URL, $get_url); -curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0); -curl_setopt($curl_session, CURLOPT_POST, 1); -curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1); -curl_setopt($curl_session, CURLOPT_POSTFIELDS, "action=showbackups&hostname={$hostname}"); -$data = curl_exec($curl_session); -if (curl_errno($curl_session)) { - $fd = fopen("/tmp/acb_backupdebug.txt", "w"); - fwrite($fd, $get_url . "" . "action=showbackups" . "\n\n"); - fwrite($fd, $data); - fwrite($fd, curl_error($curl_session)); - fclose($fd); -} else { - curl_close($curl_session); -} - -// Loop through and create new confvers -$data_split = split("\n", $data); -$confvers = array(); -foreach($data_split as $ds) { - $ds_split = split($oper_sep, $ds); - $tmp_array = array(); - $tmp_array['username'] = $ds_split[0]; - $tmp_array['reason'] = $ds_split[1]; - $tmp_array['time'] = $ds_split[2]; - if($ds_split[2] && $ds_split[0]) - $confvers[] = $tmp_array; -} - if($_REQUEST['download']) $pgtitle = "Diagnostics: Auto Configuration Backup revision information"; else @@ -283,6 +252,37 @@ include("head.inc"); require("fend.inc"); exit; } + + // Populate available backups + $curl_session = curl_init(); + curl_setopt($curl_session, CURLOPT_URL, $get_url); + curl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($curl_session, CURLOPT_POST, 1); + curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl_session, CURLOPT_POSTFIELDS, "action=showbackups&hostname={$hostname}"); + $data = curl_exec($curl_session); + if (curl_errno($curl_session)) { + $fd = fopen("/tmp/acb_backupdebug.txt", "w"); + fwrite($fd, $get_url . "" . "action=showbackups" . "\n\n"); + fwrite($fd, $data); + fwrite($fd, curl_error($curl_session)); + fclose($fd); + } else { + curl_close($curl_session); + } + + // Loop through and create new confvers + $data_split = split("\n", $data); + $confvers = array(); + foreach($data_split as $ds) { + $ds_split = split($oper_sep, $ds); + $tmp_array = array(); + $tmp_array['username'] = $ds_split[0]; + $tmp_array['reason'] = $ds_split[1]; + $tmp_array['time'] = $ds_split[2]; + if($ds_split[2] && $ds_split[0]) + $confvers[] = $tmp_array; + } ?> </td> </tr> |