]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ids.cgi: Add action if a new provider is added.
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 31 Mar 2021 11:41:28 +0000 (13:41 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Tue, 3 Aug 2021 17:25:48 +0000 (19:25 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ids.cgi

index c630297d9564b5871e0334210d729c4773468ec3..043faad2ef9e157a4538ad3014ef04d4dee3577d 100644 (file)
@@ -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'});
        }