Respect the permanentflags output. Do not show the alter flags buttons
[squirrelmail.git] / src / read_body.php
CommitLineData
59177427 1<?php
35586184 2/**
3 * read_body.php
4 *
82d304a0 5 * Copyright (c) 1999-2004 The SquirrelMail Project Team
35586184 6 * Licensed under the GNU GPL. For full terms see the file COPYING.
7 *
8 * This file is used for reading the msgs array and displaying
9 * the resulting emails in the right frame.
10 *
30967a1e 11 * @version $Id$
8f6f9ba5 12 * @package squirrelmail
a07cd1a4 13 */
35586184 14
30967a1e 15/**
16 * Path for SquirrelMail required files.
17 * @ignore
18 */
86725763 19define('SM_PATH','../');
20
21/* SquirrelMail required files. */
08185f2a 22require_once(SM_PATH . 'include/validate.php');
8650e9e1 23require_once(SM_PATH . 'functions/global.php');
86725763 24require_once(SM_PATH . 'functions/imap.php');
25require_once(SM_PATH . 'functions/mime.php');
26require_once(SM_PATH . 'functions/date.php');
27require_once(SM_PATH . 'functions/url_parser.php');
28require_once(SM_PATH . 'functions/html.php');
e95c04ec 29require_once(SM_PATH . 'functions/global.php');
6d021521 30require_once(SM_PATH . 'functions/identity.php');
d6b6d221 31require_once(SM_PATH . 'functions/mailbox_display.php');
38c944cc 32
a07cd1a4 33/**
1fca12b5 34 * Given an IMAP message id number, this will look it up in the cached
1e150c97 35 * and sorted msgs array and return the index of the next message
1fca12b5 36 *
1e150c97 37 * @param int $passed_id The current message UID
1fca12b5 38 * @return the index of the next valid message from the array
39 */
c615b1da 40function findNextMessage($passed_id) {
4669e892 41 global $msort, $msgs, $sort,
cf710efe 42 $thread_sort_messages, $allow_server_sort,
60a3e687 43 $server_sort_array;
2728fa19 44 if (!is_array($server_sort_array)) {
45 $thread_sort_messages = 0;
794d59c0 46 $allow_server_sort = FALSE;
2728fa19 47 }
a07cd1a4 48 $result = -1;
c615b1da 49 if ($thread_sort_messages || $allow_server_sort) {
d9c1dccc 50 $count = count($server_sort_array) - 1;
51 foreach($server_sort_array as $key=>$value) {
c615b1da 52 if ($passed_id == $value) {
d9c1dccc 53 if ($key == $count) {
60a3e687 54 break;
55 }
1fca12b5 56 $result = $server_sort_array[$key + 1];
4669e892 57 break;
789b4d79 58 }
60a3e687 59 }
d9c1dccc 60 } else {
7e818af0 61 if (is_array($msort)) {
62 for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
63 if ($passed_id == $msgs[$key]['ID']) {
64 next($msort);
65 $key = key($msort);
66 if (isset($key)){
67 $result = $msgs[$key]['ID'];
68 break;
d9c1dccc 69 }
1fca12b5 70 }
10f0ce72 71 }
72 }
10f0ce72 73 }
d9c1dccc 74 return $result;
a07cd1a4 75}
76
1e150c97 77/**
78 * Given an IMAP message id number, this will look it up in the cached
79 * and sorted msgs array and return the index of the previous message
80 *
81 * @param int $passed_id The current message UID
82 * @return the index of the next valid message from the array
83 */
c615b1da 84function findPreviousMessage($numMessages, $passed_id) {
85 global $msort, $sort, $msgs,
86 $thread_sort_messages,
60a3e687 87 $allow_server_sort, $server_sort_array;
a07cd1a4 88 $result = -1;
2728fa19 89 if (!is_array($server_sort_array)) {
90 $thread_sort_messages = 0;
794d59c0 91 $allow_server_sort = FALSE;
2728fa19 92 }
c615b1da 93 if ($thread_sort_messages || $allow_server_sort ) {
d9c1dccc 94 foreach($server_sort_array as $key=>$value) {
c615b1da 95 if ($passed_id == $value) {
8f11a776 96 if ($key != 0) {
97 $result = $server_sort_array[$key - 1];
60a3e687 98 }
60a3e687 99 break;
789b4d79 100 }
60a3e687 101 }
d9c1dccc 102 } else {
7e818af0 103 if (is_array($msort)) {
104 for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
105 if ($passed_id == $msgs[$key]['ID']) {
106 prev($msort);
107 $key = key($msort);
108 if (isset($key)) {
109 $result = $msgs[$key]['ID'];
110 break;
d9c1dccc 111 }
10f0ce72 112 }
113 }
10f0ce72 114 }
a07cd1a4 115 }
d9c1dccc 116 return $result;
a07cd1a4 117}
10f0ce72 118
a07cd1a4 119/**
1fca12b5 120 * Displays a link to a page where the message is displayed more
121 * "printer friendly".
1e150c97 122 * @param string $mailbox Name of current mailbox
4669e892 123 * @param int $passed_id
1fca12b5 124 */
1e150c97 125function printer_friendly_link($mailbox, $passed_id, $passed_ent_id) {
126 global $javascript_on, $color;
a07cd1a4 127
164584f0 128 $params = '?passed_ent_id=' . urlencode($passed_ent_id) .
c2324b26 129 '&mailbox=' . urlencode($mailbox) .
164584f0 130 '&passed_id=' . urlencode($passed_id);
10f0ce72 131
a07cd1a4 132 $print_text = _("View Printable Version");
10f0ce72 133
c615b1da 134 $result = '';
a07cd1a4 135 /* Output the link. */
136 if ($javascript_on) {
9f42bfc8 137 $result = '<script language="javascript" type="text/javascript">' . "\n" .
138 '<!--' . "\n" .
139 " function printFormat() {\n" .
140 ' window.open("../src/printer_friendly_main.php' .
141 $params . '","Print","width=800,height=600");' . "\n".
142 " }\n" .
143 "// -->\n" .
144 "</script>\n" .
145 "<a href=\"javascript:printFormat();\">$print_text</a>\n";
a07cd1a4 146 } else {
c2324b26 147 $result = '<a target="_blank" href="../src/printer_friendly_bottom.php' .
9f42bfc8 148 "$params\">$print_text</a>\n";
a07cd1a4 149 }
d9c1dccc 150 return $result;
a07cd1a4 151}
152
4669e892 153function ServerMDNSupport($aFlags) {
154 /* escaping $ doesn't work -> \x36 */
155 return (array_search('$mdnsent',$aFlags,true) !== false ||
156 array_search('\\*',$aFlags,true) !== false) ? true : false;
157 //$ret = preg_match('/(\x36MDNSent|\\\\\*)/i', $read);
158 //return $ret;
57257333 159}
160
fc224f68 161function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
4669e892 162 global $username, $attachment_dir,
fc224f68 163 $version, $attachments, $squirrelmail_language, $default_charset,
d9c1dccc 164 $languages, $useSendmail, $domain, $sent_folder,
165 $popuser, $data_dir, $username;
57257333 166
e95c04ec 167 sqgetGlobalVar('SERVER_NAME', $SERVER_NAME, SQ_SERVER);
0b97a708 168
38bca81c 169 $header = $message->rfc822_header;
57257333 170 $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
171
fc224f68 172 $rfc822_header = new Rfc822Header();
d9c1dccc 173 $content_type = new ContentType('multipart/report');
fc224f68 174 $content_type->properties['report-type']='disposition-notification';
d9c1dccc 175
fc224f68 176 set_my_charset();
177 if ($default_charset) {
d9c1dccc 178 $content_type->properties['charset']=$default_charset;
fc224f68 179 }
180 $rfc822_header->content_type = $content_type;
181 $rfc822_header->to[] = $header->dnt;
a20855e4 182 $rfc822_header->subject = _("Read:") . ' ' . encodeHeader($header->subject);
fc224f68 183
27a1d10a 184 // Patch #793504 Return Receipt Failing with <@> from Tim Craig (burny_md)
185 // This merely comes from compose.php and only happens when there is no
186 // email_addr specified in user's identity (which is the startup config)
187 if (ereg("^([^@%/]+)[@%/](.+)$", $username, $usernamedata)) {
188 $popuser = $usernamedata[1];
189 $domain = $usernamedata[2];
190 unset($usernamedata);
191 } else {
192 $popuser = $username;
193 }
fc224f68 194
195 $reply_to = '';
6d021521 196 $ident = get_identities();
197 if(!isset($identity)) $identity = 0;
198 $full_name = $ident[$identity]['full_name'];
199 $from_mail = $ident[$identity]['email_address'];
200 $from_addr = '"'.$full_name.'" <'.$from_mail.'>';
201 $reply_to = $ident[$identity]['reply_to'];
202
27a1d10a 203 if (!$from_mail) {
204 $from_mail = "$popuser@$domain";
205 $from_addr = $from_mail;
fc224f68 206 }
207 $rfc822_header->from = $rfc822_header->parseAddress($from_addr,true);
208 if ($reply_to) {
209 $rfc822_header->reply_to = $rfc822_header->parseAddress($reply_to,true);
210 }
d9c1dccc 211
57257333 212 // part 1 (RFC2298)
57257333 213 $senton = getLongDateString( $header->date );
214 $to_array = $header->to;
215 $to = '';
216 foreach ($to_array as $line) {
af568a82 217 $to .= ' '.$line->getAddress();
57257333 218 }
57257333 219 $now = getLongDateString( time() );
78db1583 220 set_my_charset();
46bb8da8 221 $body = _("Your message") . "\r\n\r\n" .
d39b7293 222 "\t" . _("To:") . ' ' . decodeHeader($to,false,false) . "\r\n" .
223 "\t" . _("Subject:") . ' ' . decodeHeader($header->subject,false,false) . "\r\n" .
46bb8da8 224 "\t" . _("Sent:") . ' ' . $senton . "\r\n" .
225 "\r\n" .
226 sprintf( _("Was displayed on %s"), $now );
f69feefe 227
fc224f68 228 $special_encoding = '';
4669e892 229 if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
fc224f68 230 function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
6fbd125b 231 $body = $languages[$squirrelmail_language]['XTRA_CODE']('encode', $body);
d9c1dccc 232 if (strtolower($default_charset) == 'iso-2022-jp') {
233 if (mb_detect_encoding($body) == 'ASCII') {
234 $special_encoding = '8bit';
235 } else {
236 $body = mb_convert_encoding($body, 'JIS');
237 $special_encoding = '7bit';
238 }
239 }
6fbd125b 240 }
fc224f68 241 $part1 = new Message();
242 $part1->setBody($body);
243 $mime_header = new MessageHeader;
244 $mime_header->type0 = 'text';
245 $mime_header->type1 = 'plain';
246 if ($special_encoding) {
247 $mime_header->encoding = $special_encoding;
d9c1dccc 248 } else {
fc224f68 249 $mime_header->encoding = 'us-ascii';
250 }
251 if ($default_charset) {
252 $mime_header->parameters['charset'] = $default_charset;
253 }
254 $part1->mime_header = $mime_header;
255
57257333 256 // part2 (RFC2298)
d9c1dccc 257 $original_recipient = $to;
57257333 258 $original_message_id = $header->message_id;
259
fc224f68 260 $report = "Reporting-UA : $SERVER_NAME ; SquirrelMail (version $version) \r\n";
57257333 261 if ($original_recipient != '') {
fc224f68 262 $report .= "Original-Recipient : $original_recipient\r\n";
57257333 263 }
264 $final_recipient = $sender;
fc224f68 265 $report .= "Final-Recipient: rfc822; $final_recipient\r\n" .
57257333 266 "Original-Message-ID : $original_message_id\r\n" .
267 "Disposition: manual-action/MDN-sent-manually; displayed\r\n";
268
fc224f68 269 $part2 = new Message();
270 $part2->setBody($report);
271 $mime_header = new MessageHeader;
272 $mime_header->type0 = 'message';
273 $mime_header->type1 = 'disposition-notification';
274 $mime_header->encoding = 'us-ascii';
275 $part2->mime_header = $mime_header;
276
277 $composeMessage = new Message();
278 $composeMessage->rfc822_header = $rfc822_header;
279 $composeMessage->addEntity($part1);
280 $composeMessage->addEntity($part2);
281
282
d9c1dccc 283 if ($useSendmail) {
284 require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
285 global $sendmail_path;
286 $deliver = new Deliver_SendMail();
287 $stream = $deliver->initStream($composeMessage,$sendmail_path);
fc224f68 288 } else {
d9c1dccc 289 require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
290 $deliver = new Deliver_SMTP();
47a29326 291 global $smtpServerAddress, $smtpPort, $smtp_auth_mech, $pop_before_smtp;
d9c1dccc 292 $authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
9bd3b1e6 293 get_smtp_user($user, $pass);
d9c1dccc 294 $stream = $deliver->initStream($composeMessage,$domain,0,
70ce2218 295 $smtpServerAddress, $smtpPort, $user, $pass, $authPop);
d9c1dccc 296 }
297 $success = false;
fc224f68 298 if ($stream) {
d9c1dccc 299 $length = $deliver->mail($composeMessage, $stream);
300 $success = $deliver->finalizeStream($stream);
fc224f68 301 }
d9c1dccc 302 if (!$success) {
00ac2f42 303 $msg = $deliver->dlv_msg . '<br>' .
304 _("Server replied: ") . $deliver->dlv_ret_nr . ' '.
305 $deliver->dlv_server_msg;
d9c1dccc 306 require_once(SM_PATH . 'functions/display_messages.php');
fc224f68 307 plain_error_message($msg, $color);
308 } else {
309 unset ($deliver);
d9c1dccc 310 if (sqimap_mailbox_exists ($imapConnection, $sent_folder)) {
311 sqimap_append ($imapConnection, $sent_folder, $length);
312 require_once(SM_PATH . 'class/deliver/Deliver_IMAP.class.php');
313 $imap_deliver = new Deliver_IMAP();
314 $imap_deliver->mail($composeMessage, $imapConnection);
315 sqimap_append_done ($imapConnection);
316 unset ($imap_deliver);
317 }
318 }
319 return $success;
57257333 320}
321
6201339c 322function ToggleMDNflag ($set ,$imapConnection, $mailbox, $passed_id) {
d9c1dccc 323 $sg = $set?'+':'-';
324 $cmd = 'STORE ' . $passed_id . ' ' . $sg . 'FLAGS ($MDNSent)';
4669e892 325 $read = sqimap_run_command ($imapConnection, $cmd, true, $response,
6201339c 326 $readmessage, TRUE);
57257333 327}
328
329function ClearAttachments() {
d9c1dccc 330 global $username, $attachments, $attachment_dir;
331
332 $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
333
334 $rem_attachments = array();
6191bcb1 335 if (isset($attachments)) {
336 foreach ($attachments as $info) {
337 if ($info['session'] == -1) {
338 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
339 if (file_exists($attached_file)) {
340 unlink($attached_file);
341 }
342 } else {
343 $rem_attachments[] = $info;
344 }
345 }
d9c1dccc 346 }
347 $attachments = $rem_attachments;
57257333 348}
349
4d0cd98b 350function formatRecipientString($recipients, $item ) {
d9c1dccc 351 global $show_more_cc, $show_more, $show_more_bcc,
352 $PHP_SELF;
4d0cd98b 353
d9c1dccc 354 $string = '';
38c944cc 355 if ((is_array($recipients)) && (isset($recipients[0]))) {
d9c1dccc 356 $show = false;
38c944cc 357
358 if ($item == 'to') {
d9c1dccc 359 if ($show_more) {
360 $show = true;
361 $url = set_url_var($PHP_SELF, 'show_more',0);
362 } else {
363 $url = set_url_var($PHP_SELF, 'show_more',1);
364 }
365 } else if ($item == 'cc') {
366 if ($show_more_cc) {
367 $show = true;
368 $url = set_url_var($PHP_SELF, 'show_more_cc',0);
369 } else {
370 $url = set_url_var($PHP_SELF, 'show_more_cc',1);
371 }
372 } else if ($item == 'bcc') {
373 if ($show_more_bcc) {
374 $show = true;
375 $url = set_url_var($PHP_SELF, 'show_more_bcc',0);
376 } else {
377 $url = set_url_var($PHP_SELF, 'show_more_bcc',1);
378 }
379 }
380
381 $cnt = count($recipients);
382 foreach($recipients as $r) {
a91189d6 383 $add = decodeHeader($r->getAddress(true));
d9c1dccc 384 if ($string) {
385 $string .= '<BR>' . $add;
386 } else {
387 $string = $add;
388 if ($cnt > 1) {
38c944cc 389 $string .= '&nbsp;(<A HREF="'.$url;
d9c1dccc 390 if ($show) {
391 $string .= '">'._("less").'</A>)';
392 } else {
393 $string .= '">'._("more").'</A>)';
394 break;
395 }
396 }
397 }
1fca12b5 398 }
4d0cd98b 399 }
c615b1da 400 return $string;
401}
402
4669e892 403function formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message,
af568a82 404 $color, $FirstTimeSee) {
a94c1db1 405 global $msn_user_support, $default_use_mdn, $default_use_priority,
77836429 406 $show_xmailer_default, $mdn_user_support, $PHP_SELF, $javascript_on,
407 $squirrelmail_language;
38bca81c 408
d9c1dccc 409 $header = $message->rfc822_header;
410 $env = array();
bdb9ce72 411 $env[_("Subject")] = str_replace("&nbsp;"," ",decodeHeader($header->subject));
7893c8a5 412
d9c1dccc 413 $from_name = $header->getAddr_s('from');
d6b6d221 414 if (!$from_name)
d9c1dccc 415 $from_name = $header->getAddr_s('sender');
d6b6d221 416 if (!$from_name)
417 $env[_("From")] = _("Unknown sender");
418 else
419 $env[_("From")] = decodeHeader($from_name);
d9c1dccc 420 $env[_("Date")] = getLongDateString($header->date);
421 $env[_("To")] = formatRecipientString($header->to, "to");
422 $env[_("Cc")] = formatRecipientString($header->cc, "cc");
423 $env[_("Bcc")] = formatRecipientString($header->bcc, "bcc");
424 if ($default_use_priority) {
0e8006dc 425 $env[_("Priority")] = htmlspecialchars(getPriorityStr($header->priority));
d9c1dccc 426 }
427 if ($show_xmailer_default) {
a91189d6 428 $env[_("Mailer")] = decodeHeader($header->xmailer);
d9c1dccc 429 }
430 if ($default_use_mdn) {
431 if ($mdn_user_support) {
432 if ($header->dnt) {
433 if ($message->is_mdnsent) {
509ce88e 434 $env[_("Read receipt")] = _("sent");
d9c1dccc 435 } else {
4669e892 436 $env[_("Read receipt")] = _("requested");
437 if (!(handleAsSent($mailbox) ||
d9c1dccc 438 $message->is_deleted ||
439 $passed_ent_id)) {
440 $mdn_url = $PHP_SELF . '&sendreceipt=1';
441 if ($FirstTimeSee && $javascript_on) {
442 $script = '<script language="JavaScript" type="text/javascript">' . "\n";
443 $script .= '<!--'. "\n";
444 $script .= 'if(window.confirm("' .
445 _("The message sender has requested a response to indicate that you have read this message. Would you like to send a receipt?") .
446 '")) { '."\n" .
447 ' sendMDN()'.
448 '}' . "\n";
449 $script .= '// -->'. "\n";
450 $script .= '</script>'. "\n";
451 echo $script;
452 }
453 $env[_("Read receipt")] .= '&nbsp;<a href="' . $mdn_url . '">[' .
454 _("Send read receipt now") . ']</a>';
455 }
456 }
457 }
458 }
459 }
c615b1da 460
a94c1db1 461 $s = '<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="2" BORDER="0"';
0e02d604 462 $s .= ' ALIGN="center" BGCOLOR="'.$color[0].'">';
d9c1dccc 463 foreach ($env as $key => $val) {
464 if ($val) {
465 $s .= '<TR>';
466 $s .= html_tag('TD', '<B>' . $key . ':&nbsp;&nbsp;</B>', 'RIGHT', '', 'VALIGN="TOP" WIDTH="20%"') . "\n";
467 $s .= html_tag('TD', $val, 'left', '', 'VALIGN="TOP" WIDTH="80%"') . "\n";
468 $s .= '</TR>';
469 }
470 }
a94c1db1 471 echo '<TABLE BGCOLOR="'.$color[9].'" WIDTH="100%" CELLPADDING="1"'.
da9a8410 472 ' CELLSPACING="0" BORDER="0" ALIGN="center">'."\n";
a94c1db1 473 echo '<TR><TD HEIGHT="5" COLSPAN="2" BGCOLOR="'.
474 $color[4].'"></TD></TR><TR><TD align=center>'."\n";
d9c1dccc 475 echo $s;
00ac2f42 476 do_hook('read_body_header');
d9c1dccc 477 formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color);
478 echo '</TABLE>';
a94c1db1 479 echo '</TD></TR><TR><TD HEIGHT="5" COLSPAN="2" BGCOLOR="'.$color[4].'"></TD></TR>'."\n";
feb5ec1b 480 echo '</TABLE>';
d9c1dccc 481}
c615b1da 482
1e150c97 483/**
4669e892 484 * Format message toolbar
485 *
1e150c97 486 * @param string $mailbox Name of current mailbox
487 * @param int $passed_id UID of current message
488 * @param int $passed_ent_id Id of entity within message
489 * @param object $message Current message object
490 * @param object $mbx_response
491 */
492function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response, $nav_on_top = TRUE) {
a94c1db1 493 global $base_uri, $draft_folder, $where, $what, $color, $sort,
4669e892 494 $startMessage, $PHP_SELF, $save_as_draft,
1e150c97 495 $enable_forward_as_attachment, $imapConnection, $lastTargetMailbox,
1a531551 496 $data_dir, $username, $delete_prev_next_display,
497 $compose_new_win, $javascript_on;
c615b1da 498
d9c1dccc 499 $topbar_delimiter = '&nbsp;|&nbsp;';
1e150c97 500 $double_delimiter = '&nbsp;&nbsp;&nbsp;&nbsp;';
d9c1dccc 501 $urlMailbox = urlencode($mailbox);
c615b1da 502
1e150c97 503 $msgs_url = $base_uri . 'src/';
2ffa3f57 504
1e150c97 505 // BEGIN NAV ROW - PREV/NEXT, DEL PREV/NEXT, LINKS TO INDEX, etc.
45c1ed84 506 $nav_row = '<tr><td align="left" colspan="2" style="border: 1px solid '.$color[9].';"><small>';
e55c441a 507
1e150c97 508 // Create Prev & Next links
509 // Handle nested entities first (i.e. Mime Attach parts)
510 if (isset($passed_ent_id) && $passed_ent_id) {
511 // code for navigating through attached message/rfc822 messages
d9c1dccc 512 $url = set_url_var($PHP_SELF, 'passed_ent_id',0);
70bdc740 513 $entities = array();
514 $entity_count = array();
515 $c = 0;
f2f03410 516
70bdc740 517 foreach($message->parent->entities as $ent) {
9f42bfc8 518 if ($ent->type0 == 'message' && $ent->type1 == 'rfc822') {
519 $c++;
520 $entity_count[$c] = $ent->entity_id;
521 $entities[$ent->entity_id] = $c;
522 }
70bdc740 523 }
1e150c97 524
70bdc740 525 $prev_link = _("Previous");
70bdc740 526 if($entities[$passed_ent_id] > 1) {
527 $prev_ent_id = $entity_count[$entities[$passed_ent_id] - 1];
528 $prev_link = '<a href="'
529 . set_url_var($PHP_SELF, 'passed_ent_id', $prev_ent_id)
530 . '">' . $prev_link . '</a>';
531 }
1e150c97 532
533 $next_link = _("Next");
70bdc740 534 if($entities[$passed_ent_id] < $c) {
535 $next_ent_id = $entity_count[$entities[$passed_ent_id] + 1];
536 $next_link = '<a href="'
537 . set_url_var($PHP_SELF, 'passed_ent_id', $next_ent_id)
538 . '">' . $next_link . '</a>';
539 }
1e150c97 540
d9c1dccc 541 $par_ent_id = $message->parent->entity_id;
1e150c97 542 $up_link = '';
d9c1dccc 543 if ($par_ent_id) {
544 $par_ent_id = substr($par_ent_id,0,-2);
1e150c97 545 if ( $par_ent_id != 0 ) {
546 $up_link = $topbar_delimiter;
547 $url = set_url_var($PHP_SELF, 'passed_ent_id',$par_ent_id);
548 $up_link .= '<a href="'.$url.'">'._("Up").'</a>';
549 }
550 }
551
552 $nav_row .= $prev_link . $up_link . $topbar_delimiter . $next_link;
abafb676 553 $nav_row .= $double_delimiter . '[<a href="'.$url.'">'._("View Message").'</a>]';
1e150c97 554
555 // Prev/Next links for regular messages
556 } else if ( !(isset($where) && isset($what)) ) {
557 $prev = findPreviousMessage($mbx_response['EXISTS'], $passed_id);
558 $next = findNextMessage($passed_id);
559
560 $prev_link = _("Previous");
561 if ($prev >= 0) {
562 $uri = $base_uri . 'src/read_body.php?passed_id='.$prev.
563 '&amp;mailbox='.$urlMailbox.'&amp;sort='.$sort.
564 '&amp;startMessage='.$startMessage.'&amp;show_more=0';
565 $prev_link = '<a href="'.$uri.'">'.$prev_link.'</a>';
d9c1dccc 566 }
1e150c97 567
568 $next_link = _("Next");
569 if ($next >= 0) {
570 $uri = $base_uri . 'src/read_body.php?passed_id='.$next.
571 '&amp;mailbox='.$urlMailbox.'&amp;sort='.$sort.
572 '&amp;startMessage='.$startMessage.'&amp;show_more=0';
573 $next_link = '<a href="'.$uri.'">'.$next_link.'</a>';
574 }
575
1e150c97 576 // Only bother with Delete & Prev and Delete & Next IF
6201339c 577 // top display is enabled.
4669e892 578 if ( $delete_prev_next_display == 1 &&
579 array_search('\\deleted', $mbx_response['PERMANENTFLAGS'],true) !== false) {
45c1ed84 580 $del_prev_link = _("Delete & Prev");
1e150c97 581 if ($prev >= 0) {
582 $uri = $base_uri . 'src/read_body.php?passed_id='.$prev.
583 '&amp;mailbox='.$urlMailbox.'&amp;sort='.$sort.
584 '&amp;startMessage='.$startMessage.'&amp;show_more=0'.
585 '&amp;delete_id='.$passed_id;
4669e892 586 $del_prev_link = '<a href="'.$uri.'">'.$del_prev_link.'</a>';
1e150c97 587 }
588
45c1ed84 589 $del_next_link = _("Delete & Next");
1e150c97 590 if ($next >= 0) {
591 $uri = $base_uri . 'src/read_body.php?passed_id='.$next.
592 '&amp;mailbox='.$urlMailbox.'&amp;sort='.$sort.
593 '&amp;startMessage='.$startMessage.'&amp;show_more=0'.
594 '&amp;delete_id='.$passed_id;
45c1ed84 595 $del_next_link = '<a href="'.$uri.'">'.$del_next_link.'</a>';
1e150c97 596 }
1e150c97 597 }
45c1ed84 598
abafb676 599 $nav_row .= '['.$prev_link.$topbar_delimiter.$next_link.']';
600 if ( isset($del_prev_link) && isset($del_next_link) )
601 $nav_row .= $double_delimiter.'['.$del_prev_link.$topbar_delimiter.$del_next_link.']';
1e150c97 602 }
603
604 // Start with Search Results or Message List link.
605 if (isset($where) && isset($what)) {
606 $msgs_url .= 'search.php?where=' . urlencode($where) .
607 '&amp;what=' . urlencode($what) . '&amp;mailbox=' . $urlMailbox;
608 $msgs_str = _("Search Results");
609 } else {
610 $msgs_url .= 'right_main.php?sort=' . $sort . '&amp;startMessage=' .
611 $startMessage . '&amp;mailbox=' . $urlMailbox;
612 $msgs_str = _("Message List");
613 }
614 $nav_row .= $double_delimiter .
abafb676 615 '[<a href="' . $msgs_url . '">' . $msgs_str . '</a>]';
1e150c97 616
617 $nav_row .= '</small></td></tr>';
618
619
620 // BEGIN MENU ROW - DELETE/REPLY/FORWARD/MOVE/etc.
621 $menu_row = '<tr bgcolor="'.$color[9].'"><td><small>';
98a9cc03 622 $comp_uri = $base_uri.'src/compose.php' .
623 '?passed_id=' . $passed_id .
624 '&amp;mailbox=' . $urlMailbox .
625 '&amp;startMessage=' . $startMessage .
626 (isset($passed_ent_id) ? '&amp;passed_ent_id='.$passed_ent_id : '');
4669e892 627
628 // Start form for reply/reply all/forward..
1a531551 629 $target = '';
630 $on_click='';
ee66175d 631 $method='method="post" ';
1a531551 632 if ($compose_new_win == '1') {
633 if ( $javascript_on ) {
634 $on_click=' onclick="comp_in_new_form(\''.$comp_uri.'\', this, this.form)"';
635 $comp_uri = 'javascript:void(0)';
ee66175d 636 $method='method="get" ';
1a531551 637 } else {
638 $target = 'target="_blank"';
1a531551 639 }
640 }
641
d35df487 642 $menu_row .= "\n".'<form name="composeForm" action="'.$comp_uri.'" '.$method.$target.' style="display: inline">'."\n";
98a9cc03 643
1e150c97 644 // If Draft folder - create Resume link
645 if (($mailbox == $draft_folder) && ($save_as_draft)) {
1a531551 646 $new_button = 'smaction_draft';
1e150c97 647 $comp_alt_string = _("Resume Draft");
648 } else if (handleAsSent($mailbox)) {
649 // If in Sent folder, edit as new
1a531551 650 $new_button = 'smaction_edit_new';
1e150c97 651 $comp_alt_string = _("Edit Message as New");
652 }
1e150c97 653 // Show Alt URI for Draft/Sent
98a9cc03 654 if (isset($comp_alt_string))
1a531551 655 $menu_row .= getButton('SUBMIT', $new_button, $comp_alt_string, $on_click) . "\n";
1e150c97 656
1a531551 657 $menu_row .= getButton('SUBMIT', 'smaction_reply', _("Reply"), $on_click) . "\n";
658 $menu_row .= getButton('SUBMIT', 'smaction_reply_all', _("Reply All"), $on_click) ."\n";
659 $menu_row .= getButton('SUBMIT', 'smaction_forward', _("Forward"), $on_click);
98a9cc03 660 if ($enable_forward_as_attachment)
51eb014b 661 $menu_row .= '<input type="checkbox" name="smaction_attache">' . _("As Attachment") .'&nbsp;&nbsp;'."\n";
1e150c97 662
51eb014b 663 $menu_row .= '</form>&nbsp;';
c615b1da 664
4669e892 665 if (array_search('\\deleted', $mbx_response['PERMANENTFLAGS'],true) !== false) {
98a9cc03 666 // Form for deletion
4669e892 667 $delete_url = $base_uri . 'src/delete_message.php?mailbox=' . $urlMailbox;
668 $menu_row .= '<form action="'.$delete_url.'" method="post" style="display: inline">';
a128c967 669
4669e892 670 if (!(isset($passed_ent_id) && $passed_ent_id)) {
671 $menu_row .= addHidden('message', $passed_id);
abafb676 672
4669e892 673 if ($where && $what) {
674 $menu_row .= addHidden('where', $where);
675 $menu_row .= addHidden('what', $what);
676 } else {
677 $menu_row .= addHidden('sort', $sort);
678 $menu_row .= addHidden('startMessage', $startMessage);
679 }
680 $menu_row .= getButton('SUBMIT', 'delete', _("Delete"));
681 $menu_row .= '<input type="checkbox" name="bypass_trash">' . _("Bypass Trash");
abafb676 682 }
4669e892 683 else
684 $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled
abafb676 685
4669e892 686 $menu_row .= '</form>';
687 }
abafb676 688
1e150c97 689 // Add top move link
690 $menu_row .= '</small></td><td align="right">';
4669e892 691 if ( !(isset($passed_ent_id) && $passed_ent_id) &&
692 array_search('\\deleted', $mbx_response['PERMANENTFLAGS'],true) !== false) {
693
b2811304 694 $current_box = 'mailbox='.$mailbox.'&sort='.$sort.'&startMessage='.$startMessage;
1c13663f 695
696 // Set subsequent location based on whether or not there is a 'next' message.
b2811304 697 if ( isset($next) && $next >= 0 ) {
c0312de3 698 $location = $base_uri . 'src/read_body.php?passed_id='.$next.'&';
699 } elseif (isset($prev) && $prev >= 0) {
700 $location = $base_uri . 'src/read_body.php?passed_id='.$prev.'&';
b2811304 701 } else {
c0312de3 702 $location = $base_uri . 'src/right_main.php?';
b2811304 703 }
b2811304 704
39de750f 705 $menu_row .= '<form action="'.$base_uri.'src/move_messages.php?'.$current_box.'" method="post" style="display: inline">'.
64c9e87e 706 '<small>'.
707 addHidden('show_more', '0' ).
708 addHidden('dmn', '1').
709 addHidden('location', $location.$current_box).
710 addHidden('msg[0]', $passed_id) . _("Move to:") .
1e150c97 711 '<select name="targetMailbox" style="padding: 0px; margin: 0px">';
b2811304 712
1e150c97 713 if (isset($lastTargetMailbox) && !empty($lastTargetMailbox)) {
714 $menu_row .= sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)));
715 } else {
716 $menu_row .= sqimap_mailbox_option_list($imapConnection);
717 }
b2811304 718 $menu_row .= '</select> ';
719
b2811304 720 $menu_row .= getButton('SUBMIT', 'moveButton',_("Move")) . "\n" . '</form>';
1e150c97 721 }
722 $menu_row .= '</td></tr>';
d9c1dccc 723
1e150c97 724 // echo rows, with hooks
764971df 725 $ret = do_hook_function('read_body_menu_top', array($nav_row, $menu_row));
988e24f6 726 if (is_array($ret)) {
727 if (isset($ret[0]) && !empty($ret[0])) {
728 $nav_row = $ret[0];
729 }
730 if (isset($ret[1]) && !empty($ret[1])) {
731 $menu_row = $ret[1];
732 }
764971df 733 }
1e150c97 734 echo '<table width="100%" cellpadding="3" cellspacing="0" align="center" border="0">';
735 echo $nav_on_top ? $nav_row . $menu_row : $menu_row . $nav_row;
736 echo '</table>'."\n";
d62c4938 737 do_hook('read_body_menu_bottom');
c615b1da 738}
739
740function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
78909469 741 global $base_uri, $where, $what;
4669e892 742
d9c1dccc 743 $urlMailbox = urlencode($mailbox);
78909469 744 $urlPassed_id = urlencode($passed_id);
745 $urlPassed_ent_id = urlencode($passed_ent_id);
4669e892 746
78909469 747 $query_string = 'mailbox=' . $urlMailbox . '&amp;passed_id=' . $urlPassed_id . '&amp;passed_ent_id=' . $urlPassed_ent_id;
4669e892 748
78909469 749 if (!empty($where)) {
750 $query_string .= '&amp;where=' . urlencode($where);
751 }
752
753 if (!empty($what)) {
754 $query_string .= '&amp;what=' . urlencode($what);
755 }
756
e95c04ec 757 $url = $base_uri.'src/view_header.php?'.$query_string;
d9c1dccc 758
a94c1db1 759 $s = "<TR>\n" .
98fb28fd 760 html_tag( 'td', '', 'right', '', 'VALIGN="MIDDLE" WIDTH="20%"' ) . '<B>' . _("Options") . ":&nbsp;&nbsp;</B></TD>\n" .
761 html_tag( 'td', '', 'left', '', 'VALIGN="MIDDLE" WIDTH="80%"' ) . '<SMALL>' .
d9c1dccc 762 '<a href="'.$url.'">'._("View Full Header").'</a>';
763
764 /* Output the printer friendly link if we are in subtle mode. */
765 $s .= '&nbsp;|&nbsp;' .
1e150c97 766 printer_friendly_link($mailbox, $passed_id, $passed_ent_id);
d9c1dccc 767 echo $s;
768 do_hook("read_body_header_right");
769 $s = "</SMALL></TD>\n" .
770 "</TR>\n";
771 echo $s;
a128c967 772
4d0cd98b 773}
774
6206f6c4 775/***************************/
2ffa3f57 776/* Main of read_body.php */
6206f6c4 777/***************************/
57257333 778
0b97a708 779/* get the globals we may need */
780
1e12d1ff 781sqgetGlobalVar('key', $key, SQ_COOKIE);
e95c04ec 782sqgetGlobalVar('username', $username, SQ_SESSION);
783sqgetGlobalVar('onetimepad',$onetimepad, SQ_SESSION);
e95c04ec 784sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
1e12d1ff 785sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
786
e95c04ec 787sqgetGlobalVar('msgs', $msgs, SQ_SESSION);
788sqgetGlobalVar('msort', $msort, SQ_SESSION);
789sqgetGlobalVar('lastTargetMailbox', $lastTargetMailbox, SQ_SESSION);
790sqgetGlobalVar('server_sort_array', $server_sort_array, SQ_SESSION);
791if (!sqgetGlobalVar('messages', $messages, SQ_SESSION) ) {
792 $messages = array();
ce274df9 793}
794
e95c04ec 795/** GET VARS */
796sqgetGlobalVar('sendreceipt', $sendreceipt, SQ_GET);
797sqgetGlobalVar('where', $where, SQ_GET);
798sqgetGlobalVar('what', $what, SQ_GET);
799if ( sqgetGlobalVar('show_more', $temp, SQ_GET) ) {
800 $show_more = (int) $temp;
1b9f3c04 801}
e95c04ec 802if ( sqgetGlobalVar('show_more_cc', $temp, SQ_GET) ) {
803 $show_more_cc = (int) $temp;
0b97a708 804}
e95c04ec 805if ( sqgetGlobalVar('show_more_bcc', $temp, SQ_GET) ) {
806 $show_more_bcc = (int) $temp;
0b97a708 807}
e95c04ec 808if ( sqgetGlobalVar('view_hdr', $temp, SQ_GET) ) {
809 $view_hdr = (int) $temp;
0b97a708 810}
e95c04ec 811
e95c04ec 812/** GET/POST VARS */
813sqgetGlobalVar('passed_ent_id', $passed_ent_id);
814sqgetGlobalVar('mailbox', $mailbox);
815
816if ( sqgetGlobalVar('passed_id', $temp) ) {
817 $passed_id = (int) $temp;
0b97a708 818}
e95c04ec 819if ( sqgetGlobalVar('sort', $temp) ) {
820 $sort = (int) $temp;
0b97a708 821}
e95c04ec 822if ( sqgetGlobalVar('startMessage', $temp) ) {
823 $startMessage = (int) $temp;
ce274df9 824}
0b97a708 825
ce274df9 826/* end of get globals */
6201339c 827global $sqimap_capabilities, $lastTargetMailbox;
38c944cc 828
6206f6c4 829$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
9f42bfc8 830$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox, false, false, true);
38c944cc 831
1e150c97 832/**
833 * Process Delete from delete-move-next
834 * but only if delete_id was set
835 */
836if ( sqgetGlobalVar('delete_id', $delete_id, SQ_GET) ) {
653ff1e6 837 sqimap_messages_delete($imapConnection, $delete_id, $delete_id, $mailbox);
26e90c74 838 sqimap_mailbox_expunge_dmn($delete_id,$mbx_response,$server_sort_array);
1e150c97 839}
840
38c944cc 841/**
842 * $message contains all information about the message
843 * including header and body
844 */
37d2a6ee 845
846$uidvalidity = $mbx_response['UIDVALIDITY'];
9f42bfc8 847
37d2a6ee 848if (!isset($messages[$uidvalidity])) {
849 $messages[$uidvalidity] = array();
9f42bfc8 850}
26e90c74 851if (!isset($messages[$uidvalidity][$passed_id]) || $delete_id) {
5200c026 852 $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
fc224f68 853 $FirstTimeSee = !$message->is_seen;
854 $message->is_seen = true;
5200c026 855 $messages[$uidvalidity][$passed_id] = $message;
38c944cc 856} else {
fc224f68 857// $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
858 $message = $messages[$uidvalidity][$passed_id];
859 $FirstTimeSee = !$message->is_seen;
5200c026 860}
af568a82 861
dd628162 862if (isset($passed_ent_id) && $passed_ent_id) {
5200c026 863 $message = $message->getEntity($passed_ent_id);
ff9d4297 864 if ($message->type0 != 'message' && $message->type1 != 'rfc822') {
865 $message = $message->parent;
866 }
6201339c 867 $read = sqimap_run_command ($imapConnection, "FETCH $passed_id BODY[$passed_ent_id.HEADER]", true, $response, $msg, TRUE);
19d470aa 868 $rfc822_header = new Rfc822Header();
141a16b2 869 $rfc822_header->parseHeader($read);
870 $message->rfc822_header = $rfc822_header;
c615b1da 871} else {
872 $passed_ent_id = 0;
38c944cc 873}
5200c026 874$header = $message->header;
57257333 875
6c31f818 876do_hook('html_top');
57257333 877
6206f6c4 878/****************************************/
879/* Block for handling incoming url vars */
880/****************************************/
5200c026 881
5200c026 882if (isset($sendreceipt)) {
883 if ( !$message->is_mdnsent ) {
27a1d10a 884 $final_recipient = '';
885 if ((isset($identity)) && ($identity != 0)) //Main identity
886 $final_recipient = trim(getPref($data_dir, $username, 'email_address' . $identity, '' ));
887 if ($final_recipient == '' )
888 $final_recipient = trim(getPref($data_dir, $username, 'email_address', '' ));
af568a82 889 $supportMDN = ServerMDNSupport($mbx_response["PERMANENTFLAGS"]);
fc224f68 890 if ( SendMDN( $mailbox, $passed_id, $final_recipient, $message, $imapConnection ) > 0 && $supportMDN ) {
6201339c 891 ToggleMDNflag( true, $imapConnection, $mailbox, $passed_id);
5200c026 892 $message->is_mdnsent = true;
6a108031 893 $messages[$uidvalidity][$passed_id]=$message;
5200c026 894 }
895 ClearAttachments();
896 }
897}
6206f6c4 898/***********************************************/
899/* End of block for handling incoming url vars */
900/***********************************************/
901
38c944cc 902$msgs[$passed_id]['FLAG_SEEN'] = true;
9f42bfc8 903
904$messagebody = '';
c4ad259b 905do_hook('read_body_top');
906if ($show_html_default == 1) {
907 $ent_ar = $message->findDisplayEntity(array());
908} else {
909 $ent_ar = $message->findDisplayEntity(array(), array('text/plain'));
910}
a128c967 911$cnt = count($ent_ar);
912for ($i = 0; $i < $cnt; $i++) {
6a108031 913 $messagebody .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox);
a128c967 914 if ($i != $cnt-1) {
915 $messagebody .= '<hr noshade size=1>';
916 }
38c944cc 917}
e55c441a 918
c615b1da 919displayPageHeader($color, $mailbox);
7172cad7 920formatMenuBar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response);
af568a82 921formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message, $color, $FirstTimeSee);
a94c1db1 922echo '<table width="100%" cellpadding="0" cellspacing="0" align="center" border="0">';
6206f6c4 923echo ' <tr><td>';
a94c1db1 924echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="'.$color[9].'">';
a128c967 925echo ' <tr><td>';
a94c1db1 926echo ' <table width="100%" cellpadding="3" cellspacing="0" align="center" border="0">';
6206f6c4 927echo ' <tr bgcolor="'.$color[4].'"><td>';
98fb28fd 928// echo ' <table cellpadding="1" cellspacing="5" align="left" border="0">';
929echo html_tag( 'table' ,'' , 'left', '', 'cellpadding="1" cellspacing="5" border="0"' );
ce810ea7 930echo ' <tr>' . html_tag( 'td', '<br>'. $messagebody."\n", 'left')
6c7b5d8c 931 . '</tr>';
6206f6c4 932echo ' </table>';
4669e892 933echo ' </td></tr>';
6206f6c4 934echo ' </table></td></tr>';
2ffa3f57 935echo ' </table>';
936echo ' </td></tr>';
a128c967 937
d0a2476a 938echo '<TR><TD HEIGHT="5" COLSPAN="2" BGCOLOR="'.
6c7b5d8c 939 $color[4].'"></TD></TR>'."\n";
d0a2476a 940
a128c967 941$attachmentsdisplay = formatAttachments($message,$ent_ar,$mailbox, $passed_id);
942if ($attachmentsdisplay) {
8acd2fb5 943 echo ' </table>';
6206f6c4 944 echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center"'.' border="0" bgcolor="'.$color[9].'">';
2ffa3f57 945 echo ' <tr><td>';
d0a2476a 946 echo ' <table width="100%" cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="'.$color[4].'">';
4669e892 947 echo ' <tr>' . html_tag( 'td', '', 'left', $color[9] );
6206f6c4 948 echo ' <b>' . _("Attachments") . ':</b>';
949 echo ' </td></tr>';
950 echo ' <tr><td>';
951 echo ' <table width="100%" cellpadding="2" cellspacing="2" align="center"'.' border="0" bgcolor="'.$color[0].'"><tr><td>';
952 echo $attachmentsdisplay;
953 echo ' </td></tr></table>';
6c7b5d8c 954 echo ' </td></tr></table>';
6206f6c4 955 echo ' </td></tr>';
6c7b5d8c 956 echo '<TR><TD HEIGHT="5" COLSPAN="2" BGCOLOR="'.
957 $color[4].'"></TD></TR>';
a128c967 958}
c615b1da 959echo '</table>';
a07cd1a4 960
961/* show attached images inline -- if pref'fed so */
5be9f195 962if (($attachment_common_show_images) &&
a07cd1a4 963 is_array($attachment_common_show_images_list)) {
964 foreach ($attachment_common_show_images_list as $img) {
ce274df9 965 $imgurl = SM_PATH . 'src/download.php' .
57257333 966 '?' .
cd7b8833 967 'passed_id=' . urlencode($img['passed_id']) .
3d570ba0 968 '&amp;mailbox=' . urlencode($mailbox) .
ff9d4297 969 '&amp;ent_id=' . urlencode($img['ent_id']) .
3d570ba0 970 '&amp;absolute_dl=true';
5be9f195 971
b5058e9e 972 echo html_tag( 'table', "\n" .
d9c1dccc 973 html_tag( 'tr', "\n" .
974 html_tag( 'td', '<img src="' . $imgurl . '">' ."\n", 'left'
975 )
976 ) ,
b5058e9e 977 'center', '', 'cellspacing=0 border="0" cellpadding="2"');
10f0ce72 978 }
a07cd1a4 979}
980
4267d5de 981formatMenuBar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response, FALSE);
1e150c97 982
c615b1da 983do_hook('read_body_bottom');
984do_hook('html_bottom');
a07cd1a4 985sqimap_logout($imapConnection);
4669e892 986/* sessions are written at the end of the script. it's better to register
ce274df9 987 them at the end so we avoid double session_register calls */
988sqsession_register($messages,'messages');
e55c441a 989
dcc1cc82 990?>
991</body>
992</html>