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_CUSTOM', 13);
39 define('SMOPT_TYPE_EXTERNAL', 32);
40 define('SMOPT_TYPE_PATH',33);
43 * Returns reformated aTemplateSet array data for option selection
44 * @return array template selection options
47 function adm_template_options() {
50 foreach ($aTemplateSet as $iTemplateID => $aTemplate) {
51 $ret[$iTemplateID] = $aTemplate['NAME'];
56 global $languages, $version;
58 $language_values = array( );
59 foreach ($languages as $lang_key => $lang_attributes) {
60 if (isset($lang_attributes['NAME'])) {
61 $language_values[$lang_key] = $lang_attributes['NAME'];
64 asort( $language_values );
65 $language_values = array_merge(array('' => _("Default")), $language_values);
66 $left_size_values = array();
67 for ($lsv = 100; $lsv <= 300; $lsv +
= 10) {
68 $left_size_values[$lsv] = "$lsv " . _("pixels");
71 $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
72 'type' => SMOPT_TYPE_COMMENT
,
74 'SM_ver' => array( 'name' => _("SquirrelMail Version"),
75 'type' => SMOPT_TYPE_EXTERNAL
,
76 'value' => "$version" ),
77 'PHP_ver' => array( 'name' => _("PHP Version"),
78 'type' => SMOPT_TYPE_EXTERNAL
,
79 'value' => phpversion() ),
80 /* --------------------------------------------------------*/
81 'Group1' => array( 'name' => _("Organization Preferences"),
82 'type' => SMOPT_TYPE_TITLE
),
83 '$org_name' => array( 'name' => _("Organization Name"),
84 'type' => SMOPT_TYPE_STRING
,
86 '$org_logo' => array( 'name' => _("Organization Logo"),
87 'type' => SMOPT_TYPE_PATH
,
89 'default' => '../images/sm_logo.png'),
90 '$org_logo_width' => array( 'name' => _("Organization Logo Width"),
91 'type' => SMOPT_TYPE_STRING
,
94 '$org_logo_height' => array( 'name' => _("Organization Logo Height"),
95 'type' => SMOPT_TYPE_STRING
,
98 '$org_title' => array( 'name' => _("Organization Title"),
99 'type' => SMOPT_TYPE_STRING
,
101 '$signout_page' => array( 'name' => _("Signout Page"),
102 'type' => SMOPT_TYPE_PATH
,
104 '$provider_uri' => array( 'name' => _("Provider Link URI"),
105 'type' => SMOPT_TYPE_STRING
),
106 '$provider_name' => array( 'name' => _("Provider Name"),
107 'type' => SMOPT_TYPE_STRING
),
108 '$frame_top' => array( 'name' => _("Top Frame"),
109 'type' => SMOPT_TYPE_STRING
,
111 'default' => '_top' ),
112 /* --------------------------------------------------------*/
113 'Group2' => array( 'name' => _("Server Settings"),
114 'type' => SMOPT_TYPE_TITLE
),
115 '$domain' => array( 'name' => _("Mail Domain"),
116 'type' => SMOPT_TYPE_STRING
,
118 '$imapServerAddress' => array( 'name' => _("IMAP Server Address"),
119 'type' => SMOPT_TYPE_STRING
,
121 '$imapPort' => array( 'name' => _("IMAP Server Port"),
122 'type' => SMOPT_TYPE_INTEGER
),
123 '$imap_server_type' => array( 'name' => _("IMAP Server Type"),
124 'type' => SMOPT_TYPE_STRLIST
,
125 'posvals' => array( 'cyrus' => _("Cyrus IMAP server"),
126 'uw' => _("University of Washington's IMAP server"),
127 'exchange' => _("Microsoft Exchange IMAP server"),
128 'courier' => _("Courier IMAP server"),
129 'macosx' => _("Mac OS X Mailserver"),
130 'hmailserver' => _("hMailServer IMAP server"),
131 'mercury32' => _("Mercury/32 IMAP server"),
132 'bincimap' => _("Binc IMAP server"),
133 'other' => _("Not one of the above servers") ) ),
134 '$optional_delimiter' => array( 'name' => _("IMAP Folder Delimiter"),
135 'type' => SMOPT_TYPE_STRING
,
136 'comment' => _("Use "detect" to auto-detect."),
138 'default' => 'detect' ),
139 '$use_imap_tls' => array( 'name' => _("IMAP Connection Security"),
140 'type' => SMOPT_TYPE_STRLIST
,
141 'posvals' => array( 0 => _("Plain text connection"),
142 1 => _("Secure IMAP (TLS) connection"),
143 2 => _("IMAP STARTTLS connection")),
144 'comment' => _("Requires higher PHP version and special functions. See SquirrelMail documentation."),
146 '$imap_auth_mech' => array( 'name' => _("IMAP Authentication Type"),
147 'type' => SMOPT_TYPE_STRLIST
,
148 'posvals' => array('login' => _("IMAP login"),
149 'cram-md5' => 'CRAM-MD5',
150 'digest-md5' => 'DIGEST-MD5'),
151 'default' => 'login' ),
152 '$useSendmail' => array( 'name' => _("Use Sendmail Binary"),
153 'type' => SMOPT_TYPE_BOOLEAN
,
154 'comment' => _("Choose "no" for SMTP") ),
155 '$sendmail_path' => array( 'name' => _("Sendmail Path"),
156 'type' => SMOPT_TYPE_STRING
,
158 '$sendmail_args' => array( 'name' => _("Sendmail Arguments"),
159 'type' => SMOPT_TYPE_STRING
,
161 '$smtpServerAddress' => array( 'name' => _("SMTP Server Address"),
162 'type' => SMOPT_TYPE_STRING
,
164 '$smtpPort' => array( 'name' => _("SMTP Server Port"),
165 'type' => SMOPT_TYPE_INTEGER
),
166 '$use_smtp_tls' => array( 'name' => _("SMTP Connection Security"),
167 'type' => SMOPT_TYPE_STRLIST
,
168 'posvals' => array( 0 => _("Plain text connection"),
169 1 => _("Secure IMAP (TLS) connection"),
170 2 => _("IMAP STARTTLS connection")),
171 'comment' => _("Requires higher PHP version and special functions. See SquirrelMail documentation."),
173 '$smtp_auth_mech' => array( 'name' => _("SMTP Authentication Type"),
174 'type' => SMOPT_TYPE_STRLIST
,
175 'posvals' => array('none' => _("No SMTP auth"),
176 'login' => _("Login (plain text)"),
177 'cram-md5' => 'CRAM-MD5',
178 'digest-md5' => 'DIGEST-MD5'),
179 'default' => 'none'),
180 '$pop_before_smtp' => array( 'name' => _("POP3 Before SMTP?"),
181 'type' => SMOPT_TYPE_BOOLEAN
,
182 'default' => false ),
183 '$encode_header_key' => array( 'name' => _("Header Encryption Key"),
184 'type' => SMOPT_TYPE_STRING
),
185 '$invert_time' => array( 'name' => _("Invert Time"),
186 'type' => SMOPT_TYPE_BOOLEAN
),
187 /* --------------------------------------------------------*/
188 'Group3' => array( 'name' => _("Folders Defaults"),
189 'type' => SMOPT_TYPE_TITLE
),
190 '$default_folder_prefix' => array( 'name' => _("Default Folder Prefix"),
191 'type' => SMOPT_TYPE_STRING
,
193 '$show_prefix_option' => array( 'name' => _("Show Folder Prefix Option"),
194 'type' => SMOPT_TYPE_BOOLEAN
),
195 '$trash_folder' => array( 'name' => _("Trash Folder"),
196 'type' => SMOPT_TYPE_STRING
,
198 '$sent_folder' => array( 'name' => _("Sent Folder"),
199 'type' => SMOPT_TYPE_STRING
,
201 '$draft_folder' => array( 'name' => _("Draft Folder"),
202 'type' => SMOPT_TYPE_STRING
,
204 '$default_move_to_trash' => array( 'name' => _("By default, move to trash"),
205 'type' => SMOPT_TYPE_BOOLEAN
),
206 '$default_move_to_sent' => array( 'name' => _("By default, move to sent"),
207 'type' => SMOPT_TYPE_BOOLEAN
),
208 '$default_save_as_draft' => array( 'name' => _("By default, save as draft"),
209 'type' => SMOPT_TYPE_BOOLEAN
),
210 '$list_special_folders_first' => array( 'name' => _("List Special Folders First"),
211 'type' => SMOPT_TYPE_BOOLEAN
),
212 '$use_special_folder_color' => array( 'name' => _("Show Special Folders Color"),
213 'type' => SMOPT_TYPE_BOOLEAN
),
214 '$auto_expunge' => array( 'name' => _("Auto Expunge"),
215 'type' => SMOPT_TYPE_BOOLEAN
),
216 '$default_sub_of_inbox' => array( 'name' => _("Default Sub. of INBOX"),
217 'type' => SMOPT_TYPE_BOOLEAN
),
218 '$show_contain_subfolders_option' => array( 'name' => _("Show 'Contain Sub.' Option"),
219 'type' => SMOPT_TYPE_BOOLEAN
),
220 '$default_unseen_notify' => array( 'name' => _("Default Unseen Notify"),
221 'type' => SMOPT_TYPE_NUMLIST
,
222 'posvals' => array( SMPREF_UNSEEN_NONE
=> _("No Notification"),
223 SMPREF_UNSEEN_INBOX
=> _("Only INBOX"),
224 SMPREF_UNSEEN_ALL
=> _("All Folders")) ),
225 '$default_unseen_type' => array( 'name' => _("Default Unseen Type"),
226 'type' => SMOPT_TYPE_NUMLIST
,
227 'posvals' => array( SMPREF_UNSEEN_ONLY
=> _("Only Unseen"),
228 SMPREF_UNSEEN_TOTAL
=> _("Unseen and Total") ) ),
229 '$auto_create_special' => array( 'name' => _("Auto Create Special Folders"),
230 'type' => SMOPT_TYPE_BOOLEAN
),
231 '$delete_folder' => array( 'name' => _("Auto delete folders"),
232 'type' => SMOPT_TYPE_BOOLEAN
),
233 '$noselect_fix_enable' => array( 'name' => _("Enable /NoSelect folder fix"),
234 'type' => SMOPT_TYPE_BOOLEAN
,
236 /* --------------------------------------------------------*/
237 'Group4' => array( 'name' => _("General Options"),
238 'type' => SMOPT_TYPE_TITLE
),
239 '$data_dir' => array( 'name' => _("Data Directory"),
240 'type' => SMOPT_TYPE_PATH
,
242 '$attachment_dir' => array( 'name' => _("Temp Directory"),
243 'type' => SMOPT_TYPE_PATH
,
245 '$dir_hash_level' => array( 'name' => _("Hash Level"),
246 'type' => SMOPT_TYPE_NUMLIST
,
247 'posvals' => array( 0 => _("Hash Disabled"),
252 '$default_left_size' => array( 'name' => _("Default Left Size"),
253 'type' => SMOPT_TYPE_NUMLIST
,
254 'posvals' => $left_size_values ),
255 '$force_username_lowercase' => array( 'name' => _("Usernames in Lowercase"),
256 'type' => SMOPT_TYPE_BOOLEAN
),
257 '$default_use_priority' => array( 'name' => _("Allow use of priority"),
258 'type' => SMOPT_TYPE_BOOLEAN
),
259 '$hide_sm_attributions' => array( 'name' => _("Hide SM attributions"),
260 'type' => SMOPT_TYPE_BOOLEAN
),
261 '$default_use_mdn' => array( 'name' => _("Enable use of delivery receipts"),
262 'type' => SMOPT_TYPE_BOOLEAN
),
263 '$edit_identity' => array( 'name' => _("Allow editing of identities"),
264 'type' => SMOPT_TYPE_BOOLEAN
),
265 '$edit_name' => array( 'name' => _("Allow editing of full name"),
266 'type' => SMOPT_TYPE_BOOLEAN
),
267 '$hide_auth_header' => array( 'name' => _("Remove username from headers"),
268 'comment' => _("Used only when identities can't be modified"),
269 'type' => SMOPT_TYPE_BOOLEAN
),
270 '$allow_server_sort' => array( 'name' => _("Use server-side sorting"),
271 'type' => SMOPT_TYPE_BOOLEAN
,
272 'default' => false ),
273 '$allow_thread_sort' => array( 'name' => _("Use server-side thread sorting"),
274 'type' => SMOPT_TYPE_BOOLEAN
,
275 'default' => false ),
276 '$allow_charset_search' => array( 'name' => _("Allow server charset search"),
277 'type' => SMOPT_TYPE_BOOLEAN
,
278 'default' => false ),
279 '$allow_advanced_search' => array( 'name' => _("Search functions"),
280 'type' => SMOPT_TYPE_NUMLIST
,
281 'posvals' => array( 0 => _("Only basic search"),
282 1 => _("Only advanced search"),
283 2 => _("Both search functions") ),
285 '$session_name' => array( 'name' => _("PHP session name"),
286 'type' => SMOPT_TYPE_HIDDEN
),
287 '$time_zone_type' => array( 'name' => _("Time Zone Configuration"),
288 'type' => SMOPT_TYPE_NUMLIST
,
289 'posvals' => array( 0 => _("Standard GNU C time zones"),
290 1 => _("Strict time zones"),
291 2 => _("Custom GNU C time zones"),
292 3 => _("Custom strict time zones")),
294 /* --------------------------------------------------------*/
295 'Group5' => array( 'name' => _("Message of the Day"),
296 'type' => SMOPT_TYPE_TITLE
),
297 '$motd' => array( 'name' => _("Message of the Day"),
298 'type' => SMOPT_TYPE_TEXTAREA
,
300 /* ---- Database settings ---- */
301 'Group6' => array( 'name' => _("Database"),
302 'type' => SMOPT_TYPE_TITLE
),
303 '$addrbook_dsn' => array( 'name' => _("Address book DSN"),
304 'type' => SMOPT_TYPE_STRING
,
306 '$addrbook_table' => array( 'name' => _("Address book table"),
307 'type' => SMOPT_TYPE_STRING
,
309 'default' => 'address' ),
310 '$prefs_dsn' => array( 'name' => _("Preferences DSN"),
311 'type' => SMOPT_TYPE_STRING
,
313 '$prefs_table' => array( 'name' => _("Preferences table"),
314 'type' => SMOPT_TYPE_STRING
,
316 'default' => 'userprefs' ),
317 '$prefs_user_field' => array('name' => _("Preferences username field"),
318 'type' => SMOPT_TYPE_STRING
,
320 'default' => 'user' ),
321 '$prefs_user_size' => array( 'name' => _("Size of username field"),
322 'type' => SMOPT_TYPE_INTEGER
),
323 '$prefs_key_field' => array('name' => _("Preferences key field"),
324 'type' => SMOPT_TYPE_STRING
,
326 'default' => 'prefkey' ),
327 '$prefs_key_size' => array( 'name' => _("Size of key field"),
328 'type' => SMOPT_TYPE_INTEGER
),
329 '$prefs_val_field' => array('name' => _("Preferences value field"),
330 'type' => SMOPT_TYPE_STRING
,
332 'default' => 'prefval' ),
333 '$prefs_val_size' => array( 'name' => _("Size of value field"),
334 'type' => SMOPT_TYPE_INTEGER
),
335 '$addrbook_global_dsn' => array( 'name' => _("Global address book DSN"),
336 'type' => SMOPT_TYPE_STRING
,
338 '$addrbook_global_table' => array( 'name' => _("Global address book table"),
339 'type' => SMOPT_TYPE_STRING
,
341 'default' => 'global_abook' ),
342 '$addrbook_global_writeable' => array( 'name' => _("Allow writing into global address book"),
343 'type' => SMOPT_TYPE_BOOLEAN
),
344 '$addrbook_global_listing' => array( 'name' => _("Allow listing of global address book"),
345 'type' => SMOPT_TYPE_BOOLEAN
),
346 /* ---- Language settings ---- */
347 'Group9' => array( 'name' => _("Language settings"),
348 'type' => SMOPT_TYPE_TITLE
),
349 '$squirrelmail_default_language' => array( 'name' => _("Default Language"),
350 'type' => SMOPT_TYPE_STRLIST
,
352 'posvals' => $language_values ),
353 '$default_charset' => array( 'name' => _("Default Charset"),
354 'type' => SMOPT_TYPE_STRLIST
,
355 'posvals' => array( 'iso-8859-1' => 'iso-8859-1',
356 'iso-8859-2' => 'iso-8859-2',
357 'iso-8859-7' => 'iso-8859-7',
358 'iso-8859-9' => 'iso-8859-9',
359 'iso-8859-15' => 'iso-8859-15',
361 'koi8-r' => 'koi8-r',
362 'euc-kr' => 'euc-kr',
364 'gb2312' => 'gb2312',
365 'tis-620' => 'tis-620',
366 'windows-1251' => 'windows-1251',
367 'windows-1255' => 'windows-1255',
368 'windows-1256' => 'windows-1256',
369 'iso-2022-jp' => 'iso-2022-jp' ) ),
370 '$show_alternative_names' => array( 'name' => _("Show alternative language names"),
371 'type' => SMOPT_TYPE_BOOLEAN
),
372 '$aggressive_decoding' => array( 'name' => _("Enable aggressive decoding"),
373 'type' => SMOPT_TYPE_BOOLEAN
),
374 '$lossy_encoding' => array( 'name' => _("Enable lossy encoding"),
375 'type' => SMOPT_TYPE_BOOLEAN
),
376 /* ---- Tweaks ---- */
377 'Group10' => array( 'name' => _("Tweaks"),
378 'type' => SMOPT_TYPE_TITLE
),
379 '$advanced_tree' => array( 'name' => _("Use advanced tree folder listing"),
380 'type' => SMOPT_TYPE_BOOLEAN
),
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 /* --------------------------------------------------------*/
403 'Group7' => array( 'name' => _("Templates"),
404 'type' => SMOPT_TYPE_TITLE
),
405 '$theme_css' => array( 'name' => _("Style Sheet URL (css)"),
406 'type' => SMOPT_TYPE_PATH
,
408 '$default_fontsize' => array( 'name' => _("Default font size"),
409 'type' => SMOPT_TYPE_STRING
,
411 '$default_fontset' => array( 'name' => _("Default font set"),
412 'type' => SMOPT_TYPE_STRLIST
,
413 'posvals' => $fontsets),
414 '$templateset_default' => array( 'name' => _("Default template"),
415 'type' => SMOPT_TYPE_STRLIST
,
416 'posvals' => adm_template_options()),
417 '$theme_default' => array( 'name' => _("Default theme"),
418 'type' => SMOPT_TYPE_INTEGER
,
420 'comment' => _("Use index number of theme") ),
421 /* --------------------------------------------------------*/
422 '$config_use_color' => array( 'name' => '',
423 'type' => SMOPT_TYPE_HIDDEN
),
424 '$no_list_for_subscribe' => array( 'name' => '',
425 'type' => SMOPT_TYPE_HIDDEN
),
426 /* --------------------------------------------------------*/