mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
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:
@@ -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.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user