From 7dfb1fba5001299300736e6b5d95d9400575e3e7 Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Thu, 18 Sep 2008 14:59:02 -0400 Subject: [PATCH] Set the right number of arguments for setcookie() --- program/steps/mail/show.inc | 37 +++++++++++++++++++++++++++---------- 1 files changed, 27 insertions(+), 10 deletions(-) diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index 8b6ce58..0b15c98 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -32,19 +32,16 @@ // go back to list if message not found (wrong UID) if (empty($MESSAGE->headers)) { $OUTPUT->show_message('messageopenerror', 'error'); - if ($RCMAIL->action=='preview' && template_exists('messagepreview')) + if ($RCMAIL->action=='preview' && $OUTPUT->template_exists('messagepreview')) $OUTPUT->send('messagepreview'); else { - $RCMAIL->action = 'list'; + rcmail_overwrite_action(''); return; } } $mbox_name = $IMAP->get_mailbox_name(); - // calculate Etag for this request - $etag = md5($MESSAGE->uid.$mbox_name.session_id().intval($MESSAGE->headers->mdn_sent).intval($MESSAGE->is_safe).intval($PRINT_MODE)); - // check known senders to display images if (!$MESSAGE->is_safe && !empty($MESSAGE->sender['mailto']) @@ -56,6 +53,9 @@ $MESSAGE->set_safe(true); } } + + // calculate Etag for this request + $etag = md5($MESSAGE->uid.$mbox_name.session_id().intval($MESSAGE->headers->mdn_sent).intval($MESSAGE->is_safe).intval($PRINT_MODE)); // allow caching, unless remote images are present if ((bool)$MESSAGE->is_safe) @@ -80,15 +80,21 @@ $OUTPUT->set_env('uid', $MESSAGE->uid); $OUTPUT->set_env('safemode', $MESSAGE->is_safe); $OUTPUT->set_env('sender', $MESSAGE->sender['string']); + $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name))); // check for unset disposition notification - if ($MESSAGE->headers->mdn_to && !$MESSAGE->headers->mdn_sent && - $mbox_name != $CONFIG['drafts_mbox'] && $mbox_name != $CONFIG['sent_mbox']) + if ($MESSAGE->headers->mdn_to && + !$MESSAGE->headers->mdn_sent && + $IMAP->check_permflag('MDNSENT') && + $mbox_name != $CONFIG['drafts_mbox'] && + $mbox_name != $CONFIG['sent_mbox']) { if (intval($CONFIG['mdn_requests']) === 1) { if (rcmail_send_mdn($MESSAGE->uid)) $OUTPUT->show_message('receiptsent', 'confirmation'); + else + $OUTPUT->show_message('errorsendingreceipt', 'error'); } else if (empty($CONFIG['mdn_requests'])) { @@ -147,6 +153,15 @@ $ol .= html::tag('li', null, sprintf("%s (%s)", Q($attach_prop->filename), Q(show_bytes($attach_prop->size)))); } else { + if (rc_strlen($attach_prop->filename) > 50) { + $filename = abbreviate_string($attach_prop->filename, 50); + $title = $attach_prop->filename; + } + else { + $filename = $attach_prop->filename; + $title = ''; + } + $ol .= html::tag('li', null, html::a(array( 'href' => $MESSAGE->get_part_url($attach_prop->mime_id), @@ -155,8 +170,9 @@ JS_OBJECT_NAME, $attach_prop->mime_id, $attach_prop->mimetype), + 'title' => Q($title), ), - Q($attach_prop->filename))); + Q($filename))); } } @@ -191,12 +207,13 @@ $OUTPUT->add_handlers(array( 'messageattachments' => 'rcmail_message_attachments', + 'mailboxname' => 'rcmail_mailbox_name_display', 'blockedobjects' => 'rcmail_remote_objects_msg')); -if ($RCMAIL->action=='print' && template_exists('printmessage')) +if ($RCMAIL->action=='print' && $OUTPUT->template_exists('printmessage')) $OUTPUT->send('printmessage'); -else if ($RCMAIL->action=='preview' && template_exists('messagepreview')) +else if ($RCMAIL->action=='preview' && $OUTPUT->template_exists('messagepreview')) $OUTPUT->send('messagepreview'); else $OUTPUT->send('message'); -- Gitblit v1.9.1