Exemplo n.º 1
0
// | This program is distributed in the hope that it will be useful,      |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
Auth::checkAuthentication(APP_COOKIE);
if (@$_GET['cat'] == 'blocked_email') {
    $email = Note::getBlockedMessage($_GET['note_id']);
} else {
    $email = Support::getFullEmail($_GET['sup_id']);
}
if (!empty($_GET['raw'])) {
    Attachment::outputDownload($email, 'message.eml', strlen($email), 'message/rfc822');
} else {
    if (!empty($_GET['cid'])) {
        list($mimetype, $data) = Mime_Helper::getAttachment($email, $_GET['filename'], $_GET['cid']);
    } else {
        list($mimetype, $data) = Mime_Helper::getAttachment($email, $_GET['filename']);
    }
    Attachment::outputDownload($data, $_GET['filename'], strlen($data), $mimetype);
}
Exemplo n.º 2
0
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 59 Temple Place - Suite 330                                          |
// | Boston, MA 02111-1307, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
//
// @(#) $Id: s.get_attachment.php 1.5 03/09/30 18:07:03-00:00 jpradomaia $
//
include_once "config.inc.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.support.php";
include_once APP_INC_PATH . "class.mime_helper.php";
include_once APP_INC_PATH . "db_access.php";
Auth::checkAuthentication(APP_COOKIE);
if (@$HTTP_GET_VARS['cat'] == 'blocked_email') {
    $email = Note::getBlockedMessage($HTTP_GET_VARS["note_id"]);
} else {
    $email = Support::getFullEmail($HTTP_GET_VARS["sup_id"]);
}
if (!empty($HTTP_GET_VARS['cid'])) {
    list($mimetype, $data) = Mime_Helper::getAttachment($email, $HTTP_GET_VARS["filename"], $HTTP_GET_VARS["cid"]);
} else {
    list($mimetype, $data) = Mime_Helper::getAttachment($email, $HTTP_GET_VARS["filename"]);
}
Attachment::outputDownload($data, $HTTP_GET_VARS["filename"], strlen($data), $mimetype);
Exemplo n.º 3
0
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 59 Temple Place - Suite 330                                          |
// | Boston, MA 02111-1307, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
//
// @(#) $Id: s.view_headers.php 1.1 03/06/01 03:32:48-00:00 jpm $
//
include_once "config.inc.php";
include_once APP_INC_PATH . "class.template.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.support.php";
include_once APP_INC_PATH . "db_access.php";
$tpl = new Template_API();
$tpl->setTemplate("view_headers.tpl.html");
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
if (@$HTTP_GET_VARS['cat'] == 'note') {
    $headers = Note::getBlockedMessage($HTTP_GET_VARS["id"]);
} else {
    $headers = Support::getFullEmail($HTTP_GET_VARS["id"]);
}
$tpl->assign("headers", $headers);
$tpl->displayTemplate();
Exemplo n.º 4
0
 /**
  * Moves an email from one account to another.
  *
  * @access  public
  * @param   integer $sup_id The ID of the message.
  * @param   integer $current_ema_id The ID of the account the message is currently in.
  * @param   integer $new_ema_id The ID of the account to move the message too.
  * @return  integer -1 if there was error moving the message, 1 otherwise.
  */
 function moveEmail($sup_id, $current_ema_id, $new_ema_id)
 {
     $usr_id = Auth::getUserID();
     $email = Support::getEmailDetails($current_ema_id, $sup_id);
     if (!empty($email['sup_iss_id'])) {
         return -1;
     }
     $info = Email_Account::getDetails($new_ema_id);
     $full_email = Support::getFullEmail($sup_id);
     $structure = Mime_Helper::decode($full_email, true, true);
     $headers = '';
     foreach ($structure->headers as $key => $value) {
         if (is_array($value)) {
             continue;
         }
         $headers .= "{$key}: {$value}\n";
     }
     // handle auto creating issues (if needed)
     $should_create_array = Support::createIssueFromEmail($info, $headers, $email['seb_body'], $email['timestamp'], $email['sup_from'], $email['sup_subject']);
     $should_create_issue = $should_create_array['should_create_issue'];
     $associate_email = $should_create_array['associate_email'];
     $issue_id = $should_create_array['issue_id'];
     $customer_id = $should_create_array['customer_id'];
     if (empty($issue_id)) {
         $issue_id = 0;
     }
     if (empty($customer_id)) {
         $customer_id = 'NULL';
     }
     $sql = "UPDATE\n                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email\n                SET\n                    sup_ema_id = " . Misc::escapeInteger($new_ema_id) . ",\n                    sup_iss_id = " . Misc::escapeInteger($issue_id) . ",\n                    sup_customer_id = " . Misc::escapeInteger($customer_id) . "\n                WHERE\n                    sup_id = " . Misc::escapeInteger($sup_id) . " AND\n                    sup_ema_id = " . Misc::escapeInteger($current_ema_id);
     $res = $GLOBALS["db_api"]->dbh->query($sql);
     if (PEAR::isError($res)) {
         Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
         return -1;
     }
     $row = array('customer_id' => $customer_id, 'issue_id' => $issue_id, 'ema_id' => $new_ema_id, 'message_id' => $email['sup_message_id'], 'date' => $email['timestamp'], 'from' => $email['sup_from'], 'to' => $email['sup_to'], 'cc' => $email['sup_cc'], 'subject' => $email['sup_subject'], 'body' => $email['seb_body'], 'full_email' => $email['seb_full_email'], 'has_attachment' => $email['sup_has_attachment']);
     Workflow::handleNewEmail(Support::getProjectByEmailAccount($new_ema_id), $issue_id, $structure, $row);
     return 1;
 }
Exemplo n.º 5
0
// |                                                                      |
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or    |
// | (at your option) any later version.                                  |
// |                                                                      |
// | This program is distributed in the hope that it will be useful,      |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('view_headers.tpl.html');
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
if (@$_GET['cat'] == 'note') {
    $headers = Note::getBlockedMessage($_GET['id']);
} else {
    $headers = Support::getFullEmail($_GET['id']);
}
$tpl->assign('headers', $headers);
$tpl->displayTemplate();