Added _() to some strings missing from translation.
[squirrelmail.git] / src / right_main.php
1 <?
2 /**
3 ** right_main.php
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)) {
11 echo _("You must login first.");
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 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");
37 ?>
38 <HTML>
39 <FONT FACE="Arial,Helvetica">
40 <?
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
56 // open a connection on the imap port (143)
57 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
58
59 /** If it was a successful login, lets load their preferences **/
60 include("../src/load_prefs.php");
61 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
62
63 // If the page has been loaded without a specific mailbox,
64 // just show a page of general info.
65 if (!isset($mailbox)) {
66 displayPageHeader($color, "None");
67 general_info($motd, $org_logo, $version, $org_name, $color);
68 echo "</BODY></HTML>";
69 exit;
70 }
71
72 sqimap_mailbox_select($imapConnection, $mailbox);
73 $numMessages = sqimap_get_num_messages ($imapConnection, $mailbox);
74 displayPageHeader($color, $mailbox);
75
76 showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color);
77
78 // close the connection
79 sqimap_logout ($imapConnection);
80 ?>
81 </FONT>
82 </BODY>
83 </HTML>