From d887e067a0f745e8dc6eb327069d4189acd61a53 Mon Sep 17 00:00:00 2001 From: jangliss Date: Sun, 20 Jun 2010 16:58:46 +0000 Subject: [PATCH] - Fix error with SpamCop reporting plugin not being able to send report as emails (#1795310). - Fix typo in SpamCop plugin. - Tidy some output (slightly personal to stop Eclipse complaining about errors in the code) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13942 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- doc/ChangeLog | 3 +++ plugins/spamcop/functions.php | 7 ++++++- plugins/spamcop/options.php | 26 +++++++++++++------------- po/squirrelmail.pot | 2 +- src/compose.php | 1 + 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index ff9a78c6..f9b4d179 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -338,6 +338,9 @@ Version 1.5.2 - SVN - Added the ability to configure Google Mail (Gmail) as the mail server behind SquirrelMail. - Explicitly disable caching for left_main and right_main pages (#2983134). + - Fix error with SpamCop reporting plugin not being able to send report as + emails (#1795310). + - Fix typo in SpamCop plugin. Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/plugins/spamcop/functions.php b/plugins/spamcop/functions.php index 2379a8fb..85cccf49 100644 --- a/plugins/spamcop/functions.php +++ b/plugins/spamcop/functions.php @@ -180,6 +180,8 @@ function spamcop_enable_disable($option,$disable_action,$enable_action) { */ function spamcop_getMessage_RFC822_Attachment($message, $composeMessage, $passed_id, $passed_ent_id='', $imapConnection) { + + global $username, $attachment_dir; if (!$passed_ent_id) { $body_a = sqimap_run_command($imapConnection, @@ -197,11 +199,14 @@ function spamcop_getMessage_RFC822_Attachment($message, $composeMessage, $passed $body = implode('', $body_a) . "\r\n"; $filename = sq_get_attach_tempfile(); - $fp = fopen($filename, 'wb'); + $hashed_attachment_dir = getHashedDir($username, $attachment_dir); + + $fp = fopen("$hashed_attachment_dir/$filename", 'wb'); fwrite ($fp, $body); fclose($fp); $composeMessage->initAttachment('message/rfc822','email.txt', $filename); } + return $composeMessage; } diff --git a/plugins/spamcop/options.php b/plugins/spamcop/options.php index 55e9c045..77a55f54 100755 --- a/plugins/spamcop/options.php +++ b/plugins/spamcop/options.php @@ -117,19 +117,19 @@ spamcop_load_function(); echo ">"._("Quick email-based reporting"); echo ''; } - ?> - - + $selected = ''; + if ($spamcop_method == 'thorough_email') { + $selected = ' selected'; + } + echo sprintf(' ',$selected, _("Through email-based reporting")); + + $selected = ''; + if ($spamcop_method == 'web_form') { + $selected = ' selected'; + } + echo sprintf(' ', $selected, _("Web-based form")); + + ?>