소스 검색

Fixed a bug in deleting messages where it wouldn't delete the messages. Now
it does.

Luke Ehresman 25 년 전
부모
커밋
6fd6f33dcf
5개의 변경된 파일11개의 추가작업 그리고 15개의 파일을 삭제
  1. 0 2
      functions/imap.php
  2. 2 1
      functions/mailbox.php
  3. 6 6
      src/compose_send.php
  4. 1 1
      src/left_main.php
  5. 2 5
      src/move_messages.php

+ 0 - 2
functions/imap.php

@@ -91,7 +91,5 @@
       } else {
          setMessageFlag($imapConnection, $a, $b, "Deleted");
       }
-      if ($auto_expunge == true)
-         expungeBox($imapConnection, $mailbox, $numMessages);
    }
 ?>

+ 2 - 1
functions/mailbox.php

@@ -183,12 +183,13 @@
    function copyMessages($imapConnection, $from_id, $to_id, $folder) {
       fputs($imapConnection, "mailboxStore COPY $from_id:$to_id \"$folder\"\n");
       $read = fgets($imapConnection, 1024);
+      echo ">>> $read<BR>";
       while ((substr($read, 0, 15) != "mailboxStore OK") && (substr($read, 0, 15) != "mailboxStore NO")) {
          $read = fgets($imapConnection, 1024);
+         echo ">>> $read<BR>";
       }
 
       if (substr($read, 0, 15) == "mailboxStore NO") {
-         echo "ERROR... $read<BR>";
          return false;
       } else if (substr($read, 0, 15) == "mailboxStore OK") {
          return true;

+ 6 - 6
src/compose_send.php

@@ -7,7 +7,12 @@
    include("../functions/smtp.php");
    include("../functions/display_messages.php");
 
-   if ($passed_to == "") {
+   if ($passed_body == "") {
+      echo "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
+      displayPageHeader("None");
+      plain_error_message("You have not entered a message body.");
+      exit;
+   } else if ($passed_to == "") {
       echo "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
       displayPageHeader("None");
       plain_error_message("You have not filled in the \"To:\" field.");
@@ -22,11 +27,6 @@
       echo "</CENTER></FORM>\n";
 
       exit;
-
-      echo "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
-      displayPageHeader("None");
-      plain_error_message("Message NOT sent<BR><BR>You have not entered anything into the To: field.<BR>Press the BACK button on your browser");
-      exit;
    } else if ($passed_subject == "") {
       echo "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
       displayPageHeader("None");

+ 1 - 1
src/left_main.php

@@ -68,7 +68,7 @@
       if (($move_to_trash == true) && ($mailbox == $trash_folder)) {
          $urlMailbox = urlencode($mailbox);
          selectMailbox($imapConnection, $mailbox, $numNessages);
-         echo "</A>&nbsp;&nbsp;<B>(<A HREF=\"empty_trash.php?numMessages=$numMessages&mailbox=$urlMailbox\" TARGET=right>empty</A>)</B>";
+         echo "</A>&nbsp;&nbsp;&nbsp;&nbsp;(<B><A HREF=\"empty_trash.php?numMessages=$numMessages&mailbox=$urlMailbox\" TARGET=right style=\"text-decoration:none\">empty</A></B>)";
       }
       echo "</FONT></a><br>\n";
    }

+ 2 - 5
src/move_messages.php

@@ -7,9 +7,6 @@
    include("../functions/display_messages.php");
    include("../functions/imap.php");
 
-   for ($i = 0; $i < count($msg); $i++) {
-      echo "MSG: $msg[$i]<BR>";
-   }
 
    function putSelectedMessagesIntoString($msg) {
       $j = 0;
@@ -32,8 +29,7 @@
          $i++;
       }
    }
-   
-   
+
    $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
 
    // switch to the mailbox, and get the number of messages in it.
@@ -51,6 +47,7 @@
          //    loop because we never increment j.  so check to see if msg[0] is set or not to fix this.
          while ($j < count($msg)) {
             if ($msg[$i]) {
+               echo "MSG: $msg[$i]<BR>";
                deleteMessages($imapConnection, $msg[$i], $msg[$i], $numMessages, $trash_folder, $move_to_trash, $auto_expunge, $mailbox);
                $j++;
             }