]>
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';
9 $loggedIn = $util->isLoggedIn();
10 if ($loggedIn && isset($_GET['id'])) {
12 $mail = unserialize($_SESSION['mailInfo'][$id]);
14 if (! is_object($mail) ||
false == $util->authorized($mail->recipient
)) {
15 header('Location: qtadmin.php');
19 $util->setHeading('Full Headers Report');
20 echo $util->getHeader();
21 echo $util->getHeading();
23 $row = $DB->getMail($id);
24 $string = $row->mail_text
;
26 $params['include_bodies'] = false;
27 $params['decode_bodies'] = true;
28 $params['decode_headers'] = true;
29 $params['input'] = $string;
30 $params['crlf'] = "\r\n";
32 $structure = Mail_mimeDecode
::decode($params);
33 $headers = $structure->headers
;
34 $output = '<table><tr><th>Header</th><th>Value</th></tr>';
35 foreach ($headers as $header => $value) {
36 if (is_array($value)) {
38 foreach ($value as $val) {
42 $text .= "<br/><br/>$val";
48 $output .= "<tr><td class=\"label\">$header</td><td class=\"value\">$text</td></tr>";
50 $output .= '</table>';
51 echo '<table class="button-menu">';
52 echo '<tr class="button-row">';
53 echo '<td class="button"><input class="btn-input" type="button" value="Return"
54 onclick="javascript: history.back();"/></td>';
57 echo $util->getFooter();
58 } else if ($loggedIn) {
59 header('Location: qtadmin.php');
61 header('Location: auth.php');
This page took 0.082246 seconds and 6 git commands to generate.