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