summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7c6cc17)
raw | patch | inline | side by side (parent: 7c6cc17)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 08:09:31 +0000 (08:09 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 08:09:31 +0000 (08:09 +0000) |
* under construction
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11096 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11096 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server-nobus | patch | blob | history | |
gosa-si/modules/GosaPackages.pm | patch | blob | history | |
gosa-si/modules/ServerPackages.pm | patch | blob | history |
index dc94baabaec451e47b986fb34da861bcda814fcb..e87b7dbc198465bad787ab200068b5d0ac4a7acc 100755 (executable)
if( $error == 0) {
daemon_log("$session_id INFO: Incoming msg (session_id=$session_id) with header '".@{$msg_hash->{'header'}}[0]."'", 5);
daemon_log("$session_id DEBUG: Processing module ".$module, 7);
-
- known_modules
- }
-
- if ($error == 0) {
$answer_l = &{ $module."::process_incoming_msg" }($msg, $msg_hash, $session_id);
if ( 0 < @{$answer_l} ) {
index 8f0e76eea8c69a40a39b3d8fb2bd932bc528a94b..2986f3b292be6007cf0b7ab3b3b66a95cf18b05c 100644 (file)
@out_msg_l = ();
} elsif ($out_msg_l[0] eq 'knownclienterror') {
&main::daemon_log("$session_id ERROR: no or more than 1 hits are found at known_clients_db with sql query: '$sql_events'", 1);
- &main::daemon_log("$session_id WARNING: processing is aborted and message will not be forwarded");
+ &main::daemon_log("$session_id WARNING: processing is aborted and message will not be forwarded", 3);
@out_msg_l = ();
} elsif ($out_msg_l[0] eq 'noeventerror') {
- &main::daemon_log("$session_id WARNING: client '$target' is not registered for event '$header', processing is aborted", 1);
+ &main::daemon_log("$session_id WARNING: client '$target' is not registered for event '$header', processing is aborted", 3);
@out_msg_l = ();
}
index 8e64273455bd42db862ec0c3152ba0a807dd6769..25adebdc91589524866a31e442a6c9e1c62b3912 100644 (file)
my ($msg, $msg_hash, $session_id) = @_ ;
my $header = @{$msg_hash->{header}}[0];
my $source = @{$msg_hash->{source}}[0];
- my @target_l = @{$msg_hash->{target}};
+ my $target = @{$msg_hash->{target}}[0];
my @msg_l;
my @out_msg_l;
&main::daemon_log("$session_id INFO: found event '$header' at event-module '".$event_hash->{$header}."'", 5);
no strict 'refs';
@out_msg_l = &{$event_hash->{$header}."::$header"}($msg, $msg_hash, $session_id);
+
} else {
- &main::daemon_Log("$session_id ERROR: ServerPackages: no event handler defined for '$header'", 1);
- @out_msg_l = ();
+ $sql_events = "SELECT * FROM $main::known_clients_tn WHERE ( (macaddress LIKE '$target') OR (hostname='$target') )";
+ my $res = $main::known_clients_db->select_dbentry( $sql_events );
+ my $l = keys(%$res);
+
+ # set error if no or more than 1 hits are found for sql query
+ if ( $l != 1) {
+ @out_msg_l = ('knownclienterror');
+
+ # found exact 1 hit in db
+ } else {
+ my $client_events = $res->{'1'}->{'events'};
+
+ # client is registered for this event, deliver this message to client
+ if ($client_events =~ /,$header,/) {
+ $msg =~ s/<header>gosa_/<header>/;
+ @out_msg_l = ( $msg );
+
+ # client is not registered for this event, set error
+ } else {
+ @out_msg_l = ('noeventerror');
+ }
+ }
}
+ # if delivery not possible raise error and return
+ if (not defined $out_msg_l[0]) {
+ @out_msg_l = ();
+ } elsif ($out_msg_l[0] eq 'nohandler') {
+ &main::daemon_log("$session_id ERROR: ServerPackages: no event handler defined for '$header'", 1);
+ @out_msg_l = ();
+ } elsif ($out_msg_l[0] eq 'knownclienterror') {
+ &main::daemon_log("$session_id ERROR: no or more than 1 hits are found at known_clients_db with sql query: '$sql_events'", 1);
+ &main::daemon_log("$session_id WARNING: processing is aborted and message will not be forwarded", 3);
+ @out_msg_l = ();
+ } elsif ($out_msg_l[0] eq 'noeventerror') {
+ &main::daemon_log("$session_id WARNING: client '$target' is not registered for event '$header', processing is aborted", 3);
+ @out_msg_l = ();
+ }
+
return @out_msg_l;
}