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