defines.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <?php
  2. /**
  3. * Administrator plugin - Option definitions
  4. *
  5. * @version $Id$
  6. * @author Philippe Mingo
  7. * @copyright (c) 1999-2004 The SquirrelMail Project Team
  8. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9. * @package plugins
  10. * @subpackage administrator
  11. */
  12. /** */
  13. require_once( SM_PATH . 'functions/constants.php' );
  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_EXTERNAL', 32);
  30. define('SMOPT_TYPE_PATH',33);
  31. global $languages;
  32. $language_values = array( );
  33. foreach ($languages as $lang_key => $lang_attributes) {
  34. if (isset($lang_attributes['NAME'])) {
  35. $language_values[$lang_key] = $lang_attributes['NAME'];
  36. }
  37. }
  38. asort( $language_values );
  39. $language_values = array_merge(array('' => _("Default")), $language_values);
  40. $left_size_values = array();
  41. for ($lsv = 100; $lsv <= 300; $lsv += 10) {
  42. $left_size_values[$lsv] = "$lsv " . _("pixels");
  43. }
  44. $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
  45. 'type' => SMOPT_TYPE_COMMENT,
  46. 'size' => 7 ),
  47. 'SM_ver' => array( 'name' => _("SquirrelMail Version"),
  48. 'type' => SMOPT_TYPE_EXTERNAL,
  49. 'value' => "$version" ),
  50. 'PHP_ver' => array( 'name' => _("PHP Version"),
  51. 'type' => SMOPT_TYPE_EXTERNAL,
  52. 'value' => phpversion() ),
  53. /* --------------------------------------------------------*/
  54. 'Group1' => array( 'name' => _("Organization Preferences"),
  55. 'type' => SMOPT_TYPE_TITLE ),
  56. '$org_name' => array( 'name' => _("Organization Name"),
  57. 'type' => SMOPT_TYPE_STRING,
  58. 'size' => 40 ),
  59. '$org_logo' => array( 'name' => _("Organization Logo"),
  60. 'type' => SMOPT_TYPE_PATH,
  61. 'size' => 40,
  62. 'default' => '../images/sm_logo.png'),
  63. '$org_logo_width' => array( 'name' => _("Organization Logo Width"),
  64. 'type' => SMOPT_TYPE_STRING,
  65. 'size' => 5,
  66. 'default' => 0),
  67. '$org_logo_height' => array( 'name' => _("Organization Logo Height"),
  68. 'type' => SMOPT_TYPE_STRING,
  69. 'size' => 5,
  70. 'default' => 0),
  71. '$org_title' => array( 'name' => _("Organization Title"),
  72. 'type' => SMOPT_TYPE_STRING,
  73. 'size' => 40 ),
  74. '$signout_page' => array( 'name' => _("Signout Page"),
  75. 'type' => SMOPT_TYPE_PATH,
  76. 'size' => 40 ),
  77. '$provider_uri' => array( 'name' => _("Provider Link URI"),
  78. 'type' => SMOPT_TYPE_STRING ),
  79. '$provider_name' => array( 'name' => _("Provider Name"),
  80. 'type' => SMOPT_TYPE_STRING ),
  81. '$frame_top' => array( 'name' => _("Top Frame"),
  82. 'type' => SMOPT_TYPE_STRING,
  83. 'size' => 40,
  84. 'default' => '_top' ),
  85. /* --------------------------------------------------------*/
  86. 'Group2' => array( 'name' => _("Server Settings"),
  87. 'type' => SMOPT_TYPE_TITLE ),
  88. '$domain' => array( 'name' => _("Mail Domain"),
  89. 'type' => SMOPT_TYPE_STRING,
  90. 'size' => 40 ),
  91. '$imapServerAddress' => array( 'name' => _("IMAP Server Address"),
  92. 'type' => SMOPT_TYPE_STRING,
  93. 'size' => 40 ),
  94. '$imapPort' => array( 'name' => _("IMAP Server Port"),
  95. 'type' => SMOPT_TYPE_INTEGER ),
  96. '$imap_server_type' => array( 'name' => _("IMAP Server Type"),
  97. 'type' => SMOPT_TYPE_STRLIST,
  98. 'posvals' => array( 'cyrus' => _("Cyrus IMAP server"),
  99. 'uw' => _("University of Washington's IMAP server"),
  100. 'exchange' => _("Microsoft Exchange IMAP server"),
  101. 'courier' => _("Courier IMAP server"),
  102. 'other' => _("Not one of the above servers") ) ),
  103. '$optional_delimiter' => array( 'name' => _("IMAP Folder Delimiter"),
  104. 'type' => SMOPT_TYPE_STRING,
  105. 'comment' => _("Use &quot;detect&quot; to auto-detect."),
  106. 'size' => 10,
  107. 'default' => 'detect' ),
  108. '$use_imap_tls' => array( 'name' => _("Use TLS for IMAP Connections"),
  109. 'type' => SMOPT_TYPE_BOOLEAN,
  110. 'comment' => _("Requires PHP 4.3.x! Experimental."),
  111. 'default' => false ),
  112. '$imap_auth_mech' => array( 'name' => _("IMAP Authentication Type"),
  113. 'type' => SMOPT_TYPE_STRLIST,
  114. 'posvals' => array('login' => _("IMAP login"),
  115. 'cram-md5' => 'CRAM-MD5',
  116. 'digest-md5' => 'DIGEST-MD5'),
  117. 'default' => 'login' ),
  118. '$useSendmail' => array( 'name' => _("Use Sendmail Binary"),
  119. 'type' => SMOPT_TYPE_BOOLEAN,
  120. 'comment' => _("Choose &quot;no&quot; for SMTP") ),
  121. '$sendmail_path' => array( 'name' => _("Sendmail Path"),
  122. 'type' => SMOPT_TYPE_STRING,
  123. 'size' => 40 ),
  124. '$smtpServerAddress' => array( 'name' => _("SMTP Server Address"),
  125. 'type' => SMOPT_TYPE_STRING,
  126. 'size' => 40 ),
  127. '$smtpPort' => array( 'name' => _("SMTP Server Port"),
  128. 'type' => SMOPT_TYPE_INTEGER ),
  129. '$use_smtp_tls' => array( 'name' => _("Use TLS for SMTP Connections"),
  130. 'type' => SMOPT_TYPE_BOOLEAN,
  131. 'comment' => _("Requires PHP 4.3.x! Experimental."),
  132. 'default' => false ),
  133. '$smtp_auth_mech' => array( 'name' => _("SMTP Authentication Type"),
  134. 'type' => SMOPT_TYPE_STRLIST,
  135. 'posvals' => array('none' => _("No SMTP auth"),
  136. 'login' => _("Login (plain text)"),
  137. 'cram-md5' => 'CRAM-MD5',
  138. 'digest-md5' => 'DIGEST-MD5'),
  139. 'default' => 'none'),
  140. '$pop_before_smtp' => array( 'name' => _("POP3 Before SMTP?"),
  141. 'type' => SMOPT_TYPE_BOOLEAN,
  142. 'default' => false ),
  143. '$skip_SM_header' => array( 'name' => _("Hide SquirrelMail Header"),
  144. 'type' => SMOPT_TYPE_BOOLEAN ),
  145. '$invert_time' => array( 'name' => _("Invert Time"),
  146. 'type' => SMOPT_TYPE_BOOLEAN ),
  147. /* --------------------------------------------------------*/
  148. 'Group3' => array( 'name' => _("Folders Defaults"),
  149. 'type' => SMOPT_TYPE_TITLE ),
  150. '$default_folder_prefix' => array( 'name' => _("Default Folder Prefix"),
  151. 'type' => SMOPT_TYPE_STRING,
  152. 'size' => 40 ),
  153. '$show_prefix_option' => array( 'name' => _("Show Folder Prefix Option"),
  154. 'type' => SMOPT_TYPE_BOOLEAN ),
  155. '$trash_folder' => array( 'name' => _("Trash Folder"),
  156. 'type' => SMOPT_TYPE_STRING,
  157. 'size' => 40 ),
  158. '$sent_folder' => array( 'name' => _("Sent Folder"),
  159. 'type' => SMOPT_TYPE_STRING,
  160. 'size' => 40 ),
  161. '$draft_folder' => array( 'name' => _("Draft Folder"),
  162. 'type' => SMOPT_TYPE_STRING,
  163. 'size' => 40 ),
  164. '$default_move_to_trash' => array( 'name' => _("By default, move to trash"),
  165. 'type' => SMOPT_TYPE_BOOLEAN ),
  166. '$default_move_to_sent' => array( 'name' => _("By default, move to sent"),
  167. 'type' => SMOPT_TYPE_BOOLEAN ),
  168. '$default_save_as_draft' => array( 'name' => _("By default, save as draft"),
  169. 'type' => SMOPT_TYPE_BOOLEAN ),
  170. '$list_special_folders_first' => array( 'name' => _("List Special Folders First"),
  171. 'type' => SMOPT_TYPE_BOOLEAN ),
  172. '$use_special_folder_color' => array( 'name' => _("Show Special Folders Color"),
  173. 'type' => SMOPT_TYPE_BOOLEAN ),
  174. '$auto_expunge' => array( 'name' => _("Auto Expunge"),
  175. 'type' => SMOPT_TYPE_BOOLEAN ),
  176. '$default_sub_of_inbox' => array( 'name' => _("Default Sub. of INBOX"),
  177. 'type' => SMOPT_TYPE_BOOLEAN ),
  178. '$show_contain_subfolders_option' => array( 'name' => _("Show 'Contain Sub.' Option"),
  179. 'type' => SMOPT_TYPE_BOOLEAN ),
  180. '$default_unseen_notify' => array( 'name' => _("Default Unseen Notify"),
  181. 'type' => SMOPT_TYPE_NUMLIST,
  182. 'posvals' => array( SMPREF_UNSEEN_NONE => _("No Notification"),
  183. SMPREF_UNSEEN_INBOX => _("Only INBOX"),
  184. SMPREF_UNSEEN_ALL => _("All Folders")) ),
  185. '$default_unseen_type' => array( 'name' => _("Default Unseen Type"),
  186. 'type' => SMOPT_TYPE_NUMLIST ,
  187. 'posvals' => array( SMPREF_UNSEEN_ONLY => _("Only Unseen"),
  188. SMPREF_UNSEEN_TOTAL => _("Unseen and Total") ) ),
  189. '$auto_create_special' => array( 'name' => _("Auto Create Special Folders"),
  190. 'type' => SMOPT_TYPE_BOOLEAN ),
  191. '$default_use_javascript_addr_book' => array( 'name' => _("Default Javascript Addressbook"),
  192. 'type' => SMOPT_TYPE_BOOLEAN ),
  193. '$delete_folder' => array( 'name' => _("Auto delete folders"),
  194. 'type' => SMOPT_TYPE_BOOLEAN ),
  195. '$noselect_fix_enable' => array( 'name' => _("Enable /NoSelect folder fix"),
  196. 'type' => SMOPT_TYPE_BOOLEAN,
  197. 'default' => false),
  198. /* --------------------------------------------------------*/
  199. 'Group4' => array( 'name' => _("General Options"),
  200. 'type' => SMOPT_TYPE_TITLE ),
  201. '$data_dir' => array( 'name' => _("Data Directory"),
  202. 'type' => SMOPT_TYPE_PATH,
  203. 'size' => 40 ),
  204. '$attachment_dir' => array( 'name' => _("Temp Directory"),
  205. 'type' => SMOPT_TYPE_PATH,
  206. 'size' => 40 ),
  207. '$dir_hash_level' => array( 'name' => _("Hash Level"),
  208. 'type' => SMOPT_TYPE_NUMLIST,
  209. 'posvals' => array( 0 => _("Hash Disabled"),
  210. 1 => _("Low"),
  211. 2 => _("Moderate"),
  212. 3 => _("Medium"),
  213. 4 => _("High") ) ),
  214. '$default_left_size' => array( 'name' => _("Default Left Size"),
  215. 'type' => SMOPT_TYPE_NUMLIST,
  216. 'posvals' => $left_size_values ),
  217. '$force_username_lowercase' => array( 'name' => _("Usernames in Lowercase"),
  218. 'type' => SMOPT_TYPE_BOOLEAN ),
  219. '$default_use_priority' => array( 'name' => _("Allow use of priority"),
  220. 'type' => SMOPT_TYPE_BOOLEAN ),
  221. '$hide_sm_attributions' => array( 'name' => _("Hide SM attributions"),
  222. 'type' => SMOPT_TYPE_BOOLEAN ),
  223. '$default_use_mdn' => array( 'name' => _("Enable use of delivery receipts"),
  224. 'type' => SMOPT_TYPE_BOOLEAN ),
  225. '$edit_identity' => array( 'name' => _("Allow editing of identities"),
  226. 'type' => SMOPT_TYPE_BOOLEAN ),
  227. '$edit_name' => array( 'name' => _("Allow editing of full name"),
  228. 'type' => SMOPT_TYPE_BOOLEAN ),
  229. '$allow_server_sort' => array( 'name' => _("Use server-side sorting"),
  230. 'type' => SMOPT_TYPE_BOOLEAN,
  231. 'default' => false ),
  232. '$allow_thread_sort' => array( 'name' => _("Use server-side thread sorting"),
  233. 'type' => SMOPT_TYPE_BOOLEAN,
  234. 'default' => false ),
  235. '$allow_charset_search' => array( 'name' => _("Allow server charset search"),
  236. 'type' => SMOPT_TYPE_BOOLEAN,
  237. 'default' => false ),
  238. '$allow_advanced_search' => array( 'name' => _("Search functions"),
  239. 'type' => SMOPT_TYPE_NUMLIST,
  240. 'posvals' => array( 0 => _("Only basic search"),
  241. 1 => _("Only advanced search"),
  242. 2 => _("Both search functions") ),
  243. 'default' => 0 ),
  244. '$session_name' => array( 'name' => _("PHP session name"),
  245. 'type' => SMOPT_TYPE_HIDDEN ),
  246. /* --------------------------------------------------------*/
  247. 'Group5' => array( 'name' => _("Message of the Day"),
  248. 'type' => SMOPT_TYPE_TITLE ),
  249. '$motd' => array( 'name' => _("Message of the Day"),
  250. 'type' => SMOPT_TYPE_TEXTAREA,
  251. 'size' => 40 ),
  252. /* --------------------------------------------------------*/
  253. 'Group6' => array( 'name' => _("Database"),
  254. 'type' => SMOPT_TYPE_TITLE ),
  255. '$addrbook_dsn' => array( 'name' => _("Address book DSN"),
  256. 'type' => SMOPT_TYPE_STRING,
  257. 'size' => 40 ),
  258. '$addrbook_table' => array( 'name' => _("Address book table"),
  259. 'type' => SMOPT_TYPE_STRING,
  260. 'size' => 40,
  261. 'default' => 'address' ),
  262. '$prefs_dsn' => array( 'name' => _("Preferences DSN"),
  263. 'type' => SMOPT_TYPE_STRING,
  264. 'size' => 40 ),
  265. '$prefs_table' => array( 'name' => _("Preferences table"),
  266. 'type' => SMOPT_TYPE_STRING,
  267. 'size' => 40,
  268. 'default' => 'userprefs' ),
  269. '$prefs_user_field' => array('name' => _("Preferences username field"),
  270. 'type' => SMOPT_TYPE_STRING,
  271. 'size' => 40,
  272. 'default' => 'user' ),
  273. '$prefs_key_field' => array('name' => _("Preferences key field"),
  274. 'type' => SMOPT_TYPE_STRING,
  275. 'size' => 40,
  276. 'default' => 'prefkey' ),
  277. '$prefs_val_field' => array('name' => _("Preferences value field"),
  278. 'type' => SMOPT_TYPE_STRING,
  279. 'size' => 40,
  280. 'default' => 'prefval' ),
  281. '$addrbook_global_dsn' => array( 'name' => _("Global address book DSN"),
  282. 'type' => SMOPT_TYPE_STRING,
  283. 'size' => 40 ),
  284. '$addrbook_global_table' => array( 'name' => _("Global address book table"),
  285. 'type' => SMOPT_TYPE_STRING,
  286. 'size' => 40,
  287. 'default' => 'global_abook' ),
  288. '$addrbook_global_writeable' => array( 'name' => _("Allow writing into global address book"),
  289. 'type' => SMOPT_TYPE_BOOLEAN ),
  290. '$addrbook_global_listing' => array( 'name' => _("Allow listing of global address book"),
  291. 'type' => SMOPT_TYPE_BOOLEAN ),
  292. 'Group9' => array( 'name' => _("Language settings"),
  293. 'type' => SMOPT_TYPE_TITLE ),
  294. '$squirrelmail_default_language' => array( 'name' => _("Default Language"),
  295. 'type' => SMOPT_TYPE_STRLIST,
  296. 'size' => 7,
  297. 'posvals' => $language_values ),
  298. '$default_charset' => array( 'name' => _("Default Charset"),
  299. 'type' => SMOPT_TYPE_STRLIST,
  300. 'posvals' => array( 'iso-8859-1' => 'iso-8859-1',
  301. 'iso-8859-2' => 'iso-8859-2',
  302. 'iso-8859-7' => 'iso-8859-7',
  303. 'iso-8859-15' => 'iso-8859-15',
  304. 'iso-8859-15' => 'iso-8859-15',
  305. 'ns_4551_1' => 'ns_4551_1',
  306. 'koi8-r' => 'koi8-r',
  307. 'euc-KR' => 'euc-KR',
  308. 'windows-1251' => 'windows-1251',
  309. 'ISO-2022-JP' => 'ISO-2022-JP' ) ),
  310. '$show_alternative_names' => array( 'name' => _("Show alternative language names"),
  311. 'type' => SMOPT_TYPE_BOOLEAN ),
  312. '$available_languages' => array( 'name' => _("Available languages"),
  313. 'type' => SMOPT_TYPE_STRING,
  314. 'size' => 40 ),
  315. '$agresive_decoding' => array( 'name' => _("Use agresive decoding"),
  316. 'type' => SMOPT_TYPE_BOOLEAN ),
  317. 'Group10' => array( 'name' => _("Tweaks"),
  318. 'type' => SMOPT_TYPE_TITLE ),
  319. '$advanced_tree' => array( 'name' => _("Use advanced tree folder listing"),
  320. 'type' => SMOPT_TYPE_BOOLEAN ),
  321. '$oldway' => array( 'name' => _("Use old folder listing functions"),
  322. 'type' => SMOPT_TYPE_BOOLEAN ),
  323. '$use_icons' => array( 'name' => _("Use icons"),
  324. 'type' => SMOPT_TYPE_BOOLEAN ),
  325. '$use_php_recode' => array( 'name' => _("Use php recode functions"),
  326. 'type' => SMOPT_TYPE_BOOLEAN ),
  327. '$use_php_iconv' => array( 'name' => _("Use php iconv functions"),
  328. 'type' => SMOPT_TYPE_BOOLEAN ),
  329. /* --------------------------------------------------------*/
  330. 'Group7' => array( 'name' => _("Themes"),
  331. 'type' => SMOPT_TYPE_TITLE ),
  332. '$theme_css' => array( 'name' => _("Style Sheet URL (css)"),
  333. 'type' => SMOPT_TYPE_PATH,
  334. 'size' => 40 ),
  335. '$theme_default' => array( 'name' => _("Default theme"),
  336. 'type' => SMOPT_TYPE_INTEGER,
  337. 'default' => 0,
  338. 'comment' => _("Use index number of theme") ),
  339. /* --------------------------------------------------------*/
  340. '$config_use_color' => array( 'name' => '',
  341. 'type' => SMOPT_TYPE_HIDDEN ),
  342. '$no_list_for_subscribe' => array( 'name' => '',
  343. 'type' => SMOPT_TYPE_HIDDEN ),
  344. /* --------------------------------------------------------*/
  345. );
  346. ?>