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); ?>