From: Stefan Schantl Date: Fri, 19 Mar 2021 20:28:00 +0000 (+0100) Subject: ids.cgi: Make CGI work with new ruleset-sources file. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b32d514cf55f0786a757dd17470fde11f7a34c0a;p=people%2Fstevee%2Fipfire-2.x.git ids.cgi: Make CGI work with new ruleset-sources file. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 4e8b28fd84..04222d9f0f 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -31,6 +31,9 @@ require "${General::swroot}/header.pl"; require "${General::swroot}/ids-functions.pl"; require "${General::swroot}/network-functions.pl"; +# Import ruleset providers file. +require "$IDS::rulesetsourcesfile"; + my %color = (); my %mainsettings = (); my %idsrules = (); @@ -324,17 +327,11 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) { # Read-in current (old) IDS settings. &General::readhash("$IDS::rules_settings_file", \%oldsettings); - # Get all available ruleset locations. - &General::readhash("$IDS::rulesetsourcesfile", \%rulesetsources); - # Prevent form name from been stored in conf file. delete $cgiparams{'RULESET'}; - # Grab the URL based on the choosen vendor. - my $url = $rulesetsources{$cgiparams{'RULES'}}; - # Check if the choosen vendor (URL) requires an subscription/oinkcode. - if ($url =~ /\/ ) { + if ($IDS::Ruleset::Providers{$cgiparams{'RULES'}}{'requires_subscription'} eq "True") { # Check if an subscription/oinkcode has been provided. if ($cgiparams{'OINKCODE'}) { # Check if the oinkcode contains unallowed chars. @@ -689,10 +686,6 @@ $checked{'MONITOR_TRAFFIC_ONLY'}{'off'} = ''; $checked{'MONITOR_TRAFFIC_ONLY'}{'on'} = ''; $checked{'MONITOR_TRAFFIC_ONLY'}{$idssettings{'MONITOR_TRAFFIC_ONLY'}} = "checked='checked'"; $selected{'RULES'}{'nothing'} = ''; -$selected{'RULES'}{'community'} = ''; -$selected{'RULES'}{'emerging'} = ''; -$selected{'RULES'}{'registered'} = ''; -$selected{'RULES'}{'subscripted'} = ''; $selected{'RULES'}{$rulessettings{'RULES'}} = "selected='selected'"; $selected{'AUTOUPDATE_INTERVAL'}{'off'} = ''; $selected{'AUTOUPDATE_INTERVAL'}{'daily'} = ''; @@ -902,11 +895,30 @@ print <