Marking some changes.
[squirrelmail.git] / src / webmail.php
CommitLineData
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 16require_once('../functions/strings.php');
17require_once('../config/config.php');
18require_once('../functions/prefs.php');
19require_once('../functions/imap.php');
20require_once('../functions/plugin.php');
21require_once('../functions/i18n.php');
22require_once('../functions/auth.php');
245a6892 23
5afe02cf 24$base_uri = dirname(dirname($PHP_SELF)) . "/";
88fa922a 25
864b1c33 26session_start();
27is_logged_in();
1b187352 28
15e6162e 29/**
864b1c33 30 * We'll need this to later have a noframes version
31 *
32 * Check if the user has a language preference, but no cookie.
33 * Send him a cookie with his language preference, if there is
34 * such discrepancy.
35 */
871ab9eb 36$my_language = getPref($data_dir, $username, 'language');
864b1c33 37if ($my_language != $squirrelmail_language) {
38 setcookie('squirrelmail_language', $my_language, time()+2592000, $base_uri);
39}
cf47d363 40
864b1c33 41set_up_language(getPref($data_dir, $username, 'language'));
441f2d33 42
65c3ec94 43echo "<html><head>\n" .
44 "<TITLE>$org_title</TITLE>";
45
871ab9eb 46$left_size = getPref($data_dir, $username, 'left_size');
47$location_of_bar = getPref($data_dir, $username, 'location_of_bar');
864b1c33 48if ($location_of_bar == '') {
49 $location_of_bar = 'left';
50}
51if ($left_size == "") {
52 if (isset($default_left_size)) {
f740c049 53 $left_size = $default_left_size;
864b1c33 54 }
55 else {
56 $left_size = 200;
57 }
65c3ec94 58}
59
864b1c33 60if ($location_of_bar == 'right') {
61 echo "<FRAMESET COLS=\"*, $left_size\" BORDER=0>";
62}
63else {
64 echo "<FRAMESET COLS=\"$left_size, *\" BORDER=0>";
65}
ad6787f0 66
864b1c33 67/*
68 * There are three ways to call webmail.php
69 * 1. 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.
75 *
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.
78 */
79if (!isset($right_frame)) {
793cc001 80 $right_frame = '';
864b1c33 81}
a7ea7540 82
864b1c33 83if ($right_frame == 'right_main.php') {
84 $urlMailbox = urlencode($mailbox);
85 $right_frame_url =
3d570ba0 86 "right_main.php?mailbox=$urlMailbox&amp;sort=$sort&amp;startMessage=$startMessage";
65c3ec94 87} elseif ($right_frame == 'options.php') {
864b1c33 88 $right_frame_url = 'options.php';
65c3ec94 89} elseif ($right_frame == 'folders.php') {
864b1c33 90 $right_frame_url = 'folders.php';
65c3ec94 91} elseif ($right_frame == 'compose.php') {
864b1c33 92 $right_frame_url = "compose.php?send_to=$rcptaddress";
65c3ec94 93} else {
871ab9eb 94 $right_frame_url = 'right_main.php';
864b1c33 95}
9a732bb6 96
864b1c33 97if ($location_of_bar == 'right') {
793cc001 98 echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">" .
99 '<FRAME SRC="left_main.php" NORESIZE NAME="left">';
864b1c33 100}
101else {
793cc001 102 echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">'.
103 "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">";
864b1c33 104}
753ce838 105do_hook('webmail_bottom');
ad6787f0 106?>
21c3249f 107</FRAMESET>
a507a781 108</HEAD></HTML>