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