Call me anal
[squirrelmail.git] / plugins / administrator / defines.php
1 <?php
2
3 /**
4 * Administrator plugin - Option definitions
5 *
6 * @author Philippe Mingo
7 * @copyright &copy; 1999-2007 The SquirrelMail Project Team
8 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
9 * @version $Id$
10 * @package plugins
11 * @subpackage administrator
12 */
13
14 /** Define constants for the various option types. */
15 define('SMOPT_TYPE_UNDEFINED', -1);
16 define('SMOPT_TYPE_STRING', 0);
17 define('SMOPT_TYPE_STRLIST', 1);
18 define('SMOPT_TYPE_TEXTAREA', 2);
19 define('SMOPT_TYPE_INTEGER', 3);
20 define('SMOPT_TYPE_FLOAT', 4);
21 define('SMOPT_TYPE_BOOLEAN', 5);
22 define('SMOPT_TYPE_HIDDEN', 6);
23 define('SMOPT_TYPE_COMMENT', 7);
24 define('SMOPT_TYPE_NUMLIST', 8);
25 define('SMOPT_TYPE_TITLE', 9);
26 define('SMOPT_TYPE_THEME', 10);
27 define('SMOPT_TYPE_PLUGINS', 11);
28 define('SMOPT_TYPE_LDAP', 12);
29 define('SMOPT_TYPE_CUSTOM', 13);
30 define('SMOPT_TYPE_EXTERNAL', 32);
31 define('SMOPT_TYPE_PATH',33);
32
33 /**
34 * Returns reformated aTemplateSet array data for option selection
35 * @return array template selection options
36 * @since 1.5.1
37 */
38 function adm_template_options() {
39 global $aTemplateSet;
40 $ret = array();
41 foreach ($aTemplateSet as $iTemplateID => $aTemplate) {
42 $ret[$aTemplate['ID']] = $aTemplate['NAME'];
43 }
44 return $ret;
45 }
46
47 global $languages;
48
49 $language_values = array( );
50 foreach ($languages as $lang_key => $lang_attributes) {
51 if (isset($lang_attributes['NAME'])) {
52 $language_values[$lang_key] = $lang_attributes['NAME'];
53 }
54 }
55 asort( $language_values );
56 $language_values = array_merge(array('' => _("Default")), $language_values);
57 $left_size_values = array();
58 for ($lsv = 100; $lsv <= 300; $lsv += 10) {
59 $left_size_values[$lsv] = "$lsv " . _("pixels");
60 }
61
62 $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
63 'type' => SMOPT_TYPE_COMMENT,
64 'size' => 7 ),
65 'SM_ver' => array( 'name' => _("SquirrelMail Version"),
66 'type' => SMOPT_TYPE_EXTERNAL,
67 'value' => SM_VERSION ),
68 'PHP_ver' => array( 'name' => _("PHP Version"),
69 'type' => SMOPT_TYPE_EXTERNAL,
70 'value' => phpversion() ),
71 /* --------------------------------------------------------*/
72 'Group1' => array( 'name' => _("Organization Preferences"),
73 'type' => SMOPT_TYPE_TITLE ),
74 '$org_name' => array( 'name' => _("Organization Name"),
75 'type' => SMOPT_TYPE_STRING,
76 'size' => 40 ),
77 '$org_logo' => array( 'name' => _("Organization Logo"),
78 'type' => SMOPT_TYPE_PATH,
79 'size' => 40,
80 'default' => '../images/sm_logo.png'),
81 '$org_logo_width' => array( 'name' => _("Organization Logo Width"),
82 'type' => SMOPT_TYPE_STRING,
83 'size' => 5,
84 'default' => 0),
85 '$org_logo_height' => array( 'name' => _("Organization Logo Height"),
86 'type' => SMOPT_TYPE_STRING,
87 'size' => 5,
88 'default' => 0),
89 '$org_title' => array( 'name' => _("Organization Title"),
90 'type' => SMOPT_TYPE_STRING,
91 'size' => 40 ),
92 '$signout_page' => array( 'name' => _("Signout Page"),
93 'type' => SMOPT_TYPE_PATH,
94 'size' => 40 ),
95 '$provider_uri' => array( 'name' => _("Provider Link URI"),
96 'type' => SMOPT_TYPE_STRING ),
97 '$provider_name' => array( 'name' => _("Provider Name"),
98 'type' => SMOPT_TYPE_STRING ),
99 '$frame_top' => array( 'name' => _("Top Frame"),
100 'type' => SMOPT_TYPE_STRING,
101 'size' => 40,
102 'default' => '_top' ),
103 /* --------------------------------------------------------*/
104 'Group2' => array( 'name' => _("Server Settings"),
105 'type' => SMOPT_TYPE_TITLE ),
106 '$domain' => array( 'name' => _("Mail Domain"),
107 'type' => SMOPT_TYPE_STRING,
108 'size' => 40 ),
109 '$imapServerAddress' => array( 'name' => _("IMAP Server Address"),
110 'type' => SMOPT_TYPE_STRING,
111 'size' => 40 ),
112 '$imapPort' => array( 'name' => _("IMAP Server Port"),
113 'type' => SMOPT_TYPE_INTEGER ),
114 '$imap_server_type' => array( 'name' => _("IMAP Server Type"),
115 'type' => SMOPT_TYPE_STRLIST,
116 'posvals' => array( 'cyrus' => _("Cyrus IMAP server"),
117 'uw' => _("University of Washington's IMAP server"),
118 'exchange' => _("Microsoft Exchange IMAP server"),
119 'courier' => _("Courier IMAP server"),
120 'macosx' => _("Mac OS X Mailserver"),
121 'hmailserver' => _("hMailServer IMAP server"),
122 'mercury32' => _("Mercury/32 IMAP server"),
123 'bincimap' => _("Binc IMAP server"),
124 'dovecot' => _("Dovecot IMAP server"),
125 'other' => _("Not one of the above servers") ) ),
126 '$optional_delimiter' => array( 'name' => _("IMAP Folder Delimiter"),
127 'type' => SMOPT_TYPE_STRING,
128 'comment' => _("Use &quot;detect&quot; to auto-detect."),
129 'size' => 10,
130 'default' => 'detect' ),
131 '$use_imap_tls' => array( 'name' => _("IMAP Connection Security"),
132 'type' => SMOPT_TYPE_STRLIST,
133 'posvals' => array( 0 => _("Plain text connection"),
134 1 => _("Secure IMAP (TLS) connection"),
135 2 => _("IMAP STARTTLS connection")),
136 'comment' => _("Requires higher PHP version and special functions. See SquirrelMail documentation."),
137 'default' => 0 ),
138 '$imap_auth_mech' => array( 'name' => _("IMAP Authentication Type"),
139 'type' => SMOPT_TYPE_STRLIST,
140 'posvals' => array('login' => _("IMAP login"),
141 'cram-md5' => 'CRAM-MD5',
142 'digest-md5' => 'DIGEST-MD5'),
143 'default' => 'login' ),
144 '$useSendmail' => array( 'name' => _("Use Sendmail Binary"),
145 'type' => SMOPT_TYPE_BOOLEAN,
146 'comment' => _("Choose &quot;no&quot; for SMTP") ),
147 '$sendmail_path' => array( 'name' => _("Sendmail Path"),
148 'type' => SMOPT_TYPE_STRING,
149 'size' => 40 ),
150 '$sendmail_args' => array( 'name' => _("Sendmail Arguments"),
151 'type' => SMOPT_TYPE_STRING,
152 'size' => 40 ),
153 '$smtpServerAddress' => array( 'name' => _("SMTP Server Address"),
154 'type' => SMOPT_TYPE_STRING,
155 'size' => 40 ),
156 '$smtpPort' => array( 'name' => _("SMTP Server Port"),
157 'type' => SMOPT_TYPE_INTEGER ),
158 '$use_smtp_tls' => array( 'name' => _("SMTP Connection Security"),
159 'type' => SMOPT_TYPE_STRLIST,
160 'posvals' => array( 0 => _("Plain text connection"),
161 1 => _("Secure IMAP (TLS) connection"),
162 2 => _("IMAP STARTTLS connection")),
163 'comment' => _("Requires higher PHP version and special functions. See SquirrelMail documentation."),
164 'default' => 0 ),
165 '$smtp_auth_mech' => array( 'name' => _("SMTP Authentication Type"),
166 'type' => SMOPT_TYPE_STRLIST,
167 'posvals' => array('none' => _("No SMTP auth"),
168 'login' => _("Login (plain text)"),
169 'cram-md5' => 'CRAM-MD5',
170 'digest-md5' => 'DIGEST-MD5'),
171 'default' => 'none'),
172 '$smtp_sitewide_user' => array( 'name' => _("Custom SMTP AUTH username"),
173 'type' => SMOPT_TYPE_STRING,
174 'size' => 40 ),
175 '$smtp_sitewide_pass' => array( 'name' => _("Custom SMTP AUTH password"),
176 'type' => SMOPT_TYPE_STRING,
177 'size' => 40 ),
178 '$pop_before_smtp' => array( 'name' => _("POP3 Before SMTP?"),
179 'type' => SMOPT_TYPE_BOOLEAN,
180 'default' => false ),
181 '$encode_header_key' => array( 'name' => _("Header Encryption Key"),
182 'type' => SMOPT_TYPE_STRING ),
183 '$invert_time' => array( 'name' => _("Invert Time"),
184 'type' => SMOPT_TYPE_BOOLEAN ),
185 /* --------------------------------------------------------*/
186 'Group3' => array( 'name' => _("Folders Defaults"),
187 'type' => SMOPT_TYPE_TITLE ),
188 '$default_folder_prefix' => array( 'name' => _("Default Folder Prefix"),
189 'type' => SMOPT_TYPE_STRING,
190 'size' => 40 ),
191 '$show_prefix_option' => array( 'name' => _("Show Folder Prefix Option"),
192 'type' => SMOPT_TYPE_BOOLEAN ),
193 '$trash_folder' => array( 'name' => _("Trash Folder"),
194 'type' => SMOPT_TYPE_STRING,
195 'size' => 40 ),
196 '$sent_folder' => array( 'name' => _("Sent Folder"),
197 'type' => SMOPT_TYPE_STRING,
198 'size' => 40 ),
199 '$draft_folder' => array( 'name' => _("Draft Folder"),
200 'type' => SMOPT_TYPE_STRING,
201 'size' => 40 ),
202 '$default_move_to_trash' => array( 'name' => _("By default, move to trash"),
203 'type' => SMOPT_TYPE_BOOLEAN ),
204 '$default_move_to_sent' => array( 'name' => _("By default, move to sent"),
205 'type' => SMOPT_TYPE_BOOLEAN ),
206 '$default_save_as_draft' => array( 'name' => _("By default, save as draft"),
207 'type' => SMOPT_TYPE_BOOLEAN ),
208 '$list_special_folders_first' => array( 'name' => _("List Special Folders First"),
209 'type' => SMOPT_TYPE_BOOLEAN ),
210 '$use_special_folder_color' => array( 'name' => _("Show Special Folders Color"),
211 'type' => SMOPT_TYPE_BOOLEAN ),
212 '$auto_expunge' => array( 'name' => _("Auto Expunge"),
213 'type' => SMOPT_TYPE_BOOLEAN ),
214 '$default_sub_of_inbox' => array( 'name' => _("Default Sub. of INBOX"),
215 'type' => SMOPT_TYPE_BOOLEAN ),
216 '$show_contain_subfolders_option' => array( 'name' => _("Show 'Contain Sub.' Option"),
217 'type' => SMOPT_TYPE_BOOLEAN ),
218 '$default_unseen_notify' => array( 'name' => _("Default Unseen Notify"),
219 'type' => SMOPT_TYPE_NUMLIST,
220 'posvals' => array( SMPREF_UNSEEN_NONE => _("No Notification"),
221 SMPREF_UNSEEN_INBOX => _("Only INBOX"),
222 SMPREF_UNSEEN_ALL => _("All Folders")) ),
223 '$default_unseen_type' => array( 'name' => _("Default Unseen Type"),
224 'type' => SMOPT_TYPE_NUMLIST ,
225 'posvals' => array( SMPREF_UNSEEN_ONLY => _("Only Unseen"),
226 SMPREF_UNSEEN_TOTAL => _("Unseen and Total") ) ),
227 '$auto_create_special' => array( 'name' => _("Auto Create Special Folders"),
228 'type' => SMOPT_TYPE_BOOLEAN ),
229 '$delete_folder' => array( 'name' => _("Auto delete folders"),
230 'type' => SMOPT_TYPE_BOOLEAN ),
231 '$noselect_fix_enable' => array( 'name' => _("Enable /NoSelect folder fix"),
232 'type' => SMOPT_TYPE_BOOLEAN,
233 'default' => false),
234 /* --------------------------------------------------------*/
235 'Group4' => array( 'name' => _("General Options"),
236 'type' => SMOPT_TYPE_TITLE ),
237 '$data_dir' => array( 'name' => _("Data Directory"),
238 'type' => SMOPT_TYPE_PATH,
239 'size' => 40 ),
240 '$attachment_dir' => array( 'name' => _("Temp Directory"),
241 'type' => SMOPT_TYPE_PATH,
242 'size' => 40 ),
243 '$dir_hash_level' => array( 'name' => _("Hash Level"),
244 'type' => SMOPT_TYPE_NUMLIST,
245 'posvals' => array( 0 => _("Hash Disabled"),
246 1 => _("Low"),
247 2 => _("Moderate"),
248 3 => _("Medium"),
249 4 => _("High") ) ),
250 '$default_left_size' => array( 'name' => _("Default Left Size"),
251 'type' => SMOPT_TYPE_NUMLIST,
252 'posvals' => $left_size_values ),
253 '$force_username_lowercase' => array( 'name' => _("Usernames in Lowercase"),
254 'type' => SMOPT_TYPE_BOOLEAN ),
255 '$default_use_priority' => array( 'name' => _("Allow use of priority"),
256 'type' => SMOPT_TYPE_BOOLEAN ),
257 '$hide_sm_attributions' => array( 'name' => _("Hide SM attributions"),
258 'type' => SMOPT_TYPE_BOOLEAN ),
259 '$default_use_mdn' => array( 'name' => _("Enable use of delivery receipts"),
260 'type' => SMOPT_TYPE_BOOLEAN ),
261 '$edit_identity' => array( 'name' => _("Allow editing of identities"),
262 'type' => SMOPT_TYPE_BOOLEAN ),
263 '$edit_name' => array( 'name' => _("Allow editing of full name"),
264 'type' => SMOPT_TYPE_BOOLEAN ),
265 '$hide_auth_header' => array( 'name' => _("Remove username from headers"),
266 'comment' => _("Used only when identities can't be modified"),
267 'type' => SMOPT_TYPE_BOOLEAN ),
268 '$disable_server_sort' => array( 'name' => _("Disable server-side sorting"),
269 'type' => SMOPT_TYPE_BOOLEAN,
270 'default' => false ),
271 '$disable_thread_sort' => array( 'name' => _("Disable server-side thread sorting"),
272 'type' => SMOPT_TYPE_BOOLEAN,
273 'default' => false ),
274 '$allow_charset_search' => array( 'name' => _("Allow server charset search"),
275 'type' => SMOPT_TYPE_BOOLEAN,
276 'default' => false ),
277 '$allow_advanced_search' => array( 'name' => _("Search functions"),
278 'type' => SMOPT_TYPE_NUMLIST,
279 'posvals' => array( 0 => _("Only basic search"),
280 1 => _("Only advanced search"),
281 2 => _("Both search functions") ),
282 'default' => 0 ),
283 '$session_name' => array( 'name' => _("PHP session name"),
284 'type' => SMOPT_TYPE_HIDDEN ),
285 '$time_zone_type' => array( 'name' => _("Time Zone Configuration"),
286 'type' => SMOPT_TYPE_NUMLIST,
287 'posvals' => array( 0 => _("Standard GNU C time zones"),
288 1 => _("Strict time zones"),
289 2 => _("Custom GNU C time zones"),
290 3 => _("Custom strict time zones")),
291 'default' => 0 ),
292 '$config_location_base' => array( 'name' => _("Location base"),
293 'type' => SMOPT_TYPE_STRING,
294 'size' => 40,
295 'default' => '' ),
296 /* --------------------------------------------------------*/
297 'Group5' => array( 'name' => _("Message of the Day"),
298 'type' => SMOPT_TYPE_TITLE ),
299 '$motd' => array( 'name' => _("Message of the Day"),
300 'type' => SMOPT_TYPE_TEXTAREA,
301 'size' => 40 ),
302 /* ---- Database settings ---- */
303 'Group6' => array( 'name' => _("Database"),
304 'type' => SMOPT_TYPE_TITLE ),
305 '$addrbook_dsn' => array( 'name' => _("Address book DSN"),
306 'type' => SMOPT_TYPE_STRING,
307 'size' => 40 ),
308 '$addrbook_table' => array( 'name' => _("Address book table"),
309 'type' => SMOPT_TYPE_STRING,
310 'size' => 40,
311 'default' => 'address' ),
312 '$prefs_dsn' => array( 'name' => _("Preferences DSN"),
313 'type' => SMOPT_TYPE_STRING,
314 'size' => 40 ),
315 '$prefs_table' => array( 'name' => _("Preferences table"),
316 'type' => SMOPT_TYPE_STRING,
317 'size' => 40,
318 'default' => 'userprefs' ),
319 '$prefs_user_field' => array('name' => _("Preferences username field"),
320 'type' => SMOPT_TYPE_STRING,
321 'size' => 40,
322 'default' => 'user' ),
323 '$prefs_user_size' => array( 'name' => _("Size of username field"),
324 'type' => SMOPT_TYPE_INTEGER ),
325 '$prefs_key_field' => array('name' => _("Preferences key field"),
326 'type' => SMOPT_TYPE_STRING,
327 'size' => 40,
328 'default' => 'prefkey' ),
329 '$prefs_key_size' => array( 'name' => _("Size of key field"),
330 'type' => SMOPT_TYPE_INTEGER ),
331 '$prefs_val_field' => array('name' => _("Preferences value field"),
332 'type' => SMOPT_TYPE_STRING,
333 'size' => 40,
334 'default' => 'prefval' ),
335 '$prefs_val_size' => array( 'name' => _("Size of value field"),
336 'type' => SMOPT_TYPE_INTEGER ),
337 '$addrbook_global_dsn' => array( 'name' => _("Global address book DSN"),
338 'type' => SMOPT_TYPE_STRING,
339 'size' => 40 ),
340 '$addrbook_global_table' => array( 'name' => _("Global address book table"),
341 'type' => SMOPT_TYPE_STRING,
342 'size' => 40,
343 'default' => 'global_abook' ),
344 '$addrbook_global_writeable' => array( 'name' => _("Allow writing into global address book"),
345 'type' => SMOPT_TYPE_BOOLEAN ),
346 '$addrbook_global_listing' => array( 'name' => _("Allow listing of global address book"),
347 'type' => SMOPT_TYPE_BOOLEAN ),
348 /* ---- Language settings ---- */
349 'Group9' => array( 'name' => _("Language settings"),
350 'type' => SMOPT_TYPE_TITLE ),
351 '$squirrelmail_default_language' => array( 'name' => _("Default Language"),
352 'type' => SMOPT_TYPE_STRLIST,
353 'size' => 7,
354 'posvals' => $language_values ),
355 '$default_charset' => array( 'name' => _("Default Charset"),
356 'type' => SMOPT_TYPE_STRLIST,
357 'posvals' => array( 'iso-8859-1' => 'iso-8859-1',
358 'iso-8859-2' => 'iso-8859-2',
359 'iso-8859-7' => 'iso-8859-7',
360 'iso-8859-9' => 'iso-8859-9',
361 'iso-8859-15' => 'iso-8859-15',
362 'utf-8' => 'utf-8',
363 'koi8-r' => 'koi8-r',
364 'euc-kr' => 'euc-kr',
365 'big5' => 'big5',
366 'gb2312' => 'gb2312',
367 'tis-620' => 'tis-620',
368 'windows-1251' => 'windows-1251',
369 'windows-1255' => 'windows-1255',
370 'windows-1256' => 'windows-1256',
371 'iso-2022-jp' => 'iso-2022-jp' ) ),
372 '$show_alternative_names' => array( 'name' => _("Show alternative language names"),
373 'type' => SMOPT_TYPE_BOOLEAN ),
374 '$aggressive_decoding' => array( 'name' => _("Enable aggressive decoding"),
375 'type' => SMOPT_TYPE_BOOLEAN ),
376 '$lossy_encoding' => array( 'name' => _("Enable lossy encoding"),
377 'type' => SMOPT_TYPE_BOOLEAN ),
378 /* ---- Tweaks ---- */
379 'Group10' => array( 'name' => _("Tweaks"),
380 'type' => SMOPT_TYPE_TITLE ),
381 '$use_icons' => array( 'name' => _("Use icons"),
382 'type' => SMOPT_TYPE_BOOLEAN ),
383 '$use_iframe' => array( 'name' => _("Use inline frames with HTML mails"),
384 'type' => SMOPT_TYPE_BOOLEAN ),
385 '$use_php_recode' => array( 'name' => _("Use PHP recode functions"),
386 'type' => SMOPT_TYPE_BOOLEAN ),
387 '$use_php_iconv' => array( 'name' => _("Use PHP iconv functions"),
388 'type' => SMOPT_TYPE_BOOLEAN ),
389 '$allow_remote_configtest' => array( 'name' => _("Allow remote configuration test"),
390 'type' => SMOPT_TYPE_BOOLEAN ),
391 /* ---- Settings of address books ---- */
392 'Group11' => array( 'name' => _("Address Books"),
393 'type' => SMOPT_TYPE_TITLE ),
394 '$default_use_javascript_addr_book' => array( 'name' => _("Default Javascript Addressbook"),
395 'type' => SMOPT_TYPE_BOOLEAN ),
396 '$abook_global_file' => array( 'name' => _("Global address book file"),
397 'type' => SMOPT_TYPE_STRING ),
398 '$abook_global_file_writeable' => array( 'name' => _("Allow writing into global address book file"),
399 'type' => SMOPT_TYPE_BOOLEAN ),
400 '$abook_global_file_listing' => array( 'name' => _("Allow listing of global address book"),
401 'type' => SMOPT_TYPE_BOOLEAN ),
402 '$abook_file_line_length' => array( 'name' => _("Address book file line length"),
403 'type' => SMOPT_TYPE_INTEGER ),
404 /* --------------------------------------------------------*/
405 'Group7' => array( 'name' => _("Templates"),
406 'type' => SMOPT_TYPE_TITLE ),
407 '$theme_css' => array( 'name' => _("Style Sheet URL (css)"),
408 'type' => SMOPT_TYPE_PATH,
409 'size' => 40 ),
410 '$default_fontsize' => array( 'name' => _("Default font size"),
411 'type' => SMOPT_TYPE_STRING,
412 'default' => ''),
413 '$default_fontset' => array( 'name' => _("Default font set"),
414 'type' => SMOPT_TYPE_STRLIST,
415 'posvals' => $fontsets),
416 '$templateset_default' => array( 'name' => _("Default template"),
417 'type' => SMOPT_TYPE_STRLIST,
418 'posvals' => adm_template_options()),
419 '$templateset_fallback' => array( 'name' => _("Fallback template"),
420 'type' => SMOPT_TYPE_STRLIST,
421 'posvals' => adm_template_options()),
422 '$theme_default' => array( 'name' => _("Default theme"),
423 'type' => SMOPT_TYPE_INTEGER,
424 'default' => 0,
425 'comment' => _("Use index number of theme") ),
426 /* --------------------------------------------------------*/
427 '$config_use_color' => array( 'name' => '',
428 'type' => SMOPT_TYPE_HIDDEN ),
429 '$no_list_for_subscribe' => array( 'name' => '',
430 'type' => SMOPT_TYPE_HIDDEN ),
431 /* --------------------------------------------------------*/
432
433 );