Changeset 2852 in subversion
- Timestamp:
- Aug 10, 2009 5:32:44 PM (4 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/main.inc (modified) (3 diffs)
-
program/steps/mail/compose.inc (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r2849 r2852 2 2 =========================== 3 3 4 - Added 'message_compose' hook 4 5 - Added 'imap_connect' hook (#1485956) 5 6 - Fix vcard_attachments plugin (#1486035) -
trunk/roundcubemail/program/include/main.inc
r2825 r2852 546 546 */ 547 547 function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL) 548 {548 { 549 549 global $OUTPUT; 550 550 $value = NULL; … … 583 583 else 584 584 return $value; 585 } 585 } 586 587 /** 588 * Convert array of request parameters (prefixed with _) 589 * to a regular array with non-prefixed keys. 590 * 591 * @param int Source to get value from (GPC) 592 * @return array Hash array with all request parameters 593 */ 594 function request2param($mode = RCUBE_INPUT_GPC) 595 { 596 $out = array(); 597 $src = $mode == RCUBE_INPUT_GET ? $_GET : ($mode == RCUBE_INPUT_POST ? $_POST : $_REQUEST); 598 foreach ($src as $key => $value) { 599 $fname = $key[0] == '_' ? substr($key, 1) : $key; 600 $out[$fname] = get_input_value($key, $mode); 601 } 602 603 return $out; 604 } 586 605 587 606 /** … … 959 978 $args = func_get_args(); 960 979 961 if (class_exists('rcmail', false)) 962 rcmail::get_instance()->plugins->exec_hook('console', $args); 980 if (class_exists('rcmail', false)) { 981 $rcmail = rcmail::get_instance(); 982 if (is_object($rcmail->plugins)) 983 $rcmail->plugins->exec_hook('console', $args); 984 } 963 985 964 986 $msg = array(); -
trunk/roundcubemail/program/steps/mail/compose.inc
r2788 r2852 39 39 $_SESSION['compose'] = array( 40 40 'id' => uniqid(rand()), 41 'param' => array_map('strip_tags', $_GET),41 'param' => request2param(RCUBE_INPUT_GET), 42 42 'mailbox' => $IMAP->get_mailbox_name(), 43 43 ); 44 44 45 45 // process values like "mailto:foo@bar.com?subject=new+message&cc=another" 46 if ($_SESSION['compose']['param'][' _to']) {47 $mailto = explode('?', $_SESSION['compose']['param'][' _to']);46 if ($_SESSION['compose']['param']['to']) { 47 $mailto = explode('?', $_SESSION['compose']['param']['to']); 48 48 if (count($mailto) > 1) { 49 $_SESSION['compose']['param'][' _to'] = $mailto[0];49 $_SESSION['compose']['param']['to'] = $mailto[0]; 50 50 parse_str($mailto[1], $query); 51 51 foreach ($query as $f => $val) 52 $_SESSION['compose']['param']["_$f"] = $val; 53 } 54 } 52 $_SESSION['compose']['param'][$f] = $val; 53 } 54 } 55 56 // pipe compose parameters thru plugins 57 $plugin = $RCMAIL->plugins->exec_hook('message_compose', $_SESSION['compose']); 58 $_SESSION['compose']['param'] = $plugin['param']; 55 59 56 60 // redirect to a unique URL with all parameters stored in session … … 72 76 73 77 // get reference message and set compose mode 74 if ($msg_uid = $_SESSION['compose']['param'][' _reply_uid'])78 if ($msg_uid = $_SESSION['compose']['param']['reply_uid']) 75 79 $compose_mode = RCUBE_COMPOSE_REPLY; 76 else if ($msg_uid = $_SESSION['compose']['param'][' _forward_uid'])80 else if ($msg_uid = $_SESSION['compose']['param']['forward_uid']) 77 81 $compose_mode = RCUBE_COMPOSE_FORWARD; 78 else if ($msg_uid = $_SESSION['compose']['param'][' _uid'])82 else if ($msg_uid = $_SESSION['compose']['param']['uid']) 79 83 $compose_mode = RCUBE_COMPOSE_EDIT; 80 else if ($msg_uid = $_SESSION['compose']['param'][' _draft_uid']) {84 else if ($msg_uid = $_SESSION['compose']['param']['draft_uid']) { 81 85 $RCMAIL->imap->set_mailbox($CONFIG['drafts_mbox']); 82 86 $compose_mode = RCUBE_COMPOSE_DRAFT; … … 99 103 $_SESSION['compose']['references'] = trim($MESSAGE->headers->references . " " . $MESSAGE->headers->messageID); 100 104 101 if (!empty($_SESSION['compose']['param'][' _all']))105 if (!empty($_SESSION['compose']['param']['all'])) 102 106 $MESSAGE->reply_all = 1; 103 107 } … … 139 143 case 'to': 140 144 $fname = '_to'; 141 $header = 'to';145 $header = $param = 'to'; 142 146 143 147 // we have a set of recipients stored is session 144 if (($mailto_id = $_SESSION['compose']['param'][' _mailto']) && $_SESSION['mailto'][$mailto_id])148 if (($mailto_id = $_SESSION['compose']['param']['mailto']) && $_SESSION['mailto'][$mailto_id]) 145 149 $fvalue = urldecode($_SESSION['mailto'][$mailto_id]); 146 150 … … 149 153 { 150 154 $fname = '_cc'; 151 $header = 'cc';155 $header = $param = 'cc'; 152 156 } 153 157 case 'bcc': … … 155 159 { 156 160 $fname = '_bcc'; 157 $header = 'bcc';161 $header = $param = 'bcc'; 158 162 } 159 163 … … 165 169 case 'reply-to': 166 170 $fname = '_replyto'; 171 $param = 'replyto'; 167 172 $allow_attrib = array('id', 'class', 'style', 'size', 'tabindex'); 168 173 $field_type = 'html_inputfield'; … … 170 175 } 171 176 172 if ($fname && !empty($_POST[$fname])) 177 if ($fname && !empty($_POST[$fname])) { 173 178 $fvalue = get_input_value($fname, RCUBE_INPUT_POST, TRUE); 174 else if ($fname && !$fvalue && !empty($_SESSION['compose']['param'][$fname])) 175 $fvalue = $_SESSION['compose']['param'][$fname]; 176 else if ($header && $compose_mode == RCUBE_COMPOSE_REPLY) 177 { 179 } 180 else if ($fname && !$fvalue && !empty($_SESSION['compose']['param'][$param])) { 181 $fvalue = $_SESSION['compose']['param'][$param]; 182 } 183 else if ($header && $compose_mode == RCUBE_COMPOSE_REPLY) { 178 184 // get recipent address(es) out of the message headers 179 185 if ($header=='to' && !empty($MESSAGE->headers->replyto)) … … 299 305 300 306 // add signature to array 301 if (!empty($sql_arr['signature']) && empty($_SESSION['compose']['param'][' _nosig']))307 if (!empty($sql_arr['signature']) && empty($_SESSION['compose']['param']['nosig'])) 302 308 { 303 309 $a_signatures[$identity_id]['text'] = $sql_arr['signature']; … … 369 375 { 370 376 $body = get_input_value('_message', RCUBE_INPUT_POST, true); 377 } 378 else if ($_SESSION['compose']['param']['body']) 379 { 380 $body = $_SESSION['compose']['param']['body']; 381 $isHtml = false; 371 382 } 372 383 else if ($compose_mode) … … 393 404 $body = rcmail_create_draft_body($body, $isHtml); 394 405 } 395 else if (!empty($_SESSION['compose']['param'][' _body']))396 { 397 $body = $_SESSION['compose']['param'][' _body'];406 else if (!empty($_SESSION['compose']['param']['body'])) 407 { 408 $body = $_SESSION['compose']['param']['body']; 398 409 } 399 410 … … 720 731 $subject = $MESSAGE->subject; 721 732 } 722 else if (!empty($_SESSION['compose']['param'][' _subject'])) {723 $subject = $_SESSION['compose']['param'][' _subject'];733 else if (!empty($_SESSION['compose']['param']['subject'])) { 734 $subject = $_SESSION['compose']['param']['subject']; 724 735 } 725 736
Note: See TracChangeset
for help on using the changeset viewer.
