summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 20cd6ad)
raw | patch | inline | side by side (parent: 20cd6ad)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 4 Sep 2008 09:01:46 +0000 (09:01 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 4 Sep 2008 09:01:46 +0000 (09:01 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12361 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/tests/client.php | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 0155f08b889ba7213d95e2a686689430f611ff3d..e2ca1c36d8d6a3095c271b594a65c2c8248ee83d 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
my $not_found_in_known_server_db = 0;
my $not_found_in_foreign_clients_db = 0;
my $local_address;
+ my $local_mac;
my ($target_ip, $target_port) = split(':', $target);
+
+ # Determine the local ip address if target is an ip address
if ($target =~ /^\d+\.\d+\.\d+\.\d+:\d+$/) {
$local_address = &get_local_ip_for_remote_ip($target_ip).":$server_port";
} else {
$local_address = $server_address;
}
+
+ # Determine the local mac address if target is a mac address
+ if ($target =~ /^([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})$/i) {
+ my $loc_ip = &get_local_ip_for_remote_ip($heap->{'remote_ip'});
+ my $network_interface= &get_interface_for_ip($loc_ip);
+ $local_mac = &get_mac_for_interface($network_interface);
+ } else {
+ $local_mac = $server_mac_address;
+ }
# target and source is equal to GOSA -> process here
if (not $done) {
# target is own address without forward_to_gosa-tag -> process here
if (not $done) {
- if (($target eq $local_address) && (not exists $msg_hash->{'forward_to_gosa'})) {
+ if ((($target eq $local_address) || ($target eq $local_mac) ) && (not exists $msg_hash->{'forward_to_gosa'})) {
$done = 1;
if ($source eq "GOSA") {
$msg =~ s/<\/xml>/<forward_to_gosa>$local_address,$session_id<\/forward_to_gosa><\/xml>/;
my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
my $gosa_at;
my $gosa_session_id;
- if (($target eq $local_address) && (defined $forward_to_gosa)){
+ if ((($target eq $local_address) || ($target eq $local_mac) ) && (defined $forward_to_gosa)){
my ($gosa_at, $gosa_session_id) = split(/,/, $forward_to_gosa);
if ($gosa_at ne $local_address) {
$done = 1;
my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
my $gosa_at;
my $gosa_session_id;
- if (($target eq $local_address) && (defined $forward_to_gosa)){
+ if ((($target eq $local_address) || ($target eq $local_mac) ) && (defined $forward_to_gosa)){
my ($gosa_at, $gosa_session_id) = split(/,/, $forward_to_gosa);
if ($gosa_at eq $local_address) {
my $session_reference = $kernel->ID_id_to_session($gosa_session_id);
# target is a server address -> forward to server
if (not $done) {
- $sql = "SELECT * FROM $known_server_tn WHERE hostname='$target'";
+ $sql = "SELECT * FROM $known_server_tn WHERE (hostname='$target' OR macaddress LIKE '$target')";
$res = $known_server_db->select_dbentry($sql);
if (keys(%$res) > 0) {
my $hostkey = $res->{1}->{'hostkey'};
&send_msg_to_target($msg, $target, $hostkey, $header, $session_id);
$done = 1;
- #print STDERR "target is a server address -> forward to server\n";
} else {
$not_found_in_known_server_db = 1;
}
index 67e038f14478d5a451da728c67ca5988bc804ef0..71d64c2eb4eedcbf95733f9f330db469c0fc9b8a 100755 (executable)
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
#$data = "<xml> <header>gosa_get_client_for_login_usr</header> <target>GOSA</target> <source>GOSA</source> <usr>rettenbe</usr></xml>";
# List all si-server providing opsi
- #$data = "<xml> <header>gosa_get_hosts_with_module</header> <source>GOSA</source> <target>10.89.1.31:20081</target> <module_name>opsi_com</module_name> </xml>";
+ #$data = "<xml> <header>gosa_get_hosts_with_module</header> <source>GOSA</source> <target>10.3.67.111:20081</target> <module_name>mailqueue_com</module_name> </xml>";
##################
# recreate fai dbs
###########
# messaging
#$data = "<xml> <header>gosa_send_user_msg</header> <target>GOSA</target> <source>GOSA</source> <subject>".base64_encode("eine wichtige nachricht")."</subject> <from>admin</from> <user>polle</user> <user>harald</user> <delivery_time>20130101235959</delivery_time> <message>".base64_encode("kaffeepause")."</message> </xml>";
- #$data = "<xml> <header>gosa_send_user_msg</header> <target>GOSA</target> <source>GOSA</source> <subject>".base64_encode("eine wichtige nachricht")."</subject> <from>admin</from> <delivery_time>20130101235959</delivery_time> <message>".base64_encode("kaffeepause")."</message> </xml>";
+ #$data = "<xml> <header>gosa_send_user_msg</header> <target>00:01:6c:9d:aa:16</target> <source>GOSA</source> <subject>".base64_encode("eine wichtige nachricht")."</subject> <from>admin</from> <user>polle</user> <user>harald</user> <delivery_time>20130101235959</delivery_time> <message>".base64_encode("kaffeepause")."</message> </xml>";
+ #$data = "<xml> <header>gosa_send_user_msg</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> <subject>".base64_encode("eine wichtige nachricht")."</subject> <from>admin</from> <user>polle</user> <user>harald</user> <delivery_time>20130101235959</delivery_time> <message>".base64_encode("kaffeepause")."</message> </xml>";
################
# logHandling.pm