Przeglądaj źródła

- 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)

jangliss 15 lat temu
rodzic
commit
3dc0e61960

+ 3 - 0
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)
 --------------------------------------

+ 6 - 1
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;
 }

+ 13 - 13
plugins/spamcop/options.php

@@ -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

+ 1 - 1
po/squirrelmail.pot

@@ -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"

+ 1 - 0
src/compose.php

@@ -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 */