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 <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2021-04-14 20:18:01 +02:00
parent 1e52a25825
commit 697787c930

View File

@@ -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.
#