if $key is set to false, sqimap_login() function will use sqauth_read_password()
[squirrelmail.git] / plugins / spamcop / functions.php
index 2a78c7955e21e88471074bfee5c525380d97fbd2..44c542ef7be10603b8b5551dc8617d2c7cfe3feb 100644 (file)
@@ -1,8 +1,9 @@
 <?php
+
 /**
  * SpamCop plugin - functions
  *
- * @copyright (c) 1999-2005 The SquirrelMail Project Team
+ * @copyright &copy; 1999-2006 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -92,7 +93,7 @@ function spamcop_show_link_function() {
     // Javascript is used only in web based reporting
     // don't insert javascript if javascript is disabled
     if ($spamcop_method == 'web_form' && $javascript_on) {
-?><script language="javascript" type="text/javascript">
+?><script type="text/javascript">
 document.write('<a href="../plugins/spamcop/spamcop.php?passed_id=<?php echo urlencode($passed_id); ?>&amp;js_web=1&amp;mailbox=<?php echo urlencode($mailbox); ?>&amp;passed_ent_id=<?php echo urlencode($passed_ent_id); ?>" target="_blank">');
 document.write("<?php echo _("Report as Spam"); ?>");
 document.write("</a>");
@@ -130,13 +131,12 @@ function spamcop_options_function() {
  */
 function spamcop_while_sending_function() {
     global $mailbox, $spamcop_delete, $spamcop_save, $spamcop_is_composing, $auto_expunge,
-           $username, $key, $imapServerAddress, $imapPort;
+           $username, $imapServerAddress, $imapPort;
 
     if (sqgetGlobalVar('spamcop_is_composing' , $spamcop_is_composing)) {
         // delete spam message
         if ($spamcop_delete) {
-            $imapConnection = sqimap_login($username, $key, $imapServerAddress,
-                $imapPort, 0);
+            $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
             sqimap_mailbox_select($imapConnection, $mailbox);
             sqimap_msgs_list_delete($imapConnection, $mailbox, array($spamcop_is_composing));
             if ($auto_expunge)
@@ -173,8 +173,9 @@ function spamcop_enable_disable($option,$disable_action,$enable_action) {
 /**
  * Stores message in attachment directory, when email based reports are used
  * @access private
+ * @todo Duplicate code in src/compose.php
  */
-function getMessage_RFC822_Attachment($message, $composeMessage, $passed_id,
+function spamcop_getMessage_RFC822_Attachment($message, $composeMessage, $passed_id,
                                       $passed_ent_id='', $imapConnection) {
     global $attachment_dir, $username;