]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ids.cgi: Allow to configure report summary feature
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 11 Aug 2025 17:38:13 +0000 (19:38 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 11 Aug 2025 17:38:13 +0000 (19:38 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ids.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index 362cbec87414e55daf5ab6e5b79b3a1a2340a211..fc3e583682b9dc5998fffac564efbf0b4e0c3bad 100644 (file)
@@ -575,7 +575,8 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) {
        }
 
        # Check if the e-mail feature should be used.
-       if ($cgiparams{'ENABLE_EMAIL'} eq "on") {
+       if (($cgiparams{'ENABLE_EMAIL'} eq "on") || ($cgiparams{'ENABLE_REPORT_DAILY'} eq "on") ||
+           ($cgiparams{'ENABLE_REPORT_WEEKLY'} eq "on") || ($cgiparams{'ENABLE_REPORT_MONTLY'} eq "on")) {
                # Check if a sender mail address has been provided.
                unless($cgiparams{'EMAIL_SENDER'}) {
                        $errormessage = $Lang::tr{'ids no email sender'};
@@ -1036,6 +1037,16 @@ sub show_mainpage() {
        $checked{'ENABLE_EMAIL'}{'on'} = '';
        $checked{'ENABLE_EMAIL'}{$idssettings{'ENABLE_EMAIL'}} = "checked='checked'";
 
+       $checked{'ENABLE_REPORT_DAILY'}{'off'} = '';
+       $checked{'ENABLE_REPORT_DAILY'}{'on'} = '';
+       $checked{'ENABLE_REPORT_DAILY'}{$idssettings{'ENABLE_REPORT_DAILY'}} = "checked='checked'";
+       $checked{'ENABLE_REPORT_WEEKLY'}{'off'} = '';
+       $checked{'ENABLE_REPORT_WEEKLY'}{'on'} = '';
+       $checked{'ENABLE_REPORT_WEEKLY'}{$idssettings{'ENABLE_REPORT_WEEKLY'}} = "checked='checked'";
+       $checked{'ENABLE_REPORT_MONTHLY'}{'off'} = '';
+       $checked{'ENABLE_REPORT_MONTHLY'}{'on'} = '';
+       $checked{'ENABLE_REPORT_MONTHLY'}{$idssettings{'ENABLE_REPORT_MONTHLY'}} = "checked='checked'";
+
        # Draw current state of the IDS
        &Header::opensection();
 
@@ -1133,7 +1144,7 @@ print <<END
                                        </td>
 
                                        <td>
-                                               <input type="text" name="EMAIL_SENDER" value="$idssettings{'EMAIL_SENDER'}">
+                                               <input type="text" name="EMAIL_SENDER" value="$email_sender">
                                        <td>
                                </tr>
 
@@ -1143,7 +1154,50 @@ print <<END
                                        </td>
 
                                        <td>
-                                               <input type="text" name="EMAIL_RECIPIENTS" value="$idssettings{'EMAIL_RECIPIENTS'}">
+                                               <input type="text" name="EMAIL_RECIPIENTS" value="$email_recipients">
+                                       </td>
+                               </tr>
+
+                       </table>
+
+                       <h6>
+                               $Lang::tr{'ids summary reports'}
+                       </h6>
+
+                       <table class="form">
+                               <tr>
+                                       <td>
+                                               <label for="ENABLE_REPORT_DAILY">
+                                                       $Lang::tr{'ids reports daily'}
+                                               </label>
+                                       </td>
+
+                                       <td>
+                                               <input type='checkbox' name='ENABLE_REPORT_DAILY' id="ENABLE_REPORT_DAILY" $checked{'ENABLE_REPORT_DAILY'}{'on'}>
+                                       </td>
+                               </tr>
+
+                               <tr>
+                                       <td>
+                                               <label for="ENABLE_REPORT_WEEKLY">
+                                                       $Lang::tr{'ids reports weekly'}
+                                               </label>
+                                       </td>
+
+                                       <td>
+                                               <input type='checkbox' name='ENABLE_REPORT_WEEKLY' id="ENABLE_REPORT_WEEKLY" $checked{'ENABLE_REPORT_WEEKLY'}{'on'}>
+                                       </td>
+                               </tr>
+
+                               <tr>
+                                       <td>
+                                               <label for="ENABLE_REPORT_MONTHLY">
+                                                       $Lang::tr{'ids reports monthly'}
+                                               </label>
+                                       </td>
+
+                                       <td>
+                                               <input type='checkbox' name='ENABLE_REPORT_MONTHLY' id="ENABLE_REPORT_MONTHLY" $checked{'ENABLE_REPORT_MONTHLY'}{'on'}>
                                        </td>
                                </tr>
 
index 9e064a407851a1fef0b46639fdad9701a0e8253d..7fff5164c6f6a35a89c2dc3bb1c5fe1aac69fe5e 100644 (file)
 'ids provider' => 'Regelset-Anbieter',
 'ids provider settings' => 'Regelset-Anbieter-Einstellungen',
 'ids remove rule structures' => 'Entferne alte Regelstrukturen...',
+'ids reports daily' => 'Täglicher Report',
+'ids reports weekly' => 'Wöchentlicher Report',
+'ids reports monthly' => 'Monatlicher Report',
 'ids reset provider' => 'Providereinstellungen zurücksetzen',
 'ids rules update' => 'Regelsatz',
 'ids ruleset autoupdate in progress' => 'Der Regelsatz wird gerade aktualisiert. Bitte warten Sie, bis dieser Vorgang erfolgreich beendet wurde...',
 'ids ruleset settings' => 'Regelsatzeinstellungen',
 'ids rulesets' => 'Regelsätze',
 'ids show' => 'Anzeigen',
+'ids summary reports' => 'Zusammenfassender Report',
 'ids the choosen provider is already in use' => 'Der gewhählte Provider wird bereits verwendet.',
 'ids unable to download the ruleset' => 'Das Regelset konnte nicht heruntergeladen werden.',
 'ids unsupported provider' => 'Provider wird nicht mehr unterstützt',
index cbb964b482df914b3066b70494324e38f7d00381..77ab74d3661388538fe022b0ae0db24e4c7e8529 100644 (file)
 'ids provider eol' => '(EOL)',
 'ids provider settings' => 'Provider settings',
 'ids remove rule structures' => 'Remove old rule structures...',
+'ids reports daily' => 'Daily reports',
+'ids reports weekly' => 'Weekly reports',
+'ids reports monthly' => 'Monthly reports',
 'ids reset provider' => 'Reset provider',
 'ids rules update' => 'Ruleset',
 'ids ruleset autoupdate in progress' => 'Ruleset update in progress. Please wait until all operations have completed successfully...',
 'ids rulesets' => 'Rulesets',
 'ids show' => 'Show',
 'ids subscription code required' => 'The selected ruleset requires a subscription code',
+'ids summary reports' => 'Summary reports',
 'ids the choosen provider is already in use' => 'The choosen provider is already in use.',
 'ids unable to download the ruleset' => 'Unable to download the ruleset',
 'ids unsupported provider' => 'Provider is not supported anymore',