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'];
$id = urldecode($id);
+ $mail = unserialize($_SESSION['mailInfo'][$id]);
+
+ if (! is_object($mail) || false == $util->authorized($mail->recipient)) {
+ header('Location: index.php');
+ exit;
+ }
+
$util->setHeading("Message ID : $id");
echo $util->getHeader();
echo $util->getHeading();
- $mail = unserialize($_SESSION['mailInfo'][$id]);
-
$row = $DB->getMail($id);
$string = $row->mail_text;
$sa_tests = null;
onclick="javascript: history.back();"/></td>';
echo '</tr></table>';
- echo '<table><tr>';
+ echo '<table>';
$from = $headers['from'];
$from = str_replace("<", "<", $from);
$from = str_replace(">", ">", $from);