Changeset 543 in subversion for trunk/roundcubemail/program/steps/mail/sendmail.inc
- Timestamp:
- Apr 28, 2007 2:07:12 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/sendmail.inc
r525 r543 6 6 | | 7 7 | This file is part of the RoundCube Webmail client | 8 | Copyright (C) 2005 , RoundCube Dev. - Switzerland|8 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 40 40 function rcmail_get_identity($id) 41 41 { 42 global $DB, $ CHARSET, $OUTPUT;42 global $DB, $OUTPUT; 43 43 44 44 // get identity record … … 56 56 $name = strpos($sql_arr['name'], ",") ? '"'.$sql_arr['name'].'"' : $sql_arr['name']; 57 57 $out['string'] = sprintf('%s <%s>', 58 rcube_charset_convert($name, $CHARSET, $OUTPUT->get_charset()),58 rcube_charset_convert($name, RCMAIL_CHARSET, $OUTPUT->get_charset()), 59 59 $sql_arr['mailto']); 60 60 return $out; … … 111 111 $img_file = $INSTALL_PATH . '/' . $searchstr . $image_name; 112 112 if(! $mime_message->addHTMLImage($img_file, 'image/gif', '', true, '_' . $image_name)) 113 { 114 show_message("emoticonerror", 'error'); 115 } 113 $OUTPUT->show_message("emoticonerror", 'error'); 114 116 115 array_push($included_images, $image_name); 117 116 } … … 133 132 // remove all scripts and act as called in frame 134 133 $OUTPUT->reset(); 135 $ _framed = TRUE;134 $OUTPUT->framed = TRUE; 136 135 137 136 … … 141 140 if (!$savedraft && empty($_POST['_to']) && empty($_POST['_subject']) && $_POST['_message']) 142 141 { 143 show_message("sendingfailed", 'error');144 rcube_iframe_response();142 $OUTPUT->show_message("sendingfailed", 'error'); 143 $OUTPUT->send('iframe'); 145 144 return; 146 145 } … … 169 168 // compose headers array 170 169 $headers = array('Date' => date('D, j M Y H:i:s O'), 171 'From' => rcube_charset_convert($identity_arr['string'], $CHARSET, $message_charset),170 'From' => rcube_charset_convert($identity_arr['string'], RCMAIL_CHARSET, $message_charset), 172 171 'To' => $mailto); 173 172 … … 305 304 mb_internal_encoding($message_charset); 306 305 $mb_subject = mb_encode_mimeheader($headers['Subject'], $message_charset, 'Q'); 307 mb_internal_encoding( $CHARSET);306 mb_internal_encoding(RCMAIL_CHARSET); 308 307 } 309 308 … … 335 334 // log error 336 335 if (!$sent) 337 { 338 raise_error(array('code' => 800, 339 'type' => 'smtp', 340 'line' => __LINE__, 341 'file' => __FILE__, 336 raise_error(array('code' => 800, 'type' => 'smtp', 'line' => __LINE__, 'file' => __FILE__, 342 337 'message' => "SMTP error: ".join("\n", $smtp_response)), TRUE, FALSE); 343 }344 338 } 345 339 … … 369 363 if (!$sent) 370 364 { 371 show_message("sendingfailed", 'error');372 rcube_iframe_response();365 $OUTPUT->show_message("sendingfailed", 'error'); 366 $OUTPUT->send('iframe'); 373 367 return; 374 368 } … … 410 404 if (!$saved) 411 405 { 412 raise_error(array('code' => 800, 413 'type' => 'imap', 414 'file' => __FILE__, 406 raise_error(array('code' => 800, 'type' => 'imap', 'file' => __FILE__, 415 407 'message' => "Could not save message in $CONFIG[$store_target]"), TRUE, FALSE); 416 408 417 show_message('errorsaving', 'error');418 rcube_iframe_response($errorout);409 $OUTPUT->show_message('errorsaving', 'error'); 410 $OUTPUT->send('iframe'); 419 411 } 420 412 … … 427 419 // raise error if deletion of old draft failed 428 420 if (!$deleted) 429 raise_error(array('code' => 800, 430 'type' => 'imap', 431 'file' => __FILE__, 421 raise_error(array('code' => 800, 'type' => 'imap', 'file' => __FILE__, 432 422 'message' => "Could not delete message from ".$CONFIG['drafts_mbox']), TRUE, FALSE); 433 423 } … … 436 426 if ($savedraft) 437 427 { 438 // clear the "saving message" busy status, and display success 439 show_message('messagesaved', 'confirmation'); 440 441 // update "_draft_saveid" on the page, which is used to delete a previous draft 442 $frameout = "var foundid = parent.rcube_find_object('_draft_saveid', parent.document);\n"; 443 $frameout .= sprintf("foundid.value = '%s';\n", str_replace(array('<','>'), "", $message_id)); 444 445 // update the "cmp_hash" to prevent "Unsaved changes" warning 446 $frameout .= sprintf("parent.%s.cmp_hash = parent.%s.compose_field_hash();\n", $JS_OBJECT_NAME, $JS_OBJECT_NAME); 428 // display success 429 $OUTPUT->show_message('messagesaved', 'confirmation'); 430 431 // update "_draft_saveid" and the "cmp_hash" to prevent "Unsaved changes" warning 432 $OUTPUT->command('set_draft_id', str_replace(array('<','>'), "", $message_id)); 433 $OUTPUT->command('compose_field_hash', true); 447 434 448 435 // start the auto-save timer again 449 $frameout .= sprintf("parent.%s.auto_save_start();", $JS_OBJECT_NAME); 450 451 // send html page with JS calls as response 452 rcube_iframe_response($frameout); 436 $OUTPUT->command('auto_save_start'); 437 438 $OUTPUT->send('iframe'); 453 439 } 454 440 else … … 456 442 if ($CONFIG['smtp_log']) 457 443 { 458 $log_entry = sprintf("[%s] User: %d on %s; Message for %s; %s\n", 459 date("d-M-Y H:i:s O", mktime()), 460 $_SESSION['user_id'], 461 $_SERVER['REMOTE_ADDR'], 462 $mailto, 463 !empty($smtp_response) ? join('; ', $smtp_response) : ''); 444 $log_entry = sprintf( 445 "[%s] User: %d on %s; Message for %s; %s\n", 446 date("d-M-Y H:i:s O", mktime()), 447 $_SESSION['user_id'], 448 $_SERVER['REMOTE_ADDR'], 449 $mailto, 450 !empty($smtp_response) ? join('; ', $smtp_response) : ''); 464 451 465 452 if ($fp = @fopen($CONFIG['log_dir'].'/sendmail', 'a')) … … 471 458 472 459 rcmail_compose_cleanup(); 473 rcube_iframe_response(sprintf("parent.$JS_OBJECT_NAME.sent_successfully('%s');",474 JQ(rcube_label('messagesent'))));460 $OUTPUT->command('sent_successfully', rcube_label('messagesent')); 461 $OUTPUT->send('iframe'); 475 462 } 476 463
Note: See TracChangeset
for help on using the changeset viewer.
