From 731bc6d44b9ddaa13ee248e5d49f69fb30c02668 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 8 Dec 2008 03:16:43 +0000 Subject: Force reason correctly --- packages/autoconfigbackup/autoconfigbackup.inc | 7 +++++-- packages/autoconfigbackup/autoconfigbackup_backup.php | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'packages/autoconfigbackup') diff --git a/packages/autoconfigbackup/autoconfigbackup.inc b/packages/autoconfigbackup/autoconfigbackup.inc index 45d0efbe..fd0d3169 100644 --- a/packages/autoconfigbackup/autoconfigbackup.inc +++ b/packages/autoconfigbackup/autoconfigbackup.inc @@ -88,7 +88,7 @@ function test_connection($post) { return; } -function upload_config() { +function upload_config($reasonm = "") { global $config, $g, $input_errors; /* @@ -118,7 +118,10 @@ function upload_config() { $last_backup_date = str_replace("\n", "", file_get_contents("/cf/conf/lastpfSbackup.txt")); $last_config_change = $config['revision']['time']; $hostname = $config['system']['hostname'] . "." . $config['system']['domain']; - $reason = $config['revision']['description']; + if($reasonm) + $reason = $reasonm; + else + $reason = $config['revision']['description']; $username = $config['installedpackages']['autoconfigbackup']['config'][0]['username']; $password = $config['installedpackages']['autoconfigbackup']['config'][0]['password']; $encryptpw = $config['installedpackages']['autoconfigbackup']['config'][0]['crypto_password']; diff --git a/packages/autoconfigbackup/autoconfigbackup_backup.php b/packages/autoconfigbackup/autoconfigbackup_backup.php index 9b083a24..cebd7a56 100644 --- a/packages/autoconfigbackup/autoconfigbackup_backup.php +++ b/packages/autoconfigbackup/autoconfigbackup_backup.php @@ -68,8 +68,9 @@ if($_POST) { write_config($_REQUEST['reason']); else write_config("Backup invoked via Auto Config Backup."); + $config = parse_config(true); exec("echo > /cf/conf/lastpfSbackup.txt"); - upload_config(); + upload_config($_REQUEST['reason']); $savemsg = "Backup completed successfully."; $donotshowheader=true; } -- cgit v1.2.3