- 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 ff9a78c..f9b4d17 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 2379a8f..85cccf4 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 55e9c04..77a55f5 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 01f7184..fad1460 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 25beaec..0f746c9 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 */