comparison installer/config.php @ 8:bf99236cc5cd

try to recover from upgrade fail
author Charlie Root
date Sat, 29 Dec 2018 07:07:34 -0500
parents 4681f974d28b
children
comparison
equal deleted inserted replaced
7:65fd7d441cf1 8:bf99236cc5cd
1 <?php 1 <?php
2 2
3 if (!class_exists('rcmail_install', false) || !is_object($RCI)) { 3 if (!class_exists('rcmail_install', false) || !is_object($RCI)) {
4 die("Not allowed! Please open installer/index.php instead."); 4 die("Not allowed! Please open installer/index.php instead.");
5 } 5 }
6
7 ?>
8 <form action="index.php" method="post">
9 <input type="hidden" name="_step" value="2" />
10 <?php
11 6
12 // register these boolean fields 7 // register these boolean fields
13 $RCI->bool_config_props = array( 8 $RCI->bool_config_props = array(
14 'ip_check' => 1, 9 'ip_check' => 1,
15 'enable_spellcheck' => 1, 10 'enable_spellcheck' => 1,
16 'auto_create_user' => 1, 11 'auto_create_user' => 1,
17 'smtp_log' => 1, 12 'smtp_log' => 1,
18 'prefer_html' => 1, 13 'prefer_html' => 1,
19 'preview_pane' => 1,
20 'debug_level' => 1, 14 'debug_level' => 1,
21 ); 15 );
22 16
23 // allow the current user to get to the next step 17 // allow the current user to get to the next step
24 $_SESSION['allowinstaller'] = true; 18 $_SESSION['allowinstaller'] = true;
34 } 28 }
35 29
36 echo '</p>'; 30 echo '</p>';
37 } 31 }
38 else { 32 else {
33 if (($dir = sys_get_temp_dir()) && @is_writable($dir)) {
34 echo '<iframe name="getconfig" style="display:none"></iframe>';
35 echo '<form id="getconfig_form" action="index.php" method="get" target="getconfig" style="display:none">';
36 echo '<input name="_getconfig" value="2" /></form>';
37
38 $button_txt = html::quote('Save in ' . $dir);
39 $save_button = '&nbsp;<input type="button" onclick="document.getElementById(\'getconfig_form\').submit()" value="' . $button_txt . '" />';
40 }
41
39 echo '<p class="notice">Copy or download the following configuration and save it'; 42 echo '<p class="notice">Copy or download the following configuration and save it';
40 echo ' as <tt><b>config.inc.php</b></tt> within the <tt>'.RCUBE_CONFIG_DIR.'</tt> directory of your Roundcube installation.<br/>'; 43 echo ' as <tt><b>config.inc.php</b></tt> within the <tt>'.RCUBE_CONFIG_DIR.'</tt> directory of your Roundcube installation.<br/>';
41 echo ' Make sure that there are no characters outside the <tt>&lt;?php ?&gt;</tt> brackets when saving the file.'; 44 echo ' Make sure that there are no characters outside the <tt>&lt;?php ?&gt;</tt> brackets when saving the file.';
42 echo '&nbsp;<input type="button" onclick="location.href=\'index.php?_getconfig=1\'" value="Download" />'; 45 echo '&nbsp;<input type="button" onclick="location.href=\'index.php?_getconfig=1\'" value="Download" />';
46 echo $save_button;
43 47
44 if ($RCI->legacy_config) { 48 if ($RCI->legacy_config) {
45 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.'; 49 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.';
46 } 50 }
47 51
50 $textbox = new html_textarea(array('rows' => 16, 'cols' => 60, 'class' => "configfile")); 54 $textbox = new html_textarea(array('rows' => 16, 'cols' => 60, 'class' => "configfile"));
51 echo $textbox->show(($_SESSION['config'])); 55 echo $textbox->show(($_SESSION['config']));
52 } 56 }
53 57
54 echo '<p class="hint">Of course there are more options to configure. 58 echo '<p class="hint">Of course there are more options to configure.
55 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>'; 59 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>';
56 60
57 echo '<p><input type="button" onclick="location.href=\'./index.php?_step=3\'" value="CONTINUE" /></p>'; 61 echo '<p><input type="button" onclick="location.href=\'./index.php?_step=3\'" value="CONTINUE" /></p>';
58 62
59 // echo '<style type="text/css"> .configblock { display:none } </style>'; 63 // echo '<style type="text/css"> .configblock { display:none } </style>';
60 echo "\n<hr style='margin-bottom:1.6em' />\n"; 64 echo "\n<hr style='margin-bottom:1.6em' />\n";
61 } 65 }
62 66
63 ?> 67 ?>
68 <form action="index.php" method="post">
69 <input type="hidden" name="_step" value="2" />
70
64 <fieldset> 71 <fieldset>
65 <legend>General configuration</legend> 72 <legend>General configuration</legend>
66 <dl class="configblock"> 73 <dl class="configblock">
67 74
68 <dt class="propname">product_name</dt> 75 <dt class="propname">product_name</dt>
118 $input_deskey = new html_inputfield(array('name' => '_des_key', 'size' => 30, 'id' => "cfgdeskey")); 125 $input_deskey = new html_inputfield(array('name' => '_des_key', 'size' => 30, 'id' => "cfgdeskey"));
119 echo $input_deskey->show($RCI->getprop('des_key')); 126 echo $input_deskey->show($RCI->getprop('des_key'));
120 127
121 ?> 128 ?>
122 <div>This key is used to encrypt the users imap password before storing in the session record</div> 129 <div>This key is used to encrypt the users imap password before storing in the session record</div>
123 <p class="hint">It's a random generated string to ensure that every installation has its own key. 130 <p class="hint">It's a random generated string to ensure that every installation has its own key.</p>
124 If you enter it manually please provide a string of exactly 24 chars.</p>
125 </dd> 131 </dd>
126 132
127 <dt class="propname">ip_check</dt> 133 <dt class="propname">ip_check</dt>
128 <dd> 134 <dd>
129 <?php 135 <?php
208 <dt class="propname">log_driver</dt> 214 <dt class="propname">log_driver</dt>
209 <dd> 215 <dd>
210 <?php 216 <?php
211 217
212 $select_log_driver = new html_select(array('name' => '_log_driver', 'id' => "cfglogdriver")); 218 $select_log_driver = new html_select(array('name' => '_log_driver', 'id' => "cfglogdriver"));
213 $select_log_driver->add(array('file', 'syslog'), array('file', 'syslog')); 219 $select_log_driver->add(array('file', 'syslog', 'stdout'), array('file', 'syslog', 'stdout'));
214 echo $select_log_driver->show($RCI->getprop('log_driver', 'file')); 220 echo $select_log_driver->show($RCI->getprop('log_driver', 'file'));
215 221
216 ?> 222 ?>
217 <div>How to do logging? 'file' - write to files in the log directory, 'syslog' - use the syslog facility.</div> 223 <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>
218 </dd> 224 </dd>
219 225
220 <dt class="propname">log_dir</dt> 226 <dt class="propname">log_dir</dt>
221 <dd> 227 <dd>
222 <?php 228 <?php
283 } 289 }
284 290
285 $input_dbhost = new html_inputfield(array('name' => '_dbhost', 'size' => 20, 'id' => "cfgdbhost")); 291 $input_dbhost = new html_inputfield(array('name' => '_dbhost', 'size' => 20, 'id' => "cfgdbhost"));
286 $input_dbname = new html_inputfield(array('name' => '_dbname', 'size' => 20, 'id' => "cfgdbname")); 292 $input_dbname = new html_inputfield(array('name' => '_dbname', 'size' => 20, 'id' => "cfgdbname"));
287 $input_dbuser = new html_inputfield(array('name' => '_dbuser', 'size' => 20, 'id' => "cfgdbuser")); 293 $input_dbuser = new html_inputfield(array('name' => '_dbuser', 'size' => 20, 'id' => "cfgdbuser"));
288 $input_dbpass = new html_passwordfield(array('name' => '_dbpass', 'size' => 20, 'id' => "cfgdbpass")); 294 $input_dbpass = new html_inputfield(array('name' => '_dbpass', 'size' => 20, 'id' => "cfgdbpass"));
289 295
290 $dsnw = rcube_db::parse_dsn($RCI->getprop('db_dsnw')); 296 $dsnw = rcube_db::parse_dsn($RCI->getprop('db_dsnw'));
291 297
292 echo $select_dbtype->show($RCI->is_post ? $_POST['_dbtype'] : $dsnw['phptype']); 298 echo $select_dbtype->show($RCI->is_post ? $_POST['_dbtype'] : $dsnw['phptype']);
293 echo '<label for="cfgdbtype">Database type</label><br />'; 299 echo '<label for="cfgdbtype">Database type</label><br />';
452 <dt class="propname">smtp_server</dt> 458 <dt class="propname">smtp_server</dt>
453 <dd> 459 <dd>
454 <?php 460 <?php
455 461
456 $text_smtphost = new html_inputfield(array('name' => '_smtp_server', 'size' => 30, 'id' => "cfgsmtphost")); 462 $text_smtphost = new html_inputfield(array('name' => '_smtp_server', 'size' => 30, 'id' => "cfgsmtphost"));
457 echo $text_smtphost->show($RCI->getprop('smtp_server')); 463 echo $text_smtphost->show($RCI->getprop('smtp_server', 'localhost'));
458 464
459 ?> 465 ?>
460 <div>Use this host for sending mails</div> 466 <div>Use this host for sending mails</div>
461 467
462 <p class="hint">To use SSL connection, set ssl://smtp.host.com. If left blank, the PHP mail() function is used</p> 468 <p class="hint">To use SSL connection, set ssl://smtp.host.com.</p>
463 </dd> 469 </dd>
464 470
465 <dt class="propname">smtp_port</dt> 471 <dt class="propname">smtp_port</dt>
466 <dd> 472 <dd>
467 <?php 473 <?php
476 <dt class="propname">smtp_user/smtp_pass</dt> 482 <dt class="propname">smtp_user/smtp_pass</dt>
477 <dd> 483 <dd>
478 <?php 484 <?php
479 485
480 $text_smtpuser = new html_inputfield(array('name' => '_smtp_user', 'size' => 20, 'id' => "cfgsmtpuser")); 486 $text_smtpuser = new html_inputfield(array('name' => '_smtp_user', 'size' => 20, 'id' => "cfgsmtpuser"));
481 $text_smtppass = new html_passwordfield(array('name' => '_smtp_pass', 'size' => 20, 'id' => "cfgsmtppass")); 487 $text_smtppass = new html_inputfield(array('name' => '_smtp_pass', 'size' => 20, 'id' => "cfgsmtppass"));
482 echo $text_smtpuser->show($RCI->getprop('smtp_user')); 488 echo $text_smtpuser->show($RCI->getprop('smtp_user'));
483 echo $text_smtppass->show($RCI->getprop('smtp_pass')); 489 echo $text_smtppass->show($RCI->getprop('smtp_pass'));
484 490
485 ?> 491 ?>
486 <div>SMTP username and password (if required)</div> 492 <div>SMTP username and password (if required)</div>
587 $check_htmlview = new html_checkbox(array('name' => '_prefer_html', 'id' => "cfghtmlview", 'value' => 1)); 593 $check_htmlview = new html_checkbox(array('name' => '_prefer_html', 'id' => "cfghtmlview", 'value' => 1));
588 echo $check_htmlview->show(intval($RCI->getprop('prefer_html'))); 594 echo $check_htmlview->show(intval($RCI->getprop('prefer_html')));
589 595
590 ?> 596 ?>
591 <label for="cfghtmlview">Prefer displaying HTML messages</label><br /> 597 <label for="cfghtmlview">Prefer displaying HTML messages</label><br />
592 </dd>
593
594 <dt class="propname">preview_pane <span class="userconf">*</span></dt>
595 <dd>
596 <?php
597
598 $check_prevpane = new html_checkbox(array('name' => '_preview_pane', 'id' => "cfgprevpane", 'value' => 1));
599 echo $check_prevpane->show(intval($RCI->getprop('preview_pane')));
600
601 ?>
602 <label for="cfgprevpane">If preview pane is enabled</label><br />
603 </dd> 598 </dd>
604 599
605 <dt class="propname">htmleditor <span class="userconf">*</span></dt> 600 <dt class="propname">htmleditor <span class="userconf">*</span></dt>
606 <dd> 601 <dd>
607 <label for="cfghtmlcompose">Compose HTML formatted messages</label> 602 <label for="cfghtmlcompose">Compose HTML formatted messages</label>
676 <legend>Plugins</legend> 671 <legend>Plugins</legend>
677 <dl class="configblock" id="cgfblockdisplay"> 672 <dl class="configblock" id="cgfblockdisplay">
678 673
679 <?php 674 <?php
680 $plugins = $RCI->list_plugins(); 675 $plugins = $RCI->list_plugins();
681 foreach($plugins as $p) 676 foreach ($plugins as $p) {
682 {
683 $p_check = new html_checkbox(array('name' => '_plugins_'.$p['name'], 'id' => 'cfgplugin_'.$p['name'], 'value' => $p['name'])); 677 $p_check = new html_checkbox(array('name' => '_plugins_'.$p['name'], 'id' => 'cfgplugin_'.$p['name'], 'value' => $p['name']));
684 echo '<dt class="propname"><label>'; 678 echo '<dt class="propname"><label>';
685 echo $p_check->show($p['enabled'] ? $p['name'] : 0); 679 echo $p_check->show($p['enabled'] ? $p['name'] : 0);
686 echo '&nbsp;' . $p['name'] . '</label></dt><dd>'; 680 echo '&nbsp;' . $p['name'] . '</label></dt><dd>';
687 echo '<label for="cfgplugin_'.$p['name'].'" class="hint">' . $p['desc'] . '</label><br/></dd>'; 681 echo '<label for="cfgplugin_'.$p['name'].'" class="hint">' . $p['desc'] . '</label><br/></dd>';