5 ** This is where the mailboxes are listed. This controls most of what
6 ** goes on in SquirrelMail.
10 if(!isset($logged_in)) {
12 echo "<a href=\"login.php\">";
18 if(!isset($username) ||
!isset($key)) {
19 echo _("You need a valid user and password to access this page!");
23 include("../config/config.php");
24 include("../functions/imap.php");
25 include("../functions/strings.php");
26 include("../functions/date.php");
27 include("../functions/page_header.php");
28 include("../functions/array.php");
29 include("../functions/mime.php");
30 include("../functions/mailbox_display.php");
31 include("../functions/display_messages.php");
34 <FONT FACE
="Arial,Helvetica">
36 /////////////////////////////////////////////////////////////////////////////////
38 // incoming variables from URL:
39 // $sort Direction to sort by date
40 // values: 0 - descending order
41 // values: 1 - ascending order
42 // $startMessage Message to start at
43 // $mailbox Full Mailbox name
45 // incoming from cookie:
49 /////////////////////////////////////////////////////////////////////////////////
51 // open a connection on the imap port (143)
52 $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
54 /** If it was a successful login, lets load their preferences **/
55 include("../src/load_prefs.php");
56 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
57 echo "<FONT FACE=\"Arial,Helvetica\">";
59 // If the page has been loaded without a specific mailbox,
60 // just show a page of general info.
61 if (!isset($mailbox)) {
62 displayPageHeader($color, "None");
63 general_info($motd, $org_logo, $version, $org_name, $color);
64 echo "</BODY></HTML>";
68 sqimap_mailbox_select($imapConnection, $mailbox);
69 $numMessages = sqimap_get_num_messages ($imapConnection, $mailbox);
70 displayPageHeader($color, $mailbox);
72 showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color);
74 // close the connection
75 sqimap_logout ($imapConnection);