From ff767a14ff7675fce7b23b918f41fa92157dd0c0 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 22 Sep 2014 03:31:11 -0400
Subject: [PATCH] Merge branch 'oracle'

---
 installer/test.php |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/installer/test.php b/installer/test.php
index 5d28d5f..988451e 100644
--- a/installer/test.php
+++ b/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.");
 }
 
@@ -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())) {
@@ -153,7 +154,7 @@
 
 // test database
 if ($db_working) {
-    $db_read = $DB->query("SELECT count(*) FROM {$RCI->config['db_prefix']}users");
+    $db_read = $DB->query("SELECT count(*) FROM " . $DB->quote_identifier($RCI->config['db_prefix'] . 'users'));
     if ($DB->is_error()) {
         $RCI->fail('DB Schema', "Database not initialized");
         echo '<p><input type="submit" name="initdb" value="Initialize database" /></p>';
@@ -177,17 +178,19 @@
 if ($db_working) {
     // write test
     $insert_id = md5(uniqid());
-    $db_write = $DB->query("INSERT INTO {$RCI->config['db_prefix']}session (sess_id, created, ip, vars) VALUES (?, ".$DB->now().", '127.0.0.1', 'foo')", $insert_id);
+    $db_write = $DB->query("INSERT INTO " . $DB->quote_identifier($RCI->config['db_prefix'] . 'session')
+        . " (`sess_id`, `created`, `ip`, `vars`) VALUES (?, ".$DB->now().", '127.0.0.1', 'foo')", $insert_id);
 
     if ($db_write) {
       $RCI->pass('DB Write');
-      $DB->query("DELETE FROM {$RCI->config['db_prefix']}session WHERE sess_id=?", $insert_id);
+      $DB->query("DELETE FROM " . $DB->quote_identifier($RCI->config['db_prefix'] . 'session')
+        . " WHERE `sess_id` = ?", $insert_id);
     }
     else {
       $RCI->fail('DB Write', $RCI->get_error());
     }
     echo '<br />';
-    
+
     // check timezone settings
     $tz_db = 'SELECT ' . $DB->unixtimestamp($DB->now()) . ' AS tz_db';
     $tz_db = $DB->query($tz_db);
@@ -209,7 +212,6 @@
 
 <h3>Test filetype detection</h3>
 
-<p>
 <?php
 
 if ($errors = $RCI->check_mime_detection()) {
@@ -224,12 +226,9 @@
 }
 else {
   $RCI->pass('Fileinfo/mime_content_type configuration');
+  echo "<br/>";
 }
 
-?>
-</p>
-<p>
-<?php
 
 if ($errors = $RCI->check_mime_extensions()) {
   $RCI->fail('Mimetype to file extension mapping');
@@ -238,6 +237,7 @@
 }
 else {
   $RCI->pass('Mimetype to file extension mapping');
+  echo "<br/>";
 }
 
 ?>
@@ -424,6 +424,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();

--
Gitblit v1.9.1