summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77a3437)
raw | patch | inline | side by side (parent: 77a3437)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 13:11:54 +0000 (13:11 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 29 May 2008 13:11:54 +0000 (13:11 +0000) |
* under construction
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11107 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11107 594d385d-05f5-0310-b6e9-bd551577e9d8
index d14230fe2e089c770aa3bedb9832019c16124821..b9c32d0ae220e4613b00f83d93c14f58c5abf1f1 100644 (file)
my $header = @{$msg_hash->{'header'}}[0];
my $source = @{$msg_hash->{'source'}}[0];
my $target = @{$msg_hash->{'target'}}[0];
+ my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
my $session_id = @{$msg_hash->{'session_id'}}[0];
my $out_msg;
my $out_hash;
&add_content2xml_hash($out_hash, "session_id", $session_id);
}
+ if (defined $forward_to_gosa) {
+ &add_content2xml_hash($out_hash, "forward_to_gosa", $forward_to_gosa);
+ }
$out_msg = &main::create_xml_string($out_hash);
return $out_msg;
index e167e88f4d59afb75eb2ee6c7f16d15422f9ef4e..f46e82691f27025cd738fb97eed54a746194e0d0 100755 (executable)
my $header;
my $target;
+ my $source;
my $done = 0;
my $sql;
my $res;
if ($error == 0) {
$header = @{$msg_hash->{'header'}}[0];
$target = @{$msg_hash->{'target'}}[0];
+ $source = @{$msg_hash->{'source'}}[0];
+
# target is own address without forward_to_gosa-tag -> process here
if (not $done) {
# target is own address with forward_to_gosa-tag -> forward to gosa
if (not $done) {
- if (($target eq $server_address) && (exists $msg_hash->{'forward_to_gosa'})){
- if( $msg =~ s/session_id=(\d+)$// ) {
- my $session_id = $1 ;
- }
- if( defined $session_id ) {
- my $session_reference = $kernel->ID_id_to_session($session_id);
+ my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
+ if (($target eq $server_address) && (defined $forward_to_gosa)){
+ #if( $msg =~ s/session_id=(\d+)$// ) {
+ # my $session_id = $1 ;
+ #}
+ #if( defined $session_id ) {
+ my $session_reference = $kernel->ID_id_to_session($forward_to_gosa);
if( defined $session_reference ) {
$heap = $session_reference->get_heap();
}
- }
+ #}
if(exists $heap->{'client'}) {
$msg = &encrypt_msg($msg, $GosaPackages_key);
$heap->{'client'}->put($msg);
my $regserver_key = $res->{1}->{'hostkey'};
$msg =~ s/<source>GOSA<\/source>/<source>$server_address<\/source>/;
$msg =~ s/<target>$target<\/target>/<target>$hostname<\/target>/;
+ if ($source eq "GOSA") {
+ $msg =~ s/<\/xml>/<forward_to_gosa>$session_id<\/forward_to_gosa><\/xml>/;
+ }
&send_msg_to_target($msg, $regserver, $regserver_key, $header, $session_id);
}
$done = 1;
index 7ce04da8678258e27b2826f53a3f8e3d3c491d48..45492912e654135ce7ef8d7a060220bf5bc10bf7 100644 (file)
my @msg_l;
my @out_msg_l = ( 'nohandler' );
+
+ # if message is being forwarded from another server, strip of header prefixes
+ $header =~ s/^gosa_|job_//;
+ $msg =~ s/<header>gosa_(\w+)<\/header>|<header>job_(\w+)<\/header>/<header>$1<\/header>/;
+
+
&main::daemon_log("$session_id DEBUG: ServerPackages: msg to process '$header'", 7);
if( exists $event_hash->{$header} ) {
# a event exists with the header as name
index 4f30784e9c6ba1193517022413c23cb5fe0adb52..2be71dd8a91248863a06afc19cf085dda8cf8f0b 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>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>";
+ #$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>gosa_new_ping</header> <target>00:0c:29:02:e5:4d</target> <source>GOSA</source> </xml>";
$sock->write($data);
$answer = "nothing";