Browse Source

* added the config option, auto_expunge
* added "empty trash" option

Luke Ehresman 26 years ago
parent
commit
6ffd1c7b59
5 changed files with 22 additions and 22 deletions
  1. 1 4
      BUG
  2. 1 14
      TODO
  3. 4 0
      config/config.php
  4. 8 2
      functions/mailbox.php
  5. 8 2
      functions/mailbox_display.php

+ 1 - 4
BUG

@@ -1,4 +1 @@
-KNOWN BUGS
-----------------------------------------
--  Subject in Nathan's INBOX message 757 is bad
--  There are no grid lines in IE on message list
+see bug manager

+ 1 - 14
TODO

@@ -1,15 +1,2 @@
-TODO
-------------
--  Don't view "deleted" messages
--  Write JavaScript for left side bar to auto log out on unload
--  Todo manager
--  Bug tracker
--  Moving messages to folders
--  Deleting messages (send to trash)
--  Expunge mailboxes
+see todo manager
 
-
-DONE
-------------
--  (nathan) Abstract header stuff so it can be used on all pages
--  (luke)   Genericize login page

+ 4 - 0
config/config.php

@@ -24,9 +24,13 @@ $version = "0.0.1";
  *         - This is the path to the default trash folder.  For Cyrus IMAP, it
  *           would be "INBOX.Trash", but for UW it would be "Trash".  We need the
  *           full path name here.
+ *   $auto_expunge
+ *         - If this is true, when a message is moved or copied, the source mailbox
+ *           will get expunged, removing all messages marked "Deleted".
  */
 
 $move_to_trash = true;
 $trash_folder = "INBOX.Trash";
+$auto_expunge = true;
 
 ?>

+ 8 - 2
functions/mailbox.php

@@ -48,8 +48,8 @@
       }
    }
 
-   function setMessageFlag($imapConnection, $i, $flag) {
-      fputs($imapConnection, "messageStore STORE $i:$i +FLAGS (\\$flag)\n");
+   function setMessageFlag($imapConnection, $i, $q, $flag) {
+      fputs($imapConnection, "messageStore STORE $i:$q +FLAGS (\\$flag)\n");
    }
 
    function getMessageFlags($imapConnection, $i, &$flags) {
@@ -146,4 +146,10 @@
       echo "UNKNOWN ERROR copying messages $from_id to $to_id to folder $folder.<BR>";
       return false;
    }
+
+   /** expunges a mailbox **/
+   function expungeBox($imapConnection, $mailbox) {
+      selectMailbox($imapConnection, $mailbox, $num);
+      fputs($imapConnection, "1 EXPUNGE\n");
+   }
 ?>

+ 8 - 2
functions/mailbox_display.php

@@ -31,6 +31,8 @@
     ** This function loops through a group of messages in the mailbox and shows them
     **/
    function showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort) {
+      include("../config/config.php");
+
       $j = 1;
       while ($j <= $numMessages) {
          $q = 0;
@@ -128,7 +130,9 @@
       /** The "DELETE" button */
       echo "<TR><TD BGCOLOR=DCDCDC>";
       echo "<FORM name=messageList method=post action=\"move_messages.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage\">";
-      echo "<INPUT TYPE=SUBMIT VALUE=\"Delete\"> selected messages";
+      echo "<NOBR><INPUT TYPE=SUBMIT VALUE=\"Delete Selected\">";
+      if (($move_to_trash == true) && ($mailbox == $trash_folder))
+         echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"empty_trash.php?numMessages=$numMessages&mailbox=$urlMailbox\">Empty Trash</A></NOBR>";
       echo "</TD></TR>";
 
       echo "<TR><TD BGCOLOR=DCDCDC>";
@@ -161,7 +165,9 @@
 
       /** The "DELETE" button */
       echo "<TR><TD BGCOLOR=DCDCDC>";
-      echo "<INPUT TYPE=SUBMIT VALUE=\"Delete\"> selected messages";
+      echo "<INPUT TYPE=SUBMIT VALUE=\"Delete Selected\">";
+      if (($move_to_trash == true) && ($mailbox == $trash_folder))
+         echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=\"empty_trash.php\">Empty Trash</A></NOBR>";
       echo "</TD></TR>";
 
       echo "</FORM></TABLE>\n";