Index: /trunk/plugins/new_user_identity/new_user_identity.php
===================================================================
--- /trunk/plugins/new_user_identity/new_user_identity.php	(revision 5162)
+++ /trunk/plugins/new_user_identity/new_user_identity.php	(revision 5163)
@@ -7,5 +7,5 @@
  * This plugin requires that a working public_ldap directory be configured.
  *
- * @version 1.02
+ * @version 1.05
  * @author Kris Steinhoff
  *
@@ -40,5 +40,5 @@
         $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) {
@@ -55,5 +55,5 @@
     }
 
-    private function init_ldap()
+    private function init_ldap($host)
     {
         if ($this->ldap)
@@ -73,5 +73,5 @@
             $ldap_config[$addressbook],
             $rcmail->config->get('ldap_debug'),
-            $rcmail->config->mail_domain($_SESSION['imap_host']),
+            $rcmail->config->mail_domain($host),
             $match);
 
@@ -82,5 +82,5 @@
 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);
