]> git.datanom.net - qtadmin.git/blobdiff - mail_report.php
add more debug info
[qtadmin.git] / mail_report.php
index 55b7ac48688c9276d315530a591dc7c38c0a0bca..3607ba2e1c8772ae34353e1b298b821fef2e81c8 100644 (file)
@@ -5,16 +5,21 @@
     require_once $CFG->root . 'lib/db_factory.php';
     require_once $CFG->root . 'lib/utils.inc.php';
 
-    $util = Utils::getInstance();
+    $util = new Utils;
     $loggedIn = $util->isLoggedIn();
     if ($loggedIn && isset($_GET['id'])) {
+        $id = $_GET['id'];
+        $mail = unserialize($_SESSION['mailInfo'][$id]);
+
+        if (! is_object($mail) || false == $util->authorized($mail->recipient)) {
+            header('Location: qtadmin.php');
+            exit;
+        }
+
         $util->setHeading('Spam Report');
         echo $util->getHeader();
         echo $util->getHeading();
 
-        $id = $_GET['id'];
-        $mail = unserialize($_SESSION['mailInfo'][$id]);
-
         $row = $DB->getMail($id);
         $string = $row->mail_text;
         $sa_tests = null;
@@ -89,8 +94,8 @@
         } else {
             $bayes['total'] = "<tr><td class=\"label\">TOTAL</td><td class=\"value\">-</td></tr>";
         }
-        $plain = "?id=$id&format=plain";
-        $html = "?id=$id&format=html";
+        $plain = "?id=$id&amp;format=plain";
+        $html = "?id=$id&amp;format=html";
         echo '<p class="ruler">Message ID : ' . $mail->mail_id . '</p>';
         echo '<table class="button-menu">';
         echo '<tr class="button-row">';
         echo '</table>';
         echo $util->getFooter();
     } else if ($loggedIn) {
-        header('Location: index.php');
+        header('Location: qtadmin.php');
     } else {
         header('Location: auth.php');
     }
This page took 0.032326 seconds and 5 git commands to generate.