From: rettenbe Date: Tue, 2 Sep 2008 09:15:30 +0000 (+0000) Subject: bugfix: ServerPackages adjusted to changed event_hash X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e10d90638cd487187d4b46d12fb879cd4ebfe2a4;p=gosa.git bugfix: ServerPackages adjusted to changed event_hash git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12340 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/ServerPackages.pm b/gosa-si/modules/ServerPackages.pm index 7a1357dc7..9d6591840 100644 --- a/gosa-si/modules/ServerPackages.pm +++ b/gosa-si/modules/ServerPackages.pm @@ -29,6 +29,15 @@ foreach my $log_line (@$result) { } } +# build vice versa event_hash, event_name => module +my $event2module_hash = {}; +while (my ($module, $mod_events) = each %$event_hash) { + while (my ($event_name, $nothing) = each %$mod_events) { + $event2module_hash->{$event_name} = $module; + } + +} + ### FUNCTIONS ##################################################################### sub get_module_info { @@ -56,11 +65,11 @@ sub process_incoming_msg { &main::daemon_log("$session_id DEBUG: ServerPackages: msg to process '$header'", 7); - if( exists $event_hash->{$header} ) { + if( exists $event2module_hash->{$header} ) { # a event exists with the header as name - &main::daemon_log("$session_id INFO: found event '$header' at event-module '".$event_hash->{$header}."'", 5); + &main::daemon_log("$session_id INFO: found event '$header' at event-module '".$event2module_hash->{$header}."'", 5); no strict 'refs'; - @out_msg_l = &{$event_hash->{$header}."::$header"}($msg, $msg_hash, $session_id); + @out_msg_l = &{$event2module_hash->{$header}."::$header"}($msg, $msg_hash, $session_id); } else { $sql_events = "SELECT * FROM $main::known_clients_tn WHERE ( (macaddress LIKE '$target') OR (hostname='$target') )"; @@ -108,4 +117,5 @@ sub process_incoming_msg { return \@out_msg_l; } + 1;