fixed a '\ that should have been " "
[squirrelmail.git] / src / webmail.php
CommitLineData
59177427 1<?php
c6d6fe73 2
21c3249f 3 /**
5bbe20e4 4 ** webmail.php -- Displays the main frameset
21c3249f 5 **
c6d6fe73 6 ** Copyright (c) 1999-2000 The SquirrelMail development team
5bbe20e4 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.
21c3249f 12 **
245a6892 13 ** $Id$
21c3249f 14 **/
15
2a32fc83 16 session_start();
17
441f2d33 18 if (!isset($i18n_php))
c9e9b23c 19 include ('../functions/i18n.php');
441f2d33 20
21c3249f 21 if(!isset($username)) {
441f2d33 22 set_up_language($squirrelmail_language);
c9e9b23c 23 include ('../themes/default_theme.php');
24 include ('../functions/display_messages.php');
10455998 25 printf('<html><BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">',
26 $color[8], $color[4], $color[7], $color[7], $color[7]);
27 plain_error_message(_("You need a valid user and password to access this page!")
28 . "<br><a href=\"../src/login.php\">"
29 . _("Click here to log back in.") . "</a>.", $color);
c9e9b23c 30 echo '</body></html>';
21c3249f 31 exit;
32 }
33
245a6892 34 if (!isset($strings_php))
c9e9b23c 35 include ('../functions/strings.php');
36 include ('../config/config.php');
37 include ('../functions/prefs.php');
38 include ('../functions/imap.php');
27e81758 39 if (!isset($plugin_php))
c9e9b23c 40 include ('../functions/plugin.php');
3c13b9fb 41 if (!isset($auth_php))
c9e9b23c 42 include ('../functions/auth.php');
245a6892 43
c9e9b23c 44 include ('../src/load_prefs.php');
1b187352 45
441f2d33 46 // We'll need this to later have a noframes version
cf47d363 47 //
48 // Check if the user has a language preference, but no cookie.
49 // Send him a cookie with his language preference, if there is
50 // such discrepancy.
51 $my_language=getPref($data_dir, $username, "language");
52 if ($my_language != $squirrelmail_language)
53 setcookie('squirrelmail_language', $my_language, time()+2592000);
54
c9e9b23c 55 set_up_language(getPref($data_dir, $username, 'language'));
441f2d33 56
3c13b9fb 57 echo "<html><head>\n";
c9e9b23c 58 echo '<TITLE>';
59 echo $org_title;
60 echo '</TITLE>';
9a732bb6 61
21a37291 62 $bar_size = $left_size;
9a732bb6 63
64 if ($location_of_bar == 'right')
65 {
66 echo "<FRAMESET COLS=\"*, $left_size\" NORESIZE=yes BORDER=0>";
07103a66 67 } else {
68 echo "<FRAMESET COLS=\"$left_size, *\" NORESIZE BORDER=0>";
69 }
ad6787f0 70
71/**
5a7af78b 72 There are three ways to call webmail.php
ad6787f0 73 1. webmail.php
a2222aa3 74 - This just loads the default entry screen.
907165ca 75 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
ad6787f0 76 - This loads the frames starting at the given values.
907165ca 77 3. webmail.php?right_frame=folders.php
78 - Loads the frames with the Folder options in the right frame.
ad6787f0 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**/
a7ea7540 83 if (!isset($right_frame)) $right_frame = "";
84
c9e9b23c 85 if ($right_frame == 'right_main.php') {
ad6787f0 86 $urlMailbox = urlencode($mailbox);
9a732bb6 87 $right_frame_url = "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage";
c9e9b23c 88 } else if ($right_frame == 'options.php') {
89 $right_frame_url = 'options.php';
90 } else if ($right_frame == 'folders.php') {
91 $right_frame_url = 'folders.php';
ad6787f0 92 } else {
a37f3771 93 if (!isset($just_logged_in)) $just_logged_in = 0;
9a732bb6 94 $right_frame_url = "right_main.php?just_logged_in=$just_logged_in";
95 }
96
97 if ($location_of_bar == 'right')
98 {
99 echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">";
c9e9b23c 100 echo '<FRAME SRC="left_main.php" NAME="left">';
9a732bb6 101 }
102 else
103 {
c9e9b23c 104 echo '<FRAME SRC="left_main.php" NAME="left">';
9a732bb6 105 echo "<FRAME SRC=\"$right_frame_url\" NAME=\"right\">";
ad6787f0 106 }
a2222aa3 107
ad6787f0 108?>
21c3249f 109</FRAMESET>
110</HEAD></HTML>