mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
ids.cgi: Introduce remove_provider().
This function is used to remove a configured provider by it's ID. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -2062,6 +2062,24 @@ sub get_provider_name($) {
|
||||
return $provider_name;
|
||||
}
|
||||
|
||||
#
|
||||
## Function to remove a provider by a given ID.
|
||||
#
|
||||
sub remove_provider($) {
|
||||
my ($id) = @_;
|
||||
|
||||
my %used_providers = ();
|
||||
|
||||
# Read-in provider settings file.
|
||||
&General::readhasharray($IDS::providers_settings_file, \%used_providers);
|
||||
|
||||
# Drop entry from the hash.
|
||||
delete($used_providers{$id});
|
||||
|
||||
# Write the changed hash to the provider settings file.
|
||||
&General::writehasharray($IDS::providers_settings_file, \%used_providers);
|
||||
}
|
||||
|
||||
#
|
||||
## Private function to convert a given rulefile to a category name.
|
||||
## ( No file extension anymore and if the name contained a dot, it
|
||||
|
||||
Reference in New Issue
Block a user