Example #1
0
 function execute(Account $account, Message $message)
 {
     $body = $message->getHtmlBody();
     $body = $account->parseBody($body, false);
     $commentslib = TikiLib::lib('comments');
     $message_id = '';
     // By ref
     $threadId = $commentslib->post_new_comment("{$this->type}:{$this->object}", 0, $message->getAssociatedUser(), $message->getSubject(), $body['body'], $message_id, '', 'n', '', '', '', '', '', '', '');
     return true;
 }
Example #2
0
 function createAction(Account $account, Message $message)
 {
     $subject = $message->getSubject();
     foreach ($this->config as $prefix => $factory) {
         if (empty($prefix) || strpos($subject, $prefix) === 0) {
             $subject = trim(substr($subject, strlen($prefix)));
             $message->setSubject($subject);
             return $factory->createAction($account, $message);
         }
     }
     throw new MailInException(tr("Unable to find suitable action."));
 }
Example #3
0
 function execute(Account $account, Message $message)
 {
     $artlib = TikiLib::lib('art');
     $tikilib = TikiLib::lib('tiki');
     $title = $message->getSubject();
     $heading = $message->getBody();
     $topicId = $this->topicId;
     $userm = $message->getAssociatedUser();
     $authorName = $userm;
     $body = '';
     $publishDate = $tikilib->now;
     $cur_time = explode(',', $tikilib->date_format('%Y,%m,%d,%H,%M,%S', $publishDate));
     $expireDate = $tikilib->make_time($cur_time[3], $cur_time[4], $cur_time[5], $cur_time[1], $cur_time[2], $cur_time[0] + 1);
     $subId = 0;
     $type = $this->type;
     $useImage = 'n';
     $image_x = '';
     $image_y = '';
     $imgname = '';
     $imgsize = '';
     $imgtype = '';
     $imgdata = '';
     $topline = '';
     $subtitle = '';
     $linkto = '';
     $image_caption = '';
     $lang = '';
     $rating = 7;
     $isfloat = 'n';
     $subid = $artlib->replace_submission($title, $authorName, $topicId, $useImage, $imgname, $imgsize, $imgtype, $imgdata, $heading, $body, $publishDate, $expireDate, $userm, $subId, $image_x, $image_y, $type, $topline, $subtitle, $linkto, $image_caption, $lang, $rating, $isfloat);
     $perms = TikiLib::lib('tiki')->get_user_permission_accessor($user, 'topic', $this->topicId);
     if ($perms->autoapprove_submission) {
         $artlib->approve_submission($subid);
     }
     return true;
 }
Example #4
0
 private function log(Source\Message $message, $detail)
 {
     $lib = TikiLib::lib('logs');
     $lib->add_log('mailin', $detail . ' - ' . $message->getSubject(), $message->getAssociatedUser());
 }