Changeset 4604 in subversion for trunk/roundcubemail/program/steps/mail/compose.inc
- Timestamp:
- Mar 10, 2011 3:21:21 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/compose.inc
r4542 r4604 29 29 $MESSAGE = NULL; 30 30 31 $COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GET); 32 $_SESSION['compose'] = $_SESSION['compose_data'][$COMPOSE_ID]; 33 31 34 // Nothing below is called during message composition, only at "new/forward/reply/draft" initialization or 32 35 // if a compose-ID is given (i.e. when the compose step is opened in a new window/tab). 33 // Since there are many ways to leave the compose page improperly, it seems necessary to clean-up an old 34 // compose when a "new/forward/reply/draft" is called - otherwise the old session attachments will appear 35 36 $MESSAGE_ID = get_input_value('_id', RCUBE_INPUT_GET); 37 if (!is_array($_SESSION['compose']) || $_SESSION['compose']['id'] != $MESSAGE_ID) 38 { 39 rcmail_compose_cleanup(); 40 36 if (!is_array($_SESSION['compose'])) 37 { 41 38 // Infinite redirect prevention in case of broken session (#1487028) 42 if ($ MESSAGE_ID)39 if ($COMPOSE_ID) 43 40 raise_error(array('code' => 500, 'type' => 'php', 44 41 'file' => __FILE__, 'line' => __LINE__, … … 82 79 $filename = basename($attach); 83 80 $attachment = array( 81 'group' => $COMPOSE_ID, 84 82 'name' => $filename, 85 83 'mimetype' => rc_mime_content_type($attach, $filename), 86 'path' => $attach 84 'path' => $attach, 87 85 ); 88 86 } … … 116 114 'autocompletechars'); 117 115 116 $OUTPUT->set_env('compose_id', $COMPOSE_ID); 117 118 118 // add config parameters to client script 119 119 if (!empty($CONFIG['drafts_mbox'])) { … … 128 128 129 129 // get reference message and set compose mode 130 if ($msg_uid = $_SESSION['compose']['param']['reply_uid']) 130 if ($msg_uid = $_SESSION['compose']['param']['draft_uid']) { 131 $RCMAIL->imap->set_mailbox($CONFIG['drafts_mbox']); 132 $compose_mode = RCUBE_COMPOSE_DRAFT; 133 } 134 else if ($msg_uid = $_SESSION['compose']['param']['reply_uid']) 131 135 $compose_mode = RCUBE_COMPOSE_REPLY; 132 136 else if ($msg_uid = $_SESSION['compose']['param']['forward_uid']) … … 134 138 else if ($msg_uid = $_SESSION['compose']['param']['uid']) 135 139 $compose_mode = RCUBE_COMPOSE_EDIT; 136 else if ($msg_uid = $_SESSION['compose']['param']['draft_uid']) {137 $RCMAIL->imap->set_mailbox($CONFIG['drafts_mbox']);138 $compose_mode = RCUBE_COMPOSE_DRAFT;139 }140 140 141 141 $config_show_sig = $RCMAIL->config->get('show_sig', 1); … … 621 621 $_SESSION['compose']['attachments'][$attachment['id']] = $attachment; 622 622 $body = preg_replace('#\./program/blocked\.gif#', 623 $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'] ,623 $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$_SESSION['compose']['id'], 624 624 $body); 625 625 } … … 922 922 $_SESSION['compose']['attachments'][$attachment['id']] = $attachment; 923 923 if ($bodyIsHtml && ($part->content_id || $part->content_location)) { 924 $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'] ;924 $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$_SESSION['compose']['id']; 925 925 if ($part->content_id) 926 926 $cid_map['cid:'.$part->content_id] = $url; … … 947 947 if ($attachment = rcmail_save_attachment($message, $pid)) { 948 948 $_SESSION['compose']['attachments'][$attachment['id']] = $attachment; 949 $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'] ;949 $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$_SESSION['compose']['id']; 950 950 if ($part->content_id) 951 951 $cid_map['cid:'.$part->content_id] = $url; … … 981 981 982 982 $attachment = array( 983 'group' => $_SESSION['compose']['id'], 983 984 'name' => $part->filename ? $part->filename : 'Part_'.$pid.'.'.$part->ctype_secondary, 984 985 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, … … 1007 1008 1008 1009 $attachment = array( 1010 'group' => $_SESSION['compose']['id'], 1009 1011 'name' => rcmail_basename($path), 1010 1012 'mimetype' => $mimetype ? $mimetype : rc_mime_content_type($path, $name), … … 1324 1326 $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task)); 1325 1327 $hiddenfields->add(array('name' => '_action', 'value' => 'send')); 1328 $hiddenfields->add(array('name' => '_id', 'value' => $_SESSION['compose']['id'])); 1326 1329 1327 1330 $form_start = empty($attrib['form']) ? $RCMAIL->output->form_tag(array('name' => "form", 'method' => "post")) : '';
Note: See TracChangeset
for help on using the changeset viewer.
