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)) { |
b581fa60 |
11 | echo _("You must "); |
12 | echo "<a href=\"login.php\">"; |
13 | echo _("login"); |
14 | echo "</a>"; |
9ee3e401 |
15 | echo _(" first."); |
21c3249f |
16 | exit; |
17 | } |
18 | if(!isset($username) || !isset($key)) { |
b581fa60 |
19 | echo _("You need a valid user and password to access this page!"); |
21c3249f |
20 | exit; |
21 | } |
44139266 |
22 | |
d068c0ec |
23 | if (!isset($config_php)) |
24 | include("../config/config.php"); |
25 | if (!isset($imap_php)) |
26 | include("../functions/imap.php"); |
27 | if (!isset($strings_php)) |
28 | include("../functions/strings.php"); |
29 | if (!isset($date_php)) |
30 | include("../functions/date.php"); |
31 | if (!isset($page_header_php)) |
32 | include("../functions/page_header.php"); |
33 | if (!isset($array_php)) |
34 | include("../functions/array.php"); |
35 | if (!isset($mime_php)) |
36 | include("../functions/mime.php"); |
37 | if (!isset($mailbox_display_php)) |
38 | include("../functions/mailbox_display.php"); |
39 | if (!isset($display_messages_php)) |
40 | include("../functions/display_messages.php"); |
44139266 |
41 | ?> |
42 | <HTML> |
43 | <FONT FACE="Arial,Helvetica"> |
44 | <? |
21c3249f |
45 | ///////////////////////////////////////////////////////////////////////////////// |
46 | // |
47 | // incoming variables from URL: |
48 | // $sort Direction to sort by date |
49 | // values: 0 - descending order |
50 | // values: 1 - ascending order |
51 | // $startMessage Message to start at |
52 | // $mailbox Full Mailbox name |
53 | // |
54 | // incoming from cookie: |
55 | // $username duh |
56 | // $key pass |
57 | // |
58 | ///////////////////////////////////////////////////////////////////////////////// |
59 | |
21c3249f |
60 | // open a connection on the imap port (143) |
813eba2f |
61 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0); |
21c3249f |
62 | |
f3d17401 |
63 | /** If it was a successful login, lets load their preferences **/ |
64 | include("../src/load_prefs.php"); |
f3d17401 |
65 | echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n"; |
66 | echo "<FONT FACE=\"Arial,Helvetica\">"; |
67 | |
21c3249f |
68 | // If the page has been loaded without a specific mailbox, |
69 | // just show a page of general info. |
70 | if (!isset($mailbox)) { |
f8f9bed9 |
71 | displayPageHeader($color, "None"); |
72 | general_info($motd, $org_logo, $version, $org_name, $color); |
aa32c5e4 |
73 | echo "</BODY></HTML>"; |
21c3249f |
74 | exit; |
75 | } |
76 | |
813eba2f |
77 | sqimap_mailbox_select($imapConnection, $mailbox); |
78 | $numMessages = sqimap_get_num_messages ($imapConnection, $mailbox); |
f8f9bed9 |
79 | displayPageHeader($color, $mailbox); |
21c3249f |
80 | |
d3cdb279 |
81 | showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color); |
21c3249f |
82 | |
926da13e |
83 | // close the connection |
813eba2f |
84 | sqimap_logout ($imapConnection); |
21c3249f |
85 | ?> |
86 | </FONT> |
87 | </BODY> |
88 | </HTML> |