Forums / Install & configuration / LDAP_SEARCH problem

LDAP_SEARCH problem

Author Message

Pascal Cronauer

Tuesday 23 September 2008 3:25:53 am

hi @all,

if i enable my debugging modus, i always get this error:

Warning: PHP  	Sep 23 2008 11:00:52

ldap_search() [<a href='function.ldap-search'>function.ldap-search</a>]: Search: Operations error in /data/srv/www/ez/kernel/classes/datatypes/ezuser/ezldapuser.php on line 263

Warning: PHP 	Sep 23 2008 11:00:52

ldap_get_entries(): supplied argument is not a valid ldap result resource in /data/srv/www/ez/kernel/classes/datatypes/ezuser/ezldapuser.php on line 266

Warning: ezi18n 	Sep 23 2008 11:00:52

No translation for file(translation.ts) in context(lib/template): 'The maximum nesting level of %max has been reached. The execution is stopped to avoid infinite recursion.' with comment()

i tried the ldapsearch with the same parameters written on line 263

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

in the ezldapusers.php on the shell of my unix system. It is working fine on the command line.

The second thing i tried is to write my own php file to get the ldap_search php function working, but i get always the same errors. My own written file locks like this:

<?php

$conn = ldap_connect("LDAP_server_IP") or die ("cant connect");

$ldaprdn = 'user';
$ldappass = 'pw';

$bind = ldap_bind($conn) or die ("not possible");

$result=ldap_search($conn, "dc=domain,dc=de", "(&(samaccountname=cronauer))") or die ("Failure during search");

$info = ldap_get_entries($conn, $result);

for ($i=0; $i<$info["count"]; $i++) {

echo "dn is: ". $info[$i]["dn"] ."<br>";
echo "erste cn ist: ". $info[$i]["cn"][0] ."<br>";
echo "erste E-Mail-Adresse ist: ". $info[$i]["mail"][0]."<p>";
}

echo "Anzahl der Einträge: " . ldap_count_entries($conn, $result) ."<p>";

ldap_close($conn);


?>

If i execute the php on the commandline with "php saerchscript.php" i get the same error as the configuration from ez publisher ldap gets.

Warning: ldap_search(): Search: Operations error in /home/pascal/ldaptest.php on line 11
Failure during search

I think it is probably an error with ldap_search function from php.... ???

Please, can someone help?

nice greetings
Pascal

melle mimi

Wednesday 03 June 2009 3:24:11 am

HI,

i have the same problem!!!!!!

i tried to change ldapbasedn, when i put OU, it works, but if i don't put it doesn't work!!!

can anybody help me, please??????????

SEBBANE Alexandre

Wednesday 03 June 2009 9:43:34 am

What is your ldap server ? Active Directory or OpenLdap

Are you sure php can connect to it ?

can you show us a part of the config ldap.ini you change.

if trouble with put it in public place send me a message by clikking on my name ( in french or english , no problem)

Paris, France

Gaetano Giunta

Thursday 04 June 2009 1:30:46 am

Try this:

ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); // enables ldap verbose debug even before creating the connection

$conn = ldap_connect("LDAP_server_IP") or die ("cant connect");

ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);

$bind = ldap_bind($conn) or die ("not possible");

ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); // "In order to perform the searches on Windows 2003 Server Active Directory you have to set the LDAP_OPT_REFERRALS option to 0"

$result=ldap_search($conn, "dc=domain,dc=de", "(&(samaccountname=cronauer))") or die ("Failure during search");

etc ...

Principal Consultant International Business
Member of the Community Project Board

melle mimi

Wednesday 10 June 2009 7:45:44 am

Thank's Mr Gaetano Giunta;

can y ou, please, tel me where i can pu these modifications?!

do i put it in the file ezldapuser? or in an other?!

Gaetano Giunta

Thursday 11 June 2009 1:29:01 am

@melle mini: the changes I suggested are for the test file that Pascal Cronauer used.

As for patching the eZPublish source code, I think the simplest option is to upgrade to the latest available version, that shoul already include these fixes.

Principal Consultant International Business
Member of the Community Project Board

melle mimi

Sunday 14 June 2009 12:55:54 am

IT WORKS

THANK YOU VERY MUCH .