From: Stefan Schantl Date: Wed, 14 Apr 2021 18:19:27 +0000 (+0200) Subject: ids.cgi: Use newly intruduced functions when removing a provider. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29f3ed292748fdd8a0b774bcdd618e2ff9dffc3e;p=people%2Fstevee%2Fipfire-2.x.git ids.cgi: Use newly intruduced functions when removing a provider. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index b85f9f0c34..899e15b661 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -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'}");