From: rettenbe Date: Wed, 3 Sep 2008 09:28:20 +0000 (+0000) Subject: update: 'send_user_msg' accepts 'user' and 'group' tags now X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4f7e710caf9b5efb0c1868621a9505caa89a9a0d;p=gosa.git update: 'send_user_msg' accepts 'user' and 'group' tags now git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12354 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index e18e0b4a7..0fe1127b2 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -86,8 +86,8 @@ sub send_user_msg { #my $subject = &decode_base64(@{$msg_hash->{'subject'}}[0]); # just for debugging my $subject = @{$msg_hash->{'subject'}}[0]; my $from = @{$msg_hash->{'from'}}[0]; - my @users = exists $msg_hash->{'users'} ? @{$msg_hash->{'users'}} : () ; - my @groups = exists $msg_hash->{'groups'} ? @{$msg_hash->{'groups'}} : (); + my @users = exists $msg_hash->{'user'} ? @{$msg_hash->{'user'}} : () ; + my @groups = exists $msg_hash->{'group'} ? @{$msg_hash->{'group'}} : (); my $delivery_time = @{$msg_hash->{'delivery_time'}}[0]; #my $message = &decode_base64(@{$msg_hash->{'message'}}[0]); # just for debugging my $message = @{$msg_hash->{'message'}}[0]; @@ -121,6 +121,12 @@ sub send_user_msg { @users = map(push(@receiver_l, "u_$_"), @users); @groups = map(push(@receiver_l, "g_$_"), @groups); + # Sanitiy check of receivers list + if (@receiver_l == 0) { + &main::daemon_log("$session_id ERROR: 'send_usr_msg'-message contains neither a 'usr' nor a 'group' tag. No receiver specified.", 1); + return; + } + # add incoming message to messaging_db my $func_dic = {table=>$main::messaging_tn, primkey=>[], diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index b8659926d..52d106692 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -74,7 +74,7 @@ for($count = 1; $count <= $zahl; $count++) #$data = "
gosa_get_login_usr_for_client
GOSA GOSA 00:01:6c:9d:b9:fa
"; # get_client_for_login_usr - $data = "
gosa_get_client_for_login_usr
GOSA GOSA rettenbe
"; + #$data = "
gosa_get_client_for_login_usr
GOSA GOSA rettenbe
"; # List all si-server providing opsi #$data = "
gosa_get_hosts_with_module
GOSA 10.89.1.31:20081 opsi_com
"; @@ -87,8 +87,8 @@ for($count = 1; $count <= $zahl; $count++) ########### # messaging - #$data = "
gosa_send_user_msg
GOSA GOSA ".base64_encode("eine wichtige nachricht")." admin polle rettenbe 20130101235959 ".base64_encode("kaffeepause")."
"; - #$data = "
gosa_send_user_msg
GOSA GOSA ".base64_encode("eine wichtige nachricht")." admin polle rettenbe 20130101235959 ".base64_encode("kaffeepause")."
"; + #$data = "
gosa_send_user_msg
GOSA GOSA ".base64_encode("eine wichtige nachricht")." admin polle harald 20130101235959 ".base64_encode("kaffeepause")."
"; + $data = "
gosa_send_user_msg
GOSA GOSA ".base64_encode("eine wichtige nachricht")." admin 20130101235959 ".base64_encode("kaffeepause")."
"; ################ # logHandling.pm