You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.php 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. <?php
  2. if (!class_exists('rcmail_install', false) || !is_object($RCI)) {
  3. die("Not allowed! Please open installer/index.php instead.");
  4. }
  5. // register these boolean fields
  6. $RCI->bool_config_props = array(
  7. 'ip_check' => 1,
  8. 'enable_spellcheck' => 1,
  9. 'auto_create_user' => 1,
  10. 'smtp_log' => 1,
  11. 'prefer_html' => 1,
  12. 'preview_pane' => 1,
  13. 'debug_level' => 1,
  14. );
  15. // allow the current user to get to the next step
  16. $_SESSION['allowinstaller'] = true;
  17. if (!empty($_POST['submit'])) {
  18. $_SESSION['config'] = $RCI->create_config();
  19. if ($RCI->save_configfile($_SESSION['config'])) {
  20. echo '<p class="notice">The config file was saved successfully into <tt>'.RCMAIL_CONFIG_DIR.'</tt> directory of your Roundcube installation.';
  21. if ($RCI->legacy_config) {
  22. echo '<br/><br/>Afterwards, please <b>remove</b> the old configuration files <tt>main.inc.php</tt> and <tt>db.inc.php</tt> from the config directory.';
  23. }
  24. echo '</p>';
  25. }
  26. else {
  27. if (($dir = sys_get_temp_dir()) && @is_writable($dir)) {
  28. echo '<iframe name="getconfig" style="display:none"></iframe>';
  29. echo '<form id="getconfig_form" action="index.php" method="get" target="getconfig" style="display:none">';
  30. echo '<input name="_getconfig" value="2" /></form>';
  31. $button_txt = html::quote('Save in ' . $dir);
  32. $save_button = '&nbsp;<input type="button" onclick="document.getElementById(\'getconfig_form\').submit()" value="' . $button_txt . '" />';
  33. }
  34. echo '<p class="notice">Copy or download the following configuration and save it';
  35. echo ' as <tt><b>config.inc.php</b></tt> within the <tt>'.RCUBE_CONFIG_DIR.'</tt> directory of your Roundcube installation.<br/>';
  36. echo ' Make sure that there are no characters outside the <tt>&lt;?php ?&gt;</tt> brackets when saving the file.';
  37. echo '&nbsp;<input type="button" onclick="location.href=\'index.php?_getconfig=1\'" value="Download" />';
  38. echo $save_button;
  39. if ($RCI->legacy_config) {
  40. echo '<br/><br/>Afterwards, please <b>remove</b> the old configuration files <tt>main.inc.php</tt> and <tt>db.inc.php</tt> from the config directory.';
  41. }
  42. echo '</p>';
  43. $textbox = new html_textarea(array('rows' => 16, 'cols' => 60, 'class' => "configfile"));
  44. echo $textbox->show(($_SESSION['config']));
  45. }
  46. echo '<p class="hint">Of course there are more options to configure.
  47. Have a look at the defaults.inc.php file or visit <a href="http://trac.roundcube.net/wiki/Howto_Config" target="_blank">Howto_Config</a> to find out.</p>';
  48. echo '<p><input type="button" onclick="location.href=\'./index.php?_step=3\'" value="CONTINUE" /></p>';
  49. // echo '<style type="text/css"> .configblock { display:none } </style>';
  50. echo "\n<hr style='margin-bottom:1.6em' />\n";
  51. }
  52. ?>
  53. <form action="index.php" method="post">
  54. <input type="hidden" name="_step" value="2" />
  55. <fieldset>
  56. <legend>General configuration</legend>
  57. <dl class="configblock">
  58. <dt class="propname">product_name</dt>
  59. <dd>
  60. <?php
  61. $input_prodname = new html_inputfield(array('name' => '_product_name', 'size' => 30, 'id' => "cfgprodname"));
  62. echo $input_prodname->show($RCI->getprop('product_name'));
  63. ?>
  64. <div>The name of your service (used to compose page titles)</div>
  65. </dd>
  66. <dt class="propname">support_url</dt>
  67. <dd>
  68. <?php
  69. $input_support = new html_inputfield(array('name' => '_support_url', 'size' => 50, 'id' => "cfgsupporturl"));
  70. echo $input_support->show($RCI->getprop('support_url'));
  71. ?>
  72. <div>Provide an URL where a user can get support for this Roundcube installation.<br/>PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!</div>
  73. <p class="hint">Enter an absolute URL (including http://) to a support page/form or a mailto: link.</p>
  74. </dd>
  75. <dt class="propname">skin_logo</dt>
  76. <dd>
  77. <?php
  78. $input_skin = new html_inputfield(array('name' => '_skin_logo', 'size' => 50, 'id' => "cfgskinlogo"));
  79. echo $input_skin->show($RCI->getprop('skin_logo'));
  80. ?>
  81. <div>Custom image to display instead of the Roundcube logo.</div>
  82. <p class="hint">Enter a URL relative to the document root of this Roundcube installation.</p>
  83. </dd>
  84. <dt class="propname">temp_dir</dt>
  85. <dd>
  86. <?php
  87. $input_tempdir = new html_inputfield(array('name' => '_temp_dir', 'size' => 30, 'id' => "cfgtempdir"));
  88. echo $input_tempdir->show($RCI->getprop('temp_dir'));
  89. ?>
  90. <div>Use this folder to store temp files (must be writeable for webserver)</div>
  91. </dd>
  92. <dt class="propname">des_key</dt>
  93. <dd>
  94. <?php
  95. $input_deskey = new html_inputfield(array('name' => '_des_key', 'size' => 30, 'id' => "cfgdeskey"));
  96. echo $input_deskey->show($RCI->getprop('des_key'));
  97. ?>
  98. <div>This key is used to encrypt the users imap password before storing in the session record</div>
  99. <p class="hint">It's a random generated string to ensure that every installation has its own key.</p>
  100. </dd>
  101. <dt class="propname">ip_check</dt>
  102. <dd>
  103. <?php
  104. $check_ipcheck = new html_checkbox(array('name' => '_ip_check', 'id' => "cfgipcheck"));
  105. echo $check_ipcheck->show(intval($RCI->getprop('ip_check')), array('value' => 1));
  106. ?>
  107. <label for="cfgipcheck">Check client IP in session authorization</label><br />
  108. <p class="hint">This increases security but can cause sudden logouts when someone uses a proxy with changing IPs.</p>
  109. </dd>
  110. <dt class="propname">enable_spellcheck</dt>
  111. <dd>
  112. <?php
  113. $check_spell = new html_checkbox(array('name' => '_enable_spellcheck', 'id' => "cfgspellcheck"));
  114. echo $check_spell->show(intval($RCI->getprop('enable_spellcheck')), array('value' => 1));
  115. ?>
  116. <label for="cfgspellcheck">Make use of the spell checker</label><br />
  117. </dd>
  118. <dt class="propname">spellcheck_engine</dt>
  119. <dd>
  120. <?php
  121. $select_spell = new html_select(array('name' => '_spellcheck_engine', 'id' => "cfgspellcheckengine"));
  122. if (extension_loaded('pspell'))
  123. $select_spell->add('Pspell', 'pspell');
  124. if (extension_loaded('enchant'))
  125. $select_spell->add('Enchant', 'enchant');
  126. $select_spell->add('Googie', 'googie');
  127. $select_spell->add('ATD', 'atd');
  128. echo $select_spell->show($RCI->is_post ? $_POST['_spellcheck_engine'] : 'pspell');
  129. ?>
  130. <label for="cfgspellcheckengine">Which spell checker to use</label><br />
  131. <p class="hint">Googie implies that the message content will be sent to external server to check the spelling.</p>
  132. </dd>
  133. <dt class="propname">identities_level</dt>
  134. <dd>
  135. <?php
  136. $input_ilevel = new html_select(array('name' => '_identities_level', 'id' => "cfgidentitieslevel"));
  137. $input_ilevel->add('many identities with possibility to edit all params', 0);
  138. $input_ilevel->add('many identities with possibility to edit all params but not email address', 1);
  139. $input_ilevel->add('one identity with possibility to edit all params', 2);
  140. $input_ilevel->add('one identity with possibility to edit all params but not email address', 3);
  141. $input_ilevel->add('one identity with possibility to edit only signature', 4);
  142. echo $input_ilevel->show($RCI->getprop('identities_level'), 0);
  143. ?>
  144. <div>Level of identities access</div>
  145. <p class="hint">Defines what users can do with their identities.</p>
  146. </dd>
  147. </dl>
  148. </fieldset>
  149. <fieldset>
  150. <legend>Logging & Debugging</legend>
  151. <dl class="loggingblock">
  152. <dt class="propname">debug_level</dt>
  153. <dd>
  154. <?php
  155. $value = $RCI->getprop('debug_level');
  156. $check_debug = new html_checkbox(array('name' => '_debug_level[]'));
  157. echo $check_debug->show(($value & 1) ? 1 : 0 , array('value' => 1, 'id' => 'cfgdebug1'));
  158. echo '<label for="cfgdebug1">Log errors</label><br />';
  159. echo $check_debug->show(($value & 4) ? 4 : 0, array('value' => 4, 'id' => 'cfgdebug4'));
  160. echo '<label for="cfgdebug4">Print errors (to the browser)</label><br />';
  161. ?>
  162. </dd>
  163. <dt class="propname">log_driver</dt>
  164. <dd>
  165. <?php
  166. $select_log_driver = new html_select(array('name' => '_log_driver', 'id' => "cfglogdriver"));
  167. $select_log_driver->add(array('file', 'syslog'), array('file', 'syslog'));
  168. echo $select_log_driver->show($RCI->getprop('log_driver', 'file'));
  169. ?>
  170. <div>How to do logging? 'file' - write to files in the log directory, 'syslog' - use the syslog facility.</div>
  171. </dd>
  172. <dt class="propname">log_dir</dt>
  173. <dd>
  174. <?php
  175. $input_logdir = new html_inputfield(array('name' => '_log_dir', 'size' => 30, 'id' => "cfglogdir"));
  176. echo $input_logdir->show($RCI->getprop('log_dir'));
  177. ?>
  178. <div>Use this folder to store log files (must be writeable for webserver). Note that this only applies if you are using the 'file' log_driver.</div>
  179. </dd>
  180. <dt class="propname">syslog_id</dt>
  181. <dd>
  182. <?php
  183. $input_syslogid = new html_inputfield(array('name' => '_syslog_id', 'size' => 30, 'id' => "cfgsyslogid"));
  184. echo $input_syslogid->show($RCI->getprop('syslog_id', 'roundcube'));
  185. ?>
  186. <div>What ID to use when logging with syslog. Note that this only applies if you are using the 'syslog' log_driver.</div>
  187. </dd>
  188. <dt class="propname">syslog_facility</dt>
  189. <dd>
  190. <?php
  191. $input_syslogfacility = new html_select(array('name' => '_syslog_facility', 'id' => "cfgsyslogfacility"));
  192. $input_syslogfacility->add('user-level messages', LOG_USER);
  193. $input_syslogfacility->add('mail subsystem', LOG_MAIL);
  194. $input_syslogfacility->add('local level 0', LOG_LOCAL0);
  195. $input_syslogfacility->add('local level 1', LOG_LOCAL1);
  196. $input_syslogfacility->add('local level 2', LOG_LOCAL2);
  197. $input_syslogfacility->add('local level 3', LOG_LOCAL3);
  198. $input_syslogfacility->add('local level 4', LOG_LOCAL4);
  199. $input_syslogfacility->add('local level 5', LOG_LOCAL5);
  200. $input_syslogfacility->add('local level 6', LOG_LOCAL6);
  201. $input_syslogfacility->add('local level 7', LOG_LOCAL7);
  202. echo $input_syslogfacility->show($RCI->getprop('syslog_facility'), LOG_USER);
  203. ?>
  204. <div>What ID to use when logging with syslog. Note that this only applies if you are using the 'syslog' log_driver.</div>
  205. </dd>
  206. </dl>
  207. </fieldset>
  208. <fieldset>
  209. <legend>Database setup</legend>
  210. <dl class="configblock" id="cgfblockdb">
  211. <dt class="propname">db_dsnw</dt>
  212. <dd>
  213. <p>Database settings for read/write operations:</p>
  214. <?php
  215. $select_dbtype = new html_select(array('name' => '_dbtype', 'id' => "cfgdbtype"));
  216. foreach ($RCI->supported_dbs as $database => $ext) {
  217. if (extension_loaded($ext)) {
  218. $select_dbtype->add($database, substr($ext, 4));
  219. }
  220. }
  221. $input_dbhost = new html_inputfield(array('name' => '_dbhost', 'size' => 20, 'id' => "cfgdbhost"));
  222. $input_dbname = new html_inputfield(array('name' => '_dbname', 'size' => 20, 'id' => "cfgdbname"));
  223. $input_dbuser = new html_inputfield(array('name' => '_dbuser', 'size' => 20, 'id' => "cfgdbuser"));
  224. $input_dbpass = new html_inputfield(array('name' => '_dbpass', 'size' => 20, 'id' => "cfgdbpass"));
  225. $dsnw = rcube_db::parse_dsn($RCI->getprop('db_dsnw'));
  226. echo $select_dbtype->show($RCI->is_post ? $_POST['_dbtype'] : $dsnw['phptype']);
  227. echo '<label for="cfgdbtype">Database type</label><br />';
  228. echo $input_dbhost->show($RCI->is_post ? $_POST['_dbhost'] : $dsnw['hostspec']);
  229. echo '<label for="cfgdbhost">Database server (omit for sqlite)</label><br />';
  230. echo $input_dbname->show($RCI->is_post ? $_POST['_dbname'] : $dsnw['database']);
  231. echo '<label for="cfgdbname">Database name (use absolute path and filename for sqlite)</label><br />';
  232. echo $input_dbuser->show($RCI->is_post ? $_POST['_dbuser'] : $dsnw['username']);
  233. echo '<label for="cfgdbuser">Database user name (needs write permissions)(omit for sqlite)</label><br />';
  234. echo $input_dbpass->show($RCI->is_post ? $_POST['_dbpass'] : $dsnw['password']);
  235. echo '<label for="cfgdbpass">Database password (omit for sqlite)</label><br />';
  236. ?>
  237. </dd>
  238. <dt class="propname">db_prefix</dt>
  239. <dd>
  240. <?php
  241. $input_prefix = new html_inputfield(array('name' => '_db_prefix', 'size' => 20, 'id' => "cfgdbprefix"));
  242. echo $input_prefix->show($RCI->getprop('db_prefix'));
  243. ?>
  244. <div>Optional prefix that will be added to database object names (tables and sequences).</div>
  245. </dd>
  246. </dl>
  247. </fieldset>
  248. <fieldset>
  249. <legend>IMAP Settings</legend>
  250. <dl class="configblock" id="cgfblockimap">
  251. <dt class="propname">default_host</dt>
  252. <dd>
  253. <div>The IMAP host(s) chosen to perform the log-in</div>
  254. <div id="defaulthostlist">
  255. <?php
  256. $text_imaphost = new html_inputfield(array('name' => '_default_host[]', 'size' => 30));
  257. $default_hosts = $RCI->get_hostlist();
  258. if (empty($default_hosts))
  259. $default_hosts = array('');
  260. $i = 0;
  261. foreach ($default_hosts as $host) {
  262. echo '<div id="defaulthostentry'.$i.'">' . $text_imaphost->show($host);
  263. if ($i++ > 0)
  264. echo '<a href="#" onclick="removehostfield(this.parentNode);return false" class="removelink" title="Remove this entry">remove</a>';
  265. echo '</div>';
  266. }
  267. ?>
  268. </div>
  269. <div><a href="javascript:addhostfield()" class="addlink" title="Add another field">add</a></div>
  270. <p class="hint">Leave blank to show a textbox at login. To use SSL/IMAPS connection, type ssl://hostname</p>
  271. </dd>
  272. <dt class="propname">default_port</dt>
  273. <dd>
  274. <?php
  275. $text_imapport = new html_inputfield(array('name' => '_default_port', 'size' => 6, 'id' => "cfgimapport"));
  276. echo $text_imapport->show($RCI->getprop('default_port'));
  277. ?>
  278. <div>TCP port used for IMAP connections</div>
  279. </dd>
  280. <dt class="propname">username_domain</dt>
  281. <dd>
  282. <?php
  283. $text_userdomain = new html_inputfield(array('name' => '_username_domain', 'size' => 30, 'id' => "cfguserdomain"));
  284. echo $text_userdomain->show($RCI->getprop('username_domain'));
  285. ?>
  286. <div>Automatically add this domain to user names for login</div>
  287. <p class="hint">Only for IMAP servers that require full e-mail addresses for login</p>
  288. </dd>
  289. <dt class="propname">auto_create_user</dt>
  290. <dd>
  291. <?php
  292. $check_autocreate = new html_checkbox(array('name' => '_auto_create_user', 'id' => "cfgautocreate"));
  293. echo $check_autocreate->show(intval($RCI->getprop('auto_create_user')), array('value' => 1));
  294. ?>
  295. <label for="cfgautocreate">Automatically create a new Roundcube user when log-in the first time</label><br />
  296. <p class="hint">A user is authenticated by the IMAP server but it requires a local record to store settings
  297. and contacts. With this option enabled a new user record will automatically be created once the IMAP login succeeds.</p>
  298. <p class="hint">If this option is disabled, the login only succeeds if there's a matching user-record in the local Roundcube database
  299. what means that you have to create those records manually or disable this option after the first login.</p>
  300. </dd>
  301. <dt class="propname">sent_mbox</dt>
  302. <dd>
  303. <?php
  304. $text_sentmbox = new html_inputfield(array('name' => '_sent_mbox', 'size' => 20, 'id' => "cfgsentmbox"));
  305. echo $text_sentmbox->show($RCI->getprop('sent_mbox'));
  306. ?>
  307. <div>Store sent messages in this folder</div>
  308. <p class="hint">Leave blank if sent messages should not be stored. Note: folder must include namespace prefix if any.</p>
  309. </dd>
  310. <dt class="propname">trash_mbox</dt>
  311. <dd>
  312. <?php
  313. $text_trashmbox = new html_inputfield(array('name' => '_trash_mbox', 'size' => 20, 'id' => "cfgtrashmbox"));
  314. echo $text_trashmbox->show($RCI->getprop('trash_mbox'));
  315. ?>
  316. <div>Move messages to this folder when deleting them</div>
  317. <p class="hint">Leave blank if they should be deleted directly. Note: folder must include namespace prefix if any.</p>
  318. </dd>
  319. <dt class="propname">drafts_mbox</dt>
  320. <dd>
  321. <?php
  322. $text_draftsmbox = new html_inputfield(array('name' => '_drafts_mbox', 'size' => 20, 'id' => "cfgdraftsmbox"));
  323. echo $text_draftsmbox->show($RCI->getprop('drafts_mbox'));
  324. ?>
  325. <div>Store draft messages in this folder</div>
  326. <p class="hint">Leave blank if they should not be stored. Note: folder must include namespace prefix if any.</p>
  327. </dd>
  328. <dt class="propname">junk_mbox</dt>
  329. <dd>
  330. <?php
  331. $text_junkmbox = new html_inputfield(array('name' => '_junk_mbox', 'size' => 20, 'id' => "cfgjunkmbox"));
  332. echo $text_junkmbox->show($RCI->getprop('junk_mbox'));
  333. ?>
  334. <div>Store spam messages in this folder</div>
  335. <p class="hint">Note: folder must include namespace prefix if any.</p>
  336. </dd>
  337. </dd>
  338. </dl>
  339. </fieldset>
  340. <fieldset>
  341. <legend>SMTP Settings</legend>
  342. <dl class="configblock" id="cgfblocksmtp">
  343. <dt class="propname">smtp_server</dt>
  344. <dd>
  345. <?php
  346. $text_smtphost = new html_inputfield(array('name' => '_smtp_server', 'size' => 30, 'id' => "cfgsmtphost"));
  347. echo $text_smtphost->show($RCI->getprop('smtp_server'));
  348. ?>
  349. <div>Use this host for sending mails</div>
  350. <p class="hint">To use SSL connection, set ssl://smtp.host.com. If left blank, the PHP mail() function is used</p>
  351. </dd>
  352. <dt class="propname">smtp_port</dt>
  353. <dd>
  354. <?php
  355. $text_smtpport = new html_inputfield(array('name' => '_smtp_port', 'size' => 6, 'id' => "cfgsmtpport"));
  356. echo $text_smtpport->show($RCI->getprop('smtp_port'));
  357. ?>
  358. <div>SMTP port (default is 25; 465 for SSL; 587 for submission)</div>
  359. </dd>
  360. <dt class="propname">smtp_user/smtp_pass</dt>
  361. <dd>
  362. <?php
  363. $text_smtpuser = new html_inputfield(array('name' => '_smtp_user', 'size' => 20, 'id' => "cfgsmtpuser"));
  364. $text_smtppass = new html_inputfield(array('name' => '_smtp_pass', 'size' => 20, 'id' => "cfgsmtppass"));
  365. echo $text_smtpuser->show($RCI->getprop('smtp_user'));
  366. echo $text_smtppass->show($RCI->getprop('smtp_pass'));
  367. ?>
  368. <div>SMTP username and password (if required)</div>
  369. <p>
  370. <?php
  371. $check_smtpuser = new html_checkbox(array('name' => '_smtp_user_u', 'id' => "cfgsmtpuseru"));
  372. echo $check_smtpuser->show($RCI->getprop('smtp_user') == '%u' || $_POST['_smtp_user_u'] ? 1 : 0, array('value' => 1));
  373. ?>
  374. <label for="cfgsmtpuseru">Use the current IMAP username and password for SMTP authentication</label>
  375. </p>
  376. </dd>
  377. <!--
  378. <dt class="propname">smtp_auth_type</dt>
  379. <dd>
  380. <?php
  381. /*
  382. $select_smtpauth = new html_select(array('name' => '_smtp_auth_type', 'id' => "cfgsmtpauth"));
  383. $select_smtpauth->add(array('(auto)', 'PLAIN', 'DIGEST-MD5', 'CRAM-MD5', 'LOGIN'), array('0', 'PLAIN', 'DIGEST-MD5', 'CRAM-MD5', 'LOGIN'));
  384. echo $select_smtpauth->show(intval($RCI->getprop('smtp_auth_type')));
  385. */
  386. ?>
  387. <div>Method to authenticate at the SMTP server. Choose (auto) if you don't know what this is</div>
  388. </dd>
  389. -->
  390. <dt class="propname">smtp_log</dt>
  391. <dd>
  392. <?php
  393. $check_smtplog = new html_checkbox(array('name' => '_smtp_log', 'id' => "cfgsmtplog"));
  394. echo $check_smtplog->show(intval($RCI->getprop('smtp_log')), array('value' => 1));
  395. ?>
  396. <label for="cfgsmtplog">Log sent messages in <tt>{log_dir}/sendmail</tt> or to syslog.</label><br />
  397. </dd>
  398. </dl>
  399. </fieldset>
  400. <fieldset>
  401. <legend>Display settings &amp; user prefs</legend>
  402. <dl class="configblock" id="cgfblockdisplay">
  403. <dt class="propname">language <span class="userconf">*</span></dt>
  404. <dd>
  405. <?php
  406. $input_locale = new html_inputfield(array('name' => '_language', 'size' => 6, 'id' => "cfglocale"));
  407. echo $input_locale->show($RCI->getprop('language'));
  408. ?>
  409. <div>The default locale setting. This also defines the language of the login screen.<br/>Leave it empty to auto-detect the user agent language.</div>
  410. <p class="hint">Enter a <a href="http://www.faqs.org/rfcs/rfc1766">RFC1766</a> formatted language name. Examples: en_US, de_DE, de_CH, fr_FR, pt_BR</p>
  411. </dd>
  412. <dt class="propname">skin <span class="userconf">*</span></dt>
  413. <dd>
  414. <?php
  415. $input_skin = new html_select(array('name' => '_skin', 'id' => "cfgskin"));
  416. $input_skin->add($RCI->list_skins());
  417. echo $input_skin->show($RCI->getprop('skin'));
  418. ?>
  419. <div>Name of interface skin (folder in /skins)</div>
  420. </dd>
  421. <dt class="propname">mail_pagesize <span class="userconf">*</span></dt>
  422. <dd>
  423. <?php
  424. $pagesize = $RCI->getprop('mail_pagesize');
  425. if (!$pagesize) {
  426. $pagesize = $RCI->getprop('pagesize');
  427. }
  428. $input_pagesize = new html_inputfield(array('name' => '_mail_pagesize', 'size' => 6, 'id' => "cfgmailpagesize"));
  429. echo $input_pagesize->show($pagesize);
  430. ?>
  431. <div>Show up to X items in the mail messages list view.</div>
  432. </dd>
  433. <dt class="propname">addressbook_pagesize <span class="userconf">*</span></dt>
  434. <dd>
  435. <?php
  436. $pagesize = $RCI->getprop('addressbook_pagesize');
  437. if (!$pagesize) {
  438. $pagesize = $RCI->getprop('pagesize');
  439. }
  440. $input_pagesize = new html_inputfield(array('name' => '_addressbook_pagesize', 'size' => 6, 'id' => "cfgabookpagesize"));
  441. echo $input_pagesize->show($pagesize);
  442. ?>
  443. <div>Show up to X items in the contacts list view.</div>
  444. </dd>
  445. <dt class="propname">prefer_html <span class="userconf">*</span></dt>
  446. <dd>
  447. <?php
  448. $check_htmlview = new html_checkbox(array('name' => '_prefer_html', 'id' => "cfghtmlview", 'value' => 1));
  449. echo $check_htmlview->show(intval($RCI->getprop('prefer_html')));
  450. ?>
  451. <label for="cfghtmlview">Prefer displaying HTML messages</label><br />
  452. </dd>
  453. <dt class="propname">preview_pane <span class="userconf">*</span></dt>
  454. <dd>
  455. <?php
  456. $check_prevpane = new html_checkbox(array('name' => '_preview_pane', 'id' => "cfgprevpane", 'value' => 1));
  457. echo $check_prevpane->show(intval($RCI->getprop('preview_pane')));
  458. ?>
  459. <label for="cfgprevpane">If preview pane is enabled</label><br />
  460. </dd>
  461. <dt class="propname">htmleditor <span class="userconf">*</span></dt>
  462. <dd>
  463. <label for="cfghtmlcompose">Compose HTML formatted messages</label>
  464. <?php
  465. $select_htmlcomp = new html_select(array('name' => '_htmleditor', 'id' => "cfghtmlcompose"));
  466. $select_htmlcomp->add('never', 0);
  467. $select_htmlcomp->add('always', 1);
  468. $select_htmlcomp->add('on reply to HTML message only', 2);
  469. echo $select_htmlcomp->show(intval($RCI->getprop('htmleditor')));
  470. ?>
  471. </dd>
  472. <dt class="propname">draft_autosave <span class="userconf">*</span></dt>
  473. <dd>
  474. <label for="cfgautosave">Save compose message every</label>
  475. <?php
  476. $select_autosave = new html_select(array('name' => '_draft_autosave', 'id' => 'cfgautosave'));
  477. $select_autosave->add('never', 0);
  478. foreach (array(1, 3, 5, 10) as $i => $min)
  479. $select_autosave->add("$min min", $min*60);
  480. echo $select_autosave->show(intval($RCI->getprop('draft_autosave')));
  481. ?>
  482. </dd>
  483. <dt class="propname">mdn_requests <span class="userconf">*</span></dt>
  484. <dd>
  485. <?php
  486. $mdn_opts = array(
  487. 0 => 'ask the user',
  488. 1 => 'send automatically',
  489. 3 => 'send receipt to user contacts, otherwise ask the user',
  490. 4 => 'send receipt to user contacts, otherwise ignore',
  491. 2 => 'ignore',
  492. );
  493. $select_mdnreq = new html_select(array('name' => '_mdn_requests', 'id' => "cfgmdnreq"));
  494. $select_mdnreq->add(array_values($mdn_opts), array_keys($mdn_opts));
  495. echo $select_mdnreq->show(intval($RCI->getprop('mdn_requests')));
  496. ?>
  497. <div>Behavior if a received message requests a message delivery notification (read receipt)</div>
  498. </dd>
  499. <dt class="propname">mime_param_folding <span class="userconf">*</span></dt>
  500. <dd>
  501. <?php
  502. $select_param_folding = new html_select(array('name' => '_mime_param_folding', 'id' => "cfgmimeparamfolding"));
  503. $select_param_folding->add('Full RFC 2231 (Roundcube, Thunderbird)', '0');
  504. $select_param_folding->add('RFC 2047/2231 (MS Outlook, OE)', '1');
  505. $select_param_folding->add('Full RFC 2047 (deprecated)', '2');
  506. echo $select_param_folding->show(strval($RCI->getprop('mime_param_folding')));
  507. ?>
  508. <div>How to encode attachment long/non-ascii names</div>
  509. </dd>
  510. </dl>
  511. <p class="hint"><span class="userconf">*</span>&nbsp; These settings are defaults for the user preferences</p>
  512. </fieldset>
  513. <fieldset>
  514. <legend>Plugins</legend>
  515. <dl class="configblock" id="cgfblockdisplay">
  516. <?php
  517. $plugins = $RCI->list_plugins();
  518. foreach($plugins as $p)
  519. {
  520. $p_check = new html_checkbox(array('name' => '_plugins_'.$p['name'], 'id' => 'cfgplugin_'.$p['name'], 'value' => $p['name']));
  521. echo '<dt class="propname"><label>';
  522. echo $p_check->show($p['enabled'] ? $p['name'] : 0);
  523. echo '&nbsp;' . $p['name'] . '</label></dt><dd>';
  524. echo '<label for="cfgplugin_'.$p['name'].'" class="hint">' . $p['desc'] . '</label><br/></dd>';
  525. }
  526. ?>
  527. </dl>
  528. <p class="hint">Please consider checking dependencies of enabled plugins</p>
  529. </fieldset>
  530. <?php
  531. echo '<p><input type="submit" name="submit" value="' . ($RCI->configured ? 'UPDATE' : 'CREATE') . ' CONFIG" ' . ($RCI->failures ? 'disabled' : '') . ' /></p>';
  532. ?>
  533. </form>