Everything seems to be working fine (it lists all the OU's) but the search doesn't render anything. Any Help?

Comments

rmiddle’s picture

1st how large of a tree do you have?

2nd in will only search the fields you have listed in Directory attributes: are search able. This is what my AD lists.

department=Department,cn=Name,title=Job Title,telephoneNumber=Phone,facsimileTelephoneNumber=Fax,mobile=Mobile,mail=Email,
I=city,department=Department,manager=Manager,physicalDeliveryOfficeName=Office

Thanks
Robert

jbarns’s picture

Our tree isn't big, theres about 100 users, 8 OU's neither including stock users and groups.

I tried putting what you had in Directory attributes and it didn't work.

I have a feeling the problem lies with this option.

Attribute to link with users:
physicalDeliveryOfficeName

The attribute from the users LDAP record to link to organizationalunits.

eg. I have one person in an OU called example. Under the user properties I put their Office: as Example.

I then search the OU example for nothing, the clients first, last and common name. All results show nothing.

rmiddle’s picture

What Ldap backend are you using?

Thanks
Robert

jbarns’s picture

The one that is supplied by Microsoft within AD

rmiddle’s picture

OK. I use AD as well.

1) I want to just confirm that ldap auth is working fine.

2) These are the settings I am using in AD.

Checked: Enabled
Check this option to enable directory searches for this instance.

Not Check: Collapse block
Check this option to collapse the search block by default..

Check: Enable text search
Check this option to enable a text search.

Directory attributes:
department=Department,cn=Name,title=Job Title,telephoneNumber=Phone,facsimileTelephoneNumber=Fax,mobile=Mobile,mail=Email,
I=city,department=Department,manager=Manager,physicalDeliveryOfficeName=Office

LDAP Pictures
Not Checked: Enabled

LDAP Vacation
Not checked: Enabled

LDAP Business Cards
Checked: Enabled

Directory links
Checked: Enabled

Mail attribute:
mail

Not Checked: Enabled

Organisational Units

Checked: Display organizational unit's
Search filter to use for finding organizational units:
(department=*)

Base DN for organizational units:
dc=Example,dc=com

Attribute to display:
department

Attribute to link with users:
dn

Label to give to organizational units:
Department

jbarns’s picture

Below is my OU setup. I'm learning LDAP on the go so I'm unsure of all the codes but tried my best after extensive research.

Search filter to use for finding organizational units:
objectClass=top

Base DN for organizational units:
OU=Administration,OU=Users_HO,DC=domain,DC=local

Attribute to display:
ou

Attribute to link with users:
physicalDeliveryOfficeName

Label to give to organizational units:
Company

Thanks

I also tried to copy your code almost exactly.. as much as I could and it didn't work. I setup information under department and used that as the attribute.

rmiddle’s picture

Try this instead.

I am pretty certain that:

Search filter to use for finding organizational units:
objectClass=top

Won't work. For top just leave the field black. But it should match up with you attribute to display. So
try: (ou=*)

Base DN for organizational units:
OU=Administration,OU=Users_HO,DC=domain,DC=local

Try: OU=Users_HO,DC=domain,DC=local

Attribute to display:
ou

I think that will be ok.

Attribute to link with users:
physicalDeliveryOfficeName

Most of the time this is a office name not a user name.
Try: dn
and see if that works.

Label to give to organizational units:
Company

jbarns’s picture

K, just tried that and everything seemed to work still but the search. If you search nothing should it bring it everyone?

Any other suggestions?

Thanks for your time and support.

rmiddle’s picture

No it wouldn't. Search for R should work though. I would suggest using my settings once it is working then you can change them to for your needs.

Thanks
RObert

jbarns’s picture

I copied your code as much as I could. The search still turns up nil.

I went into some users and started adding more departments and that worked well, the Directory list populated. But still searching doesn't seem to work.

Unless searching is buggy this is an example of what I search.

Department: IT
Search: Jared

I'm obviously in the IT department and my dn is Jared Barns. Search still shows nil.

Usually these issues are security? Does the user need write access maybe? Any other suggestions would be appreciated.

Thanks again for your help!

rmiddle’s picture

It uses the account set in ldap intergrations advanced settings.

Thanks
Robert

jbarns’s picture

I did notice that it says this:

PLEASE NOTE: advanced configuration for this module can be set by editing the module's config file, located at modules/ldap_integration/ldapdirectory.conf.php in your Drupal install.

There is no such file there.

I tried securities and it did not work. I guess I've exhausted all my options. I will let you know if I stumble upon a solution.

rmiddle’s picture

Please let me know were it says that I need to remove that.

Thanks
Robert

jbarns’s picture

Home>Administer>Site configuration>Ldap Directory

Its just the main configuration page.

jbarns’s picture

I've run into a lot of problems and it always seemed to be a simple PHP extension solution. I obviously have LDAP installed, is there maybe another extension needed that I may not have? Running PHP 5

rmiddle’s picture

As far as I know there are no other extension requirements outside of LDAP. I want to confirm you are using 6.x-0.1? If you are tiring inserting the following line into into ldapdirector.module and post the messages it outputs please.

  // If there is no BINDDN and BINDPW -- the connect will be an anonymous connect
  $ldap_directoryconnect = $ldap_directory->connect($serversettings['binddn'], $serversettings['bindpw']);
  $ldapentries = $ldap_directory->search($serversettings['basedn'], $filter, $ldaptags);
//Insert the following 3 lines.
drupal_set_message($filter);
drupal_set_message($$ldaptags);
drupal_set_message($serversettings['basedn']);
  // counter for LDAP entries
  $entrycount = 0;

Thanks
Robert

jbarns’s picture

Yes I am using 6.x-0.1,

I copied the code above and pasted it to the bottom of ldapdirectory.module and did a search. It now just gives me a blank white page.

I took out the code and its back to normal where it searches but results show as Nil.

rmiddle’s picture

Sorry drupal_set_message($$ldaptags); <-- Mistake.

  // If there is no BINDDN and BINDPW -- the connect will be an anonymous connect
  $ldap_directoryconnect = $ldap_directory->connect($serversettings['binddn'], $serversettings['bindpw']);
  $ldapentries = $ldap_directory->search($serversettings['basedn'], $filter, $ldaptags);
//Insert the following 3 lines.
drupal_set_message($filter);
drupal_set_message($ldaptags);
drupal_set_message($serversettings['basedn']);
  // counter for LDAP entries
  $entrycount = 0;
jbarns’s picture

That still shows a blank page for all of drupal.

rmiddle’s picture

I copied the code above and pasted it to the bottom of ldapdirectory.module

Dang I missed that. No if you look there are 3 lines to insert inside an existing function. I included the lines surrounding it in the snipped I had posted. No wonder you are white screening.

You can tiring posting the 3 lines inside the function or I will upload a replacement module when I am at my PC later today.

Thanks
Robert

jbarns’s picture

Sorry about the delay, got caught up with other things.

the message says this:

objectClass=Top
Array
OU=Accounting,DC=domain,DC=local OU=Admin_Jared,DC=domain,DC=local OU=Admin,DC=domain,DC=local OU=Users_HO,DC=bsi,DC=local OU=Users_TS,DC=domain,DC=local

*note i replaced domain with our domain name

rmiddle’s picture

jbarns,

I need to compare these to my output but I am pretty certain you DN isn't right.

Thanks
Robert

rimu’s picture

I'm having the same problem; OUs list in the dropdown box nicely, but I get no results.

The key is probably the "Attribute to display" and "Attribute to link with users" fields; I have no idea what those are for! :) The Active Directory I'm using has no dn attribute for users...

The help text says "The attribute from the LDAP record to display on forms.". Hmm. Which forms are these?
Also more help text "The attribute from the users LDAP record to link to organizationalunits." which means very little to me. There are a few 'memberOf' attributes for each user, which seem to have DNs of OUs in them, but putting that in doesn't help.

$100 bounty for the person who points me in the right direction :)

Supercows’s picture

Do you have it already working?

All other option than "Directory attributes" cannot have capitals! The Directory attributes are formated with string lower case!
Your ADIntegration connection is working?