alecpl
2011-03-17 569701d7002e71fbf76e9acaa6c83e5bee90b411
commit | author | age
e5686f 1 <?php
A 2 /*
3  +-----------------------------------------------------------------------+
4  | program/steps/mail/headers.inc                                        |
5  |                                                                       |
e019f2 6  | This file is part of the Roundcube Webmail client                     |
f5e7b3 7  | Copyright (C) 2005-2007, The Roundcube Dev Team                       |
e5686f 8  | Licensed under the GNU GPL                                            |
A 9  |                                                                       |
10  | PURPOSE:                                                              |
11  |   Fetch message headers in raw format for display                     |
12  |                                                                       |
13  +-----------------------------------------------------------------------+
14  | Author: Aleksander Machniak <alec@alec.pl>                            |
15  +-----------------------------------------------------------------------+
16
580ff9 17  $Id$
e5686f 18
A 19 */
20
21 if ($uid = get_input_value('_uid', RCUBE_INPUT_POST))
22 {
64e3e8 23     $source = $IMAP->get_raw_headers($uid);
e5686f 24
64e3e8 25     if ($source !== false) {
A 26         $source = htmlspecialchars(trim($source));
27         $source = preg_replace(
28             array(
29                 '/\n[\t\s]+/',
30                 '/^([a-z0-9_:-]+)/im',
31                 '/\r?\n/'
32             ),
33             array(
34                 "\n&nbsp;&nbsp;&nbsp;&nbsp;",
35                 '<font class="bold">\1</font>',
36                 '<br />'
37             ), $source);
38
39         $OUTPUT->command('set_headers', $source);
e5686f 40     }
64e3e8 41     else {
A 42         $RCMAIL->output->show_message('messageopenerror', 'error');
43     }
44
45     $OUTPUT->send();
e5686f 46 }
64e3e8 47
e5686f 48 exit;
A 49
b25dfd 50