54eb524c6a15abba307a8e26b0e3939cc486e51a
[squirrelmail.git] / src / webmail.php
1 <?
2 /**
3 ** webmail.php
4 **
5 ** This simply creates the frames.
6 **
7 **/
8
9 if(!isset($username)) {
10 echo "You need a valid user and password to access this page!";
11 exit;
12 }
13
14 setcookie("username", $username, 0, "/");
15 setcookie("key", $key, 0, "/");
16 setcookie("logged_in", 1, 0, "/");
17 ?>
18 <HTML><HEAD>
19 <TITLE>
20 <?
21 include ("../config/config.php");
22 include ("../functions/prefs.php");
23 echo "$org_title";
24 ?>
25 </TITLE>
26 <FRAMESET COLS="200, *" NORESIZE BORDER=0>
27
28 /**
29 There are three ways to call webmail.php
30 1. webmail.php
31 - this just loads the default entry screen.
32 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
33 - This loads the frames starting at the given values.
34 3. webmail.php?right_frame=folders.php
35 - Loads the frames with the Folder options in the right frame.
36
37 This was done to create a pure HTML way of refreshing the folder list since
38 we would like to use as little Javascript as possible.
39 **/
40 <?
41 checkForPrefs($data_dir, $username);
42
43 if ($right_frame == "right_main.php") {
44 $urlMailbox = urlencode($mailbox);
45 echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
46 echo "<FRAME SRC=\"right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage\" NAME=\"right\">";
47 } else if ($right_frame == "folders.php") {
48 $urlMailbox = urlencode($mailbox);
49 echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
50 echo "<FRAME SRC=\"folders.php\" NAME=\"right\">";
51 } else {
52 echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
53 echo "<FRAME SRC=\"right_main.php\" NAME=\"right\">";
54 }
55 ?>
56 </FRAMESET>
57 </HEAD></HTML>