You cannot delete special folders or their subfolders now
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 29 Nov 1999 17:07:33 +0000 (17:07 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 29 Nov 1999 17:07:33 +0000 (17:07 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@40 7612ce4b-ef26-0410-bec9-ea0150e637f0

config/config.php
src/folders.php

index 9048b0a..4cbbb46 100644 (file)
@@ -34,15 +34,14 @@ $trash_folder = "INBOX.Trash";
 $auto_expunge = true;
 
 /* Special Folders are folders that can't be manipulated like normal user created
-   folders can.  A couple of examples would be "INBOX", "INBOX.Trash".  We have
+   folders can.  A couple of examples would be "INBOX.Trash", "INBOX.Drafts".  We have
    them set to Netscape's default mailboxes, but this obviously can be changed.
    To add one, just add a new number to the array.
-*/
-$special_folders[0] = "INBOX";
-$special_folders[1] = "INBOX.Trash";
-$special_folders[2] = "INBOX.Sent";
-$special_folders[3] = "INBOX.Drafts";
-$special_folders[4] = "INBOX.Templates";
-
 
+   NOTE:   INBOX is handled separately.  Do not put it in this list
+*/
+$special_folders[0] = $trash_folder;
+$special_folders[1] = "INBOX.Sent";
+$special_folders[2] = "INBOX.Drafts";
+$special_folders[3] = "INBOX.Templates";
 ?>
index 99150b5..d453630 100644 (file)
    for ($i = 0; $i < count($boxesUnformatted); $i++) {
       $use_folder = true;
       for ($p = 0; $p < count($special_folders); $p++) {
-         if ($special_folders[$p] == $boxesUnformatted[$i])
+         if (substr($boxesUnformatted[$i], 0, strlen($special_folders[$p])) == $special_folders[$p]) {
             $use_folder = false;
+         }
       }
+      if ($boxesUnformatted[$i] == "INBOX")
+         $use_folder = false;
+
       if ($use_folder == true)
-         echo "   <OPTION>$boxesUnformatted[$i]\n";
+         echo "<OPTION>$boxesUnformatted[$i]\n";
    }
    echo "</SELECT>\n";
    echo "<INPUT TYPE=SUBMIT VALUE=Delete>\n";