removing code that could be used with plugin in SM 1.4.x. After init
[squirrelmail.git] / src / view_html.php
index 9c1c5ed6b637b1a76354fc7dfd26041f0d3aa4a4..b33bd79c226b9e818d6465eab32c6cf90f45bbb5 100644 (file)
  * optional. User must be authenticated ($key in cookie. $username and
  * $onetimepad in session).
  *
- * @copyright © 1999-2005 The SquirrelMail Project Team
+ * @copyright © 1999-2006 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  */
 
 /**
- * Path for SquirrelMail required files.
- * @ignore
+ * Include the SquirrelMail initialization file.
  */
-define('SM_PATH','../');
+require('../include/init.php');
 
 /** SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-include_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/mime.php');
+require_once(SM_PATH . 'functions/date.php');
 
 /** Get globals */
 sqgetGlobalVar('key',        $key,          SQ_COOKIE);
@@ -38,13 +38,6 @@ if (sqgetGlobalVar('passed_id', $temp, SQ_GET)) {
     $passed_id = (int) $temp;
 }
 
-global $view_unsafe_images;
-if (sqgetGlobalVar('view_unsafe_images', $temp, SQ_GET)) {
-    $view_unsafe_images = (bool) $temp;
-} else {
-    $view_unsafe_images = false;
-}
-
 // TODO: add required var checks here.
 
 $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
@@ -66,6 +59,8 @@ $encoding = strtolower($header->encoding);
 
 $body = mime_fetch_body($imap_stream, $passed_id, $ent_id);
 $body = decodeBody($body, $encoding);
+$hookResults = do_hook('message_body', $body);
+$body = $hookResults[1];
 
 /**
  * TODO: check if xtra_code is needed.
@@ -83,5 +78,4 @@ $body = MagicHTML( $body, $passed_id, $message, $mailbox);
 /** TODO: charset might be part of html code. */
 header('Content-Type: text/html; charset=' . $charset);
 echo $body;
-
-?>
+?>
\ No newline at end of file