59177427 |
1 | <?php |
c6d6fe73 |
2 | |
864b1c33 |
3 | /** |
15e6162e |
4 | * webmail.php -- Displays the main frameset |
5 | * |
6 | * Copyright (c) 1999-2002 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 | * $Id$ |
14 | */ |
21c3249f |
15 | |
864b1c33 |
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 | |
f3bc099d |
24 | if (!function_exists('sqm_baseuri')){ |
25 | require_once('../functions/display_messages.php'); |
26 | } |
27 | $base_uri = sqm_baseuri(); |
88fa922a |
28 | |
864b1c33 |
29 | session_start(); |
30 | is_logged_in(); |
1b187352 |
31 | |
15e6162e |
32 | /** |
864b1c33 |
33 | * We'll need this to later have a noframes version |
34 | * |
35 | * Check if the user has a language preference, but no cookie. |
36 | * Send him a cookie with his language preference, if there is |
37 | * such discrepancy. |
38 | */ |
871ab9eb |
39 | $my_language = getPref($data_dir, $username, 'language'); |
864b1c33 |
40 | if ($my_language != $squirrelmail_language) { |
41 | setcookie('squirrelmail_language', $my_language, time()+2592000, $base_uri); |
42 | } |
cf47d363 |
43 | |
864b1c33 |
44 | set_up_language(getPref($data_dir, $username, 'language')); |
441f2d33 |
45 | |
65c3ec94 |
46 | echo "<html><head>\n" . |
47 | "<TITLE>$org_title</TITLE>"; |
48 | |
871ab9eb |
49 | $left_size = getPref($data_dir, $username, 'left_size'); |
50 | $location_of_bar = getPref($data_dir, $username, 'location_of_bar'); |
864b1c33 |
51 | if ($location_of_bar == '') { |
52 | $location_of_bar = 'left'; |
53 | } |
54 | if ($left_size == "") { |
55 | if (isset($default_left_size)) { |
f740c049 |
56 | $left_size = $default_left_size; |
864b1c33 |
57 | } |
58 | else { |
59 | $left_size = 200; |
60 | } |
65c3ec94 |
61 | } |
62 | |
864b1c33 |
63 | if ($location_of_bar == 'right') { |
64 | echo "<FRAMESET COLS=\"*, $left_size\" BORDER=0>"; |
65 | } |
66 | else { |
67 | echo "<FRAMESET COLS=\"$left_size, *\" BORDER=0>"; |
68 | } |
ad6787f0 |
69 | |
864b1c33 |
70 | /* |
71 | * There are three ways to call webmail.php |
72 | * 1. webmail.php |
73 | * - This just loads the default entry screen. |
74 | * 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX |
75 | * - This loads the frames starting at the given values. |
76 | * 3. webmail.php?right_frame=folders.php |
77 | * - Loads the frames with the Folder options in the right frame. |
78 | * |
79 | * This was done to create a pure HTML way of refreshing the folder list since |
80 | * we would like to use as little Javascript as possible. |
81 | */ |
82 | if (!isset($right_frame)) { |
793cc001 |
83 | $right_frame = ''; |
864b1c33 |
84 | } |
a7ea7540 |
85 | |
864b1c33 |
86 | if ($right_frame == 'right_main.php') { |
87 | $urlMailbox = urlencode($mailbox); |
88 | $right_frame_url = |
3d570ba0 |
89 | "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage"; |
65c3ec94 |
90 | } elseif ($right_frame == 'options.php') { |
864b1c33 |
91 | $right_frame_url = 'options.php'; |
65c3ec94 |
92 | } elseif ($right_frame == 'folders.php') { |
864b1c33 |
93 | $right_frame_url = 'folders.php'; |
65c3ec94 |
94 | } elseif ($right_frame == 'compose.php') { |
864b1c33 |
95 | $right_frame_url = "compose.php?send_to=$rcptaddress"; |
65c3ec94 |
96 | } else { |
871ab9eb |
97 | $right_frame_url = 'right_main.php'; |
864b1c33 |
98 | } |
9a732bb6 |
99 | |
864b1c33 |
100 | if ($location_of_bar == 'right') { |
793cc001 |
101 | echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">" . |
102 | '<FRAME SRC="left_main.php" NORESIZE NAME="left">'; |
864b1c33 |
103 | } |
104 | else { |
793cc001 |
105 | echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">'. |
106 | "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">"; |
864b1c33 |
107 | } |
753ce838 |
108 | do_hook('webmail_bottom'); |
ad6787f0 |
109 | ?> |
21c3249f |
110 | </FRAMESET> |
a507a781 |
111 | </HEAD></HTML> |