]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/ids.cgi
ids.cgi: Handle "Not modified" when forcing an ruleset update.
[ipfire-2.x.git] / html / cgi-bin / ids.cgi
index 1d4c3928c1b9393ce8e0a1854d0ffe345502ba39..a16d4fa0dbe15bf44a009c991360dc4a9c8a3bfc 100644 (file)
@@ -436,8 +436,16 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) {
                &working_notice("$Lang::tr{'ids download new ruleset'}");
 
                # Call subfunction to download the ruleset.
-               if(&IDS::downloadruleset($provider)) {
-                       $errormessage = "$provider - $Lang::tr{'could not download latest updates'}";
+               my $return = &IDS::downloadruleset($provider);
+
+               # Check if the download function gives a return code.
+               if ($return) {
+                       # Handle different return codes.
+                       if ($return eq "not modified") {
+                               $errormessage = "$provider - $Lang::tr{'ids ruleset is up to date'}";
+                       } else {
+                               $errormessage = "$provider - $Lang::tr{'could not download latest updates'}: $return";
+                       }
 
                        # Call function to store the errormessage.
                        &IDS::_store_error_message($errormessage);