Added "Themes" to personal preferences
[squirrelmail.git] / src / right_main.php
1 <?
2 /**
3 ** right_main.php
4 **
5 ** This is where the mailboxes are listed. This controls most of what
6 ** goes on in SquirrelMail.
7 **
8 **/
9
10 if(!isset($logged_in)) {
11 echo "You must <a href=\"login.php\">login</a> first.";
12 exit;
13 }
14 if(!isset($username) || !isset($key)) {
15 echo "You need a valid user and password to access this page!";
16 exit;
17 }
18 ?>
19 <HTML>
20 <FONT FACE="Arial,Helvetica">
21 <?
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");
31
32 include("../src/load_prefs.php");
33
34 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
35 echo "<FONT FACE=\"Arial,Helvetica\">";
36 /////////////////////////////////////////////////////////////////////////////////
37 //
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
44 //
45 // incoming from cookie:
46 // $username duh
47 // $key pass
48 //
49 /////////////////////////////////////////////////////////////////////////////////
50
51 // open a connection on the imap port (143)
52 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
53
54 // If the page has been loaded without a specific mailbox,
55 // just show a page of general info.
56 if (!isset($mailbox)) {
57 displayPageHeader($color, "None");
58 general_info($motd, $org_logo, $version, $org_name, $color);
59 echo "</BODY></HTML>";
60 exit;
61 }
62
63 // switch to the mailbox, and get the number of messages in it.
64 selectMailbox($imapConnection, $mailbox, $numMessages);
65
66 // Display the header at the top of the page
67 displayPageHeader($color, $mailbox);
68
69 // Get the list of messages for this mailbox
70 showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color);
71
72 // close the connection
73 fputs($imapConnection, "1 logout\n");
74 fclose($imapConnection);
75 ?>
76 </FONT>
77 </BODY>
78 </HTML>