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

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