Bug in search ldap_count_entries

jjemmett - March 30, 2009 - 19:11
Project:LDAP Directory
Version:6.x-0.1
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

I have ldap_authentication working correctly, and after installing ldapdirectory v6, configuring the server with

General Settings:
search_name=employee_directory_search
enabled=yes
enable_text_search=yes
directory_attributes="cn=Name"

When I go to the /ldapdirectory page and type in a name in the search box and then click go I get the following warning and a blank page underneath it:

warning: ldap_count_entries(): 144 is not a valid ldap result resource in /var/www/drupal/sites/all/modules/ldap_integration/includes/LDAPInterface.inc on line 196.

#1

rmiddle - April 1, 2009 - 04:33

This is likely a config issue.

Thanks
Robert

#2

dajuice - July 7, 2009 - 21:32

I ran into this same issue but i figured out there is a bug in the module. I ran wireshark to see what the ldap lookup was doing and it gives an error on the ldap search itself. The problem is that there is no filter. If you insert the following line into the module it will work. The problem is that its missing the objectClass to search on. I suggest that the module be updated so that the user can enter their own filter as a variable in the search setup.

$ldsettings['skypelink_attr'];
  if ($ldsettings['vacationcheck_on'] == 1) {
    $ldaptags [] = $ldsettings['vacationcheck_status'];
    $ldaptags [] = $ldsettings['vacationcheck_message'];
  }

// ***Insert this line here prior to it doing the search**
$filter = 'objectClass=*';

  // If there is no BINDDN and BINDPW -- the connect will be an anonymous connect
  $ldap_directoryconnect = $ldap_directory->connect($serversettings['binddn'], $serversettings['bindpw']);

 
 

Drupal is a registered trademark of Dries Buytaert.