59177427 |
1 | <?php |
21c3249f |
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 | |
2a32fc83 |
10 | session_start(); |
11 | |
21c3249f |
12 | if(!isset($logged_in)) { |
138f26f6 |
13 | echo _("You must login first."); |
21c3249f |
14 | exit; |
15 | } |
16 | if(!isset($username) || !isset($key)) { |
b581fa60 |
17 | echo _("You need a valid user and password to access this page!"); |
21c3249f |
18 | exit; |
19 | } |
44139266 |
20 | |
d068c0ec |
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"); |
44139266 |
39 | ?> |
40 | <HTML> |
41 | <FONT FACE="Arial,Helvetica"> |
59177427 |
42 | <?php |
21c3249f |
43 | ///////////////////////////////////////////////////////////////////////////////// |
44 | // |
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 |
51 | // |
52 | // incoming from cookie: |
53 | // $username duh |
54 | // $key pass |
55 | // |
56 | ///////////////////////////////////////////////////////////////////////////////// |
57 | |
21c3249f |
58 | // open a connection on the imap port (143) |
e1469126 |
59 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
21c3249f |
60 | |
f3d17401 |
61 | /** If it was a successful login, lets load their preferences **/ |
62 | include("../src/load_prefs.php"); |
f3d17401 |
63 | echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n"; |
f3d17401 |
64 | |
21c3249f |
65 | // If the page has been loaded without a specific mailbox, |
66 | // just show a page of general info. |
67 | if (!isset($mailbox)) { |
f8f9bed9 |
68 | displayPageHeader($color, "None"); |
69 | general_info($motd, $org_logo, $version, $org_name, $color); |
aa32c5e4 |
70 | echo "</BODY></HTML>"; |
21c3249f |
71 | exit; |
72 | } |
73 | |
813eba2f |
74 | sqimap_mailbox_select($imapConnection, $mailbox); |
75 | $numMessages = sqimap_get_num_messages ($imapConnection, $mailbox); |
f8f9bed9 |
76 | displayPageHeader($color, $mailbox); |
21c3249f |
77 | |
9f2215a1 |
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"); |
85 | |
9c83f905 |
86 | showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color,$show_num); |
9f2215a1 |
87 | // } else { |
88 | // echo "<br>using cache<br>\n"; |
89 | // $msgs = unserialize($messages); |
90 | |
9c83f905 |
91 | // displayMessageArray($imapConnection, $numMessages, $startMessage, $msgs, $mailbox, $sort, $color,$show_num); |
9f2215a1 |
92 | // } |
21c3249f |
93 | |
926da13e |
94 | // close the connection |
813eba2f |
95 | sqimap_logout ($imapConnection); |
21c3249f |
96 | ?> |
97 | </FONT> |
98 | </BODY> |
99 | </HTML> |