mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 03:33:25 +02:00
ids.cg: Regeneate ruleset if the ruleset action (mode) of a provider
get changed. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -642,6 +642,7 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) {
|
|||||||
my $subscription_code = $cgiparams{'SUBSCRIPTION_CODE'};
|
my $subscription_code = $cgiparams{'SUBSCRIPTION_CODE'};
|
||||||
my $status_autoupdate;
|
my $status_autoupdate;
|
||||||
my $mode;
|
my $mode;
|
||||||
|
my $regenerate_ruleset_required;
|
||||||
|
|
||||||
# Handle autoupdate checkbox.
|
# Handle autoupdate checkbox.
|
||||||
if ($cgiparams{'ENABLE_AUTOUPDATE'} eq "on") {
|
if ($cgiparams{'ENABLE_AUTOUPDATE'} eq "on") {
|
||||||
@@ -697,6 +698,15 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) {
|
|||||||
# Undef the given ID.
|
# Undef the given ID.
|
||||||
undef($cgiparams{'ID'});
|
undef($cgiparams{'ID'});
|
||||||
|
|
||||||
|
# Grab the configured mode.
|
||||||
|
my $stored_mode = $used_providers{$id}[4];
|
||||||
|
|
||||||
|
# Check if the ruleset action (mode) has been changed.
|
||||||
|
if ($stored_mode ne $mode) {
|
||||||
|
# It has been changed, so the ruleset needs to be regenerated.
|
||||||
|
$regenerate_ruleset_required = "1";
|
||||||
|
}
|
||||||
|
|
||||||
# Grab the configured status of the corresponding entry.
|
# Grab the configured status of the corresponding entry.
|
||||||
$status = $used_providers{$id}[3];
|
$status = $used_providers{$id}[3];
|
||||||
} else {
|
} else {
|
||||||
@@ -770,6 +780,14 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if the ruleset has to be regenerated.
|
||||||
|
if ($regenerate_ruleset_required) {
|
||||||
|
# Call oinkmaster web function.
|
||||||
|
&oinkmaster_web();
|
||||||
|
|
||||||
|
# Perform a reload of the page.
|
||||||
|
&reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Undefine providers flag.
|
# Undefine providers flag.
|
||||||
|
|||||||
Reference in New Issue
Block a user