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