$composesession = $session;
sqsession_register($composesession,'composesession');
}
-if (!isset($compose_messages)) {
- $compose_messages = array();
-}
-
-if (!isset($compose_messages[$session]) || ($compose_messages[$session] == NULL)) {
+if (!empty($compose_messages[$session])) {
+ $composeMessage = $compose_messages[$session];
+} else {
$composeMessage = new Message();
$rfc822_header = new Rfc822Header();
$composeMessage->rfc822_header = $rfc822_header;
$composeMessage->reply_rfc822_header = '';
- $compose_messages[$session] = $composeMessage;
-} else {
- $composeMessage=$compose_messages[$session];
}
// re-add attachments that were already in this message
* of language interface.
*/
set_my_charset();
- $composeMessage = $compose_messages[$session];
if (! deliverMessage($composeMessage, true)) {
showInputForm($session);
exit();
}
$body = $newBody;
- $composeMessage=$compose_messages[$session];
-
$Result = deliverMessage($composeMessage);
if ($Result)
}
if (isset($delete) && is_array($delete)) {
- $composeMessage = $compose_messages[$session];
foreach($delete as $index) {
if (!empty($composeMessage->entities) && isset($composeMessage->entities[$index])) {
$composeMessage->entities[$index]->purgeAttachments();
$new_entities[] = $entity;
}
$composeMessage->entities = $new_entities;
- $compose_messages[$session] = $composeMessage;
}
showInputForm($session);
} else {
function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $session='') {
global $editor_size, $default_use_priority, $body, $idents,
$use_signature, $data_dir, $username,
- $key, $imapServerAddress, $imapPort, $compose_messages,
+ $key, $imapServerAddress, $imapPort,
$composeMessage, $body_quote, $request_mdn, $request_dr,
$mdn_user_support, $languages, $squirrelmail_language,
$default_charset;
default:
break;
}
- $compose_messages[$session] = $composeMessage;
- sqsession_register($compose_messages, 'compose_messages');
+//FIXME: we used to register $compose_messages in the session here, but not any more - so do we still need the session_write_close() and sqimap_logout() here? We probably need the IMAP logout, but what about the session closure?
session_write_close();
sqimap_logout($imapConnection);
}
$from_htmladdr_search, $location_of_buttons, $attachment_dir,
$username, $data_dir, $identity, $idents, $delete_draft,
$mailprio, $compose_new_win, $saved_draft, $mail_sent, $sig_first,
- $compose_messages, $composesession, $default_charset,
+ $composeMessage, $composesession, $default_charset,
$compose_onsubmit, $oTemplate, $oErrorHandler;
if (checkForJavascript()) {
$onfocus_array = array();
}
- $composeMessage = $compose_messages[$session];
if ($values) {
$send_to = $values['send_to'];
$send_to_cc = $values['send_to_cc'];
/* True if FAILURE */
function saveAttachedFiles($session) {
- global $compose_messages, $username, $attachment_dir;
+ global $composeMessage, $username, $attachment_dir;
/* get out of here if no file was attached at all */
if (! is_uploaded_file($_FILES['attachfile']['tmp_name']) ) {
return true;
}
}
- $message = $compose_messages[$session];
$type = strtolower($_FILES['attachfile']['type']);
$name = $_FILES['attachfile']['name'];
- $message->initAttachment($type, $name, $localfilename);
- $compose_messages[$session] = $message;
+ $composeMessage->initAttachment($type, $name, $localfilename);
}
/* parse values like 8M and 2k into bytes */