X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fempty_trash.php;h=279af75eaac657ce58fdcb86035153e5f5b4f3ac;hb=56b52934be8ce6632aec987b6530036dccdd71d7;hp=caed2019673792fcd03caa5ce4f1b7746fc2d39e;hpb=a11899fdca21f02f1d4270c70ce74a07a7712237;p=squirrelmail.git diff --git a/src/empty_trash.php b/src/empty_trash.php index caed2019..279af75e 100644 --- a/src/empty_trash.php +++ b/src/empty_trash.php @@ -1,60 +1,57 @@ -"; - exit; - } - - - /** GET FOLDER ARRAY OF TRASH SUBFOLDERS **/ - fputs($imapConnection, "1 list \"\" *\n"); - $str = imapReadData($imapConnection); - - for ($i = 0;$i < count($str); $i++) { - $box = Chop($str[$i]); - $mailbox = findMailboxName($box); - - if (strpos($box, $trash_folder) > 0) { - $folders[$i] = $mailbox; - } else { - $folders[$i] = "NOPE"; +"; - removeFolder($imapConnection, $trash); + // Now create the nodes for subfolders of the parent folder + // You can tell that it is a subfolder by tacking the mailbox delimiter + // on the end of the $mailbox string, and compare to that. + $j = 0; + for ($i = 0;$i < count($boxes);$i++) { + if (substr($boxes[$i]["unformatted"], 0, strlen($mailbox . $dm)) == ($mailbox . $dm)) { + addChildNodeToTree($boxes[$i]["unformatted"], $boxes[$i]["unformatted-dm"], $foldersTree); } } + + // now lets go through the tree and delete the folders + walkTreeInPreOrderEmptyTrash(0, $imap_stream, $foldersTree); - createFolder($imapConnection, "user.$username.$trash_folder"); - - // Log out this session - fputs($imapConnection, "1 logout"); - - echo ""; - displayPageHeader($mailbox); + $location = get_location(); + header ("Location: $location/left_main.php"); - messages_deleted_message($mailbox, $sort, $startMessage); -?> + sqimap_logout($imap_stream); +?> \ No newline at end of file