From 6f98b9100b191e0a74a947a67da9c7575931bd71 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 30 Nov 2011 08:11:34 -0500
Subject: [PATCH] - Applied r5515 from trunk

---
 program/include/rcube_ldap.php |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index 8014504..95377c7 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -228,6 +228,10 @@
             $replaces = array('%dn' => '', '%dc' => $dc, '%d' => $d, '%fu' => $fu, '%u' => $u);
 
             if ($this->prop['search_base_dn'] && $this->prop['search_filter']) {
+                if (!empty$this->prop['search_bind_dn']) && !empty($this->prop['search_bind_pw'])) {
+                    $this->bind($this->prop['search_bind_dn'], $this->prop['search_bind_pw']);
+                }
+
                 // Search for the dn to use to authenticate
                 $this->prop['search_base_dn'] = strtr($this->prop['search_base_dn'], $replaces);
                 $this->prop['search_filter'] = strtr($this->prop['search_filter'], $replaces);

--
Gitblit v1.9.1