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 <SCRIPT LANGUAGE
="JavaScript">
18 function DeleteCookie (name
) {
20 exp
.setTime (exp
.getTime() - 1);
21 // This cookie is history
22 var cval
= GetCookie (name
);
23 document
.cookie
= name +
"=" + cval +
"; expires=" + exp
.toGMTString();
26 function unSetCookies() {
27 DeleteCookie('username');
29 DeleteCookie('logged_in');
30 alert(document
.cookie
);
34 <BODY BGCOLOR
=A0B8C8 TEXT
="#000000" LINK
="#0000EE" VLINK
="#0000EE" ALINK
="#0000EE" onUnLoad
="unSetCookies()">
35 <FONT FACE
="Arial,Helvetica">
37 include("../config/config.php");
38 include("../functions/strings.php");
39 include("../functions/imap.php");
41 // open a connection on the imap port (143)
42 $imapConnection = fsockopen($imapServerAddress, 143, &$errorNumber, &$errorString);
43 if (!$imapConnection) {
44 echo "Error connecting to IMAP Server.<br>";
45 echo "$errorNumber : $errorString<br>";
48 $serverInfo = fgets($imapConnection, 256);
50 fputs($imapConnection, "1 login $username $key\n");
51 $read = fgets($imapConnection, 1024);
53 fputs($imapConnection, "1 list \"\" *\n");
54 $str = imapReadData($imapConnection);
56 echo "<FONT FACE=\"Arial,Helvetica\"><B>";
57 echo "<CENTER>$org_name</B><BR>";
58 echo "Folders</CENTER>";
59 echo "</B><BR></FONT>";
60 echo "<code><FONT FACE=\"Arial,Helvetica\">\n";
61 for ($i = 0;$i < count($str); $i++
) {
62 $mailbox = Chop($str[$i]);
63 // find the quote at the begining of the mailbox name.
64 // i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
65 $mailbox = findMailboxName($mailbox);
66 $periodCount = countCharInString($mailbox, ".");
68 // indent the correct number of spaces.
69 for ($j = 0;$j < $periodCount;$j++
)
72 $mailboxURL = urlencode($mailbox);
73 echo "<a href=\"right_main.php?sort=0&startMessage=1&mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\"><FONT FACE=\"Arial,Helvetica\">";
74 echo readShortMailboxName($mailbox, ".");
75 echo "</FONT></a><br>\n";
77 echo "</code></FONT>";
79 fclose($imapConnection);