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