7b7ec043a66d59175e1a7d9f9e476b01b75ac8bd
1 <HTML
><BODY TEXT
="#000000" BGCOLOR
="#FFFFFF" LINK
="#0000EE" VLINK
="#0000EE" ALINK
="#0000EE">
3 include("../config/config.php");
4 include("../functions/strings.php");
5 include("../functions/page_header.php");
6 include("../functions/imap.php");
7 include("../functions/mailbox.php");
9 displayPageHeader("None");
11 echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
12 echo " <TR><TD BGCOLOR=DCDCDC ALIGN=CENTER>\n";
13 echo " <FONT FACE=\"Arial,Helvetica\">Folders</FONT>\n";
17 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
19 fputs($imapConnection, "1 list \"\" *\n");
20 $str = imapReadData($imapConnection);
22 for ($i = 0;$i < count($str); $i++
) {
23 $mailbox = Chop($str[$i]);
24 // find the quote at the begining of the mailbox name.
25 // i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
26 $mailbox = findMailboxName($mailbox);
27 $periodCount = countCharInString($mailbox, ".");
29 // indent the correct number of spaces.
30 for ($j = 0;$j < $periodCount;$j++
)
31 $boxes[$i] = "$boxes[$i] ";
33 $boxes[$i] = $boxes[$i] . readShortMailboxName($mailbox, ".");
34 $long_name_boxes[$i] = $mailbox;
37 /** DELETING FOLDERS **/
39 echo "<FORM ACTION=folders_delete.php METHOD=POST>\n";
40 echo "<SELECT NAME=mailbox><FONT FACE=\"Arial,Helvetica\">\n";
41 for ($i = 0; $i < count($str); $i++
) {
42 $thisbox = Chop($str[$i]);
43 $thisbox = findMailboxName($thisbox);
45 for ($p = 0; $p < count($special_folders); $p++
) {
46 if ($special_folders[$p] == $long_name_boxes[$i])
49 if ($use_folder == true)
50 echo " <OPTION>$thisbox\n";
53 echo "<INPUT TYPE=SUBMIT VALUE=Delete>\n";
56 /** CREATING FOLDERS **/
57 echo "<FORM ACTION=folders_create.php METHOD=POST>\n";
58 echo "<INPUT TYPE=TEXT SIZE=25 NAME=folder_name>\n";
59 echo " as a subfolder of ";
60 echo "<SELECT NAME=subfolder><FONT FACE=\"Arial,Helvetica\">\n";
61 for ($i = 0;$i < count($str); $i++
) {
62 $thisbox = Chop($str[$i]);
63 $thisbox = findMailboxName($thisbox);
64 $thisbox = getFolderNameMinusINBOX($thisbox);
65 echo "<OPTION>$thisbox\n";
68 echo "<INPUT TYPE=SUBMIT VALUE=Create>\n";
71 /** RENAMING FOLDERS **/
72 echo "<FORM ACTION=folders_rename.php METHOD=POST>\n";
73 echo "<SELECT NAME=folder_list><FONT FACE=\"Arial,Helvetica\">\n";
74 for ($i = 0; $i < count($str); $i++
) {
76 for ($p = 0; $p < count($special_folders); $p++
) {
77 if ($special_folders[$p] == $long_name_boxes[$i])
80 if ($use_folder == true)
81 echo " <OPTION>$boxes[$i]\n";
84 echo "<INPUT TYPE=TEXT SIZE=25 NAME=new_folder_name>\n";
85 echo "<INPUT TYPE=SUBMIT VALUE=Rename>\n";