]>
git.datanom.net - qtadmin.git/blob - show_headers.php
2 /* vim: set ts=4 tw=0 sw=4 noet: */
3 require_once 'Mail/mimeDecode.php';
4 require_once 'config.php';
5 require_once $CFG->root
. 'lib/db_factory.php';
6 require_once $CFG->root
. 'lib/utils.inc.php';
8 $util = Utils
::getInstance();
9 $loggedIn = $util->isLoggedIn();
10 if ($loggedIn && isset($_GET['id'])) {
11 $util->setHeading('Full Headers Report');
12 echo $util->getHeader();
13 echo $util->getHeading();
16 $mail = unserialize($_SESSION['mailInfo'][$id]);
18 $row = $DB->getMail($id);
19 $string = $row->mail_text
;
21 $params['include_bodies'] = false;
22 $params['decode_bodies'] = true;
23 $params['decode_headers'] = true;
24 $params['input'] = $string;
25 $params['crlf'] = "\r\n";
27 $structure = Mail_mimeDecode
::decode($params);
28 $headers = $structure->headers
;
29 $output = '<table><tr><th>Header</th><th>Value</th></tr>';
30 foreach ($headers as $header => $value) {
31 if (is_array($value)) {
33 foreach ($value as $val) {
37 $text .= "<br/><br/>$val";
43 $output .= "<tr><td class=\"label\">$header</td><td class=\"value\">$text</td></tr>";
45 $output .= '</table>';
46 echo '<table class="button-menu">';
47 echo '<tr class="button-row">';
48 echo '<td class="button"><input class="btn-input" type="button" value="Return"
49 onclick="javascript: history.back();"/></td>';
52 echo $util->getFooter();
53 } else if ($loggedIn) {
54 header('Location: index.php');
56 header('Location: auth.php');
This page took 0.062762 seconds and 6 git commands to generate.