}
session_unregister('session_expired_post');
session_unregister('session_expired');
+ if (!isset($mailbox)) {
+ $mailbox = '';
+ }
if ($compose_new_win == '1') {
compose_Header($color, $mailbox);
} else {
if (isset($draft)) {
include_once ('../src/draft_actions.php');
- if (! isset($reply_id)) {
- $reply_id = 0;
+ if (! isset($passed_id)) {
+ $passed_id = 0;
}
if (! isset($MDN)) {
$MDN = 'False';
if (! isset($mailprio)) {
$mailprio = '';
}
- if (!saveMessageAsDraft($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id, $mailprio, $session)) {
+ if (!saveMessageAsDraft($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $passed_id, $mailprio, $session)) {
showInputForm($session);
exit();
} else {
}
if (checkInput(false) && !isset($AttachFailure)) {
$urlMailbox = urlencode (trim($mailbox));
- if (! isset($reply_id)) {
- $reply_id = 0;
+ if (! isset($passed_id)) {
+ $passed_id = 0;
}
/*
* Set $default_charset to correspond with the user's selection
$MDN = False; // we are not sending a mdn response
if (! isset($mailprio)) {
$Result = sendMessage($send_to, $send_to_cc, $send_to_bcc,
- $subject, $body, $reply_id, $MDN, '', $session);
+ $subject, $body, $passed_id, $MDN, '', $session);
} else {
$Result = sendMessage($send_to, $send_to_cc, $send_to_bcc,
- $subject, $body, $reply_id, $MDN, $mailprio, $session);
+ $subject, $body, $passed_id, $MDN, $mailprio, $session);
}
if (! $Result) {
showInputForm($session);
unlink ($attached_file);
unset ($attachments[$index]);
}
+ setPref($data_dir, $username, 'attachments', serialize($attachments));
}
showInputForm($session);
-
-} elseif (isset($attachedmessages)) {
-
- /*
- * This handles the case if we attache message
- */
- if ($compose_new_win == '1') {
- compose_Header($color, $mailbox);
- } else {
- displayPageHeader($color, $mailbox);
- }
-
- $newmail = true;
-
- if (!isset($passed_ent_id)) $passed_ent_id = '';
- if (!isset($passed_id)) $passed_id = '';
- if (!isset($mailbox)) $mailbox = '';
- if (!isset($action)) $action = '';
-
- $values = newMail($mailbox,$passed_id,$passed_ent_id, $action, $session);
- /* in case the origin is not read_body.php */
- if (isset($send_to)) {
- $values['send_to'] = $send_to;
- }
- if (isset($send_to_cc)) {
- $values['send_to_cc'] = $send_cc;
- }
- if (isset($send_to_bcc)) {
- $values['send_to_bcc'] = $send_bcc;
- }
-
- showInputForm($session, $values);
} else {
/*
* This handles the default case as well as the error case
function getAttachments($message, $session, $passed_id, $entities, $imapConnection) {
- global $attachments, $attachment_dir, $username;
+ global $attachments, $attachment_dir, $username, $data_dir;
$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
if (!count($message->entities) ||
fclose ($fp);
$attachments[] = $newAttachment;
+ setPref($data_dir, $username, 'javascript_on', $js_pref);
}
} else {
for ($i = 0; $i < count($message->entities); $i++) {
/* True if FAILURE */
function saveAttachedFiles($session) {
- global $HTTP_POST_FILES, $attachment_dir, $attachments, $username;
+ global $HTTP_POST_FILES, $attachment_dir, $attachments, $username,
+ $data_dir;
$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
$localfilename = GenerateRandomString(32, '', 7);
return true;
}
} else {
-
if (!@copy($HTTP_POST_FILES['attachfile']['tmp_name'], $full_localfilename)) {
return true;
}
if ($newAttachment['type'] == "") {
$newAttachment['type'] = 'application/octet-stream';
}
-
$attachments[] = $newAttachment;
+ setPref($data_dir, $username, 'attachments', serialize($attachments));
}
function ClearAttachments($session)
{
- global $username, $attachments, $attachment_dir;
+ global $username, $attachments, $attachment_dir, $data_dir;
$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
$rem_attachments = array();
}
}
$attachments = $rem_attachments;
+ setPref($data_dir, $username, 'attachments', serialize($attachments));
}