21c3249f |
1 | <? |
2 | /** |
a09387f4 |
3 | ** webmail.php |
21c3249f |
4 | ** |
5 | ** This simply creates the frames. |
6 | ** |
7 | **/ |
8 | |
9 | if(!isset($username)) { |
b581fa60 |
10 | echo _("You need a valid user and password to access this page!"); |
21c3249f |
11 | exit; |
12 | } |
13 | |
14 | setcookie("username", $username, 0, "/"); |
15 | setcookie("key", $key, 0, "/"); |
16 | setcookie("logged_in", 1, 0, "/"); |
288491a4 |
17 | // Refresh the language cookie. |
18 | if (isset($squirrelmail_language)) |
19 | setcookie("squirrelmail_language", $squirrelmail_language, |
20 | time()+2592000); |
21c3249f |
21 | ?> |
22 | <HTML><HEAD> |
7ce342dc |
23 | <? |
24 | include ("../config/config.php"); |
65b14f90 |
25 | include ("../functions/prefs.php"); |
19acd99f |
26 | include ("../functions/imap.php"); |
2848c630 |
27 | |
19acd99f |
28 | // verify that username and password are correct |
e1469126 |
29 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
19acd99f |
30 | |
2848c630 |
31 | include ("../src/load_prefs.php"); |
32 | |
8105d00f |
33 | echo "<TITLE>"; |
7ce342dc |
34 | echo "$org_title"; |
8105d00f |
35 | echo "</TITLE>"; |
2848c630 |
36 | echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>"; |
ad6787f0 |
37 | |
38 | /** |
907165ca |
39 | There are three ways to call webmail.php |
ad6787f0 |
40 | 1. webmail.php |
41 | - this just loads the default entry screen. |
907165ca |
42 | 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX |
ad6787f0 |
43 | - This loads the frames starting at the given values. |
907165ca |
44 | 3. webmail.php?right_frame=folders.php |
45 | - Loads the frames with the Folder options in the right frame. |
ad6787f0 |
46 | |
47 | This was done to create a pure HTML way of refreshing the folder list since |
48 | we would like to use as little Javascript as possible. |
49 | **/ |
907165ca |
50 | if ($right_frame == "right_main.php") { |
ad6787f0 |
51 | $urlMailbox = urlencode($mailbox); |
52 | echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">"; |
53 | echo "<FRAME SRC=\"right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage\" NAME=\"right\">"; |
907165ca |
54 | } else if ($right_frame == "folders.php") { |
55 | $urlMailbox = urlencode($mailbox); |
56 | echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">"; |
57 | echo "<FRAME SRC=\"folders.php\" NAME=\"right\">"; |
ad6787f0 |
58 | } else { |
59 | echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">"; |
60 | echo "<FRAME SRC=\"right_main.php\" NAME=\"right\">"; |
61 | } |
62 | ?> |
21c3249f |
63 | </FRAMESET> |
64 | </HEAD></HTML> |