diff --git a/xuanxuan/module/message/ext/control/notify.php b/xuanxuan/module/message/ext/control/notify.php index ed56d88dcc..43b104d522 100644 --- a/xuanxuan/module/message/ext/control/notify.php +++ b/xuanxuan/module/message/ext/control/notify.php @@ -8,17 +8,30 @@ class myMessage extends message $response['result'] = true; $response['message'] = ''; - $userList = empty($this->post->userList) ? '' : $this->post->userList; - $title = empty($this->post->title) ? '' : $this->post->title; - $subtitle = empty($this->post->subtitle) ? '' : $this->post->subtitle; - $content = empty($this->post->content) ? '' : $this->post->content; - $contentType = empty($this->post->contentType) ? 'text' : $this->post->contentType; - $url = empty($this->post->url) ? '' : $this->post->url; - $actions = empty($this->post->actions) ? array() : $this->post->actions; - $sender = empty($this->post->sender) ? 0 : $this->post->sender; + if(empty($_POST['userList'])) + { + $response['result'] = false; + $response['message'] = $this->lang->message->error->noUserList; + die(json_encode($response)); + } + + if(empty($_POST['sender'])) + { + $response['result'] = false; + $response['message'] = $this->lang->message->error->noSender; + die(json_encode($response)); + } + + $userList = empty($_POST['userList']) ? '' : $this->post->userList; + $title = empty($_POST['title']) ? '' : $this->post->title; + $subtitle = empty($_POST['subtitle']) ? '' : $this->post->subtitle; + $content = empty($_POST['content']) ? '' : $this->post->content; + $contentType = empty($_POST['contentType']) ? 'text' : $this->post->contentType; + $url = empty($_POST['url']) ? '' : $this->post->url; + $actions = empty($_POST['actions']) ? array() : $this->post->actions; + $sender = empty($_POST['sender']) ? 0 : $this->post->sender; $result = $this->loadModel('chat')->createNotify($userList, $title, $subtitle, $content, $contentType, $url, $actions, $sender); - if(!$result) { $response['result'] = false; diff --git a/xuanxuan/module/message/ext/lang/en/xuanxuan.php b/xuanxuan/module/message/ext/lang/en/xuanxuan.php index 2cc831d314..5f17d9ff8d 100644 --- a/xuanxuan/module/message/ext/lang/en/xuanxuan.php +++ b/xuanxuan/module/message/ext/lang/en/xuanxuan.php @@ -2,3 +2,7 @@ $lang->message->typeList['xuanxuan'] = 'Xuanxuan'; $lang->message->sender = 'ZentaoPMS'; + +if(!isset($lang->message->error)) $lang->message->error = new stdclass(); +$lang->message->error->noUserList = 'Not set user id list.'; +$lang->message->error->noSender = 'Not set sender information.'; diff --git a/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php index abff61c208..4176c92aa4 100644 --- a/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php +++ b/xuanxuan/module/message/ext/lang/zh-cn/xuanxuan.php @@ -2,3 +2,7 @@ $lang->message->typeList['xuanxuan'] = '喧喧'; $lang->message->sender = '禅道项目管理'; + +if(!isset($lang->message->error)) $lang->message->error = new stdclass(); +$lang->message->error->noUserList = '没有设置消息发送用户列表'; +$lang->message->error->noSender = '没有设置发送方信息';