configured
[bMailZu.git] / read_mail.php
blobc499dcdb3ab1ec47b9ac8302d6678bff3d4e6eee
1 <?php
2 /**
3 * This file is the 'read mail' page. Logged in users can:
4 * - read the content of a specific message
5 * - view the full headers
6 * - view the original content
7 * - release or delete the viewed message
9 * @author Brian Wong <bwsource@users.sourceforge.net>
10 * @author Samuel Tran <stran2005@users.sourceforge.net>
11 * @version 04-22-05
12 * @package MailZu
14 * Copyright (C) 2005 - 2007 MailZu
15 * License: GPL, see LICENSE
17 /**
18 * Include Template class
20 include_once('lib/Template.class.php');
21 /**
22 * Include control panel-specific output functions
24 include_once('templates/common.template.php');
25 /**
26 * Include viewmail template class
28 include_once('templates/viewmail.template.php');
29 /**
30 * Include MailEngine class
32 include_once('lib/MailEngine.class.php');
34 if (!Auth::is_logged_in()) {
35 Auth::print_login_msg(); // Check if user is logged in
38 $t = new Template(translate('Message View'));
40 $t->printHTMLHeader();
41 $t->printWelcome();
42 $t->startMain();
44 // Break table into 2 columns, put quick links on left side and all other tables on the right
45 startQuickLinksCol();
46 showQuickLinks(); // Print out My Quick Links
47 startDataDisplayCol();
49 $mail_id = CmnFns::get_mail_id();
50 $content_type = CmnFns::getGlobalVar('ctype', GET);
51 $recip_email = CmnFns::getGlobalVar('recip_email', GET);
52 $query_string = CmnFns::querystring_exclude_vars( array('mail_id','recip_email') );
54 $m = new MailEngine($mail_id,$recip_email);
56 if ( ! $m->msg_found) {
57 CmnFns::do_error_box(translate('Message Unavailable'));
59 } else {
61 echo '<form name="messages_process_form" action="messagesProcessing.php" method="POST">';
62 echo ' <input type="hidden" name="mail_id_array[]" value="' . $mail_id . '_' . $recip_email . '">';
63 echo ' <input type="hidden" name="query_string" value="' . $query_string . '">';
64 printActionButtons(false);
65 echo '</form>';
67 MsgDisplayOptions(CmnFns::get_mail_id(),$recip_email);
68 startMessage();
69 MsgDisplayHeaders($m->struct);
70 // Give a space before the body displays
71 echo '<br>' . "\n";
72 if ( ! $m->msg_error ) {
73 MsgDisplayBody($m->struct);
74 } else {
75 echo "<p> $m->last_error </p>";
77 endMessage();
80 endDataDisplayCol();
81 $t->endMain();
82 $t->printHTMLFooter();