39169be02aed20d0be77a06f47f1331c5e2ab9fd
5 ** This is where the mailboxes are listed. This controls most of what
6 ** goes on in SquirrelMail.
12 if(!isset($logged_in)) {
13 echo _("You must login first.");
16 if(!isset($username) ||
!isset($key)) {
17 echo _("You need a valid user and password to access this page!");
21 if (!isset($config_php))
22 include("../config/config.php");
23 if (!isset($imap_php))
24 include("../functions/imap.php");
25 if (!isset($strings_php))
26 include("../functions/strings.php");
27 if (!isset($date_php))
28 include("../functions/date.php");
29 if (!isset($page_header_php))
30 include("../functions/page_header.php");
31 if (!isset($array_php))
32 include("../functions/array.php");
33 if (!isset($mime_php))
34 include("../functions/mime.php");
35 if (!isset($mailbox_display_php))
36 include("../functions/mailbox_display.php");
37 if (!isset($display_messages_php))
38 include("../functions/display_messages.php");
41 <FONT FACE
="Arial,Helvetica">
43 /////////////////////////////////////////////////////////////////////////////////
45 // incoming variables from URL:
46 // $sort Direction to sort by date
47 // values: 0 - descending order
48 // values: 1 - ascending order
49 // $startMessage Message to start at
50 // $mailbox Full Mailbox name
52 // incoming from cookie:
56 /////////////////////////////////////////////////////////////////////////////////
58 // open a connection on the imap port (143)
59 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
61 /** If it was a successful login, lets load their preferences **/
62 include("../src/load_prefs.php");
63 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
65 // If the page has been loaded without a specific mailbox,
66 // just show a page of general info.
67 if (!isset($mailbox)) {
68 displayPageHeader($color, "None");
69 general_info($motd, $org_logo, $version, $org_name, $color);
70 echo "</BODY></HTML>";
74 sqimap_mailbox_select($imapConnection, $mailbox);
75 $numMessages = sqimap_get_num_messages ($imapConnection, $mailbox);
76 displayPageHeader($color, $mailbox);
78 // Check to see if we can use cache or not. Currently the only time when you wont use it is
79 // when a link on the left hand frame is used. Also check to make sure we actually have the
80 // array in the registered session data. :)
81 // if (!$use_mailbox_cache || !session_is_registered("msgs")) {
82 // echo "<br>not using cache<br>\n";
83 // if (session_is_registered("messages"))
84 // session_unregister("messages");
86 showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color,$show_num);
88 // echo "<br>using cache<br>\n";
89 // $msgs = unserialize($messages);
91 // displayMessageArray($imapConnection, $numMessages, $startMessage, $msgs, $mailbox, $sort, $color,$show_num);
94 // close the connection
95 sqimap_logout ($imapConnection);