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 if (!function_exists('sqm_baseuri')){
25 require_once('../functions/display_messages.php');
27 $base_uri = sqm_baseuri();
33 * We'll need this to later have a noframes version
35 * Check if the user has a language preference, but no cookie.
36 * Send him a cookie with his language preference, if there is
39 $my_language = getPref($data_dir, $username, 'language');
40 if ($my_language != $squirrelmail_language) {
41 setcookie('squirrelmail_language', $my_language, time()+
2592000, $base_uri);
44 set_up_language(getPref($data_dir, $username, 'language'));
46 echo "<html><head>\n" .
47 "<title>$org_title</title>";
49 $left_size = getPref($data_dir, $username, 'left_size');
50 $location_of_bar = getPref($data_dir, $username, 'location_of_bar');
52 if (isset($languages[$squirrelmail_language]['DIR']) &&
53 strtolower($languages[$squirrelmail_language]['DIR']) == 'rtl') {
54 $temp_location_of_bar = 'right';
56 $temp_location_of_bar = 'left';
59 if ($location_of_bar == '') {
60 $location_of_bar = $temp_location_of_bar;
62 $temp_location_of_bar = '';
64 if ($left_size == "") {
65 if (isset($default_left_size)) {
66 $left_size = $default_left_size;
73 if ($location_of_bar == 'right') {
74 echo "<frameset cols=\"*, $left_size\" border=\"0\" id=\"fs1\">";
77 echo "<frameset cols=\"$left_size, *\" border=\"0\" id=\"fs1\">";
81 * There are three ways to call webmail.php
83 * - This just loads the default entry screen.
84 * 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
85 * - This loads the frames starting at the given values.
86 * 3. webmail.php?right_frame=folders.php
87 * - Loads the frames with the Folder options in the right frame.
89 * This was done to create a pure HTML way of refreshing the folder list since
90 * we would like to use as little Javascript as possible.
92 if (!isset($right_frame)) {
95 if ($right_frame == 'right_main.php') {
96 $urlMailbox = urlencode($mailbox);
98 "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage";
99 } elseif ($right_frame == 'options.php') {
100 $right_frame_url = 'options.php';
101 } elseif ($right_frame == 'folders.php') {
102 $right_frame_url = 'folders.php';
103 } else if ($right_frame == '') {
104 $right_frame_url = 'right_main.php';
106 $right_frame_url = urldecode($right_frame);
109 if ($location_of_bar == 'right') {
110 echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">" .
111 '<FRAME SRC="left_main.php" NORESIZE NAME="left">';
114 echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">'.
115 "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">";
117 do_hook('webmail_bottom');