3 * webmail.php -- Displays the main frameset
5 * This file generates the main frameset. The files that are
6 * shown can be given as parameters. If the user is not logged in
7 * this file will verify username and password.
9 * @copyright © 1999-2006 The SquirrelMail Project Team
10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
12 * @package squirrelmail
16 * Include the SquirrelMail initialization file.
18 require('../include/init.php');
20 if (sqgetGlobalVar('sort', $sort)) {
24 if (sqgetGlobalVar('startMessage', $startMessage)) {
25 $startMessage = (int) $startMessage;
28 if (!sqgetGlobalVar('mailbox', $mailbox)) {
32 sqgetGlobalVar('right_frame', $right_frame, SQ_GET
);
34 if(!sqgetGlobalVar('mailto', $mailto)) {
38 // Determine the size of the left frame
39 $left_size = getPref($data_dir, $username, 'left_size');
40 if ($left_size == "") {
41 if (isset($default_left_size)) {
42 $left_size = $default_left_size;
49 // Determine where the navigation frame should be
50 $location_of_bar = getPref($data_dir, $username, 'location_of_bar');
51 if (isset($languages[$squirrelmail_language]['DIR']) &&
52 strtolower($languages[$squirrelmail_language]['DIR']) == 'rtl') {
53 $temp_location_of_bar = 'right';
55 $temp_location_of_bar = 'left';
57 if ($location_of_bar == '') {
58 $location_of_bar = $temp_location_of_bar;
61 // Determine the main frame URL
63 * There are three ways to call webmail.php
65 * - This just loads the default entry screen.
66 * 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
67 * - This loads the frames starting at the given values.
68 * 3. webmail.php?right_frame=folders.php
69 * - Loads the frames with the Folder options in the right frame.
71 * This was done to create a pure HTML way of refreshing the folder list since
72 * we would like to use as little Javascript as possible.
74 * The test for // should catch any attempt to include off-site webpages into
77 if (empty($right_frame) ||
(strpos(urldecode($right_frame), '//') !== false)) {
80 if ( strpos($right_frame,'?') ) {
81 $right_frame_file = substr($right_frame,0,strpos($right_frame,'?'));
83 $right_frame_file = $right_frame;
85 switch($right_frame) {
86 case 'right_main.php':
87 $right_frame_url = "right_main.php?mailbox=".urlencode($mailbox)
88 . (!empty($sort)?
"&sort=$sort":'')
89 . (!empty($startMessage)?
"&startMessage=$startMessage":'');
92 $right_frame_url = 'options.php';
95 $right_frame_url = 'folders.php';
98 $right_frame_url = 'compose.php?' . $mailto;
101 $right_frame_url = 'right_main.php';
104 $right_frame_url = urlencode($right_frame);
108 displayHtmlHeader($org_title, '', false, true);
109 $oErrorHandler->setDelayedErrors(true);
111 do_hook('webmail_top');
113 $oTemplate->assign('nav_size', $left_size);
114 $oTemplate->assign('nav_on_left', $location_of_bar=='left');
115 $oTemplate->assign('right_frame_url', $right_frame_url);
117 $oTemplate->display('webmail.tpl');
119 $oTemplate->display('footer.tpl');