From: Graham B. <gb...@po...> - 2001-06-06 15:08:47
|
A VLV control must be used woth a sort control. You may be able to detect this in $mesg->code. But maybe not as the control is not critical so the server may just ignore it. Graham. On Wed, Jun 06, 2001 at 10:06:22AM -0400, David A. Pinkowitz wrote: > I'm attempting to set up a virtual list view control, but I am running into > some problems. Here is a code segment from some test code I am trying to > use just to make the initial search work: > > -- > $vlv = Net::LDAP::Control::VLV->new( > before => 0, # No entries before target entry > after => 2, # number of entries after target entry > content => 0, # list size is unknown > offset => 1, # Target entry is the first > ); > > $mesg=$ldap->search( > filter => '(&(|(|(sn=*) (givenname=*)) > (mail=*))(objectclass=person))', > base => 'ou=People,o=company.com', > attrs => $anonAttr, > control => [ $vlv ], > ); > > ($resp) = $mesg->control( LDAP_CONTROL_VLVRESPONSE ) or die; > $vlv->response( $resp ); > -- > > When I run this as is, the program dies with the second to last line. If I > comment out the last two lines, I get a message "search failed with > 60." If I take the control out of the search completely, my search works > correctly. Any advice as to what I am doing wrong or how I might debug > it? Thanks in advance. > > > > -- > David A. Pinkowitz > UniPress Software, Inc. > dpi...@un... > (732) 287-2100 ext. 943 > > > |