From: rettenbe Date: Tue, 20 May 2008 08:36:19 +0000 (+0000) Subject: * gosa-si-server-nobus X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4954c04bf7137fb67ff6519075070acfdd093b3e;p=gosa.git * gosa-si-server-nobus * under construction git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10964 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server-nobus b/gosa-si/gosa-si-server-nobus index a9f612b32..012794178 100755 --- a/gosa-si/gosa-si-server-nobus +++ b/gosa-si/gosa-si-server-nobus @@ -614,7 +614,7 @@ sub input_from_known_server { else { $msg = $tmp_msg; $msg_hash = $tmp_msg_hash; - $module = "ClientPackages"; + $module = "ServerPackages"; last; } } @@ -914,7 +914,7 @@ sub send_msg_to_target { print $socket $crypted_msg."\n"; daemon_log("$session_id INFO: send ".$header."msg to $address", 5); - #daemon_log("DEBUG: message:\n$msg", 9); + daemon_log("DEBUG: message:\n$msg", 9); } diff --git a/gosa-si/server/events/server_server_com.pm b/gosa-si/server/events/server_server_com.pm index 2b130d8f7..7618c3908 100644 --- a/gosa-si/server/events/server_server_com.pm +++ b/gosa-si/server/events/server_server_com.pm @@ -3,6 +3,7 @@ use Exporter; @ISA = qw(Exporter); my @events = ( 'new_server', + 'confirm_new_server', ); @EXPORT = @events; @@ -55,10 +56,27 @@ sub new_server { # 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); + my %data = ( key=>$key ); + my $out_msg = &build_msg('confirm_new_server', $main::server_address, $source, \%data); + my $error = &main::send_msg_to_target($out_msg, $source, $main::Serverpackages_key, 'confirm_new_server', $session_id); +} + + +sub confirm_new_server { + my ($msg, $msg_hash, $session_id) = @_ ; + +print STDERR Dumper($msg_hash); + + my $header = @{$msg_hash->{'header'}}[0]; + my $source = @{$msg_hash->{'source'}}[0]; + my $key = @{$msg_hash->{'key'}}[0]; + + my $sql = "UPDATE $main::known_server_tn SET status='$header', hostkey='$key' WHERE hostname='$source'"; + my $res = $main::known_server_db->update_dbentry($sql); + + } 1;