summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb33980)
raw | patch | inline | side by side (parent: fb33980)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 20 May 2008 07:01:18 +0000 (07:01 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 20 May 2008 07:01:18 +0000 (07:01 +0000) |
* under construction
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10961 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10961 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/server/events/server_server_com.pm | patch | blob | history |
diff --git a/gosa-si/server/events/server_server_com.pm b/gosa-si/server/events/server_server_com.pm
index 2df9c7c2e02cb6a672064078410830994d8fd9dd..2b130d8f73569c1bd08fafd42b19a91ed15a4d0e 100644 (file)
sub new_server {
-print STDERR "hier kommt die logik von new_server\n";
+ my ($msg, $msg_hash, $session_id) = @_ ;
+ my $header = @{$msg_hash->{'header'}}[0];
+ my $source = @{$msg_hash->{'source'}}[0];
+ my $target = @{$msg_hash->{'target'}}[0];
+ my $key = @{$msg_hash->{'key'}}[0];
+ my $clients = @{$msg_hash->{'clients'}}[0];
+
+ # sanity check
+ if (ref $key eq 'HASH') {
+ &main::daemon_log("$session_id ERROR: 'new_server'-message from host '$source' contains no key!", 1);
+ #return;
+ }
+
+ # add foreign server to known_server_db
+ my $func_dic = {table=>$main::known_server_tn,
+ primkey=>['hostname'],
+ hostname => $source,
+ hostkey => $key,
+ timestamp=>&get_time(),
+ };
+ my $res = $main::known_server_db->add_dbentry($func_dic);
+ if (not $res == 0) {
+ &main::daemon_log("$session_id ERROR: server_server_com.pm: cannot add server to known_server_db: $res", 1);
+ } else {
+ &main::daemon_log("$session_id INFO: server_server_com.pm: server '$source' successfully added to known_server_db", 5);
+ }
+
+ # add clients of foreign server to known_foreign_clients_db
+
+
+ # build confirm_new_server message
+ my $out_msg = &build_msg('confirm_new_server', $main::server_address, $source);
+ my $error = &main::send_msg_to_target($out_msg, $source, $key, 'confirm_new_server', 0);
+
+
}
1;