Add controls for page referal verification and security token system to the configura...
[squirrelmail.git] / include / constants.php
CommitLineData
202bcbcc 1<?php
2
3/**
4 * constants.php
5 *
6 * Loads constants used by the rest of the SquirrelMail source.
202bcbcc 7 *
867fed37 8 * Before 1.5.2 script was stored in functions/constants.php
d4e46166 9 * @copyright &copy; 1999-2009 The SquirrelMail Project Team
202bcbcc 10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
11 * @version $Id$
12 * @package squirrelmail
13 * @since 1.2.0
14 */
15
16/** @ignore */
17
b37e457f 18/**
19 * SquirrelMail version number -- DO NOT CHANGE
20 * @since 1.5.2
21 */
22define('SM_VERSION', '1.5.2 [SVN]');
23
aff09f80 24/**
25 * Year interval for copyright notices in the interface
26 * @since 1.5.2
27 */
61a5a232 28define('SM_COPYRIGHT', '1999-2009');
aff09f80 29
202bcbcc 30/**************************************************************/
31/* Set values for constants used by SquirrelMail preferences. */
32/**************************************************************/
33
34/**
1888b1bf 35 * Define constants for SquirrelMail debug modes.
36 * Note that these are binary so that modes can be
37 * mixed and matched, and they are also ordered from
38 * minor to severe. When adding new modes, please
39 * order them in a sensical way (MODERATE is the 10th
40 * bit; ADVANCED is the 20th bit).
41 * @since 1.5.2
42 */
43define('SM_DEBUG_MODE_OFF', 0); // complete error suppression
44define('SM_DEBUG_MODE_SIMPLE', 1); // PHP E_ERROR
45define('SM_DEBUG_MODE_MODERATE', 512); // PHP E_ALL
46define('SM_DEBUG_MODE_ADVANCED', 524288); // PHP E_ALL plus log errors intentionally suppressed
47define('SM_DEBUG_MODE_STRICT', 536870912); // PHP E_STRICT
48
49/**
202bcbcc 50 * Define basic, general purpose preference constants.
51 * @since 1.2.0
52 */
53define('SMPREF_NO', 0);
54define('SMPREF_OFF', 0);
55define('SMPREF_YES', 1);
56define('SMPREF_ON', 1);
57define('SMPREF_NONE', 'none');
58
59/**
60 * Define constants for location based preferences.
61 * @since 1.2.0
62 */
63define('SMPREF_LOC_TOP', 'top');
64define('SMPREF_LOC_BETWEEN', 'between');
65define('SMPREF_LOC_BOTTOM', 'bottom');
66define('SMPREF_LOC_LEFT', '');
67define('SMPREF_LOC_RIGHT', 'right');
68
69/**
70 * Define preferences for folder settings.
71 * @since 1.2.0
72 */
73define('SMPREF_UNSEEN_NONE', 1);
74define('SMPREF_UNSEEN_INBOX', 2);
75define('SMPREF_UNSEEN_ALL', 3);
76define('SMPREF_UNSEEN_SPECIAL', 4); // Only special folders (since 1.2.5)
77define('SMPREF_UNSEEN_NORMAL', 5); // Only normal folders (since 1.2.5)
78define('SMPREF_UNSEEN_ONLY', 1);
79define('SMPREF_UNSEEN_TOTAL', 2);
80
d56050e1 81define('SMPREF_MAILBOX_SELECT_LONG', 0);
82define('SMPREF_MAILBOX_SELECT_INDENTED', 1);
83define('SMPREF_MAILBOX_SELECT_DELIMITED', 2);
84
202bcbcc 85/**
86 * Define constants for time/date display preferences.
87 * @since 1.2.0
88 */
89define('SMPREF_TIME_24HR', 1);
90define('SMPREF_TIME_12HR', 2);
91
92/**
93 * Define constants for javascript preferences.
94 * @since 1.2.0
95 */
96define('SMPREF_JS_OFF', 0);
97define('SMPREF_JS_ON', 1);
98define('SMPREF_JS_AUTODETECT', 2);
99
100/**
101 * default value for page_selector_max
102 * @since 1.5.1
103 */
104define('PG_SEL_MAX', 10);
105
106
107/**
108 * The number of pages to cache msg headers
109 * @since 1.5.1
110 */
111define('SQM_MAX_PAGES_IN_CACHE',5);
112
113/**
114 * The number of mailboxes to cache msg headers
115 * @since 1.5.1
116 */
117define('SQM_MAX_MBX_IN_CACHE',3);
118
119/**
120 * Sort constants used for sorting of messages
121 * @since 1.5.1
122 */
123define('SQSORT_NONE',0);
124define('SQSORT_DATE_ASC',1);
125define('SQSORT_DATE_DESC',2);
126define('SQSORT_FROM_ASC',3);
127define('SQSORT_FROM_DESC',4);
128define('SQSORT_SUBJ_ASC',5);
129define('SQSORT_SUBJ_DESC',6);
130define('SQSORT_SIZE_ASC',7);
131define('SQSORT_SIZE_DESC',8);
132define('SQSORT_TO_ASC',9);
133define('SQSORT_TO_DESC',10);
134define('SQSORT_CC_ASC',11);
135define('SQSORT_CC_DESC',12);
136define('SQSORT_INT_DATE_ASC',13);
137define('SQSORT_INT_DATE_DESC',14);
138
139/**
140 * Special sort constant thread which is added to above sort mode.
141 * By doing a bitwise check ($sort & SQSORT_THREAD) we know if the mailbox
142 * is sorted by thread.
143 * @since 1.5.1
144 */
145define('SQSORT_THREAD',32);
146
147/**
148 * Mailbox preference array keys
149 * @since 1.5.1
150 */
151define('MBX_PREF_SORT',0);
152define('MBX_PREF_LIMIT',1);
153define('MBX_PREF_AUTO_EXPUNGE',2);
154define('MBX_PREF_INTERNALDATE',3);
155define('MBX_PREF_COLUMNS',4);
156// define('MBX_PREF_FUTURE',unique integer key);
157
158/**
159 * Email address array keys
160 * @since 1.5.1
161 */
162define('SQM_ADDR_PERSONAL', 0);
163define('SQM_ADDR_ADL', 1);
164define('SQM_ADDR_MAILBOX', 2);
165define('SQM_ADDR_HOST', 3);
166
167/**
168 * Supported columns to show in a messages list
169 * The MBX_PREF_COLUMNS contains an ordered array with these columns
170 * @since 1.5.1
171 */
172define('SQM_COL_CHECK',0);
173define('SQM_COL_FROM',1);
174define('SQM_COL_DATE', 2);
175define('SQM_COL_SUBJ', 3);
176define('SQM_COL_FLAGS', 4);
177define('SQM_COL_SIZE', 5);
178define('SQM_COL_PRIO', 6);
179define('SQM_COL_ATTACHMENT', 7);
180define('SQM_COL_INT_DATE', 8);
181define('SQM_COL_TO', 9);
182define('SQM_COL_CC', 10);
183define('SQM_COL_BCC', 11);
c2b585c5 184
185/**
503c7650 186 * Address book field list
187 * @since 1.4.16 and 1.5.2
188 */
189define('SM_ABOOK_FIELD_NICKNAME', 0);
190define('SM_ABOOK_FIELD_FIRSTNAME', 1);
191define('SM_ABOOK_FIELD_LASTNAME', 2);
192define('SM_ABOOK_FIELD_EMAIL', 3);
193define('SM_ABOOK_FIELD_LABEL', 4);
194
195/**
c2b585c5 196 * Generic variable type constants
197 * @since 1.5.2
198 */
199define('SQ_TYPE_INT', 'int');
1c2963ab 200define('SQ_TYPE_BIGINT', 'bigint');
c2b585c5 201define('SQ_TYPE_STRING', 'string');
202define('SQ_TYPE_BOOL', 'bool');
203define('SQ_TYPE_ARRAY', 'array');
204
28294310 205/**
206 * Template engines supported
207 * @since 1.5.2
208 */
209define('SQ_PHP_TEMPLATE', 'PHP_');
210define('SQ_SMARTY_TEMPLATE', 'Smarty_');
211
f258865c 212/**
213 * Used by plugins to indicate an incompatibility with a SM version
214 * @since 1.5.2
215 */
216define('SQ_INCOMPATIBLE', 'INCOMPATIBLE');
217
54d23742 218/**
219 * Define constants used in the options code
220 */
221
222// Define constants for the various option types
223define('SMOPT_TYPE_STRING', 0);
224define('SMOPT_TYPE_STRLIST', 1);
225define('SMOPT_TYPE_TEXTAREA', 2);
226define('SMOPT_TYPE_INTEGER', 3);
227define('SMOPT_TYPE_FLOAT', 4);
228define('SMOPT_TYPE_BOOLEAN', 5);
229define('SMOPT_TYPE_HIDDEN', 6);
230define('SMOPT_TYPE_COMMENT', 7);
231define('SMOPT_TYPE_FLDRLIST', 8);
232define('SMOPT_TYPE_FLDRLIST_MULTI', 9);
233define('SMOPT_TYPE_EDIT_LIST', 10);
234define('SMOPT_TYPE_STRLIST_MULTI', 11);
235define('SMOPT_TYPE_BOOLEAN_CHECKBOX', 12);
236define('SMOPT_TYPE_BOOLEAN_RADIO', 13);
237define('SMOPT_TYPE_STRLIST_RADIO', 14);
238define('SMOPT_TYPE_SUBMIT', 15);
6c06cf54 239define('SMOPT_TYPE_INFO', 16);
3fa09710 240define('SMOPT_TYPE_PASSWORD', 17);
54d23742 241
242// Define constants for the layout scheme for edit lists
243define('SMOPT_EDIT_LIST_LAYOUT_LIST', 0);
244define('SMOPT_EDIT_LIST_LAYOUT_SELECT', 1);
245
246// Define constants for the options refresh levels
247define('SMOPT_REFRESH_NONE', 0);
248define('SMOPT_REFRESH_FOLDERLIST', 1);
249define('SMOPT_REFRESH_ALL', 2);
250
251// Define constants for the options size
252define('SMOPT_SIZE_TINY', 0);
253define('SMOPT_SIZE_SMALL', 1);
254define('SMOPT_SIZE_MEDIUM', 2);
255define('SMOPT_SIZE_LARGE', 3);
256define('SMOPT_SIZE_HUGE', 4);
257define('SMOPT_SIZE_NORMAL', 5);
258
259// Define miscellaneous options constants
260define('SMOPT_SAVE_DEFAULT', 'save_option');
261define('SMOPT_SAVE_NOOP', 'save_option_noop');
262
8949acd6 263// Convenience array of values 'a' through 'z'
264$a_to_z = array(
265 'a' => 'a',
266 'b' => 'b',
267 'c' => 'c',
268 'd' => 'd',
269 'e' => 'e',
270 'f' => 'f',
271 'g' => 'g',
272 'h' => 'h',
273 'i' => 'i',
274 'j' => 'j',
275 'k' => 'k',
276 'l' => 'l',
277 'm' => 'm',
278 'n' => 'n',
279 'o' => 'o',
280 'p' => 'p',
281 'q' => 'q',
282 'r' => 'r',
283 's' => 's',
284 't' => 't',
285 'u' => 'u',
286 'v' => 'v',
287 'w' => 'w',
288 'x' => 'x',
289 'y' => 'y',
290 'z' => 'z',
291 );