Esempio n. 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;
 }
Esempio n. 2
0
 function canAttach(Account $account, Message $message)
 {
     global $prefs;
     if ($prefs['feature_wiki_attachments'] != 'y') {
         return false;
     }
     $tikilib = TikiLib::lib('tiki');
     $user = $message->getAssociatedUser();
     $page = $this->getPage($message, true);
     $info = $tikilib->get_page_info($page);
     if (!$info) {
         $defaultCategory = $account->getDefaultCategory();
         if ($defaultCategory) {
             $categperms = $tikilib->get_user_permission_accessor($user, 'category', $defaultCategory);
             return $categperms->wiki_attach_files;
         }
     }
     $perms = $tikilib->get_user_permission_accessor($user, 'wiki page', $page);
     return $perms->wiki_attach_files;
 }
Esempio n. 3
0
 function execute(Account $account, Message $message)
 {
     $tikilib = TikiLib::lib('tiki');
     $page = $this->getPage($message);
     $info = $tikilib->get_page_info($page);
     if ($info) {
         $data = $tikilib->parse_data($info["data"]);
         $mail = $account->getReplyMail($message);
         $mail->setSubject($page);
         $mail->addAttachment($info['data'], 'source.txt', 'plain/txt');
         $mail->setHTML($data, strip_tags($data));
         $account->sendReply($message, $mail);
     } else {
         $l = $prefs['language'];
         $mail_data = $smarty->fetchLang($l, "mail/mailin_reply_subject.tpl");
         $mail = $account->getReplyMail($message);
         $mail->setSubject($mail_data . $page);
         $account->sendReply($message, $mail);
     }
     return true;
 }
Esempio n. 4
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $mailinlib = TikiLib::lib('mailin');
     $accs = $mailinlib->list_active_mailin_accounts(0, -1, 'account_desc', '');
     // foreach account
     foreach ($accs['data'] as $acc) {
         if (empty($acc['account'])) {
             continue;
         }
         $account = MailIn\Account::fromDb($acc);
         $account->check();
     }
 }
Esempio n. 5
0
<?php

/**
 * @package tikiwiki
 */
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
use Tiki\MailIn;
require_once 'tiki-setup.php';
$access->check_script($_SERVER["SCRIPT_NAME"], basename(__FILE__));
include_once "lib/webmail/tikimaillib.php";
$mailinlib = TikiLib::lib('mailin');
// Get a list of ACTIVE emails accounts configured for mailin procedures
$accs = $mailinlib->list_active_mailin_accounts(0, -1, 'account_desc', '');
// foreach account
foreach ($accs['data'] as $acc) {
    if (empty($acc['account'])) {
        continue;
    }
    $account = MailIn\Account::fromDb($acc);
    $account->check();
}