From 8d66475e0a9fc0c37a47d7a2d5a7522e56ed692f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 7 Dec 2008 04:20:03 +0000 Subject: * Move backup functions to its own tab backup now * Add nooverwrite support for hostname --- packages/autoconfigbackup/autoconfigbackup.inc | 8 ++ packages/autoconfigbackup/autoconfigbackup.php | 32 +---- packages/autoconfigbackup/autoconfigbackup.xml | 9 ++ .../autoconfigbackup/autoconfigbackup_backup.php | 144 +++++++++++++++++++++ 4 files changed, 162 insertions(+), 31 deletions(-) create mode 100644 packages/autoconfigbackup/autoconfigbackup_backup.php diff --git a/packages/autoconfigbackup/autoconfigbackup.inc b/packages/autoconfigbackup/autoconfigbackup.inc index 818f154a..45d0efbe 100644 --- a/packages/autoconfigbackup/autoconfigbackup.inc +++ b/packages/autoconfigbackup/autoconfigbackup.inc @@ -100,6 +100,13 @@ function upload_config() { * (C) 2008 BSD Perimeter LLC * */ + + if(file_exists("/tmp/acb_nooverwrite")) { + unlink("/tmp/acb_nooverwrite"); + $nooverwrite = "true"; + } else { + $nooverwrite = "false"; + } // Define some needed variables if(!file_exists("/cf/conf/lastpfSbackup.txt")) { @@ -152,6 +159,7 @@ function upload_config() { 'reason' => urlencode($reason), 'hostname' => urlencode($hostname), 'configxml' => urlencode($data), + 'nooverwrite' => urlencode($nooverwrite), 'raw_config_sha256_hash' => urlencode($raw_config_sha256_hash) ); diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php index 12d1406e..54cd246c 100644 --- a/packages/autoconfigbackup/autoconfigbackup.php +++ b/packages/autoconfigbackup/autoconfigbackup.php @@ -194,27 +194,6 @@ include("head.inc"); ?> -
@@ -279,9 +259,6 @@ include("head.inc"); exit; } ?> -
- -
@@ -329,13 +306,6 @@ include("head.inc");

- - -
- -
- - diff --git a/packages/autoconfigbackup/autoconfigbackup.xml b/packages/autoconfigbackup/autoconfigbackup.xml index 4cda9ee7..c0514506 100644 --- a/packages/autoconfigbackup/autoconfigbackup.xml +++ b/packages/autoconfigbackup/autoconfigbackup.xml @@ -73,6 +73,11 @@ 0755 http://www.pfsense.com/packages/config/autoconfigbackup/crypt_acb.php + + /usr/local/www/ + 0755 + http://www.pfsense.com/packages/config/autoconfigbackup/autoconfigbackup_backup.php + Settings @@ -83,6 +88,10 @@ Restore /autoconfigbackup.php + + Backup now + /autoconfigbackup_backup.php + diff --git a/packages/autoconfigbackup/autoconfigbackup_backup.php b/packages/autoconfigbackup/autoconfigbackup_backup.php new file mode 100644 index 00000000..e4763d57 --- /dev/null +++ b/packages/autoconfigbackup/autoconfigbackup_backup.php @@ -0,0 +1,144 @@ + /cf/conf/lastpfSbackup.txt"); + filter_configure_sync(); + print_info_box($savemsg); + $donotshowheader=true; +} + +$pgtitle = "Diagnostics: Auto Configuration Backup Now"; + +include("head.inc"); + +?> + +
+{$pgtitle}

"; + if($savemsg) { + echo "
"; + print_info_box($savemsg); + echo "
"; + } + if ($input_errors) + print_input_errors($input_errors); + +?> +
+ + + + +
+
+ +
+ + + + +
+ + + + + + + + + + + + +
+ Enter the backup reason: + + +
+ Do not overwrite previous backups for this hostname: + + +
+ +
+
+ +
+
+ + + -- cgit v1.2.3