6
* Copyright (c) 1999-2003 The SquirrelMail Project Team
7
* Licensed under the GNU GPL. For full terms see the file COPYING.
9
* $Id: validate.php,v 1.13 2003/12/01 21:56:48 cigamit Exp $
10
* @package squirrelmail
13
/** include the mime class before the session start ! otherwise we can't store
14
* messages with a session_register.
16
* From http://www.php.net/manual/en/language.oop.serialization.php:
17
* In case this isn't clear:
19
* session.auto_start and session objects are mutually exclusive.
21
* We need to load the classes before the session is started,
22
* except that the session could be started automatically
23
* via session.auto_start. So, we'll close the session,
24
* then load the classes, and reopen the session which should
25
* make everything happy.
27
* ** Note this means that for the 1.3.2 release, we should probably
28
* recommend that people set session.auto_start=0 to avoid this altogether.
31
session_write_close();
34
* Reset the $theme() array in case a value was passed via a cookie.
35
* This is until theming is rewritten.
41
/* SquirrelMail required files. */
42
require_once(SM_PATH . 'class/mime.class.php');
43
require_once(SM_PATH . 'functions/global.php');
44
require_once(SM_PATH . 'functions/strings.php');
45
require_once(SM_PATH . 'config/config.php');
47
/* set the name of the session cookie */
48
if(isset($session_name) && $session_name) {
49
ini_set('session.name' , $session_name);
51
ini_set('session.name' , 'SQMSESSID');
54
sqsession_is_active();
56
require_once(SM_PATH . 'functions/i18n.php');
57
require_once(SM_PATH . 'functions/auth.php');
64
* if $send (the form button's name) contains "\n" as the first char
65
* and the script is compose.php, then trim everything. Otherwise, we
66
* don't have to worry.
68
* This is for a RedHat package bug and a Konqueror (pre 2.1.1?) bug
70
global $send, $PHP_SELF;
72
&& (substr($send, 0, 1) == "\n")
73
&& (substr($PHP_SELF, -12) == '/compose.php')) {
74
if ($REQUEST_METHOD == 'POST') {
75
global $HTTP_POST_VARS;
76
TrimArray($HTTP_POST_VARS);
78
global $HTTP_GET_VARS;
79
TrimArray($HTTP_GET_VARS);
83
require_once(SM_PATH . 'include/load_prefs.php');
84
require_once(SM_PATH . 'functions/page_header.php');
85
require_once(SM_PATH . 'functions/prefs.php');
87
/* Set up the language (i18n.php was included by auth.php). */
88
global $username, $data_dir;
89
set_up_language(getPref($data_dir, $username, 'language'));
91
$timeZone = getPref($data_dir, $username, 'timezone');
93
/* Check to see if we are allowed to set the TZ environment variable.
94
* We are able to do this if ...
95
* safe_mode is disabled OR
96
* safe_mode_allowed_env_vars is empty (you are allowed to set any) OR
97
* safe_mode_allowed_env_vars contains TZ
99
$tzChangeAllowed = (!ini_get('safe_mode')) ||
100
!strcmp(ini_get('safe_mode_allowed_env_vars'),'') ||
101
preg_match('/^([\w_]+,)*TZ/', ini_get('safe_mode_allowed_env_vars'));
103
if ( $timeZone != SMPREF_NONE && ($timeZone != "")
104
&& $tzChangeAllowed ) {
105
putenv("TZ=".$timeZone);