diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 570906585df085ba9d7546697b33dac252526a7b..ea39ccfdd73889eeff8e50718848cab6d2591277 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
sub client_input {
no strict "refs";
- my ($heap,$input,$wheel) = @_[HEAP, ARG0, ARG1];
+ my ($kernel, $session, $heap,$input,$wheel) = @_[KERNEL, SESSION, HEAP, ARG0, ARG1];
+ my $session_id = $session->ID;
my ($msg, $msg_hash, $module);
my $error = 0;
my $answer_l;
# process incoming msg
if( $error == 0) {
daemon_log("Processing module ".$module, 5);
- $answer_l = &{ $module."::process_incoming_msg" }($msg, $msg_hash, $heap->{'remote_ip'});
+ $answer_l = &{ $module."::process_incoming_msg" }($msg, $msg_hash, $session_id);
if ( 0 > @{$answer_l} ) {
my $answer_str = join("\n", @{$answer_l});
}
}
elsif( $answer_target eq "GOSA" ) {
+ $answer =~ /<session_id>(\d+)<\/session_id>/;
+ my $session_id = $1;
+ my $add_on = "";
+
+ if( defined $session_id ) {
+ $add_on = ".session_id=$session_id";
+ }
+
# answer is for GOSA and has to returned to connected client
my $gosa_answer = &encrypt_msg($answer, $GosaPackages_key);
- $client_answer = $gosa_answer;
+ $client_answer = $gosa_answer.$add_on;
}
elsif( $answer_target eq "KNOWN_SERVER" ) {
# answer is for all server in known_server
}
if( $client_answer ) {
- $heap->{client}->put($client_answer);
+ if( $client_answer =~ s/session_id=(\d+)$// ) {
+ my $session_id = $1;
+ if( defined $session_id ) {
+ my $session_reference = $kernel->ID_id_to_session($session_id);
+ $heap = $session_reference->get_heap();
+ }
+ }
+ $heap->{client}->put($client_answer);
}
return;