X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=1440363b5ee3c722c52f127e6aafa9727459b79c;hb=069b4374494c35d8c68a8710841ed5180f1a8ba3;hp=cc06a47888fed68166ccf61615b05f1a95d0e40a;hpb=ef8703220ec8e7573417b08881f636082e4b8d58;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index cc06a478..1440363b 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -9,11 +9,6 @@ ** the resulting emails in the right frame. **/ - - - - - session_start(); if (!isset($config_php)) @@ -29,6 +24,38 @@ if (!isset($date_php)) include("../functions/date.php"); + include("../src/load_prefs.php"); + $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + sqimap_mailbox_select($imapConnection, $mailbox); + displayPageHeader($color, $mailbox); + + if ($view_hdr) { + fputs ($imapConnection, "a003 FETCH $passed_id BODY[HEADER]\r\n"); + $read = sqimap_read_data ($imapConnection, "a003", true, $a, $b); + + echo "
"; + echo "\n"; + echo "
" . _("Viewing full header") . " - "; + echo ""; + echo ""._("View message") . "
\n"; + echo "\n"; + echo "
";
+      for ($i=1; $i < count($read)-1; $i++) {
+         $read[$i] = htmlspecialchars($read[$i]);
+         if (substr($read[$i], 0, 1) != "\t" && 
+             substr($read[$i], 0, 1) != " " && 
+             substr($read[$i], 0, 1) != "&" && 
+             trim($read[$i])) {
+            $pre = substr($read[$i], 0, strpos($read[$i], ":"));
+            $read[$i] = str_replace("$pre", "$pre", decodeHeader($read[$i]));
+         }
+         echo "$read[$i]";
+      }
+      echo "
\n"; + echo ""; + exit; + } + // given an IMAP message id number, this will look it up in the cached and sorted msgs array and // return the index. used for finding the next and previous messages @@ -79,16 +106,10 @@ $msgs[$i]["FLAG_SEEN"] = true; } - include("../src/load_prefs.php"); - $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); - sqimap_mailbox_select($imapConnection, $mailbox); - // $message contains all information about the message // including header and body $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); - displayPageHeader($color, $mailbox); - /** translate the subject and mailbox into url-able text **/ $url_subj = urlencode(trim(stripslashes($message->header->subject))); $urlMailbox = urlencode($mailbox); @@ -158,8 +179,8 @@ $subject = decodeHeader(htmlspecialchars(stripslashes($message->header->subject))); echo "
"; - echo "\n"; - echo "
"; + echo "\n"; + echo "
"; echo " "; echo " "; echo " "; + echo "
"; @@ -179,11 +200,11 @@ $prev = findPreviousMessage(); $next = findNextMessage(); if ($prev != -1) - echo "" . _("Previous") . " | "; + echo "" . _("Previous") . " | "; else echo _("Previous") . " | "; if ($next != -1) - echo "" . _("Next") . ""; + echo "" . _("Next") . ""; else echo _("Next"); } @@ -208,57 +229,63 @@ echo " \n"; echo " \n"; /** subject **/ - echo " \n"; + echo " "; echo " \n"; /** from **/ echo " \n"; - echo " \n"; echo " \n"; /** date **/ echo " \n"; - echo " \n"; echo " \n"; /** to **/ echo " \n"; - echo " \n"; echo " \n"; /** cc **/ if ($message->header->cc) { echo " \n"; - echo " \n"; echo " \n"; } echo "
\n"; + echo " \n"; echo _("Subject:"); - echo " \n"; + echo " \n"; echo " $subject\n"; echo " " . _("View full header") . "  
\n"; + echo " \n"; echo _("From:"); - echo " \n"; + echo " \n"; echo " $from_name\n"; echo "
\n"; + echo " \n"; echo _("Date:"); - echo " \n"; + echo " \n"; echo " $dateString\n"; echo "
\n"; + echo " \n"; echo _("To:"); - echo " \n"; + echo " \n"; echo " $to_string\n"; echo "
\n"; + echo " \n"; echo " Cc:\n"; - echo " \n"; + echo " \n"; echo " $cc_string\n"; echo "
"; echo "
"; + echo "\n"; echo " \n"; + echo "
\n"; - $body = formatBody($message, $color, $wrap_at); + $body = formatBody($imapConnection, $message, $color, $wrap_at); echo "
"; echo "$body"; echo "
"; + echo "\n"; echo " "; echo "
 
\n"; + sqimap_logout($imapConnection); ?>