59177427 |
1 | <?php |
c6d6fe73 |
2 | |
21c3249f |
3 | /** |
5bbe20e4 |
4 | ** webmail.php -- Displays the main frameset |
21c3249f |
5 | ** |
c6d6fe73 |
6 | ** Copyright (c) 1999-2000 The SquirrelMail development team |
5bbe20e4 |
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. |
21c3249f |
12 | ** |
13 | **/ |
14 | |
2a32fc83 |
15 | session_start(); |
16 | |
441f2d33 |
17 | if (!isset($i18n_php)) |
18 | include ("../functions/i18n.php"); |
19 | |
21c3249f |
20 | if(!isset($username)) { |
441f2d33 |
21 | set_up_language($squirrelmail_language); |
b581fa60 |
22 | echo _("You need a valid user and password to access this page!"); |
21c3249f |
23 | exit; |
24 | } |
25 | |
7ce342dc |
26 | include ("../config/config.php"); |
65b14f90 |
27 | include ("../functions/prefs.php"); |
19acd99f |
28 | include ("../functions/imap.php"); |
27e81758 |
29 | if (!isset($plugin_php)) |
30 | include ("../functions/plugin.php"); |
3c13b9fb |
31 | if (!isset($auth_php)) |
32 | include ("../functions/auth.php"); |
52eefafc |
33 | if (!isset($strings_php)) |
34 | include ("../functions/strings.php"); |
27e81758 |
35 | |
2848c630 |
36 | include ("../src/load_prefs.php"); |
1b187352 |
37 | |
441f2d33 |
38 | // We'll need this to later have a noframes version |
39 | set_up_language(getPref($data_dir, $username, "language")); |
40 | |
3c13b9fb |
41 | echo "<html><head>\n"; |
8105d00f |
42 | echo "<TITLE>"; |
7ce342dc |
43 | echo "$org_title"; |
8105d00f |
44 | echo "</TITLE>"; |
07103a66 |
45 | $ishelp = substr(getenv(REQUEST_URI),-8); // If calling help, set left frame to 300 |
9a732bb6 |
46 | |
47 | if (ishelp == 'help.php') |
48 | $bar_size = 300; |
49 | else |
50 | $bar_size = $left_size; |
51 | |
52 | if ($location_of_bar == 'right') |
53 | { |
54 | echo "<FRAMESET COLS=\"*, $left_size\" NORESIZE=yes BORDER=0>"; |
07103a66 |
55 | } else { |
56 | echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>"; |
57 | } |
ad6787f0 |
58 | |
59 | /** |
5a7af78b |
60 | There are three ways to call webmail.php |
ad6787f0 |
61 | 1. webmail.php |
a2222aa3 |
62 | - This just loads the default entry screen. |
907165ca |
63 | 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX |
ad6787f0 |
64 | - This loads the frames starting at the given values. |
907165ca |
65 | 3. webmail.php?right_frame=folders.php |
66 | - Loads the frames with the Folder options in the right frame. |
ad6787f0 |
67 | |
68 | This was done to create a pure HTML way of refreshing the folder list since |
69 | we would like to use as little Javascript as possible. |
70 | **/ |
907165ca |
71 | if ($right_frame == "right_main.php") { |
ad6787f0 |
72 | $urlMailbox = urlencode($mailbox); |
9a732bb6 |
73 | $right_frame_url = "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage"; |
c36ed9cf |
74 | } else if ($right_frame == "options.php") { |
9a732bb6 |
75 | $right_frame_url = "options.php"; |
907165ca |
76 | } else if ($right_frame == "folders.php") { |
9a732bb6 |
77 | $right_frame_url = "folders.php"; |
ad6787f0 |
78 | } else { |
a37f3771 |
79 | if (!isset($just_logged_in)) $just_logged_in = 0; |
9a732bb6 |
80 | $right_frame_url = "right_main.php?just_logged_in=$just_logged_in"; |
81 | } |
82 | |
83 | if ($location_of_bar == 'right') |
84 | { |
85 | echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">"; |
86 | echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">"; |
87 | } |
88 | else |
89 | { |
90 | echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">"; |
91 | echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">"; |
ad6787f0 |
92 | } |
a2222aa3 |
93 | |
ad6787f0 |
94 | ?> |
21c3249f |
95 | </FRAMESET> |
96 | </HEAD></HTML> |