288ce90d70a546d24c672e94c623191c34e91edb
5 ** This is where the mailboxes are listed. This controls most of what
6 ** goes on in SquirrelMail.
10 if(!isset($logged_in)) {
11 echo "You must <a href=\"login.php\">login</a> first.";
14 if(!isset($username) ||
!isset($key)) {
15 echo "You need a valid user and password to access this page!";
20 <FONT FACE
="Arial,Helvetica">
22 include("../config/config.php");
23 include("../functions/imap.php");
24 include("../functions/strings.php");
25 include("../functions/date.php");
26 include("../functions/page_header.php");
27 include("../functions/array.php");
28 include("../functions/mailbox.php");
29 include("../functions/mailbox_display.php");
30 include("../functions/display_messages.php");
32 /////////////////////////////////////////////////////////////////////////////////
34 // incoming variables from URL:
35 // $sort Direction to sort by date
36 // values: 0 - descending order
37 // values: 1 - ascending order
38 // $startMessage Message to start at
39 // $mailbox Full Mailbox name
41 // incoming from cookie:
45 /////////////////////////////////////////////////////////////////////////////////
47 // open a connection on the imap port (143)
48 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
50 /** If it was a successful login, lets load their preferences **/
51 include("../src/load_prefs.php");
52 checkForPrefs($data_dir, $username);
53 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
54 echo "<FONT FACE=\"Arial,Helvetica\">";
56 // If the page has been loaded without a specific mailbox,
57 // just show a page of general info.
58 if (!isset($mailbox)) {
59 displayPageHeader($color, "None");
60 general_info($motd, $org_logo, $version, $org_name, $color);
61 echo "</BODY></HTML>";
65 // switch to the mailbox, and get the number of messages in it.
66 selectMailbox($imapConnection, $mailbox, $numMessages);
68 // Display the header at the top of the page
69 displayPageHeader($color, $mailbox);
71 // Get the list of messages for this mailbox
72 showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color);
74 // close the connection
75 fputs($imapConnection, "1 logout\n");
76 fclose($imapConnection);