/** ** left_main.php ** ** This is the code for the left bar. The left bar shows the folders ** available, and has cookie information. ** **/ if(!isset($username)) { echo "You need a valid user and password to access this page!"; exit; } ?>
include("../config/config.php"); include("../functions/strings.php"); include("../functions/imap.php"); // open a connection on the imap port (143) $imapConnection = loginToImapServer($username, $key, $imapServerAddress); fputs($imapConnection, "1 list \"\" *\n"); $str = imapReadData($imapConnection); echo ""; echo "\n";
for ($i = 0;$i < count($str); $i++) {
$mailbox = Chop($str[$i]);
// find the quote at the begining of the mailbox name.
// i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
$mailbox = findMailboxName($mailbox);
$periodCount = countCharInString($mailbox, ".");
// indent the correct number of spaces.
for ($j = 0;$j < $periodCount;$j++)
echo " ";
$mailboxURL = urlencode($mailbox);
echo "";
echo readShortMailboxName($mailbox, ".");
echo "
\n";
}
echo "
";
fclose($imapConnection);
?>