Added basic framework for plugin support. Very little code so far. Two
[squirrelmail.git] / src / webmail.php
CommitLineData
59177427 1<?php
21c3249f 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
9f2215a1 16 setcookie("username", $username, 0, "/");
17 setcookie("key", $key, 0, "/");
18 setcookie("logged_in", 1, 0, "/");
2a32fc83 19
288491a4 20 // Refresh the language cookie.
2a32fc83 21 if (isset($squirrelmail_language)) {
9f2215a1 22 setcookie("squirrelmail_language", $squirrelmail_language, time()+2592000);
2a32fc83 23 }
21c3249f 24?>
25<HTML><HEAD>
59177427 26<?php
7ce342dc 27 include ("../config/config.php");
65b14f90 28 include ("../functions/prefs.php");
19acd99f 29 include ("../functions/imap.php");
2848c630 30
19acd99f 31 // verify that username and password are correct
e1469126 32 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
19acd99f 33
2848c630 34 include ("../src/load_prefs.php");
35
8105d00f 36 echo "<TITLE>";
7ce342dc 37 echo "$org_title";
8105d00f 38 echo "</TITLE>";
07103a66 39 $ishelp = substr(getenv(REQUEST_URI),-8); // If calling help, set left frame to 300
40 if ($ishelp == "help.php") {
41 echo "<FRAMESET COLS=\"300, *\" NORESIZE BORDER=0>";
42 } else {
43 echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>";
44 }
ad6787f0 45
46/**
a2222aa3 47 There are four ways to call webmail.php
ad6787f0 48 1. webmail.php
a2222aa3 49 - This just loads the default entry screen.
907165ca 50 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
ad6787f0 51 - This loads the frames starting at the given values.
907165ca 52 3. webmail.php?right_frame=folders.php
53 - Loads the frames with the Folder options in the right frame.
a2222aa3 54 4. webmail.php?right_frame=help.php
55 - Lets the left frame set up different menu for help and calls the right frame.
ad6787f0 56
57 This was done to create a pure HTML way of refreshing the folder list since
58 we would like to use as little Javascript as possible.
59**/
907165ca 60 if ($right_frame == "right_main.php") {
ad6787f0 61 $urlMailbox = urlencode($mailbox);
9f2215a1 62 echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
63 echo "<FRAME SRC=\"right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage\" NAME=\"right\">";
907165ca 64 } else if ($right_frame == "folders.php") {
65 $urlMailbox = urlencode($mailbox);
9f2215a1 66 echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
67 echo "<FRAME SRC=\"folders.php\" NAME=\"right\">";
a2222aa3 68 } else if ($right_frame == "help.php") {
74836edc 69 echo "<FRAME SRC=\"left_help.php\" NAME=\"left\">";
a2222aa3 70 echo "<FRAME SRC=\"help.php\" NAME=\"right\">";
ad6787f0 71 } else {
9f2215a1 72 echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
73 echo "<FRAME SRC=\"right_main.php\" NAME=\"right\">";
ad6787f0 74 }
a2222aa3 75
ad6787f0 76?>
21c3249f 77</FRAMESET>
78</HEAD></HTML>