X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=3f0f0bbe8ebf805a98678772dd46d978ec841249;hb=9d9430d6b34c5157d887bbfdbcfba6b17a48acd3;hp=42670eae7593dd09c1df445f092356a5e17ca76c;hpb=77b88425285b73a8670c8fc8c1a6f5fc113a1906;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 42670eae..3f0f0bbe 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -139,22 +139,8 @@ function printer_friendly_link() { } function ServerMDNSupport( $read ) { - - $num = 0; - $resp = ''; - while ($num < count($read) ) { - $resp .= $read[$num]; - $num++; - } - $read[] = split(' * ', $resp); - $num = 0; - $ret = FALSE; - while ( !$ret && $num < count($read) ) { - if ( ereg('PERMANENTFLAGS', $read[$num] ) ) { - $ret = ( ereg('mdnsent',strtolower($read[$num]) ) || ereg("\\\*", $read[$num] ) ); - } - $num++; - } + /* escaping $ doesn't work -> \x36 */ + $ret = preg_match( '/(\x36MDNSent|\\\*)/i', $read ); return ( $ret ); } @@ -162,9 +148,7 @@ function SendMDN ( $recipient , $sender) { global $imapConnection, $mailbox, $username, $attachment_dir, $SERVER_NAME, $version, $attachments, $identity, $data_dir, $passed_id; - $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); - $header = $message->header; - + $header = sqimap_get_message_header($imapConnection, $passed_id, $mailbox); $hashed_attachment_dir = getHashedDir($username, $attachment_dir); // part 1 (RFC2298) @@ -178,10 +162,13 @@ function SendMDN ( $recipient , $sender) { $subject = $header->subject; $now = getLongDateString( time() ); - $body = sprintf( _("This message sent on %s to %s with subject \"%s\" has been displayed on %s."), - $senton, $to, $subject, $now ) . + + $body = _("Your message") . "\r\n\r\n" . + "\t" . _("To:") . ' ' . $to . "\r\n" . + "\t" . _("Subject:") . ' ' . $subject . "\r\n" . + "\t" . _("Sent:") . ' ' . $senton . "\r\n" . "\r\n" . - _("This is no guarantee that the message has been read or understood.") . "\r\n"; + sprintf( _("Was displayed on %s"), $now ); // part2 (RFC2298) @@ -213,25 +200,18 @@ function SendMDN ( $recipient , $sender) { $MDN_to = trim($recipient); $reply_id = 0; - return (SendMessage($MDN_to,'','',"Read: $subject", $body,$reply_id, True, 3) ); + return (SendMessage($MDN_to,'','', _("Read:") . ' ' . $subject, $body,$reply_id, True, 3) ); } function ToggleMDNflag ( $set ) { - global $imapConnection, $passed_id, $mailbox; - - if ( $set ) { - $sg = '+'; - - } else { - $sg = '-'; - } - - $cmd = 'STORE ' . $passed_id . ' ' . $cmd . 'FLAGS ($MDNSent)'; sqimap_mailbox_select($imapConnection, $mailbox); - $read = sqimap_run_command ($imapConnection, $cmd, true, $response, $readmessage); - + + $sg = $set?'+':'-'; + $cmd = 'STORE ' . $passed_id . ' ' . $sg . 'FLAGS ($MDNSent)'; + $read = sqimap_run_command ($imapConnection, $cmd, true, $response, + $readmessage); } function ClearAttachments() { @@ -260,8 +240,11 @@ function ClearAttachments() { $passed_id */ +if ( isset( $mailbox ) ) { + $mailbox = urldecode( $mailbox ); +} $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); -$read = sqimap_mailbox_select($imapConnection, $mailbox); +$read = sqimap_mailbox_select($imapConnection, $mailbox, false, false, true); do_hook('html_top'); @@ -271,7 +254,7 @@ do_hook('html_top'); if( $default_use_mdn && ( $mdn_user_support = getPref($data_dir, $username, 'mdn_user_support', $default_use_mdn) ) ) { - $supportMDN = ServerMDNSupport($read); + $supportMDN = ServerMDNSupport($read["PERMANENTFLAGS"]); $flags = sqimap_get_flags ($imapConnection, $passed_id); $FirstTimeSee = !(in_array( 'Seen', $flags )); } @@ -510,6 +493,9 @@ if (isset ($message->header->cc[0]) && trim($message->header->cc[0])) { } } } +else { + $cc_string = ''; +} /** FORMAT THE BCC STRING **/ $i = 0; @@ -551,6 +537,9 @@ if (isset ($message->header->bcc[0]) && trim($message->header->bcc[0])){ } } } +else { + $bcc_string = ''; +} if ($default_use_priority) { $priority_level = substr($message->header->priority,0,1); @@ -611,7 +600,11 @@ if ($where && $what) { echo _("Delete") . ' '; if (($mailbox == $draft_folder) && ($save_as_draft)) { echo '| ". + "src/compose.php?mailbox=$mailbox&send_to=$to_string&send_to_cc=$cc_string&send_to_bcc=$bcc_string&subject=$url_subj&draft_id=$passed_id&ent_num=$ent_num\""; + if ($compose_new_win == '1') { + echo 'TARGET="compose_window" onClick="comp_in_new()"'; + } + echo '>'. _("Resume Draft") . ''; } @@ -648,17 +641,29 @@ echo '' . '' . '" . + ."mailbox=$urlMailbox&ent_num=$ent_num\""; + if ($compose_new_win == '1') { + echo 'TARGET="compose_window" onClick="comp_in_new()"'; + } + echo '>'. _("Forward") . ' | ' . '" . + "reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\""; + if ($compose_new_win == '1') { + echo 'TARGET="compose_window" onClick="comp_in_new()"'; + } + echo '>'. _("Reply") . ' | ' . '" . + "reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\""; + if ($compose_new_win == '1') { + echo 'TARGET="compose_window" onClick="comp_in_new()"'; + } + echo '>'. _("Reply All") . ' ' . '' . @@ -724,7 +729,7 @@ echo "