From: rettenbe Date: Thu, 29 May 2008 09:10:03 +0000 (+0000) Subject: * gosa-si-server-nobus X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9c9b72b7ab72098c803e9965380476eb1bd57de0;p=gosa.git * gosa-si-server-nobus * under construction git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11099 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/client/events/corefunctions.pm b/gosa-si/client/events/corefunctions.pm index 1e7717f12..d14230fe2 100644 --- a/gosa-si/client/events/corefunctions.pm +++ b/gosa-si/client/events/corefunctions.pm @@ -498,12 +498,21 @@ sub new_ping { my $source = @{$msg_hash->{'source'}}[0]; my $target = @{$msg_hash->{'target'}}[0]; my $session_id = @{$msg_hash->{'session_id'}}[0]; + my $out_msg; + my $out_hash; + + # there is no session_id so send 'got_new_ping'-msg + if (not defined $session_id) { + $out_hash = &main::create_xml_hash("got_new_ping", $target, $source); + + # there is a session_id so send 'answer_$session_id'-msg because there is + # a process waiting for this message + } else { + $out_hash = &main::create_xml_hash("answer_$session_id", $target, $source); + &add_content2xml_hash($out_hash, "session_id", $session_id); + } - - # switch target and source and send msg back - my $out_hash = &main::create_xml_hash("answer_$session_id", $target, $source); - &add_content2xml_hash($out_hash, "session_id", $session_id); - my $out_msg = &main::create_xml_string($out_hash); + $out_msg = &main::create_xml_string($out_hash); return $out_msg; } diff --git a/gosa-si/gosa-si-server-nobus b/gosa-si/gosa-si-server-nobus index e87b7dbc1..e167e88f4 100755 --- a/gosa-si/gosa-si-server-nobus +++ b/gosa-si/gosa-si-server-nobus @@ -1077,7 +1077,9 @@ sub msg_to_decrypt { $sql = "SELECT * FROM $known_clients_tn WHERE (hostname='$target' OR macaddress LIKE '$target')"; $res = $known_clients_db->select_dbentry($sql); if (keys(%$res) > 0) { - $done = 1; + $done = 1; + my $hostname = $res->{1}->{'hostname'}; + $msg =~ s/$target<\/target>/$hostname<\/target>/; print STDERR "target is a client address in known_clients -> process here\n"; } } @@ -1123,12 +1125,14 @@ sub msg_to_decrypt { $sql = "SELECT * FROM $foreign_clients_tn WHERE (hostname='$target' OR macaddress LIKE '$target')"; $res = $foreign_clients_db->select_dbentry($sql); if (keys(%$res) > 0) { + my $hostname = $res->{1}->{'hostname'}; my $regserver = $res->{1}->{'regserver'}; my $sql = "SELECT * FROM $known_server_tn WHERE hostname='$regserver'"; my $res = $known_server_db->select_dbentry($sql); if (keys(%$res) > 0) { my $regserver_key = $res->{1}->{'hostkey'}; $msg =~ s/GOSA<\/source>/$server_address<\/source>/; + $msg =~ s/$target<\/target>/$hostname<\/target>/; &send_msg_to_target($msg, $regserver, $regserver_key, $header, $session_id); } $done = 1; diff --git a/gosa-si/modules/ServerPackages.pm b/gosa-si/modules/ServerPackages.pm index 25adebdc9..820ccc258 100644 --- a/gosa-si/modules/ServerPackages.pm +++ b/gosa-si/modules/ServerPackages.pm @@ -52,6 +52,7 @@ sub process_incoming_msg { my $header = @{$msg_hash->{header}}[0]; my $source = @{$msg_hash->{source}}[0]; my $target = @{$msg_hash->{target}}[0]; + my $sql_events; my @msg_l; my @out_msg_l; @@ -103,7 +104,7 @@ sub process_incoming_msg { @out_msg_l = (); } - return @out_msg_l; + return \@out_msg_l; } 1; diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 135bb44a1..4f30784e9 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -105,8 +105,8 @@ for($count = 1; $count <= $zahl; $count++) #$data = "
gosa_krb5_create_principal
00:01:6c:9d:aa:16 horst@WIRECARD.SYSGOSA666
"; #$data = "
gosa_krb5_modify_principal
00:01:6c:9d:b9:fa horst@WIRECARD.SYSGOSA666
"; - #$data = "
new_ping
10.89.1.131:20083 GOSA
"; - $data = "
new_ping
00:0c:29:02:e5:4d GOSA
"; + $data = "
gosa_new_ping
10.89.1.31:20083 GOSA
"; + #$data = "
new_ping
00:0c:29:02:e5:4d GOSA
"; $sock->write($data); $answer = "nothing";