Merge branch 'MS_Wrong_sender_if_reply_message_with_token_if_message_recipient_ou'

This commit is contained in:
Andreas Österreicher
2020-07-20 18:26:10 +02:00
+10 -1
View File
@@ -284,9 +284,11 @@ class Messages_model extends CI_Model
$sender = getData($senderResult)[0]; // Found sender data
// If the sender is not the system sender and are present configurations to reply
// If the sender is not the system sender and the receiver is not the system sender
// and are present configurations to reply
$hrefReply = '';
if ($message->sender_id != $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID)
&& $message->receiver_id != $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID)
&& !isEmptyString($this->config->item(MessageLib::CFG_REDIRECT_VIEW_MESSAGE_URL)))
{
$hrefReply = $this->config->item(MessageLib::CFG_MESSAGE_SERVER).
@@ -294,6 +296,13 @@ class Messages_model extends CI_Model
$token;
}
// If the receiver is the system sender (the message was sent to an organization unit)
// redirect the reply to an authenticated controller to reply
if ($message->receiver_id == $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID))
{
$hrefReply = site_url('system/messages/MessageClient/writeReply?token='.$token);
}
return array (
'sender' => $sender,
'message' => $message,