pavanred
pavanred

Reputation: 13823

LDAP search error

I am trying to use LDAP login to ezpublish but I am facing this error -

ldap_search() [<a href='function.ldap-search'>function.ldap-search</a>]: Search: Operations error in C:\wamp\www\ezpub\kernel\classes\datatypes\ezuser\ezldapuser.php on line 322

I don't know how to fix this or why this error is occuring. This is the debug trace before ldap_search fails -

  'LDAPFilter' => '( &(objectCategory=person)([email protected]))',

 'retrieveAttributes' => 
  array (
    0 => 'userprincipalname',
    1 => '',
    2 => '',
    3 => 'userprincipalname',
  )

  'LDAPSearchScope' => 'sub'

  'LDAPBaseDN' => 'ou=xyz,dc=xy,dc=xyzldap'

And, this fails when it hits this line of code -

$sr = ldap_search( $ds, $LDAPBaseDN, $LDAPFilter, $retrieveAttributes );

What is wrong here? Does anyone have any idea what the problem might be? And how can I resolve it?

Upvotes: 1

Views: 4100

Answers (2)

pavanred
pavanred

Reputation: 13823

I found the reason it was not working. Turns out that the LDAP server that I was connecting to does not allow anonymous bind, so I had to specify the user name and password to bind to the server (ldap_bind function).

Once I provided the user name and password it started working fine.

Upvotes: 1

Stefan Gehrig
Stefan Gehrig

Reputation: 83672

Why do you have empty values in your $retrieveAttributes-array?

This might be the problem... Could you try:

$retrieveAttributes = array('userprincipalname');

Upvotes: 1

Related Questions