21c3249f |
1 | <? |
2 | /** |
a09387f4 |
3 | ** right_main.php |
21c3249f |
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)) { |
a09387f4 |
11 | echo "You must <a href=\"login.php\">login</a> first."; |
21c3249f |
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 | <BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#0000EE" ALINK="#0000EE"> |
21 | <FONT FACE="Arial,Helvetica"> |
22 | <? |
a09387f4 |
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/mailbox.php"); |
30 | include("../functions/mailbox_display.php"); |
31 | include("../functions/display_messages.php"); |
21c3249f |
32 | |
33 | ///////////////////////////////////////////////////////////////////////////////// |
34 | // |
35 | // incoming variables from URL: |
36 | // $sort Direction to sort by date |
37 | // values: 0 - descending order |
38 | // values: 1 - ascending order |
39 | // $startMessage Message to start at |
40 | // $mailbox Full Mailbox name |
41 | // |
42 | // incoming from cookie: |
43 | // $username duh |
44 | // $key pass |
45 | // |
46 | ///////////////////////////////////////////////////////////////////////////////// |
47 | |
48 | |
49 | // open a connection on the imap port (143) |
2aa12d5e |
50 | $imapConnection = loginToImapServer($username, $key, $imapServerAddress); |
21c3249f |
51 | |
52 | // If the page has been loaded without a specific mailbox, |
53 | // just show a page of general info. |
54 | if (!isset($mailbox)) { |
55 | displayPageHeader("None"); |
56 | general_info($motd, $org_logo, $version, $org_name); |
57 | exit; |
58 | } |
59 | |
21c3249f |
60 | // switch to the mailbox, and get the number of messages in it. |
61 | selectMailbox($imapConnection, $mailbox, $numMessages); |
21c3249f |
62 | |
926da13e |
63 | // Display the header at the top of the page |
64 | displayPageHeader($mailbox); |
21c3249f |
65 | |
926da13e |
66 | // Get the list of messages for this mailbox |
926da13e |
67 | showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort); |
21c3249f |
68 | |
926da13e |
69 | // close the connection |
4c2d69ac |
70 | fputs($imapConnection, "1 logout\n"); |
21c3249f |
71 | fclose($imapConnection); |
72 | ?> |
73 | </FONT> |
74 | </BODY> |
75 | </HTML> |