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 | ** |
245a6892 |
13 | ** $Id$ |
21c3249f |
14 | **/ |
15 | |
ff8a98e7 |
16 | require_once('../functions/strings.php'); |
17 | require_once('../config/config.php'); |
18 | require_once('../functions/prefs.php'); |
19 | require_once('../functions/imap.php'); |
20 | require_once('../functions/plugin.php'); |
21 | require_once('../functions/i18n.php'); |
22 | require_once('../functions/auth.php'); |
245a6892 |
23 | |
f740c049 |
24 | session_start(); |
25 | is_logged_in(); |
26 | checkForPrefs($data_dir, $username); |
1b187352 |
27 | |
441f2d33 |
28 | // We'll need this to later have a noframes version |
cf47d363 |
29 | // |
30 | // Check if the user has a language preference, but no cookie. |
31 | // Send him a cookie with his language preference, if there is |
32 | // such discrepancy. |
33 | $my_language=getPref($data_dir, $username, "language"); |
34 | if ($my_language != $squirrelmail_language) |
35 | setcookie('squirrelmail_language', $my_language, time()+2592000); |
36 | |
c9e9b23c |
37 | set_up_language(getPref($data_dir, $username, 'language')); |
441f2d33 |
38 | |
3c13b9fb |
39 | echo "<html><head>\n"; |
c9e9b23c |
40 | echo '<TITLE>'; |
41 | echo $org_title; |
42 | echo '</TITLE>'; |
9a732bb6 |
43 | |
f740c049 |
44 | $left_size = getPref($data_dir, $username, "left_size"); |
45 | $location_of_bar = getPref($data_dir, $username, "location_of_bar"); |
46 | if ($location_of_bar == '') |
47 | $location_of_bar = 'left'; |
48 | if ($left_size == "") { |
49 | if (isset($default_left_size)) |
50 | $left_size = $default_left_size; |
51 | else |
52 | $left_size = 200; |
53 | } |
9a732bb6 |
54 | |
55 | if ($location_of_bar == 'right') |
56 | { |
9c6d8388 |
57 | echo "<FRAMESET COLS=\"*, $left_size\" BORDER=0>"; |
07103a66 |
58 | } else { |
9c6d8388 |
59 | echo "<FRAMESET COLS=\"$left_size, *\" BORDER=0>"; |
07103a66 |
60 | } |
ad6787f0 |
61 | |
62 | /** |
5a7af78b |
63 | There are three ways to call webmail.php |
ad6787f0 |
64 | 1. webmail.php |
a2222aa3 |
65 | - This just loads the default entry screen. |
907165ca |
66 | 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX |
ad6787f0 |
67 | - This loads the frames starting at the given values. |
907165ca |
68 | 3. webmail.php?right_frame=folders.php |
69 | - Loads the frames with the Folder options in the right frame. |
ad6787f0 |
70 | |
71 | This was done to create a pure HTML way of refreshing the folder list since |
72 | we would like to use as little Javascript as possible. |
73 | **/ |
a7ea7540 |
74 | if (!isset($right_frame)) $right_frame = ""; |
75 | |
c9e9b23c |
76 | if ($right_frame == 'right_main.php') { |
ad6787f0 |
77 | $urlMailbox = urlencode($mailbox); |
9a732bb6 |
78 | $right_frame_url = "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage"; |
c9e9b23c |
79 | } else if ($right_frame == 'options.php') { |
80 | $right_frame_url = 'options.php'; |
81 | } else if ($right_frame == 'folders.php') { |
82 | $right_frame_url = 'folders.php'; |
6978d355 |
83 | } else if ($right_frame == 'compose.php') { |
84 | $right_frame_url = "compose.php?send_to=$rcptaddress"; |
ad6787f0 |
85 | } else { |
8061a3fb |
86 | $right_frame_url = "right_main.php"; |
9a732bb6 |
87 | } |
88 | |
89 | if ($location_of_bar == 'right') |
90 | { |
9c6d8388 |
91 | echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">"; |
92 | echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">'; |
9a732bb6 |
93 | } |
94 | else |
95 | { |
9c6d8388 |
96 | echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">'; |
97 | echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">"; |
ad6787f0 |
98 | } |
a2222aa3 |
99 | |
ad6787f0 |
100 | ?> |
21c3249f |
101 | </FRAMESET> |
ff8a98e7 |
102 | </HEAD></HTML> |