From c26e3c422c42a4e8e446fd2a87b52534d1bcf05f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 27 Sep 2006 02:00:58 +0000 Subject: Do not allow the download process to even start by removing the start button if no oink id is defined. --- packages/snort/snort_download_rules.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'packages') diff --git a/packages/snort/snort_download_rules.php b/packages/snort/snort_download_rules.php index bca57b7e..d726d650 100644 --- a/packages/snort/snort_download_rules.php +++ b/packages/snort/snort_download_rules.php @@ -35,6 +35,10 @@ require_once("service-utils.inc"); $pgtitle = "Services: Snort: Update Rules"; +/* define oinkid */ +if($config['installedpackages']['snort']) + $oinkid = $config['installedpackages']['snort']['config'][0]['oinkmastercode']; + include("head.inc"); ?> @@ -81,14 +85,18 @@ include("head.inc"); else echo "You last updated the ruleset:NEVER"; echo ""; - /* get time stamps for comparison operations */ - $date1ts = strtotime($last_ruleset_download); - $date2ts = strtotime($last_ruleset_download); - /* is there a newer ruleset available? */ - if($date1ts > $date2ts or !$last_ruleset_download) - echo "Press here to start download."; - else - echo "Your snort rulesets are up to date."; + if(!$oinkid) { + echo "You must obtain an oinkid from snort.com and set its value in the Snort settings tab in order to start the download process."; + } else { + /* get time stamps for comparison operations */ + $date1ts = strtotime($last_ruleset_download); + $date2ts = strtotime($last_ruleset_download); + /* is there a newer ruleset available? */ + if($date1ts > $date2ts or !$last_ruleset_download) + echo "Press here to start download."; + else + echo "Your snort rulesets are up to date."; + } echo ""; echo " "; echo " "; @@ -133,10 +141,6 @@ include("head.inc");