Moved the load_prefs include to before the dispayheader call, other wise Plugin prefs...
[squirrelmail.git] / src / folders.php
index db48ce95b952dd8083103128274d4eeaf71fca4a..80697f038eb46dd32182ae5a3e2b5b2ba23deef7 100644 (file)
@@ -73,6 +73,7 @@
    echo "</CENTER>";
    echo "</BODY></HTML>";
        
+   sqimap_logout($imapConnection);
    exit;
    }
 
@@ -92,9 +93,9 @@
            if (!sqimap_mailbox_exists ($imapConnection, $trash_folder)){
            echo _("Create Trash") . "<INPUT TYPE=checkbox NAME=trash_create value=true><br>\n";
            echo "<INPUT TYPE=submit VALUE=Create>";
-           echo "</FORM></TD></TR>\n";
            }
        }
+       echo "</FORM></TD></TR></TABLE>n";
    }
 
    /** DELETING FOLDERS **/
 
    for ($i = 0; $i < count($boxes); $i++) {
       if (count($boxes[$i]["flags"]) > 0) {
+         $noinf = false;
          for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
-            if ($boxes[$i]["flags"][$j] != "noinferiors") {
-               if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
-                  $box = $boxes[$i]["unformatted"];
-                  $box2 = replace_spaces($boxes[$i]["formatted"]);
-                  echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
-               } else {
-                  $box = $boxes[$i]["unformatted"];
-                  $box2 = replace_spaces($boxes[$i]["formatted"]);
-                  echo "<OPTION VALUE=\"$box\">$box2\n";
-               }
-            }   
+            if ($boxes[$i]["flags"][$j] == "noinferiors") {
+               $noinf = true;
+               continue;
+            }
          }    
+         if ($noinf == false) {
+            if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
+               $box = $boxes[$i]["unformatted"];
+               $box2 = replace_spaces($boxes[$i]["formatted"]);
+               echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
+            } else {
+               $box = $boxes[$i]["unformatted"];
+               $box2 = replace_spaces($boxes[$i]["formatted"]);
+               echo "<OPTION VALUE=\"$box\">$box2\n";
+            }
+         }
       } else {
          if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
             $box = $boxes[$i]["unformatted"];