<?php

/** $Id$ **/
/**
 * @package Mediboard
 * @subpackage messagerie
 * @version $Revision$
 * @author SARL OpenXtrem
 * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 */
CCanDo::checkRead();
$user = CMediusers::get();
$mail_id = CValue::get("mail_id");
$log_pop = new CSourcePOP();
$log_pop->name = "user-pop-" . $user->_id;
$log_pop->loadMatchingObject();
if (!$log_pop) {
    CAppUI::stepAjax("Source POP indisponible", UI_MSG_ERROR);
}
if (!$mail_id) {
    CAppUI::stepAjax("CSourcePOP-error-mail_id", UI_MSG_ERROR);
}
//pop init
$pop = new CPop($log_pop);
$pop->open();
//mail
$mail = new CUserMail();
$head = $pop->header($mail_id);
$content = $pop->getFullBody($_mail, false, false, true);
$hash = $mail_unseen->makeHash($head, $content);
$mail->loadMatchingFromHash($hash);
Beispiel #2
0
<?php

/**
 * $Id$
 *  
 * @package    Mediboard
 * @subpackage messagerie
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 * @link       http://www.mediboard.org
 */
$user = CMediusers::get();
$source_smtp = CExchangeSource::get("mediuser-" . $user->_id, "smtp", true, null, false);
$source_pop = new CSourcePOP();
$source_pop->object_class = $user->_class;
$source_pop->object_id = $user->_id;
$source_pop->name = 'SourcePOP-' . $user->_id . '-' . ($source_pop->countMatchingList() + 1);
$mssante = false;
if (CModule::getActive('mssante') && CModule::getCanDo('mssante')->read) {
    $mssante = true;
}
$apicrypt = false;
if (CModule::getActive('apicrypt') && CModule::getCanDo('apicrypt')->read) {
    $apicrypt = true;
}
$smarty = new CSmartyDP();
$smarty->assign('source_smtp', $source_smtp);
$smarty->assign('source_pop', $source_pop);
$smarty->assign('mssante', $mssante);
$smarty->assign('apicrypt', $apicrypt);
/**
 * $Id$
 *  
 * @package    Mediboard
 * @subpackage messagerie
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 * @link       http://www.mediboard.org
 */
$account_id = CValue::get('account_id');
$mail_id = Cvalue::get('mail_id');
$reply_to_id = CValue::get('reply_to_id');
$answer_to_all = CValue::get('answer_to_all');
$account = new CSourcePOP();
$account->load($account_id);
$smtp = CExchangeSource::get("mediuser-{$account->object_id}", 'smtp');
if (!$smtp->_id) {
    $smarty = new CSmartyDP();
    $smarty->assign('msg', CAppUI::tr('CUserMail-msg-no_smtp_source_linked_to_pop_account'));
    $smarty->assign('type', 'error');
    $smarty->assign('modal', 1);
    $smarty->assign('close_modal', 1);
    $smarty->display('inc_display_msg.tpl');
    CApp::rip();
}
$mail = new CUserMail();
if ($mail_id) {
    $mail->load($mail_id);
    if ($mail->text_html_id) {
Beispiel #4
0
 * @package    Mediboard
 * @subpackage messagerie
 * @version    $Revision$
 * @author     SARL OpenXtrem
 */
CCanDo::checkRead();
$account_id = CValue::get("account_id");
//user connected
$user = CMediusers::get();
//filters
$mode = CValue::get("mode", "inbox");
//others
$page = CValue::get("page", 0);
$limit_list = CAppUI::pref("nbMailList", 20);
//account POP
$account_pop = new CSourcePOP();
$account_pop->load($account_id);
if ($account_pop->object_id != $user->_id && $account_pop->is_private) {
    CAppUI::stepAjax("CSourcePOP-error-private_account", UI_MSG_ERROR);
}
//no account_id, first of account of user
$where = array();
$where["object_class"] = " = 'CMediusers'";
$where["object_id"] = " = '{$user->_id}'";
$account_pop->loadObject($where);
$where = array();
//mails
$mail = new CUserMail();
switch ($mode) {
    case 'inbox':
        $nb_mails = CUserMail::countInbox($account_id);
 * @version $Revision$
 * @author SARL OpenXtrem
 * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 */
CCanDo::checkRead();
$user_connected = CMediusers::get();
$user_id = CValue::get("user_id");
if (!$user_id) {
    $user_id = $user_connected->_id;
}
$account_id = CValue::getOrSession("account_id");
//user
$user = new CMediusers();
$user->load($user_id);
//CSourcePOP account
$account = new CSourcePOP();
//getting the list of user with the good rights
$listUsers = $user->loadListWithPerms(PERM_EDIT);
$where = array();
$where["source_pop.is_private"] = "= '0'";
$where["source_pop.object_class"] = "= 'CMediusers'";
$where["users_mediboard.function_id"] = "= '{$user->function_id}'";
$where["users_mediboard.user_id"] = CSQLDataSource::prepareIn(array_keys($listUsers));
$ljoin = array();
$ljoin["users_mediboard"] = "source_pop.object_id = users_mediboard.user_id AND source_pop.object_class = 'CMediusers'";
//all accounts linked to a mediuser
//all accounts from an unique mediuser are grouped, in order to have the mediusers list
/** @var CSourcePOP[] $accounts_available */
$accounts_available = $account->loadList($where, null, null, null, $ljoin);
//getting user list
$users = array();
<?php

/** $Id$ **/
/**
 * @package    Mediboard
 * @subpackage messagerie
 * @version    $Revision$
 * @author     SARL OpenXtrem
 */
CCanDo::checkRead();
CPop::checkImapLib();
$account_id = CValue::get("account_id");
$user = CMediusers::get();
//get account
$account_pop = new CSourcePOP();
$account_pop->load($account_id);
//get the list
$mail = new CUserMail();
$where = array();
$where[] = "date_read IS NULL AND account_id = '{$account_id}' AND account_class = 'CSourcePOP'";
$mails = $mail->loadList($where);
$pop = new CPop($account_pop);
$pop->open();
$count = 0;
/** @var $mails CUserMail[] */
foreach ($mails as $_mail) {
    if ($pop->setflag($_mail->uid, "\\Seen")) {
        $_mail->date_read = CMbDT::dateTime();
        if (!($msg = $_mail->store())) {
            $count++;
        }
 * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 */
CCanDo::checkRead();
$user = CMediusers::get();
$mail_id = CValue::get("mail_id");
//pop init
//mail
$mail = new CUserMail();
$mail->load($mail_id);
$mail->loadRefsFwd();
$mail->checkHprim();
//HprimMedecin
$mail->checkApicrypt();
//HprimMedecin
//pop account
$log_pop = new CSourcePOP();
$log_pop->load($mail->account_id);
//if not read email, send the seen flag to server
if (!$mail->date_read && !CAppUI::pref("markMailOnServerAsRead")) {
    $pop = new CPop($log_pop);
    $pop->open();
    $pop->setflag($mail->uid, "\\Seen");
    $pop->close();
}
$mail->date_read = CMbDT::dateTime();
$mail->store();
//get the CFile attachments
$nbAttachPicked = 0;
$nbAttach = count($mail->_attachments);
foreach ($mail->_attachments as $_att) {
    $_att->loadRefsFwd();
Beispiel #8
0
 *  
 * @category Messagerie
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
$mail_id = CValue::get("id");
//usermail
$mail = new CUserMail();
$mail->load($mail_id);
$mail->loadAttachments();
//client POP
$clientPOP = new CSourcePOP();
$clientPOP->load($mail->account_id);
$pop = new CPop($clientPOP);
if (!$pop->open()) {
    return;
}
//overview
$overview = $pop->header($mail->uid);
$msgno = $overview->msgno;
$infos = $pop->infos($msgno);
//structure
$structure = $pop->structure($mail->uid);
//content
$content = $pop->getFullBody($mail->uid);
//attachments
$attachments = array();
Beispiel #9
0
 * @category Messagerie
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id:\$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
CPop::checkImapLib();
$nbAccount = CAppUI::conf("messagerie CronJob_nbMail");
$older = CAppUI::conf("messagerie CronJob_olderThan");
$limitMail = CValue::get("limit", CAppUI::conf("messagerie limit_external_mail") + 1);
$account_id = CValue::get("account_id");
$import = CValue::get("import", 0);
//source
$source = new CSourcePOP();
$where = array();
$where["active"] = "= '1'";
$where["cron_update"] = "= '1'";
if ($account_id) {
    $where["source_pop_id"] = " = '{$account_id}'";
}
$order = "'last_update' ASC";
$limit = "0, {$nbAccount}";
$sources = $source->loadList($where, $order, $limit);
/** @var $sources CSourcePOP[] */
foreach ($sources as $_source) {
    $user = $_source->loadRefMetaObject();
    //no user => next
    if (!$_source->user) {
        CAppUI::stepAjax("pas d'utilisateur pour cette source %s", UI_MSG_WARNING, $_source->_view);
/**
 * $Id$
 *  
 * @category Messagerie
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$user_connected = CMediusers::get();
$account_id = CValue::get("account_id");
$selected_folder = CValue::get('selected_folder', 'inbox');
$account = new CSourcePOP();
$account->load($account_id);
if ($account_id) {
    CValue::setSession("account_id", $account_id);
}
//user is atempting to see an account private from another medisuers
if ($account->object_id != $user_connected->_id && $account->is_private) {
    CAppUI::stepAjax("CSourcePOP-error-private_account", UI_MSG_ERROR);
}
$folders = array('inbox' => CUserMail::countUnread($account_id), 'archived' => CUserMail::countArchived($account_id), 'favorites' => CUserMail::countFavorites($account_id), 'sentbox' => CUserMail::countSent($account_id), 'drafts' => CUserMail::countDrafted($account_id));
//smarty
$smarty = new CSmartyDP();
$smarty->assign("account", $account);
$smarty->assign('folders', $folders);
$smarty->assign('selected_folder', $selected_folder);
$smarty->display("vw_account_mail.tpl");
Beispiel #11
0
<?php

/**
 * $Id$
 *  
 * @category Messagerie
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
$source = new CSourcePOP();
/** @var CSourcePOP[] $sources */
$sources = $source->loadList();
foreach ($sources as $_source) {
    $_source->loadRefMetaObject();
    $_source->countRefMails();
}
//smarty
$smarty = new CSmartyDP();
$smarty->assign("sources", $sources);
$smarty->display("vw_list_accounts.tpl");
 //linking
 if ($attachment->_file->_id) {
     $attachment->_file->setObject($object);
     if ($msg = $attachment->_file->store()) {
         CAppUI::setMsg($msg, UI_MSG_ERROR);
     } else {
         $attachment->file_id = $attachment->_file->_id;
         if ($msg = $attachment->store()) {
             CAppUI::setMsg($msg, UI_MSG_ERROR);
         } else {
             CAppUI::stepAjax("CMailAttachments-msg-attachmentLinked-success", UI_MSG_OK);
         }
     }
 } else {
     // pop
     $account = new CSourcePOP();
     $account->load($mail->account_id);
     $pop = new CPop($account);
     $pop->open();
     $file = new CFile();
     $file->setObject($object);
     $file->author_id = CAppUI::$user->_id;
     $pop = new CPop($account);
     $pop->open();
     $file_pop = $pop->decodeMail($attachment->encoding, $pop->openPart($mail->uid, $attachment->getpartDL()));
     $pop->close();
     $file->file_name = $attachment->name;
     $file->file_type = $attachment->getType($attachment->type, $attachment->subtype);
     $file->fillFields();
     $file->putContent($file_pop);
     if ($str = $file->store()) {
<?php

/**
 * Edit user exchange sources
 *
 * @category Mediusers
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id:$
 * @link     http://www.mediboard.org
 */
$mediuser = CMediusers::get();
// Source SMTP
$smtp_source = CExchangeSource::get("mediuser-" . $mediuser->_id, "smtp", true, null, false);
// Source POP
$pop_sources = $mediuser->loadRefsSourcePop();
// Dans le cas où l'on aucune source POP on va en créer une vide
$new_source_pop = new CSourcePOP();
$new_source_pop->object_class = $mediuser->_class;
$new_source_pop->object_id = $mediuser->_id;
$new_source_pop->name = "SourcePOP-" . $mediuser->_id . '-' . ($new_source_pop->countMatchingList() + 1);
// Source FTP
$archiving_source = CExchangeSource::get("archiving-" . $mediuser->_guid, "ftp", true, null, false);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("smtp_sources", array($smtp_source));
$smarty->assign("archiving_sources", array($archiving_source));
$smarty->assign("pop_sources", $pop_sources);
$smarty->assign("new_source_pop", $new_source_pop);
$smarty->display("inc_edit_exchange_sources.tpl");
Beispiel #14
0
<?php

/**
 * dPboard
 *
 * @category Board
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  SVN: $Id:$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$ds = CSQLDataSource::get("std");
// Récupération des paramètres
$chirSel = CValue::getOrSession("chirSel");
$date = CValue::getOrSession("date", CMbDT::date());
// Création du template
$smarty = new CSmartyDP();
$account = new CSourcePOP();
$account->object_class = "CMediusers";
$account->object_id = $chirSel;
$account->loadMatchingObject();
$smarty->assign("account", $account);
$smarty->assign("date", $date);
$smarty->assign("chirSel", $chirSel);
$smarty->display("inc_worklist.tpl");