mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-18 23:42:17 +00:00
MessageLib -> sendMessage: if no sender_id is specified the system default person_id will be used
This commit is contained in:
@@ -4,6 +4,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
$config['msg_delivery'] = true;
|
||||
$config['send_immediately'] = false; // If the message should be sent immediately
|
||||
$config['system_person_id'] = 1; // Dummy sender, used for sending messages from the system
|
||||
|
||||
define('EMAIL_KONTAKT_TYPE', 'email'); // Email kontakt type
|
||||
define('SENT_INFO_NEWLINE', '\n'); // tbl_msg_recipient->sentInfo separator
|
||||
|
||||
@@ -132,7 +132,7 @@ class Message extends APIv1_Controller
|
||||
if (is_object($validation) && $validation->error == EXIT_SUCCESS)
|
||||
{
|
||||
$result = $this->messagelib->sendMessage(
|
||||
$this->post()['person_id'],
|
||||
isset($this->post()['person_id']) ? $this->post()['person_id'] : null,
|
||||
isset($this->post()['receiver_id']) ? $this->post()['receiver_id'] : null,
|
||||
$this->post()['subject'],
|
||||
$this->post()['body'],
|
||||
@@ -204,10 +204,6 @@ class Message extends APIv1_Controller
|
||||
{
|
||||
return $this->_error('Parameter is null');
|
||||
}
|
||||
if (!isset($message['person_id']))
|
||||
{
|
||||
return $this->_error('person_id is not set');
|
||||
}
|
||||
if (!isset($message['subject']))
|
||||
{
|
||||
return $this->_error('subject is not set');
|
||||
|
||||
@@ -199,7 +199,9 @@ class MessageLib
|
||||
public function sendMessage($sender_id, $receiver_id, $subject, $body, $priority = PRIORITY_NORMAL, $relationmessage_id = null, $oe_kurzbz = null)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_SENDER_ID);
|
||||
{
|
||||
$sender_id = $this->ci->config->item('system_person_id');
|
||||
}
|
||||
|
||||
$receivers = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user