From: Stefan Schantl Date: Wed, 14 Apr 2021 18:18:01 +0000 (+0200) Subject: ids.cgi: Introduce get_provider_handle(). X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=697787c9309c5bfee0067d7486f0b095e968dc73;p=people%2Fstevee%2Fipfire-2.x.git ids.cgi: Introduce get_provider_handle(). This function is used to get the configured provider handle by a a given ID. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index b793ecd2f5..582b9aa681 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -2021,6 +2021,24 @@ sub get_memory_usage($) { return; } +# +## Function to get the provider handle by a given ID. +# +sub get_provider_handle($) { + my ($id) = @_; + + my %used_providers = (); + + # Read-in provider settings file. + &General::readhasharray($IDS::providers_settings_file, \%used_providers); + + # Obtain the provider handle for the given ID. + my $provider_handle = $used_providers{$cgiparams{'ID'}}[0]; + + # Return the handle. + return $provider_handle; +} + # ## Function to get the provider name from the language file or providers file for a given handle. #