Changeset 8fa58e7 in github for program/steps/mail/get.inc
- Timestamp:
- May 17, 2008 1:46:43 PM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 26539d5f
- Parents:
- e2f958c
- File:
-
- 1 edited
-
program/steps/mail/get.inc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/steps/mail/get.inc
r47124c22 r8fa58e7 6 6 | | 7 7 | This file is part of the RoundCube Webmail client | 8 | Copyright (C) 2005-200 7, RoundCube Dev. - Switzerland |8 | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 24 24 25 25 // show loading page 26 if ($_GET['_preload']) 27 { 26 if (!empty($_GET['_preload'])) { 28 27 $url = str_replace('&_preload=1', '', $_SERVER['REQUEST_URI']); 29 28 $message = rcube_label('loadingdata'); … … 35 34 "\n</body>\n</html>"; 36 35 exit; 37 }36 } 38 37 39 38 40 39 // similar code as in program/steps/mail/show.inc 41 if ($_GET['_uid']) 42 { 43 $MESSAGE = array('UID' => get_input_value('_uid', RCUBE_INPUT_GET)); 44 $MESSAGE['structure'] = $IMAP->get_structure($MESSAGE['UID']); 45 $MESSAGE['parts'] = $IMAP->get_mime_numbers($MESSAGE['structure']); 46 } 40 if (!empty($_GET['_uid'])) { 41 $RCMAIL->config->set('prefer_html', true); 42 $MESSAGE = new rcube_message(get_input_value('_uid', RCUBE_INPUT_GET)); 43 } 47 44 48 45 49 46 // show part page 50 if ($_GET['_frame']) 51 { 47 if (!empty($_GET['_frame'])) { 52 48 $OUTPUT->send('messagepart'); 53 49 exit; 54 }50 } 55 51 56 else if ($pid = get_input_value('_part', RCUBE_INPUT_GET)) 57 { 58 if ($part = $MESSAGE['parts'][$pid]) 59 { 52 else if ($pid = get_input_value('_part', RCUBE_INPUT_GET)) { 53 if ($part = $MESSAGE->mime_parts[$pid]) { 60 54 $ctype_primary = strtolower($part->ctype_primary); 61 55 $ctype_secondary = strtolower($part->ctype_secondary); … … 68 62 69 63 // send download headers 70 if ($_GET['_download']) 71 { 64 if ($_GET['_download']) { 72 65 header("Cache-Control: private", false); 73 66 header("Content-Type: application/octet-stream"); 74 }67 } 75 68 else 76 69 header("Content-Type: $mimetype"); 77 70 78 71 // We need to set the following headers to make downloads work using IE in HTTPS mode. 79 if (isset($_SERVER['HTTPS'])) 80 { 72 if (isset($_SERVER['HTTPS'])) { 81 73 header('Pragma: '); 82 74 header('Cache-Control: '); 83 }75 } 84 76 85 77 // deliver part content 86 if ($ctype_primary=='text' && $ctype_secondary=='html') 87 { 78 if ($ctype_primary == 'text' && $ctype_secondary == 'html') { 88 79 // we have to analyze the whole structure again to find inline objects 80 /* what was this good for again ? 89 81 list($new_parts, $new_attachments) = 90 82 rcmail_parse_message($MESSAGE['structure'], … … 97 89 if ($all_parts[$partix]->mime_id == $pid) 98 90 $part = &$all_parts[$partix]; 91 */ 99 92 100 93 // get part body if not available 101 94 if (!$part->body) 102 $part->body = $ IMAP->get_message_part($MESSAGE['UID'], $part->mime_id, $part);95 $part->body = $MESSAGE->get_part_content($part->mime_id); 103 96 104 97 $OUTPUT = new rcube_html_page(); 105 $OUTPUT->write(rcmail_print_body($part, intval($_GET['_safe']))); 106 } 107 else 108 { 98 $OUTPUT->write(rcmail_print_body($part, $MESSAGE->is_safe)); 99 } 100 else { 109 101 header(sprintf('Content-Disposition: %s; filename="%s";', 110 102 $_GET['_download'] ? 'attachment' : 'inline', … … 112 104 113 105 // turn off output buffering and print part content 114 $IMAP->get_message_part($MESSAGE ['UID'], $part->mime_id, $part, true);115 }106 $IMAP->get_message_part($MESSAGE->uid, $part->mime_id, $part, true); 107 } 116 108 117 109 exit; 118 }119 110 } 111 } 120 112 121 113 // print message 122 else 123 { 124 $ctype_primary = strtolower($MESSAGE['structure']->ctype_primary); 125 $ctype_secondary = strtolower($MESSAGE['structure']->ctype_secondary); 126 $mimetype = sprintf('%s/%s', $ctype_primary, $ctype_secondary); 127 114 else { 128 115 // send correct headers for content type 129 116 header("Content-Type: text/html"); 130 131 $cont = '';132 list($MESSAGE['parts']) = rcmail_parse_message($MESSAGE['structure'],133 array('safe' => intval($_GET['_safe']),134 'get_url' => $GET_URL.'&_part=%s'));135 117 136 118 $cont = "<html>\n<head><title></title>\n</head>\n<body>"; … … 142 124 143 125 exit; 144 }126 } 145 127 146 128
Note: See TracChangeset
for help on using the changeset viewer.
