]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
ids.cgi: Use newly intruduced functions when removing a provider.
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 14 Apr 2021 18:19:27 +0000 (20:19 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 19 Dec 2021 12:23:45 +0000 (13:23 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ids.cgi

index b3a7d9f5225ad9a36d5f09700443a5b673f98c79..e72820204087e6ca5a60dd1b04a3ecea3c43cea4 100644 (file)
@@ -937,23 +937,18 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'ids apply'}) {
 ## Remove provider from the list of used providers.
 #
 } elsif ($cgiparams{'PROVIDERS'} eq $Lang::tr{'remove'}) {
-       my %used_providers = ();
+       # Assign a nice human-readable variable.
+       my $id = $cgiparams{'ID'};
 
-       # Read-in provider settings file.
-       &General::readhasharray($IDS::providers_settings_file, \%used_providers);
+       # Grab the provider name bevore deleting.
+       my $provider = &get_provider_handle($id);
 
-       # Grab the provider name bevore deleting it from hash.
-       my $provider = $used_providers{$cgiparams{'ID'}}[0];
-
-       # Drop entry from the hash.
-       delete($used_providers{$cgiparams{'ID'}});
+       # Remove the provider.
+       &remove_provider($id);
 
        # Undef the given ID.
        undef($cgiparams{'ID'});
 
-       # Write the changed hash to the provide settings file.
-       &General::writehasharray($IDS::providers_settings_file, \%used_providers);
-
        # Lock the webpage and print message.
        &working_notice("$Lang::tr{'ids apply ruleset changes'}");