]> git.datanom.net - qtadmin.git/blame - show_headers.php
Add change row per page
[qtadmin.git] / show_headers.php
CommitLineData
6df4b805 1<?php
7ef22e21 2/* vim: set ts=4 tw=4 sw=4 noet: */
b95d1cdb
MR
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';
6df4b805 7
3056d117 8 $util = new Utils;
b95d1cdb
MR
9 $loggedIn = $util->isLoggedIn();
10 if ($loggedIn && isset($_GET['id'])) {
11 $util->setHeading('Full Headers Report');
12 echo $util->getHeader();
13 echo $util->getHeading();
6df4b805 14
b95d1cdb
MR
15 $id = $_GET['id'];
16 $mail = unserialize($_SESSION['mailInfo'][$id]);
6df4b805 17
b95d1cdb
MR
18 $row = $DB->getMail($id);
19 $string = $row->mail_text;
20 $sa_tests = null;
21 $params['include_bodies'] = false;
22 $params['decode_bodies'] = true;
23 $params['decode_headers'] = true;
24 $params['input'] = $string;
25 $params['crlf'] = "\r\n";
26
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)) {
32 $text = '';
33 foreach ($value as $val) {
34 if ($text == '') {
35 $text = $val;
36 } else {
37 $text .= "<br/><br/>$val";
38 }
39 }
40 } else {
41 $text = $value;
42 }
43 $output .= "<tr><td class=\"label\">$header</td><td class=\"value\">$text</td></tr>";
44 }
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>';
50 echo '</tr></table>';
51 echo $output;
52 echo $util->getFooter();
53 } else if ($loggedIn) {
54 header('Location: index.php');
55 } else {
56 header('Location: auth.php');
57 }
6df4b805
MR
58
59?>
This page took 0.041452 seconds and 5 git commands to generate.