aboutsummaryrefslogtreecommitdiffstats
path: root/packages/autoconfigbackup/autoconfigbackup.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-10-19 04:46:59 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-10-19 04:46:59 +0000
commit08c8db8a0320e400f751a026be98b774c613228c (patch)
tree22b5870d0917eb5c07cc9d70d1a407f9a0404358 /packages/autoconfigbackup/autoconfigbackup.php
parentd88652109dfa0f8079e590ab6f2442bd6801b265 (diff)
downloadpfsense-packages-08c8db8a0320e400f751a026be98b774c613228c.tar.gz
pfsense-packages-08c8db8a0320e400f751a026be98b774c613228c.tar.bz2
pfsense-packages-08c8db8a0320e400f751a026be98b774c613228c.zip
Add some lovely ajax
Diffstat (limited to 'packages/autoconfigbackup/autoconfigbackup.php')
-rw-r--r--packages/autoconfigbackup/autoconfigbackup.php27
1 files changed, 20 insertions, 7 deletions
diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php
index 488a144e..9086b2a1 100644
--- a/packages/autoconfigbackup/autoconfigbackup.php
+++ b/packages/autoconfigbackup/autoconfigbackup.php
@@ -68,8 +68,13 @@ if($_POST['backup']) {
$savemsg = "Backup completed successfully.";
exec("echo > /cf/conf/lastpfSbackup.txt");
filter_configure_sync();
+ print_info_box($savemsg);
+ $donotshowheader=true;
}
+if($_REQUEST['savemsg'])
+ $savemsg = htmlentities($_REQUEST['savemsg']);
+
if($_REQUEST['newver'] != "") {
// Phone home and obtain backups
$curl_session = curl_init();
@@ -151,12 +156,14 @@ foreach($data_split as $ds) {
}
$pgtitle = "Diagnostics: Auto Configuration Backup";
+
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<script type="text/javascript">
function backupnow() {
+ scroll(0,0);
var reason = prompt ("Enter the reason for the backup","");
var url = "/autoconfigbackup.php";
var pars = 'backup=yes&reason=' + reason;
@@ -167,24 +174,31 @@ include("head.inc");
parameters: pars,
onComplete: backupcomplete
});
+ $('savemsg').innerHTML = '';
+ $('feedbackdiv').innerHTML = "<img src='themes/metallic/images/misc/loader.gif'> One moment please, saving backup to portal.pfsense.org...<p/>";
}
function backupcomplete(transport) {
- $('feedbackdiv').innerHTML = '<p/>' + transport.responseText + '<p/>';
+ document.location.href = 'autoconfigbackup.php?savemsg=Backup+completed+successfully';
}
</script>
-
-<div id='feedbackdiv'></div>
+<div id='maincontent'>
<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script>
<?php
include("fbegin.inc");
if(strstr($pfSversion, "1.2"))
echo "<p class=\"pgtitle\">{$pgtitle}</p>";
- if($savemsg)
- print_info_box($savemsg);
+ if($savemsg) {
+ echo "<div id='savemsg'>";
+ print_info_box($savemsg);
+ echo "</div>";
+ }
if ($input_errors)
print_input_errors($input_errors);
+
?>
+
<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>
+<div id='feedbackdiv'></div>
<?php
$tab_array = array();
$tab_array[0] = array("Settings", false, "/pkg_edit.php?xml=autoconfigbackup.xml&amp;id=0");
@@ -194,8 +208,7 @@ include("head.inc");
</td></tr>
<tr>
<td>
- <div id="mainarea">
- <table class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
+ <table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="30%" class="listhdrr">Date</td>
<td width="70%" class="listhdrr">Configuration Change</td>