| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | ** webmail.php -- Displays the main frameset |
| 5 | ** |
| 6 | ** Copyright (c) 1999-2000 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 | **/ |
| 15 | |
| 16 | include ('../functions/strings.php'); |
| 17 | include ('../config/config.php'); |
| 18 | include ('../functions/prefs.php'); |
| 19 | include ('../functions/imap.php'); |
| 20 | include ('../functions/plugin.php'); |
| 21 | include ('../functions/i18n.php'); |
| 22 | include ('../functions/auth.php'); |
| 23 | |
| 24 | session_start(); |
| 25 | is_logged_in(); |
| 26 | checkForPrefs($data_dir, $username); |
| 27 | |
| 28 | // We'll need this to later have a noframes version |
| 29 | // |
| 30 | // Check if the user has a language preference, but no cookie. |
| 31 | // Send him a cookie with his language preference, if there is |
| 32 | // such discrepancy. |
| 33 | $my_language=getPref($data_dir, $username, "language"); |
| 34 | if ($my_language != $squirrelmail_language) |
| 35 | setcookie('squirrelmail_language', $my_language, time()+2592000); |
| 36 | |
| 37 | set_up_language(getPref($data_dir, $username, 'language')); |
| 38 | |
| 39 | echo "<html><head>\n"; |
| 40 | echo '<TITLE>'; |
| 41 | echo $org_title; |
| 42 | echo '</TITLE>'; |
| 43 | |
| 44 | $left_size = getPref($data_dir, $username, "left_size"); |
| 45 | $location_of_bar = getPref($data_dir, $username, "location_of_bar"); |
| 46 | if ($location_of_bar == '') |
| 47 | $location_of_bar = 'left'; |
| 48 | if ($left_size == "") { |
| 49 | if (isset($default_left_size)) |
| 50 | $left_size = $default_left_size; |
| 51 | else |
| 52 | $left_size = 200; |
| 53 | } |
| 54 | |
| 55 | if ($location_of_bar == 'right') |
| 56 | { |
| 57 | echo "<FRAMESET COLS=\"*, $left_size\" BORDER=0>"; |
| 58 | } else { |
| 59 | echo "<FRAMESET COLS=\"$left_size, *\" BORDER=0>"; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | There are three ways to call webmail.php |
| 64 | 1. 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. |
| 70 | |
| 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. |
| 73 | **/ |
| 74 | if (!isset($right_frame)) $right_frame = ""; |
| 75 | |
| 76 | if ($right_frame == 'right_main.php') { |
| 77 | $urlMailbox = urlencode($mailbox); |
| 78 | $right_frame_url = "right_main.php?mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage"; |
| 79 | } else if ($right_frame == 'options.php') { |
| 80 | $right_frame_url = 'options.php'; |
| 81 | } else if ($right_frame == 'folders.php') { |
| 82 | $right_frame_url = 'folders.php'; |
| 83 | } else if ($right_frame == 'compose.php') { |
| 84 | $right_frame_url = "compose.php?send_to=$rcptaddress"; |
| 85 | } else { |
| 86 | if (!isset($just_logged_in)) $just_logged_in = 0; |
| 87 | $right_frame_url = "right_main.php?just_logged_in=$just_logged_in"; |
| 88 | } |
| 89 | |
| 90 | if ($location_of_bar == 'right') |
| 91 | { |
| 92 | echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">"; |
| 93 | echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">'; |
| 94 | } |
| 95 | else |
| 96 | { |
| 97 | echo '<FRAME SRC="left_main.php" NORESIZE NAME="left">'; |
| 98 | echo "<FRAME SRC=\"$right_frame_url\" NORESIZE NAME=\"right\">"; |
| 99 | } |
| 100 | |
| 101 | ?> |
| 102 | </FRAMESET> |
| 103 | </HEAD></HTML> |