f740c049 |
1 | <?php |
895905c0 |
2 | |
35586184 |
3 | /** |
cab99c3a |
4 | * validate.php |
5 | * |
6 | * Copyright (c) 1999-2002 The SquirrelMail Project Team |
7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | * |
9 | * $Id$ |
10 | */ |
f740c049 |
11 | |
35586184 |
12 | session_start(); |
cab99c3a |
13 | |
35586184 |
14 | require_once('../functions/i18n.php'); |
15 | require_once('../functions/auth.php'); |
16 | require_once('../functions/strings.php'); |
f740c049 |
17 | |
cab99c3a |
18 | is_logged_in(); |
f740c049 |
19 | |
cab99c3a |
20 | /* Remove all slashes for form values. */ |
21 | if (get_magic_quotes_gpc()) { |
22 | global $REQUEST_METHOD; |
f740c049 |
23 | |
5be9f195 |
24 | if ($REQUEST_METHOD == 'POST') { |
cab99c3a |
25 | global $HTTP_POST_VARS; |
26 | RemoveSlashes($HTTP_POST_VARS); |
5be9f195 |
27 | } else if ($REQUEST_METHOD == 'GET') { |
cab99c3a |
28 | global $HTTP_GET_VARS; |
29 | RemoveSlashes($HTTP_GET_VARS); |
f7b1b3b1 |
30 | } |
cab99c3a |
31 | } |
f740c049 |
32 | |
cab99c3a |
33 | /** |
34 | * Auto-detection |
35 | * |
36 | * if $send (the form button's name) contains "\n" as the first char |
37 | * and the script is compose.php, then trim everything. Otherwise, we |
38 | * don't have to worry. |
39 | * |
40 | * This is for a RedHat package bug and a Konqueror (pre 2.1.1?) bug |
41 | */ |
42 | global $send, $PHP_SELF; |
43 | if (isset($send) |
44 | && (substr($send, 0, 1) == "\n") |
45 | && (substr($PHP_SELF, -12) == '/compose.php')) { |
5be9f195 |
46 | if ($REQUEST_METHOD == 'POST') { |
cab99c3a |
47 | global $HTTP_POST_VARS; |
48 | TrimArray($HTTP_POST_VARS); |
49 | } else { |
50 | global $HTTP_GET_VARS; |
51 | TrimArray($HTTP_GET_VARS); |
f7b1b3b1 |
52 | } |
cab99c3a |
53 | } |
f7b1b3b1 |
54 | |
cab99c3a |
55 | /** |
56 | * Everyone needs stuff from config, and config needs stuff from |
57 | * strings.php, so include them both here. Actually, strings is |
58 | * included at the top now as the string array functions have |
59 | * been moved into it. |
60 | * |
61 | * Include them down here instead of at the top so that all config |
62 | * variables overwrite any passed in variables (for security). |
63 | */ |
5dfb4b0b |
64 | |
65 | /** |
66 | * Reset the $theme() array in case a value was passed via a cookie. |
67 | * This is until theming is rewritten. |
68 | */ |
69 | global $theme; |
70 | unset($theme); |
71 | $theme=array(); |
72 | |
80f057ca |
73 | require_once('../config/config.php'); |
cab99c3a |
74 | require_once('../src/load_prefs.php'); |
75 | require_once('../functions/page_header.php'); |
d4e84069 |
76 | |
cab99c3a |
77 | /* Set up the language (i18n.php was included by auth.php). */ |
78 | global $username, $data_dir; |
79 | set_up_language(getPref($data_dir, $username, 'language')); |
5be9f195 |
80 | |
7bcc8f54 |
81 | $timeZone = getPref($data_dir, $username, 'timezone'); |
94ac35c6 |
82 | if ( $timeZone != SMPREF_NONE && ($timeZone <> '') |
83 | && !ini_get( 'safe_mode' )) { |
84 | putenv( 'TZ=' . $timeZone ); |
7bcc8f54 |
85 | } |
94ac35c6 |
86 | |
8008456a |
87 | ?> |