deleted old files, removed old help stuff from webmail.php
[squirrelmail.git] / src / webmail.php
1 <?php
2
3 /**
4 ** webmail.php -- Displays the main frameset
5 **
6 ** Copyright (c) 1999-2000 The SquirrelMail development team
7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 **
9 ** This file generates the main frameset. The files that are
10 ** shown can be given as parameters. If the user is not logged in
11 ** this file will verify username and password.
12 **
13 **/
14
15 session_start();
16
17 if (!isset($i18n_php))
18 include ("../functions/i18n.php");
19
20 if(!isset($username)) {
21 set_up_language($squirrelmail_language);
22 echo _("You need a valid user and password to access this page!");
23 exit;
24 }
25
26 include ("../config/config.php");
27 include ("../functions/prefs.php");
28 include ("../functions/imap.php");
29 if (!isset($plugin_php))
30 include ("../functions/plugin.php");
31 if (!isset($auth_php))
32 include ("../functions/auth.php");
33 if (!isset($strings_php))
34 include ("../functions/strings.php");
35
36 include ("../src/load_prefs.php");
37
38 // We'll need this to later have a noframes version
39 set_up_language(getPref($data_dir, $username, "language"));
40
41 echo "<html><head>\n";
42 echo "<TITLE>";
43 echo "$org_title";
44 echo "</TITLE>";
45 $ishelp = substr(getenv(REQUEST_URI),-8); // If calling help, set left frame to 300
46
47 $bar_size = $left_size;
48
49 if ($location_of_bar == 'right')
50 {
51 echo "<FRAMESET COLS=\"*, $left_size\" NORESIZE=yes BORDER=0>";
52 } else {
53 echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>";
54 }
55
56 /**
57 There are three ways to call webmail.php
58 1. webmail.php
59 - This just loads the default entry screen.
60 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
61 - This loads the frames starting at the given values.
62 3. webmail.php?right_frame=folders.php
63 - Loads the frames with the Folder options in the right frame.
64
65 This was done to create a pure HTML way of refreshing the folder list since
66 we would like to use as little Javascript as possible.
67 **/
68 if ($right_frame == "right_main.php") {
69 $urlMailbox = urlencode($mailbox);
70 $right_frame_url = "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage";
71 } else if ($right_frame == "options.php") {
72 $right_frame_url = "options.php";
73 } else if ($right_frame == "folders.php") {
74 $right_frame_url = "folders.php";
75 } else {
76 if (!isset($just_logged_in)) $just_logged_in = 0;
77 $right_frame_url = "right_main.php?just_logged_in=$just_logged_in";
78 }
79
80 if ($location_of_bar == 'right')
81 {
82 echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">";
83 echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
84 }
85 else
86 {
87 echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">";
88 echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">";
89 }
90
91 ?>
92 </FRAMESET>
93 </HEAD></HTML>