Added a counter pref and a fix for the imapid
[squirrelmail.git] / src / validate.php
CommitLineData
f740c049 1<?php
895905c0 2
f7b1b3b1 3 /**
2d367c68 4 ** validate.php
5 **
6 ** Copyright (c) 1999-2001 The SquirrelMail Development Team
7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 **
9 ** $Id$
10 **/
f740c049 11
f7b1b3b1 12 if (defined ('validate_php')) { return; }
13 define ('validate_php', true);
f740c049 14
f7b1b3b1 15 session_start();
16 require_once('../functions/i18n.php');
17 require_once('../functions/auth.php');
23d6bd09 18 require_once('../functions/strings.php');
f740c049 19
f7b1b3b1 20 is_logged_in();
f740c049 21
f7b1b3b1 22 /* Remove all slashes for form values. */
23 if (get_magic_quotes_gpc()) {
24 global $REQUEST_METHOD;
f740c049 25
f7b1b3b1 26 if ($REQUEST_METHOD == "POST") {
27 global $HTTP_POST_VARS;
28 RemoveSlashes($HTTP_POST_VARS);
29 } else if ($REQUEST_METHOD == "GET") {
30 global $HTTP_GET_VARS;
31 RemoveSlashes($HTTP_GET_VARS);
32 }
33 }
f740c049 34
f7b1b3b1 35 /**
36 * Auto-detection
37 *
38 * if $send (the form button's name) contains "\n" as the first char
39 * and the script is compose.php, then trim everything. Otherwise, we
40 * don't have to worry.
41 *
42 * This is for a RedHat package bug and a Konqueror (pre 2.1.1?) bug
43 */
44 global $send, $PHP_SELF;
45 if (isset($send)
46 && (substr($send, 0, 1) == "\n")
47 && (substr($PHP_SELF, -12) == '/compose.php')) {
48 if ($REQUEST_METHOD == "POST") {
49 global $HTTP_POST_VARS;
50 TrimArray($HTTP_POST_VARS);
51 } else {
52 global $HTTP_GET_VARS;
53 TrimArray($HTTP_GET_VARS);
54 }
55 }
56
23d6bd09 57 /**
58 * Everyone needs stuff from config, and config needs stuff from
59 * strings.php, so include them both here. Actually, strings is
60 * included at the top now as the string array functions have
61 * been moved into it.
62 *
63 * Include them down here instead of at the top so that all config
64 * variables overwrite any passed in variables (for security).
65 */
f7b1b3b1 66 require_once('../config/config.php');
67 require_once('../src/load_prefs.php');
68 require_once('../functions/page_header.php');
69 require_once('../functions/prefs.php');
d4e84069 70
f7b1b3b1 71 /* Set up the language (i18n.php was included by auth.php). */
72 global $username, $data_dir;
73 set_up_language(getPref($data_dir, $username, 'language'));
59e95aca 74?>