From: stekkel Date: Wed, 25 Sep 2002 17:18:55 +0000 (+0000) Subject: rg=0 updates X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ce274df943cb730e7008f94ca927f9f10c78da09;p=squirrelmail.git rg=0 updates git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3731 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/download.php b/src/download.php index 092940a2..472ce840 100644 --- a/src/download.php +++ b/src/download.php @@ -30,15 +30,15 @@ $username = $_SESSION['username']; $onetimepad = $_SESSION['onetimepad']; $mailbox = $_GET['mailbox']; $passed_id = $_GET['passed_id']; +$ent_id = $_GET['ent_id']; $messages = $_SESSION['messages']; if (!isset($passed_ent_id)) { $passed_ent_id = ''; } else { - $passed_ent_id = $_GET['passed_ent_id']; + $passed_ent_id = $_GET['passed_ent_id']; } /* end globals */ - $mailbox = decodeHeader($mailbox); global $uid_support; diff --git a/src/read_body.php b/src/read_body.php index 137a19fd..b74b0584 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -632,6 +632,13 @@ elseif (isset($_POST['passed_id'])) { $passed_id = $_POST['passed_id']; } +if (isset($_GET['passed_ent_id'])) { + $passed_ent_id = $_GET['passed_ent_id']; +} +elseif (isset($_POST['passed_ent_id'])) { + $passed_ent_id = $_POST['passed_ent_id']; +} + if (isset($_GET['sendreceipt'])) { $sendreceipt = $_GET['sendreceipt']; } @@ -684,9 +691,15 @@ if (isset($_POST['move_id'])) { if (isset($_SESSION['lastTargetMailbox'])) { $lastTargetMailbox = $_SESSION['lastTargetMailbox']; } +if (isset($_SESSION['messages'])) { + $messages = $_SESSION['messages']; +} else { + $messages = array(); +} -/* end of get globals */ + +/* end of get globals */ global $uid_support, $sqimap_capabilities; if (isset($mailbox)) { @@ -696,10 +709,6 @@ if (isset($mailbox)) { $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $mbx_response = sqimap_mailbox_select($imapConnection, $mailbox, false, false, true); -if (!isset($messages)) { - $messages = array(); - sqsession_register($messages,'messages'); -} /** * $message contains all information about the message @@ -716,15 +725,11 @@ if (!isset($messages[$uidvalidity][$passed_id]) || !$uid_support) { $FirstTimeSee = !$message->is_seen; $message->is_seen = true; $messages[$uidvalidity][$passed_id] = $message; - sqsession_register($messages, 'messages'); } else { // $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); $message = $messages[$uidvalidity][$passed_id]; $FirstTimeSee = !$message->is_seen; } -//$FirstTimeSee = !$message->is_seen; -//$message->is_seen = true; -//$messages[$uidvalidity][$passed_id] = $message; if (isset($passed_ent_id) && $passed_ent_id) { $message = $message->getEntity($passed_ent_id); @@ -825,12 +830,11 @@ if ($attachmentsdisplay) { } echo ''; - /* show attached images inline -- if pref'fed so */ if (($attachment_common_show_images) && is_array($attachment_common_show_images_list)) { foreach ($attachment_common_show_images_list as $img) { - $imgurl = '../src/download.php' . + $imgurl = SM_PATH . 'src/download.php' . '?' . 'passed_id=' . urlencode($img['passed_id']) . '&mailbox=' . urlencode($mailbox) . @@ -848,8 +852,11 @@ if (($attachment_common_show_images) && do_hook('read_body_bottom'); do_hook('html_bottom'); -//$message->clean_up(); sqimap_logout($imapConnection); +/* sessions are written at the end of the script. it's better to register + them at the end so we avoid double session_register calls */ +sqsession_register($messages,'messages'); + ?>