From d016dcc6f6a3daf8c19e2ececd3c676cd274381a Mon Sep 17 00:00:00 2001
From: Thomas <tb@woodcrest.local>
Date: Wed, 09 Oct 2013 06:02:52 -0400
Subject: [PATCH] Refactor multi-threaded autocomple contact searching to make it available for other purposes, too

---
 index.php |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/index.php b/index.php
index 5d52571..3be71f2 100644
--- a/index.php
+++ b/index.php
@@ -39,7 +39,7 @@
 require_once 'program/include/iniset.php';
 
 // init application, start session, init output class, etc.
-$RCMAIL = rcmail::get_instance();
+$RCMAIL = rcmail::get_instance($GLOBALS['env']);
 
 // Make the whole PHP output non-cacheable (#1487797)
 $RCMAIL->output->nocacheing_headers();
@@ -138,7 +138,7 @@
   }
   else {
     if (!$auth['valid']) {
-      $error_code  = RCMAIL::ERROR_INVALID_REQUEST;
+      $error_code = RCMAIL::ERROR_INVALID_REQUEST;
     }
     else {
       $error_code = $auth['error'] ? $auth['error'] : $RCMAIL->login_error();
@@ -153,6 +153,9 @@
 
     $error_message = $error_labels[$error_code] ? $error_labels[$error_code] : 'loginfailed';
 
+    // log failed login
+    $RCMAIL->log_login($auth['user'], true, $error_code);
+
     $OUTPUT->show_message($error_message, 'warning');
     $RCMAIL->plugins->exec_hook('login_failed', array(
       'code' => $error_code, 'host' => $auth['host'], 'user' => $auth['user']));

--
Gitblit v1.9.1