put the send button back at the top
[squirrelmail.git] / src / empty_trash.php
index 1d177b551c7eea6e000f73f947c1358dc8cc0a1e..407f74f865824b056c9e0bb32b9740ec280c1adf 100644 (file)
@@ -5,19 +5,22 @@
    include("../functions/page_header.php");
    include("../functions/display_messages.php");
    include("../functions/imap.php");
+   include("../functions/array.php");
 
-   $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
+   include("../src/load_prefs.php");
 
-   getFolderList($imapConnection, $boxesFormatted, $boxesUnformatted, $boxesRaw);
+   $imapConnection = loginToImapServer($username, $key, $imapServerAddress, 0);
+
+   getFolderList($imapConnection, $boxes);
 
    $mailbox = $trash_folder;
    fputs($imapConnection, "1 LIST \"$mailbox\" *\n");
    $data = imapReadData($imapConnection , "1", false, $response, $message);
    while (substr($data[0], strpos($data[0], " ")+1, 4) == "LIST") {
-      for ($i = 0; $i < count($boxesUnformatted); $i++) {
-         if (($boxesUnformatted[$i] == $mailbox) ||
-             (substr($boxesUnformatted[$i], 0, strlen($mailbox . $dm)) == $mailbox . $dm)) {
-            removeFolder($imapConnection, "$boxesUnformatted[$i]");
+      for ($i = 0; $i < count($boxes); $i++) {
+         if (($boxes[$i]["UNFORMATTED"] == $mailbox) ||
+             (substr($boxes[$i]["UNFORMATTED"], 0, strlen($mailbox . $dm)) == $mailbox . $dm)) {
+            removeFolder($imapConnection, $boxes[$i]["UNFORMATTED"]);
          }
       }
       fputs($imapConnection, "1 LIST \"$mailbox\" *\n");