From 853696b15a11708e04412001f68a516f2332363c Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 05 Sep 2011 04:49:04 -0400
Subject: [PATCH] Backport changes from trunk up to r5164

---
 plugins/new_user_identity/new_user_identity.php |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/plugins/new_user_identity/new_user_identity.php b/plugins/new_user_identity/new_user_identity.php
index 2fc025b..32c2c9d 100644
--- a/plugins/new_user_identity/new_user_identity.php
+++ b/plugins/new_user_identity/new_user_identity.php
@@ -6,7 +6,7 @@
  *
  * This plugin requires that a working public_ldap directory be configured.
  *
- * @version 1.02
+ * @version 1.05
  * @author Kris Steinhoff
  *
  * Example configuration:
@@ -39,7 +39,7 @@
     {
         $rcmail = rcmail::get_instance();
         
-        if ($this->init_ldap()) {
+        if ($this->init_ldap($args['host'])) {
             $results = $this->ldap->search('*', $args['user'], TRUE);
             if (count($results->records) == 1) {
                 $args['user_name'] = $results->records[0]['name'];
@@ -54,7 +54,7 @@
         return $args;
     }
 
-    private function init_ldap()
+    private function init_ldap($host)
     {
         if ($this->ldap)
             return $this->ldap->ready;
@@ -72,7 +72,7 @@
         $this->ldap = new new_user_identity_ldap_backend(
             $ldap_config[$addressbook],
             $rcmail->config->get('ldap_debug'),
-            $rcmail->config->mail_domain($_SESSION['imap_host']),
+            $rcmail->config->mail_domain($host),
             $match);
 
         return $this->ldap->ready;
@@ -81,7 +81,7 @@
 
 class new_user_identity_ldap_backend extends rcube_ldap
 {
-    function __construct($p, $debug=false, $mail_domain=NULL, $search=null)
+    function __construct($p, $debug, $mail_domain, $search)
     {
         parent::__construct($p, $debug, $mail_domain);
         $this->prop['search_fields'] = (array)$search;

--
Gitblit v1.9.1