diff --git a/src/www/diag_backup.php b/src/www/diag_backup.php index 39f94590d..e28d58f59 100644 --- a/src/www/diag_backup.php +++ b/src/www/diag_backup.php @@ -110,7 +110,7 @@ $do_reboot = false; if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig = array(); - + $pconfig['backupcount'] = isset($config['system']['backupcount']) ? $config['system']['backupcount'] : null; foreach ($backupFactory->listProviders() as $providerId => $provider) { foreach ($provider['handle']->getConfigurationFields() as $field) { $fieldId = $providerId . "_" .$field['name']; @@ -324,6 +324,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } system_cron_configure(); } + } elseif (!empty($pconfig['save'])) { + if ($pconfig['backupcount'] != null && (!is_numeric($pconfig['backupcount']) || $pconfig['backupcount'] <= 0)) { + $input_errors[] = gettext('Backup count must be greater than zero.'); + } + if (count($input_errors) == 0) { + if ($pconfig['backupcount'] != null) { + $config['system']['backupcount'] = $pconfig['backupcount']; + } elseif (isset($config['system']['backupcount'])) { + unset($config['system']['backupcount']); + } + write_config('Changed backup revision count'); + $savemsg = get_std_save_message(); + } } } @@ -374,6 +387,32 @@ $( document ).ready(function() { 0) print_input_errors($input_errors); ?>
+
+
+ +
+
+ + + + + + + + + + + + + +
+ +getBackups(true)) > 0): ?> + + +
+
+
diff --git a/src/www/diag_confbak.php b/src/www/diag_confbak.php index 49b20d5e5..a67f8d0ff 100644 --- a/src/www/diag_confbak.php +++ b/src/www/diag_confbak.php @@ -93,21 +93,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $input_errors = array(); $pconfig = $_POST; - if (!empty($pconfig['save'])) { - if ($pconfig['backupcount'] != null && (!is_numeric($pconfig['backupcount']) || $pconfig['backupcount'] <= 0)) { - $input_errors[] = gettext('Backup count must be greater than zero.'); - } - if (count($input_errors) == 0) { - if ($pconfig['backupcount'] != null) { - $config['system']['backupcount'] = $pconfig['backupcount']; - } elseif (isset($config['system']['backupcount'])) { - unset($config['system']['backupcount']); - } - write_config('Changed backup revision count'); - $savemsg = get_std_save_message(); - } - } - $cnf = OPNsense\Core\Config::getInstance(); $confvers = $cnf->getBackups(true); array_shift($confvers); @@ -206,41 +191,15 @@ include("fbegin.inc"); ?>
+ + + +
0) print_input_errors($input_errors); ?>
-
- - -
-
- - - - - - - - - - - - - -
- -
- - - - 0): ?> - - -
-
-