Aleksander Machniak
2014-07-22 6b0106a32446a125fd8a4ea7b9637c2378d52f72
installer/test.php
@@ -1,6 +1,6 @@
<?php
if (!class_exists('rcube_install') || !is_object($RCI)) {
if (!class_exists('rcmail_install', false) || !is_object($RCI)) {
    die("Not allowed! Please open installer/index.php instead.");
}
@@ -91,7 +91,7 @@
    $dirs[] = $RCI->config['log_dir'] ? $RCI->config['log_dir'] : 'logs';
foreach ($dirs as $dir) {
    $dirpath = $dir[0] == '/' ? $dir : INSTALL_PATH . $dir;
    $dirpath = rcube_utils::is_absolute_path($dir) ? $dir : INSTALL_PATH . $dir;
    if (is_writable(realpath($dirpath))) {
        $RCI->pass($dir);
        $pass = true;
@@ -115,6 +115,7 @@
if ($RCI->configured) {
    if (!empty($RCI->config['db_dsnw'])) {
        $DB = rcube_db::factory($RCI->config['db_dsnw'], '', false);
        $DB->set_debug((bool)$RCI->config['sql_debug']);
        $DB->db_connect('w');
        if (!($db_error_msg = $DB->is_error())) {
@@ -206,6 +207,39 @@
}
?>
<h3>Test filetype detection</h3>
<?php
if ($errors = $RCI->check_mime_detection()) {
  $RCI->fail('Fileinfo/mime_content_type configuration');
  if (!empty($RCI->config['mime_magic'])) {
    echo '<p class="hint">Try setting the <tt>mime_magic</tt> config option to <tt>null</tt>.</p>';
  }
  else {
    echo '<p class="hint">Check the <a href="http://www.php.net/manual/en/function.finfo-open.php">Fileinfo functions</a> of your PHP installation.<br/>';
    echo 'The path to the magic.mime file can be set using the <tt>mime_magic</tt> config option in Roundcube.</p>';
  }
}
else {
  $RCI->pass('Fileinfo/mime_content_type configuration');
  echo "<br/>";
}
if ($errors = $RCI->check_mime_extensions()) {
  $RCI->fail('Mimetype to file extension mapping');
  echo '<p class="hint">Please set a valid path to your webserver\'s mime.types file to the <tt>mime_types</tt> config option.<br/>';
  echo 'If you can\'t find such a file, download it from <a href="http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types">svn.apache.org</a>.</p>';
}
else {
  $RCI->pass('Mimetype to file extension mapping');
  echo "<br/>";
}
?>
<h3>Test SMTP config</h3>
@@ -388,6 +422,11 @@
  $imap_user = idn_to_ascii($_POST['_user']);
  $imap = new rcube_imap(null);
  $imap->set_options(array(
    'auth_type' => $RCI->getprop('imap_auth_type'),
    'debug'     => $RCI->getprop('imap_debug'),
  ));
  if ($imap->connect($imap_host, $imap_user, $_POST['_pass'], $imap_port, $imap_ssl)) {
    $RCI->pass('IMAP connect', 'SORT capability: ' . ($imap->get_capability('SORT') ? 'yes' : 'no'));
    $imap->close();