summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e10d906)
raw | patch | inline | side by side (parent: e10d906)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 2 Sep 2008 09:31:04 +0000 (09:31 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 2 Sep 2008 09:31:04 +0000 (09:31 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12341 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/server/events/server_server_com.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 7cf1e482d307108fe919e1603d5e4ce2a022f256..7b7a61d22c3c8b05a08acb67b96b4ed77cdaab9a 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
&add_content2xml_hash($myhash, 'key', $hostkey);
map(&add_content2xml_hash($myhash, 'client', @{$_}[0].",".@{$_}[4]), @$client_res);
+ # add locally loaded gosa-si modules to registration message
my $loaded_modules = {};
while (my ($package, $pck_info) = each %$known_modules) {
foreach my $act_module (keys(%{@$pck_info[2]})) {
hostname=>$foreign_server,
status=>'not_jet_registered',
hostkey=>"none",
+ loaded_modules => "",
timestamp=>$act_timestamp,
} );
}
diff --git a/gosa-si/server/events/server_server_com.pm b/gosa-si/server/events/server_server_com.pm
index b393da3a3cc2714cedcc9f07ece900dcec9df8d5..b14c900297c53b41424629629dff4279ddf7cb01 100644 (file)
my $key = @{$msg_hash->{'key'}}[0];
my @clients = exists $msg_hash->{'client'} ? @{$msg_hash->{'client'}} : qw();
my @loaded_modules = exists $msg_hash->{'loaded_modules'} ? @{$msg_hash->{'loaded_modules'}} : qw();
-
+
# 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'],
&add_content2xml_hash($myhash, 'key', $key);
map(&add_content2xml_hash($myhash, 'client', @{$_}[0].",".@{$_}[4]), @$client_res);
+ # add locally loaded gosa-si modules to registration message
+ my $loaded_modules = {};
+ while (my ($package, $pck_info) = each %$main::known_modules) {
+ foreach my $act_module (keys(%{@$pck_info[2]})) {
+ $loaded_modules->{$act_module} = "";
+ }
+ }
+ map(&add_content2xml_hash($myhash, "loaded_modules", $_), keys(%$loaded_modules));
+
# build registration message and send it
my $out_msg = &create_xml_string($myhash);
my $error = &main::send_msg_to_target($out_msg, $source, $main::ServerPackages_key, 'confirm_new_server', $session_id);
my $source = @{$msg_hash->{'source'}}[0];
my $key = @{$msg_hash->{'key'}}[0];
my @clients = exists $msg_hash->{'client'} ? @{$msg_hash->{'client'}} : qw();
+ my @loaded_modules = exists $msg_hash->{'loaded_modules'} ? @{$msg_hash->{'loaded_modules'}} : qw();
- my $sql = "UPDATE $main::known_server_tn SET status='$header', hostkey='$key' WHERE hostname='$source'";
+ my $sql = "UPDATE $main::known_server_tn SET status='$header', hostkey='$key', loaded_modules='".join(",",@loaded_modules)."' WHERE hostname='$source'";
my $res = $main::known_server_db->update_dbentry($sql);
# add clients of foreign server to known_foreign_clients_db