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 .

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 05:17:45
Script start
Timing: Jan 19 2025 05:17:45
Module start 'layout'
Timing: Jan 19 2025 05:17:45
Module start 'content'
Timing: Jan 19 2025 05:17:46
Module end 'content'
Timing: Jan 19 2025 05:17:46
Script end

Main resources:

Total runtime1.4721 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 589.1563152.6250
Module start 'layout' 0.00420.0029 741.781339.4453
Module start 'content' 0.00701.4636 781.2266665.5703
Module end 'content' 1.47060.0014 1,446.796916.1719
Script end 1.4720  1,462.9688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2063160.0002
Check MTime0.00130.0898160.0001
Mysql Total
Database connection0.00060.042010.0006
Mysqli_queries1.404095.3728730.0192
Looping result0.00070.0456710.0000
Template Total1.444498.120.7222
Template load0.00230.156420.0012
Template processing1.442097.959720.7210
Template load and register function0.00020.011110.0002
states
state_id_array0.00090.061010.0009
state_identifier_array0.00160.109620.0008
Override
Cache load0.00180.1251500.0000
Sytem overhead
Fetch class attribute can translate value0.00090.061940.0002
Fetch class attribute name0.00140.094390.0002
XML
Image XML parsing0.00330.227240.0008
class_abstraction
Instantiating content class attribute0.00000.0033100.0000
General
dbfile0.00280.1913220.0001
String conversion0.00000.000440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs