From 57e54397a9a2f8613734cc4b2c0f75e1dff5362d Mon Sep 17 00:00:00 2001 From: vgilc Date: Wed, 4 Apr 2012 11:40:34 +0000 Subject: [PATCH] 2012-04-04 Vanessa Gil * include/functions_messages.php: Fixed bug duplicate sent messages. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5894 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_messages.php | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index da4bb235c8..04774b2ff6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-04-04 Vanessa Gil + + * include/functions_messages.php: Fixed bug duplicate + sent messages. + 2012-04-04 Dario Rodriguez * godmode/menu.php: Fixed a problem with menu link. diff --git a/pandora_console/include/functions_messages.php b/pandora_console/include/functions_messages.php index 7c404643ad..1f3998331d 100644 --- a/pandora_console/include/functions_messages.php +++ b/pandora_console/include/functions_messages.php @@ -82,7 +82,16 @@ function messages_create_group ($usuario_origen, $dest_group, $subject, $mensaje //Start transaction so that if it fails somewhere along the way, we roll back db_process_sql_begin (); + // array unique foreach ($group_users as $user) { + foreach ($user as $key=>$us) { + if ($key == 'id_user') { + $group_user[$us] = $us; + } + } + } + + foreach ($group_user as $user) { $return = messages_create_message ($usuario_origen, get_user_id ($user), $subject, $mensaje); if ($return === false) { //Error sending message, rollback and return false