#21643 [Opn]: ldap_search same criteria no results

From: Date: Mon, 20 Jan 2003 22:52:27 +0000
Subject: #21643 [Opn]: ldap_search same criteria no results
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30727@lists.php.net to get a copy of this message
ID: 21643 User updated by: ryanphp@ryanjameson.com Reported By: ryanphp@ryanjameson.com Status: Open Bug Type: LDAP related Operating System: windows 2000 PHP Version: 4.3.0 New Comment: Sorry, I was counting the wrong thing... the single quotes are not required, but the parens are a problem. Anyway, that seems to be what it boils down to. Previous Comments: ------------------------------------------------------------------------ [2003-01-20 16:40:00] ryanphp@ryanjameson.com Aha... it doesn't like the parens ... also, it seems to not like the single quote. The problem with that is if i don't use the single quotes I get back 2 records. :-\ ------------------------------------------------------------------------ [2003-01-20 16:33:14] ryanphp@ryanjameson.com Ok, I give up. After I actually found one of those servers that worked I couldn't find a single valid attribute to search on. I tried cn, name, ... and other common attribute types. All returned invalid attribute type. So here's a simpler sample of the problem: <?PHP $ds=ldap_connect("censored"); $dn = "cn=censored, ou=censored, dc=ibs, dc=org"; $password = "censored"; $dir = "cn=users, dc=IBS, dc=org"; $criteria = "'name=Ryan Jameson (USA)'"; if ($ds) { $r=ldap_bind($ds,$dn,$password); $sr=ldap_search($ds,$dir, $criteria); $info = ldap_get_entries($ds, $sr); echo count($info) . " records returned."; } ldap_close($ds); ?> PHP 4.2.3 extension returns: 1 records returned. PHP 4.3.0 extension returns: Warning: ldap_search(): Search: Bad search filter in R:\WebApps\api\ldapSearcherTest.php on line 9 Warning: ldap_get_entries(): supplied argument is not a valid ldap result resource in R:\WebApps\api\ldapSearcherTest.php on line 10 0 records returned. ------------------------------------------------------------------------ [2003-01-19 17:57:16] kalowsky@php.net leaving as feedback until a response comes in... ------------------------------------------------------------------------ [2003-01-18 08:18:39] ryanphp@ryanjameson.com I'm on the edit submission tab but it still says "New Comment" I hope this is the right way to respond to this. Anyway, I will try to build a simple sample on Monday. Thanks! ------------------------------------------------------------------------ [2003-01-17 21:03:32] sniper@php.net Please don't reply to your own report using 'Add Comment', use 'Edit Submission' link instead!!! And yes, it might be possible that your search string is not valid, please ask on some openldap mailing list. And I didn't ask for you to make your own ldap server public, but come up with script accessing one of these servers: http://www.emailman.com/ldap/public.html ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21643 -- Edit this bug report at http://bugs.php.net/?id=21643&edit=1

« previous php.bugs (#30727) next »