From: Stefan Schantl Date: Wed, 31 Mar 2021 11:41:28 +0000 (+0200) Subject: ids.cgi: Add action if a new provider is added. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=271ae29829afe893ebb2dc5f19fd51740e7d0e39;p=people%2Fstevee%2Fipfire-2.x.git ids.cgi: Add action if a new provider is added. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index c630297d95..043faad2ef 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -761,6 +761,28 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) { # Write the changed hash to the providers settings file. &General::writehasharray($IDS::providers_settings_file, \%used_providers); + # Check if a new provider will be added. + if ($cgiparams{'PROVIDERS'} eq $Lang::tr{'add'}) { + # Lock the webpage and print notice about downloading + # a new ruleset. + &working_notice("$Lang::tr{'ids working'}"); + + # Download the ruleset. + &IDS::downloadruleset($provider); + + # Extract the ruleset + &IDS::extractruleset($provider); + + # Move the ruleset. + &IDS::move_tmp_ruleset(); + + # Cleanup temporary directory. + &IDS::cleanup_tmp_directory(); + + # Perform a reload of the page. + &reload(); + } + # Undefine providers flag. undef($cgiparams{'PROVIDERS'}); }