Revision: 1828
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1828&view=rev
Author:   jberanek
Date:     2011-05-18 16:17:01 +0000 (Wed, 18 May 2011)

Log Message:
-----------
* LDAP authentication change to fix (particular) configurations
 using $ldap_filter. Patch provided by rudd_j in SF tracker #3299258.

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

Modified: mrbs/trunk/web/auth_ldap.inc
===================================================================
--- mrbs/trunk/web/auth_ldap.inc        2011-05-14 11:01:24 UTC (rev 1827)
+++ mrbs/trunk/web/auth_ldap.inc        2011-05-18 16:17:01 UTC (rev 1828)
@@ -135,7 +135,7 @@
           if (@ldap_count_entries($ldap, $res) == 1)
           {
             authLdapDebug("authLdapAction: Found one entry using ".
-                          "\$ldap_dn_search_attrib");
+                          "$ldap_dn_search_attrib");
             $entries = ldap_get_entries($ldap, $res);
             $dn = $entries[0]["dn"];
             $user_search = "distinguishedName=" . $dn;
@@ -143,7 +143,7 @@
           else
           {
             authLdapDebug("authLdapAction: Didn't find entry using ".
-                          "\$ldap_dn_search_attrib");
+                          "$ldap_dn_search_attrib");
           }
           authLdapDebug("authLdapAction: base_dn $base_dn user $user ".
                         "dn $dn");
@@ -223,9 +223,9 @@
 
   if ($ldap && $base_dn && $dn && $user_search)
   {
-    $res = @ldap_search($ldap,
-                        $base_dn,
-                        "($user_search)",
+       $res = @ldap_read($ldap,
+                        $dn,
+                        "(objectclass=*)",
                         array($ldap_email_attrib)
                        );
     if (@ldap_count_entries($ldap, $res) > 0)
@@ -306,7 +306,7 @@
     if (! $ldap_filter)
     {
       authLdapDebug("authValidateUserCallback: Successful authenticated ".
-                    "bind with no $ldap_filter");
+                    "bind with no \$ldap_filter");
       return 1;
     }
     else
@@ -314,11 +314,11 @@
       authLdapDebug("authValidateUserCallback: Successful authenticated ".
                     "bind checking $ldap_filter");
 
-      $res = @ldap_search($ldap,
-                          $base_dn,
-                          "(&($user_search)($ldap_filter))",
-                          array()
-                         );
+      $res = @ldap_read($ldap,
+                        $dn,
+                        "($ldap_filter)",
+                        array()
+                       );
       if (@ldap_count_entries($ldap, $res) > 0)
       {
         authLdapDebug("authValidateUserCallback: Found entry with filter");


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

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to