e3725eb8f151036a9403d8f1cbdb091ba0c9a6ff
5 ** This is the code for the left bar. The left bar shows the folders
6 ** available, and has cookie information.
10 if(!isset($username)) {
11 echo "You need a valid user and password to access this page!";
17 include("../config/config.php");
18 include("../functions/strings.php");
19 include("../functions/imap.php");
20 include("../functions/mailbox.php");
22 echo "<BODY BGCOLOR=\"$color[3]\" TEXT=\"$color[6]\" LINK=\"$color[6]\" VLINK=\"$color[6]\" ALINK=\"$color[6]\">";
23 echo "<FONT FACE=\"Arial,Helvetica\">";
25 // open a connection on the imap port (143)
26 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
28 fputs($imapConnection, "1 list \"\" *\n");
29 $str = imapReadData($imapConnection);
31 echo "<FONT FACE=\"Arial,Helvetica\" COLOR=000000 SIZE=4><B><CENTER>";
32 echo "Folders</B><BR></FONT>";
33 echo "<FONT FACE=\"Arial,Helvetica\" COLOR=000000 SIZE=2>(<A HREF=\"../src/left_main.php\" TARGET=left>refresh folder list</A>)</FONT></CENTER><BR>";
34 echo "<FONT FACE=\"Arial,Helvetica\">\n";
35 for ($i = 0;$i < count($str); $i++
) {
36 $mailbox = Chop($str[$i]);
37 $mailbox = findMailboxName($mailbox);
39 // find the quote at the begining of the mailbox name.
40 // i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
41 $periodCount = countCharInString($mailbox, ".");
43 // indent the correct number of spaces.
44 for ($j = 0;$j < $periodCount;$j++
)
47 $mailboxURL = urlencode($mailbox);
48 selectMailbox($imapConnection, $mailbox, $numNessages);
49 $unseen = unseenMessages($imapConnection, $numUnseen);
52 echo "<a href=\"right_main.php?sort=0&startMessage=1&mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\"><FONT FACE=\"Arial,Helvetica\">";
53 echo readShortMailboxName($mailbox, ".");
54 if (($move_to_trash == true) && ($mailbox == $trash_folder)) {
55 $urlMailbox = urlencode($mailbox);
56 echo "</A> (<B><A HREF=\"empty_trash.php?numMessages=$numMessages&mailbox=$urlMailbox\" TARGET=right style=\"text-decoration:none\">empty</A></B>)";
60 echo "</B> </FONT><FONT FACE=\"Arial,Helvetica\" SIZE=2>($numUnseen)</FONT>";
66 fclose($imapConnection);