X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=bf3d1c9b90da22cabd766339f761c0bd1db60e1f;hb=d30d79f24098bb0e09a68467539912208434ac2f;hp=98e7f568aeec5422568b4abb3b2ee3828ded913c;hpb=2844086da1696de4ab45981b0d749d57502781d0;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 98e7f568..bf3d1c9b 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,46 +1,50 @@ - include("../config/config.php"); - include("../functions/strings.php"); - include("../functions/page_header.php"); - include("../functions/imap.php"); - include("../functions/mailbox.php"); - include("../functions/date.php"); - - $imapConnection = loginToImapServer($username, $key, $imapServerAddress); - selectMailbox($imapConnection, $mailbox, $numMessages); - - echo "
\n"; - displayPageHeader($mailbox); - $body = fetchBody($imapConnection, $passed_id); - getMessageHeaders($imapConnection, $passed_id, $passed_id, $f, $s, $d); - getMessageHeadersTo($imapConnection, $passed_id, $passed_id, $t); - - $subject = $s[0]; - $url_subj = urlencode(trim($subject)); - - $d[0] = ereg_replace(" ", " ", $d[0]); - $date = $d[0]; - $from_name = getSenderName($f[0]); + if (!isset($config_php)) + include("../config/config.php"); + if (!isset($strings_php)) + include("../functions/strings.php"); + if (!isset($page_header_php)) + include("../functions/page_header.php"); + if (!isset($imap_php)) + include("../functions/imap.php"); + if (!isset($mime_php)) + include("../functions/mime.php"); + if (!isset($date_php)) + include("../functions/date.php"); + + include("../src/load_prefs.php"); + + $imapConnection = sqimap_login($username, $key, $imapServerAddress, 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); + + echo ""; + echo "\n"; + displayPageHeader($color, $mailbox); + + /** translate the subject and mailbox into url-able text **/ + $url_subj = urlencode(trim(stripslashes($message["HEADER"]["SUBJECT"]))); $urlMailbox = urlencode($mailbox); + $url_replyto = urlencode($message["HEADER"]["REPLYTO"]); - $url_from = trim(decodeEmailAddr($f[0])); - $url_from = urlencode($url_from); + $url_replytoall = urlencode($message["HEADER"]["REPLYTO"]); + $url_replytoallcc = urlencode(getLineOfAddrs($message["HEADER"]["TO"]) . ", " . getLineOfAddrs($message["HEADER"]["CC"])); - $to_left = trim($t[0]); - for ($i = 0; $to_left;$i++) { - if (strpos($to_left, ",")) { - $to_ary[$i] = trim(substr($to_left, 0, strpos($to_left, ","))); - $to_left = substr($to_left, strpos($to_left, ",")+1, strlen($to_left)); - } - else { - $to_ary[$i] = trim($to_left); - $to_left = ""; - } - } + $dateString = getLongDateString($message["HEADER"]["DATE"]); + + /** TEXT STRINGS DEFINITIONS **/ + $echo_more = _("more"); + $echo_less = _("less"); + /** FORMAT THE TO STRING **/ $i = 0; $to_string = ""; + $to_ary = $message["HEADER"]["TO"]; while ($i < count($to_ary)) { + $to_ary[$i] = htmlspecialchars($to_ary[$i]); if ($to_string) $to_string = "$to_string";
- echo "
|