72f0c0783d789e002632f9c48f4f7b2ae50674ec
4 * webmail.php -- Displays the main frameset
6 * Copyright (c) 1999-2002 The SquirrelMail development team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
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.
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');
24 $base_uri = dirname(dirname($PHP_SELF)) . "/";
30 * We'll need this to later have a noframes version
32 * Check if the user has a language preference, but no cookie.
33 * Send him a cookie with his language preference, if there is
36 $my_language = getPref($data_dir, $username, 'language');
37 if ($my_language != $squirrelmail_language) {
38 setcookie('squirrelmail_language', $my_language, time()+
2592000, $base_uri);
41 set_up_language(getPref($data_dir, $username, 'language'));
43 echo "<html><head>\n" .
44 "<TITLE>$org_title</TITLE>";
46 $left_size = getPref($data_dir, $username, 'left_size');
47 $location_of_bar = getPref($data_dir, $username, 'location_of_bar');
48 if ($location_of_bar == '') {
49 $location_of_bar = 'left';
51 if ($left_size == "") {
52 if (isset($default_left_size)) {
53 $left_size = $default_left_size;
60 if ($location_of_bar == 'right') {
61 echo "<FRAMESET COLS=\"*, $left_size\" BORDER=0>";
64 echo "<FRAMESET COLS=\"$left_size, *\" BORDER=0>";
68 * There are three ways to call webmail.php
70 * - This just loads the default entry screen.
71 * 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
72 * - This loads the frames starting at the given values.
73 * 3. webmail.php?right_frame=folders.php
74 * - Loads the frames with the Folder options in the right frame.
76 * This was done to create a pure HTML way of refreshing the folder list since
77 * we would like to use as little Javascript as possible.
79 if (!isset($right_frame)) {
83 if ($right_frame == 'right_main.php') {
84 $urlMailbox = urlencode($mailbox);
86 "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage";
87 } elseif ($right_frame == 'options.php') {
88 $right_frame_url = 'options.php';
89 } elseif ($right_frame == 'folders.php') {
90 $right_frame_url = 'folders.php';
91 } elseif ($right_frame == 'compose.php') {
92 $right_frame_url = "compose.php?send_to=$rcptaddress";
94 $right_frame_url = 'right_main.php';
97 if ($location_of_bar == 'right') {
98 echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">" .
99 '<FRAME SRC="left_main.php" NORESIZE NAME="left">';
102 echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">'.
103 "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">";
105 do_hook('webmail_bottom');