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