4 * webmail.php -- Displays the main frameset
6 * This file generates the main frameset. The files that are
7 * shown can be given as parameters. If the user is not logged in
8 * this file will verify username and password.
10 * @copyright © 1999-2006 The SquirrelMail Project Team
11 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
13 * @package squirrelmail
17 * Include the SquirrelMail initialization file.
19 require('../include/init.php');
21 sqgetGlobalVar('username', $username, SQ_SESSION
);
22 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION
);
23 sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION
);
25 if (sqgetGlobalVar('sort', $sort)) {
29 if (sqgetGlobalVar('startMessage', $startMessage)) {
30 $startMessage = (int) $startMessage;
33 if (!sqgetGlobalVar('mailbox', $mailbox)) {
37 sqgetGlobalVar('right_frame', $right_frame, SQ_GET
);
39 if ( isset($_SESSION['session_expired_post']) ) {
40 sqsession_unregister('session_expired_post');
42 if(!sqgetGlobalVar('mailto', $mailto)) {
46 do_hook('webmail_top');
48 $output = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\"\n".
49 " \"http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd\">\n".
51 "<meta name=\"robots\" content=\"noindex,nofollow\">\n" .
52 "<title>$org_title</title>\n".
55 $left_size = getPref($data_dir, $username, 'left_size');
56 $location_of_bar = getPref($data_dir, $username, 'location_of_bar');
58 if (isset($languages[$squirrelmail_language]['DIR']) &&
59 strtolower($languages[$squirrelmail_language]['DIR']) == 'rtl') {
60 $temp_location_of_bar = 'right';
62 $temp_location_of_bar = 'left';
65 if ($location_of_bar == '') {
66 $location_of_bar = $temp_location_of_bar;
68 $temp_location_of_bar = '';
70 if ($left_size == "") {
71 if (isset($default_left_size)) {
72 $left_size = $default_left_size;
79 if ($location_of_bar == 'right') {
80 $output .= "<frameset cols=\"*, $left_size\" id=\"fs1\">\n";
83 $output .= "<frameset cols=\"$left_size, *\" id=\"fs1\">\n";
87 * There are three ways to call webmail.php
89 * - This just loads the default entry screen.
90 * 2. webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
91 * - This loads the frames starting at the given values.
92 * 3. webmail.php?right_frame=folders.php
93 * - Loads the frames with the Folder options in the right frame.
95 * This was done to create a pure HTML way of refreshing the folder list since
96 * we would like to use as little Javascript as possible.
98 * The test for // should catch any attempt to include off-site webpages into
102 if (empty($right_frame) ||
(strpos(urldecode($right_frame), '//') !== false)) {
106 if ( strpos($right_frame,'?') ) {
107 $right_frame_file = substr($right_frame,0,strpos($right_frame,'?'));
109 $right_frame_file = $right_frame;
112 switch($right_frame) {
113 case 'right_main.php':
114 $right_frame_url = "right_main.php?mailbox=".urlencode($mailbox)
115 . (!empty($sort)?
"&sort=$sort":'')
116 . (!empty($startMessage)?
"&startMessage=$startMessage":'');
119 $right_frame_url = 'options.php';
122 $right_frame_url = 'folders.php';
125 $right_frame_url = 'compose.php?' . $mailto;
128 $right_frame_url = 'right_main.php';
131 $right_frame_url = urlencode($right_frame);
135 $left_frame = '<frame src="left_main.php" name="left" frameborder="1" title="'.
136 _("Folder List") ."\" />\n";
137 $right_frame = '<frame src="'.$right_frame_url.'" name="right" frameborder="1" title="'.
138 _("Message List") ."\" />\n";
140 if ($location_of_bar == 'right') {
141 $output .= $right_frame . $left_frame;
144 $output .= $left_frame . $right_frame;
146 $ret = concat_hook_function('webmail_bottom', $output);
151 echo $output . '</frameset>';
153 $oTemplate->display('footer.tpl');