0942ddbf19626a718d620892c6365cbee9fd63d3
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");
8 displayPageHeader("None");
10 echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
11 echo " <TR><TD BGCOLOR=DCDCDC ALIGN=CENTER>\n";
12 echo " <FONT FACE=\"Arial,Helvetica\">Folders</FONT>\n";
16 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
18 fputs($imapConnection, "1 list \"\" *\n");
19 $str = imapReadData($imapConnection);
21 for ($i = 0;$i < count($str); $i++
) {
22 $mailbox = Chop($str[$i]);
23 // find the quote at the begining of the mailbox name.
24 // i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
25 $mailbox = findMailboxName($mailbox);
26 $periodCount = countCharInString($mailbox, ".");
28 // indent the correct number of spaces.
29 for ($j = 0;$j < $periodCount;$j++
)
30 $boxes[$i] = "$boxes[$i] ";
32 $boxes[$i] = $boxes[$i] . readShortMailboxName($mailbox, ".");
33 $long_name_boxes[$i] = $mailbox;
36 /** DELETING FOLDERS **/
37 echo "<FORM ACTION=folders_delete.php METHOD=POST>\n";
38 echo "<SELECT NAME=folder_list><FONT FACE=\"Arial,Helvetica\">\n";
39 for ($i = 0; $i < count($str); $i++
) {
41 for ($p = 0; $p < count($special_folders); $p++
) {
42 if ($special_folders[$p] == $long_name_boxes[$i])
45 if ($use_folder == true)
46 echo " <OPTION>$boxes[$i]\n";
49 echo "<INPUT TYPE=SUBMIT VALUE=Delete>\n";
52 /** CREATING FOLDERS **/
53 echo "<FORM ACTION=folders_create.php METHOD=POST>\n";
54 echo "<INPUT TYPE=TEXT SIZE=25 NAME=folder_name>\n";
55 echo " as a subfolder of ";
56 echo "<SELECT NAME=subfolder><FONT FACE=\"Arial,Helvetica\">\n";
57 for ($i = 0;$i < count($str); $i++
) {
58 $thisbox = Chop($str[$i]);
59 $thisbox = findMailboxName($thisbox);
60 $thisbox = getBoxForCreate($thisbox);
61 echo "<OPTION>$thisbox\n";
64 echo "<INPUT TYPE=SUBMIT VALUE=Create>\n";
67 /** RENAMING FOLDERS **/
68 echo "<FORM ACTION=folders_rename.php METHOD=POST>\n";
69 echo "<SELECT NAME=folder_list><FONT FACE=\"Arial,Helvetica\">\n";
70 for ($i = 0; $i < count($str); $i++
) {
72 for ($p = 0; $p < count($special_folders); $p++
) {
73 if ($special_folders[$p] == $long_name_boxes[$i])
76 if ($use_folder == true)
77 echo " <OPTION>$boxes[$i]\n";
80 echo "<INPUT TYPE=TEXT SIZE=25 NAME=new_folder_name>\n";
81 echo "<INPUT TYPE=SUBMIT VALUE=Rename>\n";