CL/Messages_model->prepareHtmlRead changed to redirect to an

authenticated controller to reply to a message in case the receiver
is the the system sender
This commit is contained in:
Paolo
2020-06-17 14:57:01 +02:00
parent e8272a1757
commit 596494708d
+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,