From 583cb6990f353c496b29d128dee0b2b5da40b137 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Thu, 9 Oct 2014 15:43:30 -0400 Subject: Do not lose custom update time when disabling rule auto-updates. --- config/snort/snort_interfaces_global.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort_interfaces_global.php b/config/snort/snort_interfaces_global.php index 26b08fc1..fb36d192 100644 --- a/config/snort/snort_interfaces_global.php +++ b/config/snort/snort_interfaces_global.php @@ -124,12 +124,15 @@ if (!$input_errors) { $config['installedpackages']['snortglobal']['autorulesupdate7'] = $_POST['autorulesupdate7']; /* Check and adjust format of Rule Update Starttime string to add colon and leading zero if necessary */ - $pos = strpos($_POST['rule_update_starttime'], ":"); - if ($pos === false) { - $tmp = str_pad($_POST['rule_update_starttime'], 4, "0", STR_PAD_LEFT); - $_POST['rule_update_starttime'] = substr($tmp, 0, 2) . ":" . substr($tmp, -2); + if ($_POST['rule_update_starttime']) { + $pos = strpos($_POST['rule_update_starttime'], ":"); + if ($pos === false) { + $tmp = str_pad($_POST['rule_update_starttime'], 4, "0", STR_PAD_LEFT); + $_POST['rule_update_starttime'] = substr($tmp, 0, 2) . ":" . substr($tmp, -2); + } + $config['installedpackages']['snortglobal']['rule_update_starttime'] = str_pad($_POST['rule_update_starttime'], 4, "0", STR_PAD_LEFT); } - $config['installedpackages']['snortglobal']['rule_update_starttime'] = str_pad($_POST['rule_update_starttime'], 4, "0", STR_PAD_LEFT); + $config['installedpackages']['snortglobal']['forcekeepsettings'] = $_POST['forcekeepsettings'] ? 'on' : 'off'; $retval = 0; @@ -311,7 +314,7 @@ if ($input_errors) " . gettext("Default") . " " . gettext("is ") . "" . gettext("00:05") . ""; ?>.

+ "start time of 00:05 and choosing 12 Hours for the interval, the rules will update at 00:05 and 12:05 each day."); ?> -- cgit v1.2.3