Revision: 1286
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1286&view=rev
Author:   jberanek
Date:     2009-12-14 20:30:23 +0000 (Mon, 14 Dec 2009)

Log Message:
-----------
* Fixes for the LDAP authentication method when $ldap_filter is configured.

Modified Paths:
--------------
    mrbs/trunk/web/auth_ldap.inc

Modified: mrbs/trunk/web/auth_ldap.inc
===================================================================
--- mrbs/trunk/web/auth_ldap.inc        2009-12-13 19:34:50 UTC (rev 1285)
+++ mrbs/trunk/web/auth_ldap.inc        2009-12-14 20:30:23 UTC (rev 1286)
@@ -138,13 +138,15 @@
           {
             $entries = ldap_get_entries($ldap, $res);
             $dn = $entries[0]["dn"];
+            $user_search = "distinguishedName=" . $dn;
           }
         }
       }
       else
       {
         // construct dn for user
-        $dn = $all_ldap_user_attrib[$idx] . "=" . $user . "," . $base_dn;
+        $user_search = $all_ldap_user_attrib[$idx] . "=" . $user;
+        $dn = $user_search . "," . $base_dn;
       }
 
       // try an authenticated bind
@@ -162,7 +164,7 @@
         {
           $res = @ldap_search($ldap,
                               $base_dn,
-                              "(&($dn)($ldap_filter))",
+                              "(&($user_search)($ldap_filter))",
                               array()
                              );
           if (@ldap_count_entries($ldap, $res) > 0)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to