thomascube
2008-02-25 c5042d468e605a7ec9bb6883ba721c8fd222b4ec
commit | author | age
354978 1 <form action="index.php" method="post">
T 2 <input type="hidden" name="_step" value="2" />
3 <?php
4
5 ini_set('display_errors', 1);
c5042d 6 require_once 'include/rcube_html.inc';
T 7
8 $RCI->get_defaults();
9
10 if (!empty($_POST['submit'])) {
11   
12   echo '<p class="notice">Copy the following configurations and save them in two files (names above the text box)';
13   echo ' within the <tt>config/</tt> directory of your RoundCube installation.</p>';
14   
15   $textbox = new textarea(array('rows' => 16, 'cols' => 60, 'class' => "configfile"));
16   
17   echo '<div><em>main.inc.php</em></div>';
18   echo $textbox->show($RCI->create_config('main'));
19   
20   echo '<div style="margin-top:1em"><em>db.inc.php</em></div>';
21   echo $textbox->show($RCI->create_config('db'));
22
23   echo '<p><input type="button" onclick="location.href=\'./index.php?_step=3\'" value="CONTINUE" /></p>';
24   
25   // echo '<style type="text/css"> .configblock { display:none } </style>';
26   echo "\n<hr style='margin-bottom:1.6em' />\n";
27 }
354978 28
T 29 ?>
30 <fieldset>
31 <legend>General configuration</legend>
c5042d 32 <dl class="configblock">
354978 33 <!--
c5042d 34 <dt id="cgfblockgeneral" class="propname">debug_level</dt>
354978 35 <dd>
T 36 <?php
37 /*
38 $value = $RCI->getprop('debug_level');
39 $check_debug = new checkbox(array('name' => '_debug_level[]'));
40 echo $check_debug->show(($value & 1) ? 1 : 0 , array('value' => 1, 'id' => 'cfgdebug1'));
41 echo '<label for="cfgdebug1">Log errors</label><br />';
42
43 echo $check_debug->show(($value & 4) ? 4 : 0, array('value' => 4, 'id' => 'cfgdebug4'));
44 echo '<label for="cfgdebug4">Display errors</label><br />';
45
46 echo $check_debug->show(($value & 8) ? 8 : 0, array('value' => 8, 'id' => 'cfgdebug8'));
47 echo '<label for="cfgdebug8">Verbose display</label><br />';
48 */
49 ?>
50 </dd>
51 -->
52
53 <dt class="propname">product_name</dt>
54 <dd>
55 <?php
56
57 $input_prodname = new textfield(array('name' => '_product_name', 'size' => 30, 'id' => "cfgprodname"));
58 echo $input_prodname->show($RCI->getprop('product_name'));
59
60 ?>
61 <div>The name of your service (used to compose page titles)</div>
62 </dd>
63
64 <dt class="propname">skin_path</dt>
65 <dd>
66 <?php
67
68 $input_skinpath = new textfield(array('name' => '_skin_path', 'size' => 30, 'id' => "cfgskinpath"));
69 echo $input_skinpath->show($RCI->getprop('skin_path'));
70
71 ?>
72 <div>Relative path to the skin folder</div>
73 </dd>
74
75 <dt class="propname">temp_dir</dt>
76 <dd>
77 <?php
78
79 $input_tempdir = new textfield(array('name' => '_temp_dir', 'size' => 30, 'id' => "cfgtempdir"));
80 echo $input_tempdir->show($RCI->getprop('temp_dir'));
81
82 ?>
83 <div>Use this folder to store temp files (must be writebale for webserver)</div>
84 </dd>
85
86 <dt class="propname">log_dir</dt>
87 <dd>
88 <?php
89
90 $input_logdir = new textfield(array('name' => '_log_dir', 'size' => 30, 'id' => "cfglogdir"));
91 echo $input_logdir->show($RCI->getprop('log_dir'));
92
93 ?>
94 <div>Use this folder to store log files (must be writebale for webserver)</div>
95 </dd>
96
97 <dt class="propname">ip_check</dt>
98 <dd>
99 <?php
100
101 $check_ipcheck = new checkbox(array('name' => '_ip_check', 'id' => "cfgipcheck"));
102 echo $check_ipcheck->show(intval($RCI->getprop('ip_check')), array('value' => 1));
103
104 ?>
c5042d 105 <label for="cfgipcheck">Check client IP in session authorization</label><br />
354978 106
T 107 <p class="hint">This increases security but can cause sudden logouts when someone uses a proxy with changeing IPs.</p>
108 </dd>
109
110 <dt class="propname">des_key</dt>
111 <dd>
112 <?php
113
114 $input_deskey = new textfield(array('name' => '_des_key', 'size' => 30, 'id' => "cfgdeskey"));
115 echo $input_deskey->show($RCI->getprop('des_key'));
116
117 ?>
118 <div>This key is used to encrypt the users imap password before storing in the session record</div>
119 <p class="hint">It's a random generated string to ensure that every installation has it's own key.
120 If you enter it manually please provide a string of exactly 24 chars.</p>
121 </dd>
122
123 <dt class="propname">enable_caching</dt>
124 <dd>
125 <?php
126
127 $check_caching = new checkbox(array('name' => '_enable_caching', 'id' => "cfgcache"));
128 echo $check_caching->show(intval($RCI->getprop('enable_caching')), array('value' => 1));
129
130 ?>
131 <label for="cfgcache">Cache messages in local database</label><br />
132 </dd>
133
c5042d 134 <dt class="propname">enable_spellcheck</dt>
T 135 <dd>
136 <?php
137
138 $check_caching = new checkbox(array('name' => '_enable_spellcheck', 'id' => "cfgspellcheck"));
139 echo $check_caching->show(intval($RCI->getprop('enable_spellcheck')), array('value' => 1));
140
141 ?>
142 <label for="cfgspellcheck">Make use of the built-in spell checker</label><br />
143
144 <p class="hint">It is based on GoogieSpell what implies that the message content will be sent to Google in order to check the spelling.</p>
145 </dd>
146
147 <dt class="propname">mdn_requests</dt>
148 <dd>
149 <?php
150
151 $select_mdnreq = new select(array('name' => '_mdn_requests', 'id' => "cfgmdnreq"));
152 $select_mdnreq->add(array('ask the user', 'send automatically', 'ignore'), array(0, 1, 2));
153 echo $select_mdnreq->show(intval($RCI->getprop('mdn_requests')));
154
155 ?>
156 <div>Behavior if a received message requests a message delivery notification (read receipt)</div>
157 </dd>
158
354978 159 </dl>
T 160 </fieldset>
161
162 <fieldset>
6557d3 163 <legend>Database setup</legend>
c5042d 164 <dl class="configblock" id="cgfblockdb">
T 165 <dt class="propname">db_dsnw</dt>
166 <dd>
167 <p>Database settings for read/write operations:</p>
168 <?php
169
170 $supported_dbs = array('MySQL' => 'mysql', 'MySQLi' => 'mysqli',
171     'PgSQL' => 'pgsql', 'SQLite' => 'sqlite');
172
173 $select_dbtype = new select(array('name' => '_dbtype', 'id' => "cfgdbtype"));
174 foreach ($supported_dbs AS $database => $ext) {
175     if (extension_loaded($ext)) {
176         $select_dbtype->add($database, $ext);
177     }
178 }
179
180 $input_dbhost = new textfield(array('name' => '_dbhost', 'size' => 20, 'id' => "cfgdbhost"));
181 $input_dbname = new textfield(array('name' => '_dbname', 'size' => 20, 'id' => "cfgdbname"));
182 $input_dbuser = new textfield(array('name' => '_dbuser', 'size' => 20, 'id' => "cfgdbuser"));
183 $input_dbpass = new textfield(array('name' => '_dbpass', 'size' => 20, 'id' => "cfgdbpass"));
184
185 $dsnw = parse_url($RCI->getprop('db_dsnw'));
186
187 echo $select_dbtype->show($_POST['_dbtype'] ? $_POST['_dbtype'] : $dsnw['scheme']);
188 echo '<label for="cfgdbtype">Database type</label><br />';
189 echo $input_dbhost->show($_POST['_dbhost'] ? $_POST['_dbhost'] : $dsnw['host']);
190 echo '<label for="cfgdbhost">Database server</label><br />';
191 echo $input_dbname->show($_POST['_dbname'] ? $_POST['_dbname'] : preg_replace('/^\//', '', $dsnw['path']));
192 echo '<label for="cfgdbname">Database name</label><br />';
193 echo $input_dbuser->show($_POST['_dbuser'] ? $_POST['_dbuser'] : $dsnw['user']);
194 echo '<label for="cfgdbuser">Database user name (needs write permissions)</label><br />';
195 echo $input_dbpass->show($_POST['_dbpass'] ? $_POST['_dbpass'] : $dsnw['pass']);
196 echo '<label for="cfgdbpass">Database password</label><br />';
197
198 ?>
199 </dd>
200
201 <dt class="propname">db_backend</dt>
202 <dd>
203 <?php
204
205 // check for existing PEAR classes
206 @include_once 'DB.php';
207 @include_once 'MDB2.php';
208
209 $select_dbba = new select(array('name' => '_db_backend', 'id' => "cfgdbba"));
210
211 if (class_exists('DB'))
212   $select_dbba->add('DB', 'db');
213 if (class_exists('MDB2'))
214   $select_dbba->add('MDB2', 'mdb2');
215
216 echo $select_dbba->show($RCI->getprop('db_backend'));
217
218 ?>
219 <div>PEAR Database backend to use</div>
220 </dd>
221
6557d3 222 </dl>
T 223 </fieldset>
224
c5042d 225
6557d3 226 <fieldset>
354978 227 <legend>IMAP Settings</legend>
c5042d 228 <dl class="configblock" id="cgfblockimap">
T 229 <dt class="propname">default_host</dt>
230 <dd>
231 <div>The IMAP host(s) chosen to perform the log-in</div>
232 <div id="defaulthostlist">
233 <?php
234
235 $default_hosts = array_unique((array)$RCI->getprop('default_host'));
236 $text_imaphost = new textfield(array('name' => '_default_host[]', 'size' => 30));
237
238 for ($i=0; $i < count($default_hosts); $i++) {
239   echo '<div id="defaulthostentry'.$i.'">' . $text_imaphost->show($default_hosts[$i]);
240   if ($i > 0)
241     echo '<a href="#" onclick="removehostfield(this.parentNode);return false" class="removelink" title="Remove this entry">remove</a>';
242   echo '</div>';
243 }
244
245 ?>
246 </div>
247 <div><a href="javascript:addhostfield()" class="addlink" title="Add another field">add</a></div>
248
249 <p class="hint">Leave blank to show a textbox at login</p>
250 </dd>
251
252 <dt class="propname">default_port</dt>
253 <dd>
254 <?php
255
256 $text_imapport = new textfield(array('name' => '_default_port', 'size' => 6, 'id' => "cfgimapport"));
257 echo $text_imapport->show($RCI->getprop('default_port'));
258
259 ?>
260 <div>TCP port used for IMAP connections</div>
261 </dd>
262
263 <dt class="propname">username_domain</dt>
264 <dd>
265 <?php
266
267 $text_userdomain = new textfield(array('name' => '_username_domain', 'size' => 30, 'id' => "cfguserdomain"));
268 echo $text_userdomain->show($RCI->getprop('username_domain'));
269
270 ?>
271 <div>Automatically add this domain to user names for login</div>
272
273 <p class="hint">Only for IMAP servers that require full e-mail addresses for login</p>
274 </dd>
275
354978 276 <dt class="propname">auto_create_user</dt>
T 277 <dd>
278 <?php
279
280 $check_autocreate = new checkbox(array('name' => '_auto_create_user', 'id' => "cfgautocreate"));
281 echo $check_autocreate->show(intval($RCI->getprop('auto_create_user')), array('value' => 1));
282
283 ?>
284 <label for="cfgautocreate">Automatically create a new RoundCube user when log-in the first time</label><br />
285
286 <p class="hint">A user is authenticated by the IMAP server but it requires a local record to store settings
287 and contacts. With this option enabled a new user record will automatically be created once the IMAP login succeeds.</p>
288
289 <p class="hint">If this option is disabled, the login only succeeds if there's a matching user-record in the local RoundCube database
290 what means that you have to create those records manually or disable this option after the first login.</p>
291 </dd>
292
c5042d 293 <dt class="propname">sent_mbox</dt>
T 294 <dd>
295 <?php
296
297 $text_sentmbox = new textfield(array('name' => '_sent_mbox', 'size' => 20, 'id' => "cfgsentmbox"));
298 echo $text_sentmbox->show($RCI->getprop('sent_mbox'));
299
300 ?>
301 <div>Store sent messages is this folder</div>
302
303 <p class="hint">Leave blank if sent messages should not be stored</p>
304 </dd>
305
306 <dt class="propname">trash_mbox</dt>
307 <dd>
308 <?php
309
310 $text_trashmbox = new textfield(array('name' => '_trash_mbox', 'size' => 20, 'id' => "cfgtrashmbox"));
311 echo $text_trashmbox->show($RCI->getprop('trash_mbox'));
312
313 ?>
314 <div>Move messages to this folder when deleting them</div>
315
316 <p class="hint">Leave blank if they should be deleted directly</p>
317 </dd>
318
319 <dt class="propname">drafts_mbox</dt>
320 <dd>
321 <?php
322
323 $text_draftsmbox = new textfield(array('name' => '_drafts_mbox', 'size' => 20, 'id' => "cfgdraftsmbox"));
324 echo $text_draftsmbox->show($RCI->getprop('drafts_mbox'));
325
326 ?>
327 <div>Store draft messages is this folder</div>
328 </dd>
329
354978 330 </dl>
T 331 </fieldset>
c5042d 332
354978 333
T 334 <fieldset>
335 <legend>SMTP Settings</legend>
c5042d 336 <dl class="configblock" id="cgfblocksmtp">
T 337 <dt class="propname">smtp_server</dt>
338 <dd>
339 <?php
340
341 $text_smtphost = new textfield(array('name' => '_smtp_server', 'size' => 30, 'id' => "cfgsmtphost"));
342 echo $text_smtphost->show($RCI->getprop('smtp_server'));
343
344 ?>
345 <div>Use this host for sending mails</div>
346
347 <p class="hint">To use SSL connection, set ssl://smtp.host.com. If left blank, the PHP mail() function is used</p>
348 </dd>
349
350 <dt class="propname">smtp_port</dt>
351 <dd>
352 <?php
353
354 $text_smtpport = new textfield(array('name' => '_smtp_port', 'size' => 6, 'id' => "cfgsmtpport"));
355 echo $text_smtpport->show($RCI->getprop('smtp_port'));
356
357 ?>
358 <div>SMTP port (default is 25; 465 for SSL)</div>
359 </dd>
360
361 <dt class="propname">smtp_user/smtp_pass</dt>
362 <dd>
363 <?php
364
365 $text_smtpuser = new textfield(array('name' => '_smtp_user', 'size' => 20, 'id' => "cfgsmtpuser"));
366 $text_smtppass = new textfield(array('name' => '_smtp_pass', 'size' => 20, 'id' => "cfgsmtppass"));
367 echo $text_smtpuser->show($RCI->getprop('smtp_user'));
368 echo $text_smtppass->show($RCI->getprop('smtp_pass'));
369
370 ?>
371 <div>SMTP username and password (if required)</div>
372 <p>
373 <?php
374
375 $check_smtpuser = new checkbox(array('name' => '_smtp_user_u', 'id' => "cfgsmtpuseru"));
376 echo $check_smtpuser->show($RCI->getprop('smtp_user') == '%u' || $_POST['_smtp_user_u'] ? 1 : 0, array('value' => 1));
377
378 ?>
379 <label for="cfgsmtpuseru">Use the current IMAP username and password for SMTP authentication</label>
380 </p>
381 </dd>
382 <!--
383 <dt class="propname">smtp_auth_type</dt>
384 <dd>
385 <?php
386 /*
387 $select_smtpauth = new select(array('name' => '_smtp_auth_type', 'id' => "cfgsmtpauth"));
388 $select_smtpauth->add(array('(auto)', 'PLAIN', 'DIGEST-MD5', 'CRAM-MD5', 'LOGIN'), array('0', 'PLAIN', 'DIGEST-MD5', 'CRAM-MD5', 'LOGIN'));
389 echo $select_smtpauth->show(intval($RCI->getprop('smtp_auth_type')));
390 */
391 ?>
392 <div>Method to authenticate at the SMTP server. Choose (auto) if you don't know what this is</div>
393 </dd>
394 -->
395 <dt class="propname">smtp_log</dt>
396 <dd>
397 <?php
398
399 $check_smtplog = new checkbox(array('name' => '_smtp_log', 'id' => "cfgsmtplog"));
400 echo $check_smtplog->show(intval($RCI->getprop('smtp_log')), array('value' => 1));
401
402 ?>
403 <label for="cfgsmtplog">Log sent messages in <tt>logs/sendmail</tt></label><br />
404 </dd>
405
354978 406 </dl>
T 407 </fieldset>
408
c5042d 409
354978 410 <fieldset>
T 411 <legend>Display settings</legend>
c5042d 412 <dl class="configblock" id="cgfblockdisplay">
354978 413
T 414 <dt class="propname">locale_string</dt>
415 <dd>
416 <?php
417
418 $input_locale = new textfield(array('name' => '_locale_string', 'size' => 6, 'id' => "cfglocale"));
419 echo $input_locale->show($RCI->getprop('locale_string'));
420
421 ?>
422 <div>The default locale setting. This also defines the language of the login screen.</div>
423 <p class="hint">Enter a <a href="http://www.faqs.org/rfcs/rfc1766">RFC1766</a> formatted locale name. Examples: en_US, de, de_CH, fr, pt_BR</p>
424 </dd>
425
426 </dl>
427 </fieldset>
428
429 <?php
430
431 echo '<p><input type="submit" name="submit" value="UPDATE" ' . ($RCI->failures ? 'disabled' : '') . ' /></p>';
432
433 ?>
434 </form>