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); |
10455998 |
22 | include ("../themes/default_theme.php"); |
23 | include ("../functions/display_messages.php"); |
24 | printf('<html><BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">', |
25 | $color[8], $color[4], $color[7], $color[7], $color[7]); |
26 | plain_error_message(_("You need a valid user and password to access this page!") |
27 | . "<br><a href=\"../src/login.php\">" |
28 | . _("Click here to log back in.") . "</a>.", $color); |
29 | echo "</body></html>"; |
21c3249f |
30 | exit; |
31 | } |
32 | |
7ce342dc |
33 | include ("../config/config.php"); |
65b14f90 |
34 | include ("../functions/prefs.php"); |
19acd99f |
35 | include ("../functions/imap.php"); |
27e81758 |
36 | if (!isset($plugin_php)) |
37 | include ("../functions/plugin.php"); |
3c13b9fb |
38 | if (!isset($auth_php)) |
39 | include ("../functions/auth.php"); |
52eefafc |
40 | if (!isset($strings_php)) |
41 | include ("../functions/strings.php"); |
27e81758 |
42 | |
2848c630 |
43 | include ("../src/load_prefs.php"); |
1b187352 |
44 | |
441f2d33 |
45 | // We'll need this to later have a noframes version |
46 | set_up_language(getPref($data_dir, $username, "language")); |
47 | |
3c13b9fb |
48 | echo "<html><head>\n"; |
8105d00f |
49 | echo "<TITLE>"; |
7ce342dc |
50 | echo "$org_title"; |
8105d00f |
51 | echo "</TITLE>"; |
9a732bb6 |
52 | |
21a37291 |
53 | $bar_size = $left_size; |
9a732bb6 |
54 | |
55 | if ($location_of_bar == 'right') |
56 | { |
57 | echo "<FRAMESET COLS=\"*, $left_size\" NORESIZE=yes BORDER=0>"; |
07103a66 |
58 | } else { |
59 | echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>"; |
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 | **/ |
907165ca |
74 | if ($right_frame == "right_main.php") { |
ad6787f0 |
75 | $urlMailbox = urlencode($mailbox); |
9a732bb6 |
76 | $right_frame_url = "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage"; |
c36ed9cf |
77 | } else if ($right_frame == "options.php") { |
9a732bb6 |
78 | $right_frame_url = "options.php"; |
907165ca |
79 | } else if ($right_frame == "folders.php") { |
9a732bb6 |
80 | $right_frame_url = "folders.php"; |
ad6787f0 |
81 | } else { |
a37f3771 |
82 | if (!isset($just_logged_in)) $just_logged_in = 0; |
9a732bb6 |
83 | $right_frame_url = "right_main.php?just_logged_in=$just_logged_in"; |
84 | } |
85 | |
86 | if ($location_of_bar == 'right') |
87 | { |
88 | echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">"; |
89 | echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">"; |
90 | } |
91 | else |
92 | { |
93 | echo "<FRAME SRC=\"left_main.php\" NAME=\"left\">"; |
94 | echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">"; |
ad6787f0 |
95 | } |
a2222aa3 |
96 | |
ad6787f0 |
97 | ?> |
21c3249f |
98 | </FRAMESET> |
99 | </HEAD></HTML> |