Changeset 5521 in subversion
- Timestamp:
- Dec 1, 2011 6:06:27 AM (18 months ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 5 edited
-
include/rcmail.php (modified) (1 diff)
-
include/rcube_session.php (modified) (1 diff)
-
steps/mail/compose.inc (modified) (40 diffs)
-
steps/mail/func.inc (modified) (1 diff)
-
steps/mail/sendmail.inc (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcmail.php
r5418 r5521 1229 1229 // before closing the database connection, write session data 1230 1230 if ($_SERVER['REMOTE_ADDR'] && is_object($this->session)) { 1231 $this->session->cleanup();1232 1231 session_write_close(); 1233 1232 } -
trunk/roundcubemail/program/include/rcube_session.php
r5414 r5521 322 322 foreach ($this->gc_handlers as $fct) 323 323 call_user_func($fct); 324 }325 326 327 /**328 * Cleanup session data before saving329 */330 public function cleanup()331 {332 // current compose information is stored in $_SESSION['compose'], move it to $_SESSION['compose_data_<ID>']333 if ($compose_id = $_SESSION['compose']['id']) {334 $_SESSION['compose_data_'.$compose_id] = $_SESSION['compose'];335 $this->remove('compose');336 }337 324 } 338 325 -
trunk/roundcubemail/program/steps/mail/compose.inc
r5427 r5521 26 26 define('RCUBE_COMPOSE_EDIT', 0x0109); 27 27 28 $MESSAGE_FORM = NULL; 29 $MESSAGE = NULL; 30 31 $COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GET); 32 $_SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID]; 28 $MESSAGE_FORM = null; 29 $MESSAGE = null; 30 $COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GET); 31 $COMPOSE = null; 32 33 if ($COMPOSE_ID && $_SESSION['compose_data_'.$COMPOSE_ID]) 34 $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID]; 33 35 34 36 // give replicated session storage some time to synchronize 35 37 $retries = 0; 36 while ($COMPOSE_ID && !is_array($ _SESSION['compose']) && $RCMAIL->db->is_replicated() && $retries++ < 5) {38 while ($COMPOSE_ID && !is_array($COMPOSE) && $RCMAIL->db->is_replicated() && $retries++ < 5) { 37 39 usleep(500000); 38 40 $RCMAIL->session->reload(); 39 $_SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID]; 41 if ($_SESSION['compose_data_'.$COMPOSE_ID]) 42 $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID]; 40 43 } 41 44 42 45 // Nothing below is called during message composition, only at "new/forward/reply/draft" initialization or 43 46 // if a compose-ID is given (i.e. when the compose step is opened in a new window/tab). 44 if (!is_array($ _SESSION['compose']))47 if (!is_array($COMPOSE)) 45 48 { 46 49 // Infinite redirect prevention in case of broken session (#1487028) … … 50 53 'message' => "Invalid compose ID"), true, true); 51 54 52 $_SESSION['compose'] = array( 53 'id' => uniqid(mt_rand()), 54 'param' => request2param(RCUBE_INPUT_GET), 55 $COMPOSE_ID = uniqid(mt_rand()); 56 $_SESSION['compose_data_'.$COMPOSE_ID] = array( 57 'id' => $COMPOSE_ID, 58 'param' => request2param(RCUBE_INPUT_GET), 55 59 'mailbox' => $IMAP->get_mailbox_name(), 56 60 ); 61 $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID]; 57 62 58 63 // process values like "mailto:foo@bar.com?subject=new+message&cc=another" 59 if ($ _SESSION['compose']['param']['to']) {64 if ($COMPOSE['param']['to']) { 60 65 // #1486037: remove "mailto:" prefix 61 $ _SESSION['compose']['param']['to'] = preg_replace('/^mailto:/i', '', $_SESSION['compose']['param']['to']);62 $mailto = explode('?', $ _SESSION['compose']['param']['to']);66 $COMPOSE['param']['to'] = preg_replace('/^mailto:/i', '', $COMPOSE['param']['to']); 67 $mailto = explode('?', $COMPOSE['param']['to']); 63 68 if (count($mailto) > 1) { 64 $ _SESSION['compose']['param']['to'] = $mailto[0];69 $COMPOSE['param']['to'] = $mailto[0]; 65 70 parse_str($mailto[1], $query); 66 71 foreach ($query as $f => $val) 67 $ _SESSION['compose']['param'][$f] = $val;72 $COMPOSE['param'][$f] = $val; 68 73 } 69 74 } 70 75 71 76 // select folder where to save the sent message 72 $ _SESSION['compose']['param']['sent_mbox'] = $RCMAIL->config->get('sent_mbox');77 $COMPOSE['param']['sent_mbox'] = $RCMAIL->config->get('sent_mbox'); 73 78 74 79 // pipe compose parameters thru plugins 75 $plugin = $RCMAIL->plugins->exec_hook('message_compose', $ _SESSION['compose']);76 $ _SESSION['compose']['param'] = array_merge($_SESSION['compose']['param'], $plugin['param']);80 $plugin = $RCMAIL->plugins->exec_hook('message_compose', $COMPOSE); 81 $COMPOSE['param'] = array_merge($COMPOSE['param'], $plugin['param']); 77 82 78 83 // add attachments listed by message_compose hook … … 101 106 if ($attachment['status'] && !$attachment['abort']) { 102 107 unset($attachment['data'], $attachment['status'], $attachment['abort']); 103 $ _SESSION['compose']['attachments'][$attachment['id']] = $attachment;108 $COMPOSE['attachments'][$attachment['id']] = $attachment; 104 109 } 105 110 } … … 107 112 108 113 // check if folder for saving sent messages exists and is subscribed (#1486802) 109 if ($sent_folder = $ _SESSION['compose']['param']['sent_mbox']) {114 if ($sent_folder = $COMPOSE['param']['sent_mbox']) { 110 115 rcmail_check_sent_folder($sent_folder, true); 111 116 } 112 117 113 118 // redirect to a unique URL with all parameters stored in session 114 $OUTPUT->redirect(array('_action' => 'compose', '_id' => $ _SESSION['compose']['id']));119 $OUTPUT->redirect(array('_action' => 'compose', '_id' => $COMPOSE['id'])); 115 120 } 116 121 … … 122 127 'fileuploaderror'); 123 128 124 $OUTPUT->set_env('compose_id', $COMPOSE _ID);129 $OUTPUT->set_env('compose_id', $COMPOSE['id']); 125 130 126 131 // add config parameters to client script … … 136 141 137 142 // get reference message and set compose mode 138 if ($msg_uid = $ _SESSION['compose']['param']['draft_uid']) {143 if ($msg_uid = $COMPOSE['param']['draft_uid']) { 139 144 $RCMAIL->imap->set_mailbox($CONFIG['drafts_mbox']); 140 145 $compose_mode = RCUBE_COMPOSE_DRAFT; 141 146 } 142 else if ($msg_uid = $ _SESSION['compose']['param']['reply_uid'])147 else if ($msg_uid = $COMPOSE['param']['reply_uid']) 143 148 $compose_mode = RCUBE_COMPOSE_REPLY; 144 else if ($msg_uid = $ _SESSION['compose']['param']['forward_uid'])149 else if ($msg_uid = $COMPOSE['param']['forward_uid']) 145 150 $compose_mode = RCUBE_COMPOSE_FORWARD; 146 else if ($msg_uid = $ _SESSION['compose']['param']['uid'])151 else if ($msg_uid = $COMPOSE['param']['uid']) 147 152 $compose_mode = RCUBE_COMPOSE_EDIT; 148 153 … … 176 181 if ($compose_mode == RCUBE_COMPOSE_REPLY) 177 182 { 178 $ _SESSION['compose']['reply_uid'] = $msg_uid;179 $ _SESSION['compose']['reply_msgid'] = $MESSAGE->headers->messageID;180 $ _SESSION['compose']['references'] = trim($MESSAGE->headers->references . " " . $MESSAGE->headers->messageID);181 182 if (!empty($ _SESSION['compose']['param']['all']))183 $MESSAGE->reply_all = $ _SESSION['compose']['param']['all'];183 $COMPOSE['reply_uid'] = $msg_uid; 184 $COMPOSE['reply_msgid'] = $MESSAGE->headers->messageID; 185 $COMPOSE['references'] = trim($MESSAGE->headers->references . " " . $MESSAGE->headers->messageID); 186 187 if (!empty($COMPOSE['param']['all'])) 188 $MESSAGE->reply_all = $COMPOSE['param']['all']; 184 189 185 190 $OUTPUT->set_env('compose_mode', 'reply'); 186 191 187 192 // Save the sent message in the same folder of the message being replied to 188 if ($RCMAIL->config->get('reply_same_folder') && ($sent_folder = $ _SESSION['compose']['mailbox'])193 if ($RCMAIL->config->get('reply_same_folder') && ($sent_folder = $COMPOSE['mailbox']) 189 194 && rcmail_check_sent_folder($sent_folder, false) 190 195 ) { 191 $ _SESSION['compose']['param']['sent_mbox'] = $sent_folder;196 $COMPOSE['param']['sent_mbox'] = $sent_folder; 192 197 } 193 198 } … … 200 205 201 206 if ($info['type'] == 'reply') 202 $ _SESSION['compose']['reply_uid'] = $info['uid'];207 $COMPOSE['reply_uid'] = $info['uid']; 203 208 else if ($info['type'] == 'forward') 204 $ _SESSION['compose']['forward_uid'] = $info['uid'];205 206 $ _SESSION['compose']['mailbox'] = $info['folder'];209 $COMPOSE['forward_uid'] = $info['uid']; 210 211 $COMPOSE['mailbox'] = $info['folder']; 207 212 208 213 // Save the sent message in the same folder of the message being replied to … … 210 215 && rcmail_check_sent_folder($sent_folder, false) 211 216 ) { 212 $ _SESSION['compose']['param']['sent_mbox'] = $sent_folder;217 $COMPOSE['param']['sent_mbox'] = $sent_folder; 213 218 } 214 219 } 215 220 216 221 if ($MESSAGE->headers->in_reply_to) 217 $ _SESSION['compose']['reply_msgid'] = '<'.$MESSAGE->headers->in_reply_to.'>';218 219 $ _SESSION['compose']['references'] = $MESSAGE->headers->references;222 $COMPOSE['reply_msgid'] = '<'.$MESSAGE->headers->in_reply_to.'>'; 223 224 $COMPOSE['references'] = $MESSAGE->headers->references; 220 225 } 221 226 else if ($compose_mode == RCUBE_COMPOSE_FORWARD) 222 227 { 223 $ _SESSION['compose']['forward_uid'] = $msg_uid;228 $COMPOSE['forward_uid'] = $msg_uid; 224 229 $OUTPUT->set_env('compose_mode', 'forward'); 225 230 226 if (!empty($ _SESSION['compose']['param']['attachment']))231 if (!empty($COMPOSE['param']['attachment'])) 227 232 $MESSAGE->forward_attachment = true; 228 233 } … … 248 253 $MESSAGE->compose['from'] = get_input_value('_from', RCUBE_INPUT_POST); 249 254 } 250 else if (!empty($ _SESSION['compose']['param']['from'])) {251 $MESSAGE->compose['from'] = $ _SESSION['compose']['param']['from'];255 else if (!empty($COMPOSE['param']['from'])) { 256 $MESSAGE->compose['from'] = $COMPOSE['param']['from']; 252 257 } 253 258 else if (count($MESSAGE->identities)) { … … 341 346 342 347 // we have a set of recipients stored is session 343 if ($header == 'to' && ($mailto_id = $ _SESSION['compose']['param']['mailto'])344 && $ _SESSION['mailto'][$mailto_id]348 if ($header == 'to' && ($mailto_id = $COMPOSE['param']['mailto']) 349 && $COMPOSE[$mailto_id] 345 350 ) { 346 $fvalue = urldecode($ _SESSION['mailto'][$mailto_id]);351 $fvalue = urldecode($COMPOSE[$mailto_id]); 347 352 $decode_header = false; 348 353 } … … 350 355 $fvalue = get_input_value('_'.$header, RCUBE_INPUT_POST, TRUE); 351 356 } 352 else if (!empty($ _SESSION['compose']['param'][$header])) {353 $fvalue = $ _SESSION['compose']['param'][$header];357 else if (!empty($COMPOSE['param'][$header])) { 358 $fvalue = $COMPOSE['param'][$header]; 354 359 } 355 360 else if ($compose_mode == RCUBE_COMPOSE_REPLY) { … … 531 536 532 537 // add signature to array 533 if (!empty($sql_arr['signature']) && empty($ _SESSION['compose']['param']['nosig']))538 if (!empty($sql_arr['signature']) && empty($COMPOSE['param']['nosig'])) 534 539 { 535 540 $a_signatures[$identity_id]['text'] = $sql_arr['signature']; … … 585 590 function rcmail_prepare_message_body() 586 591 { 587 global $RCMAIL, $MESSAGE, $ compose_mode, $LINE_LENGTH, $HTML_MODE;592 global $RCMAIL, $MESSAGE, $COMPOSE, $compose_mode, $LINE_LENGTH, $HTML_MODE; 588 593 589 594 // use posted message body … … 592 597 $isHtml = (bool) get_input_value('_is_html', RCUBE_INPUT_POST); 593 598 } 594 else if ($ _SESSION['compose']['param']['body']) {595 $body = $ _SESSION['compose']['param']['body'];599 else if ($COMPOSE['param']['body']) { 600 $body = $COMPOSE['param']['body']; 596 601 $isHtml = false; 597 602 } … … 600 605 $isHtml = rcmail_compose_editor_mode(); 601 606 $body = ''; 602 if (empty($ _SESSION['compose']['attachments']))607 if (empty($COMPOSE['attachments'])) 603 608 rcmail_write_forward_attachment($MESSAGE); 604 609 } … … 663 668 if ($isHtml && preg_match('#<img src="\./program/blocked\.gif"#', $body)) { 664 669 if ($attachment = rcmail_save_image('program/blocked.gif', 'image/gif')) { 665 $ _SESSION['compose']['attachments'][$attachment['id']] = $attachment;670 $COMPOSE['attachments'][$attachment['id']] = $attachment; 666 671 $body = preg_replace('#\./program/blocked\.gif#', 667 $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$ _SESSION['compose']['id'],672 $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$COMPOSE['id'], 668 673 $body); 669 674 } … … 849 854 function rcmail_create_forward_body($body, $bodyIsHtml) 850 855 { 851 global $RCMAIL, $MESSAGE ;856 global $RCMAIL, $MESSAGE, $COMPOSE; 852 857 853 858 // add attachments 854 if (!isset($ _SESSION['compose']['forward_attachments']) && is_array($MESSAGE->mime_parts))859 if (!isset($COMPOSE['forward_attachments']) && is_array($MESSAGE->mime_parts)) 855 860 $cid_map = rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml); 856 861 … … 911 916 function rcmail_create_draft_body($body, $bodyIsHtml) 912 917 { 913 global $MESSAGE, $OUTPUT ;918 global $MESSAGE, $OUTPUT, $COMPOSE; 914 919 915 920 /** … … 917 922 * sizeof($MESSAGE->mime_parts can be 1 - e.g. attachment, but no text! 918 923 */ 919 if (empty($ _SESSION['compose']['forward_attachments'])924 if (empty($COMPOSE['forward_attachments']) 920 925 && is_array($MESSAGE->mime_parts) 921 926 && count($MESSAGE->mime_parts) > 0) … … 955 960 function rcmail_write_compose_attachments(&$message, $bodyIsHtml) 956 961 { 957 global $RCMAIL ;962 global $RCMAIL, $COMPOSE; 958 963 959 964 $cid_map = $messages = array(); … … 977 982 978 983 if (!$skip && ($attachment = rcmail_save_attachment($message, $pid))) { 979 $ _SESSION['compose']['attachments'][$attachment['id']] = $attachment;984 $COMPOSE['attachments'][$attachment['id']] = $attachment; 980 985 if ($bodyIsHtml && ($part->content_id || $part->content_location)) { 981 $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$ _SESSION['compose']['id'];986 $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$COMPOSE['id']; 982 987 if ($part->content_id) 983 988 $cid_map['cid:'.$part->content_id] = $url; … … 989 994 } 990 995 991 $ _SESSION['compose']['forward_attachments'] = true;996 $COMPOSE['forward_attachments'] = true; 992 997 993 998 return $cid_map; … … 997 1002 function rcmail_write_inline_attachments(&$message) 998 1003 { 999 global $RCMAIL ;1004 global $RCMAIL, $COMPOSE; 1000 1005 1001 1006 $cid_map = array(); … … 1003 1008 if (($part->content_id || $part->content_location) && $part->filename) { 1004 1009 if ($attachment = rcmail_save_attachment($message, $pid)) { 1005 $ _SESSION['compose']['attachments'][$attachment['id']] = $attachment;1006 $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$ _SESSION['compose']['id'];1010 $COMPOSE['attachments'][$attachment['id']] = $attachment; 1011 $url = $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'].'&_id='.$COMPOSE['id']; 1007 1012 if ($part->content_id) 1008 1013 $cid_map['cid:'.$part->content_id] = $url; … … 1019 1024 function rcmail_write_forward_attachment(&$message) 1020 1025 { 1021 global $RCMAIL ;1026 global $RCMAIL, $COMPOSE; 1022 1027 1023 1028 if (strlen($message->subject)) { … … 1046 1051 1047 1052 $attachment = array( 1048 'group' => $ _SESSION['compose']['id'],1053 'group' => $COMPOSE['id'], 1049 1054 'name' => $name, 1050 1055 'mimetype' => 'message/rfc822', … … 1058 1063 if ($attachment['status']) { 1059 1064 unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']); 1060 $ _SESSION['compose']['attachments'][$attachment['id']] = $attachment;1065 $COMPOSE['attachments'][$attachment['id']] = $attachment; 1061 1066 return true; 1062 1067 } else if ($path) { … … 1070 1075 function rcmail_save_attachment(&$message, $pid) 1071 1076 { 1077 global $COMPOSE; 1078 1072 1079 $rcmail = rcmail::get_instance(); 1073 1080 $part = $message->mime_parts[$pid]; … … 1090 1097 1091 1098 $attachment = array( 1092 'group' => $ _SESSION['compose']['id'],1099 'group' => $COMPOSE['id'], 1093 1100 'name' => $part->filename ? $part->filename : 'Part_'.$pid.'.'.$part->ctype_secondary, 1094 1101 'mimetype' => $part->ctype_primary . '/' . $part->ctype_secondary, … … 1113 1120 function rcmail_save_image($path, $mimetype='') 1114 1121 { 1122 global $COMPOSE; 1123 1115 1124 // handle attachments in memory 1116 1125 $data = file_get_contents($path); 1117 1126 1118 1127 $attachment = array( 1119 'group' => $ _SESSION['compose']['id'],1128 'group' => $COMPOSE['id'], 1120 1129 'name' => rcmail_basename($path), 1121 1130 'mimetype' => $mimetype ? $mimetype : rc_mime_content_type($path, $name), … … 1146 1155 function rcmail_compose_subject($attrib) 1147 1156 { 1148 global $MESSAGE, $ compose_mode;1149 1157 global $MESSAGE, $COMPOSE, $compose_mode; 1158 1150 1159 list($form_start, $form_end) = get_form_tags($attrib); 1151 1160 unset($attrib['form']); 1152 1161 1153 1162 $attrib['name'] = '_subject'; 1154 1163 $attrib['spellcheck'] = 'true'; … … 1179 1188 $subject = $MESSAGE->subject; 1180 1189 } 1181 else if (!empty($ _SESSION['compose']['param']['subject'])) {1182 $subject = $ _SESSION['compose']['param']['subject'];1183 } 1184 1190 else if (!empty($COMPOSE['param']['subject'])) { 1191 $subject = $COMPOSE['param']['subject']; 1192 } 1193 1185 1194 $out = $form_start ? "$form_start\n" : ''; 1186 1195 $out .= $textfield->show($subject); … … 1193 1202 function rcmail_compose_attachment_list($attrib) 1194 1203 { 1195 global $OUTPUT, $CONFIG ;1196 1204 global $OUTPUT, $CONFIG, $COMPOSE; 1205 1197 1206 // add ID if not given 1198 1207 if (!$attrib['id']) 1199 1208 $attrib['id'] = 'rcmAttachmentList'; 1200 1209 1201 1210 $out = "\n"; 1202 1211 $jslist = array(); 1203 1212 1204 if (is_array($_SESSION['compose']['attachments'])) 1205 { 1213 if (is_array($COMPOSE['attachments'])) { 1206 1214 if ($attrib['deleteicon']) { 1207 1215 $button = html::img(array( … … 1213 1221 $button = Q(rcube_label('delete')); 1214 1222 1215 foreach ($ _SESSION['compose']['attachments'] as $id => $a_prop)1223 foreach ($COMPOSE['attachments'] as $id => $a_prop) 1216 1224 { 1217 1225 if (empty($a_prop)) 1218 1226 continue; 1219 1227 1220 1228 $out .= html::tag('li', array('id' => 'rcmfile'.$id), 1221 1229 html::a(array( … … 1230 1238 1231 1239 if ($attrib['deleteicon']) 1232 $ _SESSION['compose']['deleteicon'] = $CONFIG['skin_path'] . $attrib['deleteicon'];1240 $COMPOSE['deleteicon'] = $CONFIG['skin_path'] . $attrib['deleteicon']; 1233 1241 if ($attrib['cancelicon']) 1234 1242 $OUTPUT->set_env('cancelicon', $CONFIG['skin_path'] . $attrib['cancelicon']); … … 1398 1406 function rcmail_store_target_selection($attrib) 1399 1407 { 1408 global $COMPOSE; 1409 1400 1410 $attrib['name'] = '_store_target'; 1401 1411 $select = rcmail_mailbox_select(array_merge($attrib, array( … … 1404 1414 'folder_rights' => 'w', 1405 1415 ))); 1406 return $select->show($ _SESSION['compose']['param']['sent_mbox'], $attrib);1416 return $select->show($COMPOSE['param']['sent_mbox'], $attrib); 1407 1417 } 1408 1418 … … 1430 1440 function get_form_tags($attrib) 1431 1441 { 1432 global $RCMAIL, $MESSAGE_FORM ;1442 global $RCMAIL, $MESSAGE_FORM, $COMPOSE; 1433 1443 1434 1444 $form_start = ''; … … 1437 1447 $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task)); 1438 1448 $hiddenfields->add(array('name' => '_action', 'value' => 'send')); 1439 $hiddenfields->add(array('name' => '_id', 'value' => $ _SESSION['compose']['id']));1449 $hiddenfields->add(array('name' => '_id', 'value' => $COMPOSE['id'])); 1440 1450 1441 1451 $form_start = empty($attrib['form']) ? $RCMAIL->output->form_tag(array('name' => "form", 'method' => "post")) : ''; -
trunk/roundcubemail/program/steps/mail/func.inc
r5509 r5521 1439 1439 $rcmail->plugins->exec_hook('attachments_cleanup', array('group' => $id)); 1440 1440 $rcmail->session->remove('compose_data_'.$id); 1441 $rcmail->session->remove('compose');1442 1441 } 1443 1442 -
trunk/roundcubemail/program/steps/mail/sendmail.inc
r5401 r5521 28 28 29 29 $COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GPC); 30 $ _SESSION['compose'] =$_SESSION['compose_data_'.$COMPOSE_ID];30 $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID]; 31 31 32 32 /****** checks ********/ 33 33 34 if (!isset($ _SESSION['compose']['id'])) {34 if (!isset($COMPOSE['id'])) { 35 35 raise_error(array('code' => 500, 'type' => 'php', 36 36 'file' => __FILE__, 'line' => __LINE__, … … 341 341 $headers['Mail-Followup-To'] = rcmail_email_input_format(get_input_value('_followupto', RCUBE_INPUT_POST, TRUE, $message_charset)); 342 342 } 343 if (!empty($ _SESSION['compose']['reply_msgid'])) {344 $headers['In-Reply-To'] = $ _SESSION['compose']['reply_msgid'];343 if (!empty($COMPOSE['reply_msgid'])) { 344 $headers['In-Reply-To'] = $COMPOSE['reply_msgid']; 345 345 } 346 346 347 347 // remember reply/forward UIDs in special headers 348 if (!empty($ _SESSION['compose']['reply_uid']) && $savedraft) {349 $headers['X-Draft-Info'] = array('type' => 'reply', 'uid' => $ _SESSION['compose']['reply_uid']);350 } 351 else if (!empty($ _SESSION['compose']['forward_uid']) && $savedraft) {352 $headers['X-Draft-Info'] = array('type' => 'forward', 'uid' => $ _SESSION['compose']['forward_uid']);353 } 354 355 if (!empty($ _SESSION['compose']['references'])) {356 $headers['References'] = $ _SESSION['compose']['references'];348 if (!empty($COMPOSE['reply_uid']) && $savedraft) { 349 $headers['X-Draft-Info'] = array('type' => 'reply', 'uid' => $COMPOSE['reply_uid']); 350 } 351 else if (!empty($COMPOSE['forward_uid']) && $savedraft) { 352 $headers['X-Draft-Info'] = array('type' => 'forward', 'uid' => $COMPOSE['forward_uid']); 353 } 354 355 if (!empty($COMPOSE['references'])) { 356 $headers['References'] = $COMPOSE['references']; 357 357 } 358 358 … … 375 375 376 376 if (is_array($headers['X-Draft-Info'])) { 377 $headers['X-Draft-Info'] = rcmail_draftinfo_encode($headers['X-Draft-Info'] + array('folder' => $ _SESSION['compose']['mailbox']));377 $headers['X-Draft-Info'] = rcmail_draftinfo_encode($headers['X-Draft-Info'] + array('folder' => $COMPOSE['mailbox'])); 378 378 } 379 379 if (!empty($CONFIG['useragent'])) { … … 415 415 // Check spelling before send 416 416 if ($CONFIG['spellcheck_before_send'] && $CONFIG['enable_spellcheck'] 417 && empty($ _SESSION['compose']['spell_checked']) && !empty($message_body)417 && empty($COMPOSE['spell_checked']) && !empty($message_body) 418 418 ) { 419 419 $spellchecker = new rcube_spellchecker(get_input_value('_lang', RCUBE_INPUT_GPC)); 420 420 $spell_result = $spellchecker->check($message_body, $isHtml); 421 421 422 $ _SESSION['compose']['spell_checked'] = true;422 $COMPOSE['spell_checked'] = true; 423 423 424 424 if (!$spell_result) { … … 459 459 // Check if we have enough memory to handle the message in it 460 460 // It's faster than using files, so we'll do this if we only can 461 if (is_array($ _SESSION['compose']['attachments']) && $CONFIG['smtp_server']461 if (is_array($COMPOSE['attachments']) && $CONFIG['smtp_server'] 462 462 && ($mem_limit = parse_bytes(ini_get('memory_limit')))) 463 463 { 464 464 $memory = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024; // safe value: 16MB 465 465 466 foreach ($ _SESSION['compose']['attachments'] as $id => $attachment)466 foreach ($COMPOSE['attachments'] as $id => $attachment) 467 467 $memory += $attachment['size']; 468 468 … … 528 528 529 529 // add stored attachments, if any 530 if (is_array($ _SESSION['compose']['attachments']))530 if (is_array($COMPOSE['attachments'])) 531 531 { 532 foreach ($ _SESSION['compose']['attachments'] as $id => $attachment) {532 foreach ($COMPOSE['attachments'] as $id => $attachment) { 533 533 // This hook retrieves the attachment contents from the file storage backend 534 534 $attachment = $RCMAIL->plugins->exec_hook('attachment_get', $attachment); … … 627 627 628 628 // set replied/forwarded flag 629 if ($ _SESSION['compose']['reply_uid'])630 $IMAP->set_flag($ _SESSION['compose']['reply_uid'], 'ANSWERED', $_SESSION['compose']['mailbox']);631 else if ($ _SESSION['compose']['forward_uid'])632 $IMAP->set_flag($ _SESSION['compose']['forward_uid'], 'FORWARDED', $_SESSION['compose']['mailbox']);629 if ($COMPOSE['reply_uid']) 630 $IMAP->set_flag($COMPOSE['reply_uid'], 'ANSWERED', $COMPOSE['mailbox']); 631 else if ($COMPOSE['forward_uid']) 632 $IMAP->set_flag($COMPOSE['forward_uid'], 'FORWARDED', $COMPOSE['mailbox']); 633 633 634 634 } // End of SMTP Delivery Block … … 730 730 $saved = $draftuids[0]; 731 731 } 732 $ _SESSION['compose']['param']['draft_uid'] = $saved;732 $COMPOSE['param']['draft_uid'] = $saved; 733 733 734 734 // display success
Note: See TracChangeset
for help on using the changeset viewer.
