summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/system_advanced_misc.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2016-03-29 11:09:28 -0400
committerjim-p <jimp@pfsense.org>2016-03-29 11:10:02 -0400
commit5c948e5422e0b8d3ce8063e431727271a7dae8a1 (patch)
tree1665501da93903cf04ab9edeaa21e7db1954d786 /src/usr/local/www/system_advanced_misc.php
parent97f42a0590c0bad9bd233b84d6f3173f6bd38c11 (diff)
downloadpfsense-5c948e5422e0b8d3ce8063e431727271a7dae8a1.zip
pfsense-5c948e5422e0b8d3ce8063e431727271a7dae8a1.tar.gz
Fix logic for RRD and DHCP leases backup, and fix wording in the placeholder text. Fixes #6040
Diffstat (limited to 'src/usr/local/www/system_advanced_misc.php')
-rw-r--r--src/usr/local/www/system_advanced_misc.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php
index a40d67f..ddec186 100644
--- a/src/usr/local/www/system_advanced_misc.php
+++ b/src/usr/local/www/system_advanced_misc.php
@@ -273,11 +273,19 @@ if ($_POST) {
$config['system']['use_mfs_var_size'] = $_POST['use_mfs_var_size'];
if (isset($_POST['rrdbackup'])) {
- $config['system']['rrdbackup'] = $_POST['rrdbackup'];
+ if (($_POST['rrdbackup'] > 0) && ($_POST['rrdbackup'] <= 24)) {
+ $config['system']['rrdbackup'] = intval($_POST['rrdbackup']);
+ } else {
+ unset($config['system']['rrdbackup']);
+ }
install_cron_job("/etc/rc.backup_rrd.sh", ($config['system']['rrdbackup'] > 0), $minute="0", "*/{$config['system']['rrdbackup']}");
}
if (isset($_POST['dhcpbackup'])) {
- $config['system']['dhcpbackup'] = $_POST['dhcpbackup'];
+ if (($_POST['dhcpbackup'] > 0) && ($_POST['dhcpbackup'] <= 24)) {
+ $config['system']['dhcpbackup'] = intval($_POST['dhcpbackup']);
+ } else {
+ unset($config['system']['dhcpbackup']);
+ }
install_cron_job("/etc/rc.backup_dhcpleases.sh", ($config['system']['dhcpbackup'] > 0), $minute="0", "*/{$config['system']['dhcpbackup']}");
}
@@ -543,7 +551,7 @@ $section->addInput(new Form_Input(
'Periodic RRD Backup',
'number',
$config['system']['rrdbackup'],
- ['min' => 1, 'max' => 24, 'placeholder' => 'frequency between 1 and 24 hours']
+ ['min' => 0, 'max' => 24, 'placeholder' => 'Period between 1 and 24 hours']
))->setHelp('This will periodically backup the RRD data so '.
'it can be restored automatically on the next boot. Keep in mind that the more '.
'frequent the backup, the more writes will happen to the media.');
@@ -553,7 +561,7 @@ $section->addInput(new Form_Input(
'Periodic DHCP Leases Backup',
'number',
$config['system']['dhcpbackup'],
- ['min' => 1, 'max' => 24, 'placeholder' => 'frequency between 1 and 24 hours']
+ ['min' => 0, 'max' => 24, 'placeholder' => 'Period between 1 and 24 hours']
))->setHelp('This will periodically backup the DHCP leases so '.
'it can be restored automatically on the next boot. Keep in mind that the more '.
'frequent the backup, the more writes will happen to the media.');
OpenPOWER on IntegriCloud