- Fix error with SpamCop reporting plugin not being able to send report as
authorjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 20 Jun 2010 16:58:46 +0000 (16:58 +0000)
committerjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 20 Jun 2010 16:58:46 +0000 (16:58 +0000)
    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
plugins/spamcop/functions.php
plugins/spamcop/options.php
po/squirrelmail.pot
src/compose.php

index ff9a78c6ed96118bc8f1ee3bcc06fe416048e6d9..f9b4d179657ff144081941776538656114a99b6c 100644 (file)
@@ -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)
 --------------------------------------
index 2379a8fb55722d9212f8a8403911d0f98008bc1f..85cccf49f7acabe02ad5553514aaae55a0539e23 100644 (file)
@@ -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;
 }
index 55e9c0454741d38dd9163cef64ebafdee5edf49d..77a55f54771924c0fe27095e2111a198f42352d8 100755 (executable)
@@ -117,19 +117,19 @@ spamcop_load_function();
                     echo ">"._("Quick email-based reporting");
                     echo '</option>';
                 }
-              ?>
-              <option value="thorough_email"
-                <?php
-                  if ($spamcop_method == 'thorough_email') echo ' selected="selected"';
-                  echo ">"._("Thorough email-based reporting");
-                ?>
-              </option>
-              <option value="web_form"
-                <?php
-                  if ($spamcop_method == 'web_form') echo ' selected="selected"';
-                  echo ">"._("Web-based form");
-                ?>
-              </option>
+                   $selected = '';
+                   if ($spamcop_method == 'thorough_email') {
+                       $selected = ' selected';
+                   }
+                   echo sprintf('            <option value="thorough_email"%s>%s</option>',$selected, _("Through email-based reporting"));
+                   
+                   $selected = '';
+                   if ($spamcop_method == 'web_form') {
+                       $selected = ' selected';
+                   }
+                   echo sprintf('            <option value="web_form"%s>%s</option>', $selected, _("Web-based form"));
+                
+            ?>
             </select>
             <input type="hidden" name="action" value="meth" />
             <?php
index 01f71843a6ab735c303996b8a178fb7640ff6d14..fad1460be9c14248c741068fab17d700c04f1730 100644 (file)
@@ -3763,7 +3763,7 @@ msgstr ""
 msgid "Quick email-based reporting"
 msgstr ""
 
-msgid "Thorough email-based reporting"
+msgid "Through email-based reporting"
 msgstr ""
 
 msgid "Web-based form"
index 25beaec8f7f3bb1d152bc9be5971082e3aacdbf4..0f746c9b30b0abe3c13a7ffa45312427021777d6 100644 (file)
@@ -483,6 +483,7 @@ if ($send) {
             $_FILES['attachfile']['tmp_name'] != 'none') {
         $AttachFailure = saveAttachedFiles($session);
     }
+    
     if (checkInput(false) && !isset($AttachFailure)) {
         if ($mailbox == "All Folders") {
             /* We entered compose via the search results page */