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
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);
34 * Returns reformated aTemplateSet array data for option selection
35 * @return array template selection options
38 function adm_template_options() {
41 foreach ($aTemplateSet as $iTemplateID => $aTemplate) {
42 $ret[$iTemplateID] = $aTemplate['NAME'];
47 global $languages, $version;
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'];
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");
62 $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
63 'type' => SMOPT_TYPE_COMMENT
,
65 'SM_ver' => array( 'name' => _("SquirrelMail Version"),
66 'type' => SMOPT_TYPE_EXTERNAL
,
67 'value' => "$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
,
77 '$org_logo' => array( 'name' => _("Organization Logo"),
78 'type' => SMOPT_TYPE_PATH
,
80 'default' => '../images/sm_logo.png'),
81 '$org_logo_width' => array( 'name' => _("Organization Logo Width"),
82 'type' => SMOPT_TYPE_STRING
,
85 '$org_logo_height' => array( 'name' => _("Organization Logo Height"),
86 'type' => SMOPT_TYPE_STRING
,
89 '$org_title' => array( 'name' => _("Organization Title"),
90 'type' => SMOPT_TYPE_STRING
,
92 '$signout_page' => array( 'name' => _("Signout Page"),
93 'type' => SMOPT_TYPE_PATH
,
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
,
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
,
109 '$imapServerAddress' => array( 'name' => _("IMAP Server Address"),
110 'type' => SMOPT_TYPE_STRING
,
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 'other' => _("Not one of the above servers") ) ),
125 '$optional_delimiter' => array( 'name' => _("IMAP Folder Delimiter"),
126 'type' => SMOPT_TYPE_STRING
,
127 'comment' => _("Use "detect" to auto-detect."),
129 'default' => 'detect' ),
130 '$use_imap_tls' => array( 'name' => _("IMAP Connection Security"),
131 'type' => SMOPT_TYPE_STRLIST
,
132 'posvals' => array( 0 => _("Plain text connection"),
133 1 => _("Secure IMAP (TLS) connection"),
134 2 => _("IMAP STARTTLS connection")),
135 'comment' => _("Requires higher PHP version and special functions. See SquirrelMail documentation."),
137 '$imap_auth_mech' => array( 'name' => _("IMAP Authentication Type"),
138 'type' => SMOPT_TYPE_STRLIST
,
139 'posvals' => array('login' => _("IMAP login"),
140 'cram-md5' => 'CRAM-MD5',
141 'digest-md5' => 'DIGEST-MD5'),
142 'default' => 'login' ),
143 '$useSendmail' => array( 'name' => _("Use Sendmail Binary"),
144 'type' => SMOPT_TYPE_BOOLEAN
,
145 'comment' => _("Choose "no" for SMTP") ),
146 '$sendmail_path' => array( 'name' => _("Sendmail Path"),
147 'type' => SMOPT_TYPE_STRING
,
149 '$sendmail_args' => array( 'name' => _("Sendmail Arguments"),
150 'type' => SMOPT_TYPE_STRING
,
152 '$smtpServerAddress' => array( 'name' => _("SMTP Server Address"),
153 'type' => SMOPT_TYPE_STRING
,
155 '$smtpPort' => array( 'name' => _("SMTP Server Port"),
156 'type' => SMOPT_TYPE_INTEGER
),
157 '$use_smtp_tls' => array( 'name' => _("SMTP Connection Security"),
158 'type' => SMOPT_TYPE_STRLIST
,
159 'posvals' => array( 0 => _("Plain text connection"),
160 1 => _("Secure IMAP (TLS) connection"),
161 2 => _("IMAP STARTTLS connection")),
162 'comment' => _("Requires higher PHP version and special functions. See SquirrelMail documentation."),
164 '$smtp_auth_mech' => array( 'name' => _("SMTP Authentication Type"),
165 'type' => SMOPT_TYPE_STRLIST
,
166 'posvals' => array('none' => _("No SMTP auth"),
167 'login' => _("Login (plain text)"),
168 'cram-md5' => 'CRAM-MD5',
169 'digest-md5' => 'DIGEST-MD5'),
170 'default' => 'none'),
171 '$pop_before_smtp' => array( 'name' => _("POP3 Before SMTP?"),
172 'type' => SMOPT_TYPE_BOOLEAN
,
173 'default' => false ),
174 '$encode_header_key' => array( 'name' => _("Header Encryption Key"),
175 'type' => SMOPT_TYPE_STRING
),
176 '$invert_time' => array( 'name' => _("Invert Time"),
177 'type' => SMOPT_TYPE_BOOLEAN
),
178 /* --------------------------------------------------------*/
179 'Group3' => array( 'name' => _("Folders Defaults"),
180 'type' => SMOPT_TYPE_TITLE
),
181 '$default_folder_prefix' => array( 'name' => _("Default Folder Prefix"),
182 'type' => SMOPT_TYPE_STRING
,
184 '$show_prefix_option' => array( 'name' => _("Show Folder Prefix Option"),
185 'type' => SMOPT_TYPE_BOOLEAN
),
186 '$trash_folder' => array( 'name' => _("Trash Folder"),
187 'type' => SMOPT_TYPE_STRING
,
189 '$sent_folder' => array( 'name' => _("Sent Folder"),
190 'type' => SMOPT_TYPE_STRING
,
192 '$draft_folder' => array( 'name' => _("Draft Folder"),
193 'type' => SMOPT_TYPE_STRING
,
195 '$default_move_to_trash' => array( 'name' => _("By default, move to trash"),
196 'type' => SMOPT_TYPE_BOOLEAN
),
197 '$default_move_to_sent' => array( 'name' => _("By default, move to sent"),
198 'type' => SMOPT_TYPE_BOOLEAN
),
199 '$default_save_as_draft' => array( 'name' => _("By default, save as draft"),
200 'type' => SMOPT_TYPE_BOOLEAN
),
201 '$list_special_folders_first' => array( 'name' => _("List Special Folders First"),
202 'type' => SMOPT_TYPE_BOOLEAN
),
203 '$use_special_folder_color' => array( 'name' => _("Show Special Folders Color"),
204 'type' => SMOPT_TYPE_BOOLEAN
),
205 '$auto_expunge' => array( 'name' => _("Auto Expunge"),
206 'type' => SMOPT_TYPE_BOOLEAN
),
207 '$default_sub_of_inbox' => array( 'name' => _("Default Sub. of INBOX"),
208 'type' => SMOPT_TYPE_BOOLEAN
),
209 '$show_contain_subfolders_option' => array( 'name' => _("Show 'Contain Sub.' Option"),
210 'type' => SMOPT_TYPE_BOOLEAN
),
211 '$default_unseen_notify' => array( 'name' => _("Default Unseen Notify"),
212 'type' => SMOPT_TYPE_NUMLIST
,
213 'posvals' => array( SMPREF_UNSEEN_NONE
=> _("No Notification"),
214 SMPREF_UNSEEN_INBOX
=> _("Only INBOX"),
215 SMPREF_UNSEEN_ALL
=> _("All Folders")) ),
216 '$default_unseen_type' => array( 'name' => _("Default Unseen Type"),
217 'type' => SMOPT_TYPE_NUMLIST
,
218 'posvals' => array( SMPREF_UNSEEN_ONLY
=> _("Only Unseen"),
219 SMPREF_UNSEEN_TOTAL
=> _("Unseen and Total") ) ),
220 '$auto_create_special' => array( 'name' => _("Auto Create Special Folders"),
221 'type' => SMOPT_TYPE_BOOLEAN
),
222 '$delete_folder' => array( 'name' => _("Auto delete folders"),
223 'type' => SMOPT_TYPE_BOOLEAN
),
224 '$noselect_fix_enable' => array( 'name' => _("Enable /NoSelect folder fix"),
225 'type' => SMOPT_TYPE_BOOLEAN
,
227 /* --------------------------------------------------------*/
228 'Group4' => array( 'name' => _("General Options"),
229 'type' => SMOPT_TYPE_TITLE
),
230 '$data_dir' => array( 'name' => _("Data Directory"),
231 'type' => SMOPT_TYPE_PATH
,
233 '$attachment_dir' => array( 'name' => _("Temp Directory"),
234 'type' => SMOPT_TYPE_PATH
,
236 '$dir_hash_level' => array( 'name' => _("Hash Level"),
237 'type' => SMOPT_TYPE_NUMLIST
,
238 'posvals' => array( 0 => _("Hash Disabled"),
243 '$default_left_size' => array( 'name' => _("Default Left Size"),
244 'type' => SMOPT_TYPE_NUMLIST
,
245 'posvals' => $left_size_values ),
246 '$force_username_lowercase' => array( 'name' => _("Usernames in Lowercase"),
247 'type' => SMOPT_TYPE_BOOLEAN
),
248 '$default_use_priority' => array( 'name' => _("Allow use of priority"),
249 'type' => SMOPT_TYPE_BOOLEAN
),
250 '$hide_sm_attributions' => array( 'name' => _("Hide SM attributions"),
251 'type' => SMOPT_TYPE_BOOLEAN
),
252 '$default_use_mdn' => array( 'name' => _("Enable use of delivery receipts"),
253 'type' => SMOPT_TYPE_BOOLEAN
),
254 '$edit_identity' => array( 'name' => _("Allow editing of identities"),
255 'type' => SMOPT_TYPE_BOOLEAN
),
256 '$edit_name' => array( 'name' => _("Allow editing of full name"),
257 'type' => SMOPT_TYPE_BOOLEAN
),
258 '$hide_auth_header' => array( 'name' => _("Remove username from headers"),
259 'comment' => _("Used only when identities can't be modified"),
260 'type' => SMOPT_TYPE_BOOLEAN
),
261 '$disable_server_sort' => array( 'name' => _("Disable server-side sorting"),
262 'type' => SMOPT_TYPE_BOOLEAN
,
263 'default' => false ),
264 '$disable_thread_sort' => array( 'name' => _("Disable server-side thread sorting"),
265 'type' => SMOPT_TYPE_BOOLEAN
,
266 'default' => false ),
267 '$allow_charset_search' => array( 'name' => _("Allow server charset search"),
268 'type' => SMOPT_TYPE_BOOLEAN
,
269 'default' => false ),
270 '$allow_advanced_search' => array( 'name' => _("Search functions"),
271 'type' => SMOPT_TYPE_NUMLIST
,
272 'posvals' => array( 0 => _("Only basic search"),
273 1 => _("Only advanced search"),
274 2 => _("Both search functions") ),
276 '$session_name' => array( 'name' => _("PHP session name"),
277 'type' => SMOPT_TYPE_HIDDEN
),
278 '$time_zone_type' => array( 'name' => _("Time Zone Configuration"),
279 'type' => SMOPT_TYPE_NUMLIST
,
280 'posvals' => array( 0 => _("Standard GNU C time zones"),
281 1 => _("Strict time zones"),
282 2 => _("Custom GNU C time zones"),
283 3 => _("Custom strict time zones")),
285 /* --------------------------------------------------------*/
286 'Group5' => array( 'name' => _("Message of the Day"),
287 'type' => SMOPT_TYPE_TITLE
),
288 '$motd' => array( 'name' => _("Message of the Day"),
289 'type' => SMOPT_TYPE_TEXTAREA
,
291 /* ---- Database settings ---- */
292 'Group6' => array( 'name' => _("Database"),
293 'type' => SMOPT_TYPE_TITLE
),
294 '$addrbook_dsn' => array( 'name' => _("Address book DSN"),
295 'type' => SMOPT_TYPE_STRING
,
297 '$addrbook_table' => array( 'name' => _("Address book table"),
298 'type' => SMOPT_TYPE_STRING
,
300 'default' => 'address' ),
301 '$prefs_dsn' => array( 'name' => _("Preferences DSN"),
302 'type' => SMOPT_TYPE_STRING
,
304 '$prefs_table' => array( 'name' => _("Preferences table"),
305 'type' => SMOPT_TYPE_STRING
,
307 'default' => 'userprefs' ),
308 '$prefs_user_field' => array('name' => _("Preferences username field"),
309 'type' => SMOPT_TYPE_STRING
,
311 'default' => 'user' ),
312 '$prefs_user_size' => array( 'name' => _("Size of username field"),
313 'type' => SMOPT_TYPE_INTEGER
),
314 '$prefs_key_field' => array('name' => _("Preferences key field"),
315 'type' => SMOPT_TYPE_STRING
,
317 'default' => 'prefkey' ),
318 '$prefs_key_size' => array( 'name' => _("Size of key field"),
319 'type' => SMOPT_TYPE_INTEGER
),
320 '$prefs_val_field' => array('name' => _("Preferences value field"),
321 'type' => SMOPT_TYPE_STRING
,
323 'default' => 'prefval' ),
324 '$prefs_val_size' => array( 'name' => _("Size of value field"),
325 'type' => SMOPT_TYPE_INTEGER
),
326 '$addrbook_global_dsn' => array( 'name' => _("Global address book DSN"),
327 'type' => SMOPT_TYPE_STRING
,
329 '$addrbook_global_table' => array( 'name' => _("Global address book table"),
330 'type' => SMOPT_TYPE_STRING
,
332 'default' => 'global_abook' ),
333 '$addrbook_global_writeable' => array( 'name' => _("Allow writing into global address book"),
334 'type' => SMOPT_TYPE_BOOLEAN
),
335 '$addrbook_global_listing' => array( 'name' => _("Allow listing of global address book"),
336 'type' => SMOPT_TYPE_BOOLEAN
),
337 /* ---- Language settings ---- */
338 'Group9' => array( 'name' => _("Language settings"),
339 'type' => SMOPT_TYPE_TITLE
),
340 '$squirrelmail_default_language' => array( 'name' => _("Default Language"),
341 'type' => SMOPT_TYPE_STRLIST
,
343 'posvals' => $language_values ),
344 '$default_charset' => array( 'name' => _("Default Charset"),
345 'type' => SMOPT_TYPE_STRLIST
,
346 'posvals' => array( 'iso-8859-1' => 'iso-8859-1',
347 'iso-8859-2' => 'iso-8859-2',
348 'iso-8859-7' => 'iso-8859-7',
349 'iso-8859-9' => 'iso-8859-9',
350 'iso-8859-15' => 'iso-8859-15',
352 'koi8-r' => 'koi8-r',
353 'euc-kr' => 'euc-kr',
355 'gb2312' => 'gb2312',
356 'tis-620' => 'tis-620',
357 'windows-1251' => 'windows-1251',
358 'windows-1255' => 'windows-1255',
359 'windows-1256' => 'windows-1256',
360 'iso-2022-jp' => 'iso-2022-jp' ) ),
361 '$show_alternative_names' => array( 'name' => _("Show alternative language names"),
362 'type' => SMOPT_TYPE_BOOLEAN
),
363 '$aggressive_decoding' => array( 'name' => _("Enable aggressive decoding"),
364 'type' => SMOPT_TYPE_BOOLEAN
),
365 '$lossy_encoding' => array( 'name' => _("Enable lossy encoding"),
366 'type' => SMOPT_TYPE_BOOLEAN
),
367 /* ---- Tweaks ---- */
368 'Group10' => array( 'name' => _("Tweaks"),
369 'type' => SMOPT_TYPE_TITLE
),
370 '$use_icons' => array( 'name' => _("Use icons"),
371 'type' => SMOPT_TYPE_BOOLEAN
),
372 '$use_iframe' => array( 'name' => _("Use inline frames with HTML mails"),
373 'type' => SMOPT_TYPE_BOOLEAN
),
374 '$use_php_recode' => array( 'name' => _("Use PHP recode functions"),
375 'type' => SMOPT_TYPE_BOOLEAN
),
376 '$use_php_iconv' => array( 'name' => _("Use PHP iconv functions"),
377 'type' => SMOPT_TYPE_BOOLEAN
),
378 '$allow_remote_configtest' => array( 'name' => _("Allow remote configuration test"),
379 'type' => SMOPT_TYPE_BOOLEAN
),
380 /* ---- Settings of address books ---- */
381 'Group11' => array( 'name' => _("Address Books"),
382 'type' => SMOPT_TYPE_TITLE
),
383 '$default_use_javascript_addr_book' => array( 'name' => _("Default Javascript Addressbook"),
384 'type' => SMOPT_TYPE_BOOLEAN
),
385 '$abook_global_file' => array( 'name' => _("Global address book file"),
386 'type' => SMOPT_TYPE_STRING
),
387 '$abook_global_file_writeable' => array( 'name' => _("Allow writing into global address book file"),
388 'type' => SMOPT_TYPE_BOOLEAN
),
389 '$abook_global_file_listing' => array( 'name' => _("Allow listing of global address book"),
390 'type' => SMOPT_TYPE_BOOLEAN
),
391 /* --------------------------------------------------------*/
392 'Group7' => array( 'name' => _("Templates"),
393 'type' => SMOPT_TYPE_TITLE
),
394 '$theme_css' => array( 'name' => _("Style Sheet URL (css)"),
395 'type' => SMOPT_TYPE_PATH
,
397 '$default_fontsize' => array( 'name' => _("Default font size"),
398 'type' => SMOPT_TYPE_STRING
,
400 '$default_fontset' => array( 'name' => _("Default font set"),
401 'type' => SMOPT_TYPE_STRLIST
,
402 'posvals' => $fontsets),
403 '$templateset_default' => array( 'name' => _("Default template"),
404 'type' => SMOPT_TYPE_STRLIST
,
405 'posvals' => adm_template_options()),
406 '$theme_default' => array( 'name' => _("Default theme"),
407 'type' => SMOPT_TYPE_INTEGER
,
409 'comment' => _("Use index number of theme") ),
410 /* --------------------------------------------------------*/
411 '$config_use_color' => array( 'name' => '',
412 'type' => SMOPT_TYPE_HIDDEN
),
413 '$no_list_for_subscribe' => array( 'name' => '',
414 'type' => SMOPT_TYPE_HIDDEN
),
415 /* --------------------------------------------------------*/