diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-10-19 04:09:40 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-10-19 04:09:40 +0000 |
commit | 0d928e82682221809c6306c3be432a323ed93ab7 (patch) | |
tree | 484b0ef7565eadaf0d298e31ea0b2e6e8181f4a3 /packages/autoconfigbackup | |
parent | c7c5bffbf9cb75297ae26187c5a4d6beb0156253 (diff) | |
download | pfsense-packages-0d928e82682221809c6306c3be432a323ed93ab7.tar.gz pfsense-packages-0d928e82682221809c6306c3be432a323ed93ab7.tar.bz2 pfsense-packages-0d928e82682221809c6306c3be432a323ed93ab7.zip |
* Include autoconfigbackup.inc
* Start Ajaxifying backup now command with reason
Diffstat (limited to 'packages/autoconfigbackup')
-rw-r--r-- | packages/autoconfigbackup/autoconfigbackup.php | 28 | ||||
-rw-r--r-- | packages/autoconfigbackup/parse_config_upload.php | 5 | ||||
-rw-r--r-- | packages/autoconfigbackup/upload_config_filter.php | 5 |
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(); +} ?> |