X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fview_html.php;h=cddde4c7be754ffc157d5b910d9ebfbe23ba9da8;hb=8ec806b85655f4b3933c65f1877df68cec3c0cdf;hp=0763b191560bd499b54a0996e183a45f1361826d;hpb=f63fd5f01e50e7843f45c64a47332013d6ded1b3;p=squirrelmail.git diff --git a/src/view_html.php b/src/view_html.php index 0763b191..cddde4c7 100644 --- a/src/view_html.php +++ b/src/view_html.php @@ -17,19 +17,16 @@ */ /** - * Path for SquirrelMail required files. - * @ignore + * Include the SquirrelMail initialization file. */ -define('SM_PATH','../'); +require('../include/init.php'); /** SquirrelMail required files. */ -include_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); -sqgetGlobalVar('username', $username, SQ_SESSION); -sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); sqgetGlobalVar('messages', $messages, SQ_SESSION); sqgetGlobalVar('mailbox', $mailbox, SQ_GET); sqgetGlobalVar('ent_id', $ent_id, SQ_GET); @@ -40,7 +37,7 @@ if (sqgetGlobalVar('passed_id', $temp, SQ_GET)) { // TODO: add required var checks here. -$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); +$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); $mbx_response = sqimap_mailbox_select($imap_stream, $mailbox); $message = &$messages[$mbx_response['UIDVALIDITY']][$passed_id]; @@ -59,8 +56,7 @@ $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]; +do_hook('message_body', $body); /** * TODO: check if xtra_code is needed. @@ -78,5 +74,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 +?>