aboutsummaryrefslogtreecommitdiffstats
path: root/packages/autoconfigbackup
diff options
context:
space:
mode:
Diffstat (limited to 'packages/autoconfigbackup')
-rw-r--r--packages/autoconfigbackup/autoconfigbackup.php28
-rw-r--r--packages/autoconfigbackup/parse_config_upload.php5
-rw-r--r--packages/autoconfigbackup/upload_config_filter.php5
3 files changed, 34 insertions, 4 deletions
diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php
index fc12785e..0fda3aae 100644
--- a/packages/autoconfigbackup/autoconfigbackup.php
+++ b/packages/autoconfigbackup/autoconfigbackup.php
@@ -61,7 +61,10 @@ if(!$username) {
}
if($_POST['backup']) {
- write_config("Backup invoked via Auto Config Backup.");
+ if($_REQUEST['reason'])
+ write_config($_REQUEST['reason']);
+ else
+ write_config("Backup invoked via Auto Config Backup.");
$savemsg = "Backup completed successfully.";
exec("echo > /cf/conf/lastpfSbackup.txt");
filter_configure_sync();
@@ -152,6 +155,27 @@ include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<script type="text/javascript">
+ function backupnow() {
+ var reason = prompt ("Enter the reason for the backup","");
+ var url = "/autoconfigbackup.php";
+ var pars = 'backup=yes&reason=' + reason;
+ var myAjax = new Ajax.Request(
+ url,
+ {
+ method: 'post',
+ parameters: pars,
+ onComplete: backupcomplete
+ });
+ event.preventDefault();
+ }
+ function backupcomplete(transport) {
+ $('feedbackdiv').innerHTML = '<p/>' + transport.responseText + '<p/>';
+ }
+</script>
+
+<div id='feedbackdiv'></div>
+<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script>
<?php
include("fbegin.inc");
if(strstr($pfSversion, "1.2"))
@@ -210,7 +234,7 @@ include("head.inc");
</td></tr>
<tr><td>
<form method="post" action="autoconfigbackup.php">
- <input type="submit" name="backup" value="Backup Now">
+ <input type="button" onClick='backupnow()' name="backup" value="Backup Now">
</form>
</td></tr>
</tr>
diff --git a/packages/autoconfigbackup/parse_config_upload.php b/packages/autoconfigbackup/parse_config_upload.php
index d5e6082a..ce592966 100644
--- a/packages/autoconfigbackup/parse_config_upload.php
+++ b/packages/autoconfigbackup/parse_config_upload.php
@@ -1,5 +1,8 @@
<?php
-upload_config();
+if(file_exists("/usr/local/pkg/autoconfigbackup.inc")) {
+ require_once("/usr/local/pkg/autoconfigbackup.inc");
+ upload_config();
+}
?>
diff --git a/packages/autoconfigbackup/upload_config_filter.php b/packages/autoconfigbackup/upload_config_filter.php
index d5e6082a..ce592966 100644
--- a/packages/autoconfigbackup/upload_config_filter.php
+++ b/packages/autoconfigbackup/upload_config_filter.php
@@ -1,5 +1,8 @@
<?php
-upload_config();
+if(file_exists("/usr/local/pkg/autoconfigbackup.inc")) {
+ require_once("/usr/local/pkg/autoconfigbackup.inc");
+ upload_config();
+}
?>