summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 645f88d)
raw | patch | inline | side by side (parent: 645f88d)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 09:10:03 +0000 (09:10 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 09:10:03 +0000 (09:10 +0000) |
* under construction
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11099 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11099 594d385d-05f5-0310-b6e9-bd551577e9d8
index 1e7717f12a0a2b5526fdb3fd95d60c37f5cb1362..d14230fe2e089c770aa3bedb9832019c16124821 100644 (file)
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;
}
index e87b7dbc198465bad787ab200068b5d0ac4a7acc..e167e88f4d59afb75eb2ee6c7f16d15422f9ef4e 100755 (executable)
$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<\/target>/<target>$hostname<\/target>/;
print STDERR "target is a client address in known_clients -> process here\n";
}
}
$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/<source>GOSA<\/source>/<source>$server_address<\/source>/;
+ $msg =~ s/<target>$target<\/target>/<target>$hostname<\/target>/;
&send_msg_to_target($msg, $regserver, $regserver_key, $header, $session_id);
}
$done = 1;
index 25adebdc91589524866a31e442a6c9e1c62b3912..820ccc2586f790b0791625465c630a745b53d1e2 100644 (file)
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;
@out_msg_l = ();
}
- return @out_msg_l;
+ return \@out_msg_l;
}
1;
index 135bb44a1a25d8f2863f6003ebcee4d9bb798364..4f30784e9c6ba1193517022413c23cb5fe0adb52 100755 (executable)
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
#$data = "<xml> <header>gosa_krb5_create_principal</header> <target>00:01:6c:9d:aa:16</target> <principal>horst@WIRECARD.SYS</principal><source>GOSA</source><max_life>666</max_life></xml>";
#$data = "<xml> <header>gosa_krb5_modify_principal</header> <target>00:01:6c:9d:b9:fa</target> <principal>horst@WIRECARD.SYS</principal><source>GOSA</source><max_life>666</max_life></xml>";
- #$data = "<xml> <header>new_ping</header> <target>10.89.1.131:20083</target> <source>GOSA</source> <forward_to_gosa></forward_to_gosa> </xml>";
- $data = "<xml> <header>new_ping</header> <target>00:0c:29:02:e5:4d</target> <source>GOSA</source> </xml>";
+ $data = "<xml> <header>gosa_new_ping</header> <target>10.89.1.31:20083</target> <source>GOSA</source> <forward_to_gosa></forward_to_gosa> </xml>";
+ #$data = "<xml> <header>new_ping</header> <target>00:0c:29:02:e5:4d</target> <source>GOSA</source> </xml>";
$sock->write($data);
$answer = "nothing";