X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fspamcop%2Fspamcop.php;h=83f57230348b034b0c5f8a36e424422f4bc5bb97;hb=0f610dca6fd52a148e290f79cdfcfc572998b475;hp=9dc4062a2e8128ad29236a844d675377aca7b952;hpb=2bd52bbe2f7a0b5d4875ebb1668b7e57bf4b9fc4;p=squirrelmail.git diff --git a/plugins/spamcop/spamcop.php b/plugins/spamcop/spamcop.php index 9dc4062a..83f57230 100644 --- a/plugins/spamcop/spamcop.php +++ b/plugins/spamcop/spamcop.php @@ -1,37 +1,42 @@ parent; } if ($response == 'OK') { - $subject = encodeHeader($message->rfc822_header->subject); array_shift($body_a); $body = implode('', $body_a) . "\r\n"; @@ -63,12 +68,16 @@ sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); sqgetGlobalVar('mailbox', $mailbox, SQ_GET); sqgetGlobalVar('passed_id', $passed_id, SQ_GET); +sqgetGlobalVar('js_web', $js_web, SQ_GET); if (! sqgetGlobalVar('startMessage', $startMessage, SQ_GET) ) { $startMessage = 1; } if (! sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET) ) { - $passed_ent_id = ''; + $passed_ent_id = 0; +} +if (! sqgetGlobalVar('js_web', $js_web, SQ_GET) ) { + $js_web = 0; } sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION); @@ -79,8 +88,14 @@ if(! sqgetGlobalVar('composesession', $composesession, SQ_SESSION) ) { } /* END GLOBALS */ - - displayPageHeader($color, $mailbox); +// js_web variable is 1 only when link opens web based report page in new window +// and in new window menu line or extra javascript code is not needed. +if ($js_web) { + displayHTMLHeader(_("SpamCop reporting")); + echo "\n"; +} else { + displayPageHeader($color,$mailbox); +} $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); @@ -109,7 +124,7 @@ if(! sqgetGlobalVar('composesession', $composesession, SQ_SESSION) ) { $message = sqimap_get_message($imap_stream, $passed_id, $mailbox); $composeMessage = getMessage_RFC822_Attachment($message, $composeMessage, $passed_id, - $passed_ent_id='', $imap_stream); + $passed_ent_id, $imap_stream); $compose_messages[$session] = $composeMessage; sqsession_register($compose_messages, 'compose_messages'); @@ -124,7 +139,7 @@ if(! sqgetGlobalVar('composesession', $composesession, SQ_SESSION) ) { echo "

"; -echo _("Sending this spam report will give you back a reply with URLs that you can click on to properly report this spam message to the proper authorities. This is a free service. By pressing the \"Send Spam Report\" button, you agree to follow SpamCop's rules/terms of service/etc."); +echo _("Sending this spam report will give you back a reply with URLs that you can click on to properly report this spam message to the proper authorities. This is a free service. By pressing the \"Send Spam Report\" button, you agree to follow SpamCop's rules/terms of service/etc."); echo "

"; ?> @@ -132,64 +147,64 @@ echo "

";
-
- - '; + echo '\n"; } else { ?> - - - - " /> + +"; } ?>
-
- - - - - - - - 50000) { +?> + + + + + + +\n"; +} else { + $spam_message = mime_fetch_body ($imap_stream, $passed_id, $passed_ent_id, 50000); + + if (strlen($spam_message) == 50000) { $Warning = "\n[truncated by SpamCop]\n"; - $Message = substr($Message, 0, 50000 - strlen($Warning)) . $Warning; + $spam_message = substr($spam_message, 0, 50000 - strlen($Warning)) . $Warning; + } + if ($spamcop_type=='member') { + $action_url="http://members.spamcop.net/sc"; + } else { + $action_url="http://www.spamcop.net/sc"; } if (isset($js_web) && $js_web) { -?> \n"; } else { -?> \n"; } ?> - - - - - - + + + + \n"; + } ?>
- +