6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
12 /* include the mime class before the session start ! otherwise we can't store
13 * messages with a session_register.
15 * From http://www.php.net/manual/en/language.oop.serialization.php:
16 * In case this isn't clear:
18 * session.auto_start and session objects are mutually exclusive.
20 * We need to load the classes before the session is started,
21 * except that the session could be started automatically
22 * via session.auto_start. So, we'll close the session,
23 * then load the classes, and reopen the session which should
24 * make everything happy.
26 * ** Note this means that for the 1.3.2 release, we should probably
27 * recommend that people set session.auto_start=0 to avoid this altogether.
29 session_write_close();
31 /* SquirrelMail required files. */
32 require_once(SM_PATH
. 'class/mime.class.php');
36 require_once(SM_PATH
. 'functions/i18n.php');
37 require_once(SM_PATH
. 'functions/auth.php');
38 require_once(SM_PATH
. 'functions/strings.php');
39 require_once(SM_PATH
. 'functions/global.php');
43 /* Remove all slashes for form values. */
44 if (get_magic_quotes_gpc()) {
45 global $REQUEST_METHOD;
47 if ($REQUEST_METHOD == 'POST') {
48 global $HTTP_POST_VARS;
49 RemoveSlashes($HTTP_POST_VARS);
50 } else if ($REQUEST_METHOD == 'GET') {
51 global $HTTP_GET_VARS;
52 RemoveSlashes($HTTP_GET_VARS);
59 * if $send (the form button's name) contains "\n" as the first char
60 * and the script is compose.php, then trim everything. Otherwise, we
61 * don't have to worry.
63 * This is for a RedHat package bug and a Konqueror (pre 2.1.1?) bug
65 global $send, $PHP_SELF;
67 && (substr($send, 0, 1) == "\n")
68 && (substr($PHP_SELF, -12) == '/compose.php')) {
69 if ($REQUEST_METHOD == 'POST') {
70 global $HTTP_POST_VARS;
71 TrimArray($HTTP_POST_VARS);
73 global $HTTP_GET_VARS;
74 TrimArray($HTTP_GET_VARS);
79 * Everyone needs stuff from config, and config needs stuff from
80 * strings.php, so include them both here. Actually, strings is
81 * included at the top now as the string array functions have
84 * Include them down here instead of at the top so that all config
85 * variables overwrite any passed in variables (for security).
89 * Reset the $theme() array in case a value was passed via a cookie.
90 * This is until theming is rewritten.
96 require_once(SM_PATH
. 'config/config.php');
97 require_once(SM_PATH
. 'include/load_prefs.php');
98 require_once(SM_PATH
. 'functions/page_header.php');
99 require_once(SM_PATH
. 'functions/prefs.php');
101 /* Set up the language (i18n.php was included by auth.php). */
102 global $username, $data_dir;
103 set_up_language(getPref($data_dir, $username, 'language'));
105 $timeZone = getPref($data_dir, $username, 'timezone');
106 if ( $timeZone != SMPREF_NONE
&& ($timeZone != "")
107 && !ini_get("safe_mode")) {
108 putenv("TZ=".$timeZone);