X-Git-Url: http://git.datanom.net/qtadmin.git/blobdiff_plain/6df4b8055a0e63b554ed211760ab1aa5cb431306..c6e155714d4facf6297b5159057c1483a59609c8:/message_view.php?ds=sidebyside diff --git a/message_view.php b/message_view.php index 03cced9..93cc339 100644 --- a/message_view.php +++ b/message_view.php @@ -1,96 +1,101 @@ root . 'lib/db_factory.php'; - require_once $CFG->root . 'lib/utils.inc.php'; + require_once 'Mail/mimeDecode.php'; + require_once 'config.php'; + require_once $CFG->root . 'lib/db_factory.php'; + require_once $CFG->root . 'lib/utils.inc.php'; - $util = Utils::getInstance(); - $loggedIn = $util->isLoggedIn(); - if ($loggedIn && isset($_GET['id'])) { + $util = new Utils; + $loggedIn = $util->isLoggedIn(); + if ($loggedIn && isset($_GET['id'])) { $id = $_GET['id']; $id = urldecode($id); - $util->setHeading("Message ID : $id"); - echo $util->getHeader(); - echo $util->getHeading(); + $mail = unserialize($_SESSION['mailInfo'][$id]); - $mail = unserialize($_SESSION['mailInfo'][$id]); + if (! is_object($mail) || false == $util->authorized($mail->recipient)) { + header('Location: qtadmin.php'); + exit; + } - $row = $DB->getMail($id); - $string = $row->mail_text; - $sa_tests = null; - $params['include_bodies'] = true; - $params['decode_bodies'] = true; - $params['decode_headers'] = true; - $params['input'] = $string; - $params['crlf'] = "\r\n"; - - $structure = Mail_mimeDecode::decode($params); - $headers = $structure->headers; + $util->setHeading("Message ID : $id"); + echo $util->getHeader(); + echo $util->getHeading(); + + $row = $DB->getMail($id); + $string = $row->mail_text; + $sa_tests = null; + $params['include_bodies'] = true; + $params['decode_bodies'] = true; + $params['decode_headers'] = true; + $params['input'] = $string; + $params['crlf'] = "\r\n"; + + $structure = Mail_mimeDecode::decode($params); + $headers = $structure->headers; echo '
'; echo ' |
From | $from | ||||||||||
To | $to | ||||||||||
Date | $date | ||||||||||
Subject | ".$headers['subject']." | ||||||||||
Body | ';
- if (isset($structure->parts)) {
- foreach ($structure->parts as $part) {
- if ($_GET['format'] == 'html') {
- if ($part->ctype_primary=="text" and $part->ctype_secondary=="html") {
- $bodytext = str_replace("\n", " ",$part->body);
- $bodytext = str_replace("", "", $bodytext);
- $bodytext = str_replace("", "", $bodytext);
- $bodytext = str_replace("", "", $bodytext);
- $bodytext = str_replace("", "", $bodytext);
- $bodytext = str_replace("", "", $bodytext);
- $bodytext = str_replace("", "", $bodytext);
- echo $bodytext;
- }
- } else {
- if ($part->ctype_primary=="text" and $part->ctype_secondary=="plain") {
- $bodytext = str_replace("\n", " ",$part->body); - echo $bodytext; - } - } - } - } else { - if ($_GET['format'] == 'html') { - $bodytext = str_replace("\n", " ",$structure->body); - $bodytext = str_replace("", "", $bodytext); - $bodytext = str_replace("", "", $bodytext); - $bodytext = str_replace("", "", $bodytext); - $bodytext = str_replace("", "", $bodytext); + echo '
"); + echo $bodytext; + } + } + echo ' |