Uses the brand new configuration directive email_address to set the
[squirrelmail.git] / src / right_main.php
CommitLineData
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
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");
a4c2cd49 29 include("../functions/mime.php");
a09387f4 30 include("../functions/mailbox_display.php");
31 include("../functions/display_messages.php");
44139266 32?>
33<HTML>
34<FONT FACE="Arial,Helvetica">
35<?
21c3249f 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
21c3249f 51 // open a connection on the imap port (143)
813eba2f 52 $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
21c3249f 53
f3d17401 54 /** If it was a successful login, lets load their preferences **/
55 include("../src/load_prefs.php");
f3d17401 56 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
57 echo "<FONT FACE=\"Arial,Helvetica\">";
58
21c3249f 59 // If the page has been loaded without a specific mailbox,
60 // just show a page of general info.
61 if (!isset($mailbox)) {
f8f9bed9 62 displayPageHeader($color, "None");
63 general_info($motd, $org_logo, $version, $org_name, $color);
aa32c5e4 64 echo "</BODY></HTML>";
21c3249f 65 exit;
66 }
67
813eba2f 68 sqimap_mailbox_select($imapConnection, $mailbox);
69 $numMessages = sqimap_get_num_messages ($imapConnection, $mailbox);
f8f9bed9 70 displayPageHeader($color, $mailbox);
21c3249f 71
d3cdb279 72 showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color);
21c3249f 73
926da13e 74 // close the connection
813eba2f 75 sqimap_logout ($imapConnection);
21c3249f 76?>
77</FONT>
78</BODY>
79</HTML>