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