From 5f37e60179b9960be8245a2236e4e271230a577e Mon Sep 17 00:00:00 2001 From: rettenbe Date: Fri, 23 May 2008 12:37:21 +0000 Subject: [PATCH] * gosa-si-server-nobus * under construction git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10990 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/server/events/server_server_com.pm | 33 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/gosa-si/server/events/server_server_com.pm b/gosa-si/server/events/server_server_com.pm index e417150e1..25cf2b66d 100644 --- a/gosa-si/server/events/server_server_com.pm +++ b/gosa-si/server/events/server_server_com.pm @@ -4,6 +4,7 @@ use Exporter; my @events = ( 'new_server', 'confirm_new_server', + 'new_foreign_client', ); @EXPORT = @events; @@ -101,10 +102,36 @@ sub new_foreign_client { my ($msg, $msg_hash, $session_id) = @_ ; my $header = @{$msg_hash->{'header'}}[0]; my $source = @{$msg_hash->{'source'}}[0]; - my $new_client = @{$msg_hash->{'client'}}[0]; + my $hostname = @{$msg_hash->{'client'}}[0]; + my $macaddress = @{$msg_hash->{'macaddress'}}[0]; + + my $func_dic = { table => $main::foreign_clients_tn, + primkey => ['hostname'], + hostname => $hostname, + macaddress => $macaddress, + regserver => $source, + timestamp => &get_time(), + }; + + + my $res = $main::foreign_clients_db->add_dbentry($func_dic); + if (not $res == 0) { + &main::daemon_log("$session_id ERROR: server_server_com.pm: cannot add server to foreign_clients_db: $res", 1); + } else { + &main::daemon_log("$session_id INFO: server_server_com.pm: client '$hostname' successfully added to foreign_clients_db", 5); + } + + +# +# 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); +# - my $func_dic = (); - return; } -- 2.30.2