From 3a5b11395dfde383f9e2a95bab06d8405f518ebf Mon Sep 17 00:00:00 2001 From: rettenbe Date: Fri, 15 Feb 2008 10:08:58 +0000 Subject: [PATCH] substitute source GOSA with $server_address in all outgoing msgs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8925 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/modules/GosaPackages.pm | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index f5f976284..7ea3e54f0 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -50,7 +50,7 @@ $network_interface= &get_interface_for_ip($server_ip); $gosa_mac_address= &get_mac($network_interface); # complete addresses -my $server_address = "$server_ip:$server_port"; +our $server_address = "$server_ip:$server_port"; my $gosa_address = "$gosa_ip:$gosa_port"; # create general settings for this module @@ -277,6 +277,9 @@ sub process_incoming_msg { my $res = $main::job_db->exec_statement($sql); } + # substitute in all outgoing msg GOSA of $server_address + $out_msg =~ s/GOSA<\/source>/$server_address<\/source>/g; + my @out_msg_l; if (defined $out_msg){ push(@out_msg_l, $out_msg); @@ -320,26 +323,6 @@ sub process_gosa_msg { no strict 'refs'; $out_msg = &{$event_hash->{$header}."::$header"}($msg, $msg_hash); } - -# opendir (DIR, $server_event_dir) or &main::daemon_log("ERROR cannot open $server_event_dir: $!\n", 1) and return; -# while (defined (my $file = readdir (DIR))) { -# if (not $file eq $header) { -# next; -# } -# # try to deliver incoming msg to eventhandler -# my $cmd = File::Spec->join($server_event_dir, $header)." '$msg'"; -# &main::daemon_log("GosaPackages: execute event_handler $header", 3); -# &main::daemon_log("GosaPackages: cmd: $cmd", 8); -# -# $out_msg = ""; -# open(PIPE, "$cmd 2>&1 |"); -# while() { -# $out_msg.=$_; -# } -# close(PIPE); -# &main::daemon_log("GosaPackages: answer of cmd: $out_msg", 5); -# last; -# } } # if delivery not possible raise error and return -- 2.30.2