From: Pythagoras W. <py...@ec...> - 2000-05-05 02:15:56
|
On Fri, May 05, 2000 at 10:17:33AM +1000, David Bussenschutt wrote: :So far, I have borrowed POD example code, and managed to connect, bind, :add, and delete user objects quite easily...but I can't get search to work. : What to I have to provide as a filter in order to return all objects in a :particular ou (or o)? For this, I search on the "objectclass" attribute being present. Something like: $mesg = $ldap->search ( base => 'o=SGCS', filter => '(objectclass=*)', ); would do it. :When I unbind at the end of the script, I get the following error: :"Can't call method "pdu" on an undefined value at :/usr/lib/perl5/site_perl/5.005/Net/LDAP.pm line 536" This is a minor bug, which is corrected in the development version. :$mesg = $ldap->search ( : base => 'o=SGCS', : filter => '(&(sn=Surnametest) (o=SGCS))', : ); "o" is not an attribute in the specified objectclasses, so you cannot search on it. Since you are already limiting yourself to the "o=SGCS" users with the "base", using: $mesg = $ldap->search ( base => 'o=SGCS', filter => '(sn=Surnametest)', ); should get you what you want. -- Py (Amateur Radio: KF6WFP) -- 3.141592653589793238462643383... Pythagoras Watson -- "Live long and may all your kernels pop." === py...@cs... ==== http://www.ecst.csuchico.edu/~py/ === |