From: Murugan K G <mur...@ya...> - 2002-06-18 05:54:20
|
Hi What is the return value of $ldap->extension function. I closely looked in to the extension function in LDAP.PM version 0.25. But i found the following . Am i using the correct version. I am confused. If i use like this , it is giving the following error $mesg = $ldap->extension( name => $oid, value => $value); $mesg->response_name gives undefined value error. But the same time $mesg=$ldap->_sendmesg($mesg);# with proper encoding including oid and value $mesg->response_name gives the correct response_name . Which usage is correct . ###### code copied form LDAP.PM ######### # which is sending message . Is it returning any value ################################### sub extension { my $ldap = shift; my $arg = &_options; require Net::LDAP::Extension; my $mesg = $ldap->message('Net::LDAP::Extension' => $arg); return _error($ldap, $mesg, LDAP_LOCAL_ERROR, "ExtendedRequest requires LDAPv3") if $ldap->{net_ldap_version} < 3; $mesg->encode( extendedRequest => { requestName => $arg->{name}, requestValue => $arg->{value} }, controls => $arg->{control} ) or return _error($ldap, $mesg, LDAP_ENCODING_ERROR,"$@"); $ldap->_sendmesg($mesg); } Regards K.Murugan --- Graham Barr <gb...@po...> wrote: > Currently Net::LDAP only gives a skeleton access to > the extended operation. > > You must encode the value yourself and pass in with > > $mesg = $ldap->extension( name => $oid, value => > $value); > > Then you can call > > $mesg->response_name > $mesg->response > > to get the names and value of the response. > > The intent is that as "standard" extensions get > defined we would define > classes for them so that you could do > > $mesg = $ldap->extension( type => 'set-password', > ... args for set password ); > > And the class of the object returned will be a > sub-class of Net::LDAP::Extension > with methods that are of use to 'set-password'. We > could even go as far as > > use Net::LDAP::Extension qw(set_password); > > $mesg = $ldap->set_password( ... ); > > Graham. > > On Fri, Jun 14, 2002 at 03:17:27PM +0100, Graham > Barr wrote: > > ----- Forwarded message from Darryl C Price > <da...@co...> ----- > > > > Date: Fri, 14 Jun 2002 10:13:12 -0400 > > To: gb...@po... > > From: Darryl C Price <da...@co...> > > Subject: Documentation for Net::LDAP::Extension > > > > Hello Graham, > > > > I am trying to figure out how to use the > set-password ldapv3 extension but > > can't find the documentation for > Net::LDAP::Extension or any examples. Your > > help would be greatly appreciated. > > > > --Darryl > > Darryl C Price > > Conversant Systems, LLC > > Email: da...@co... > > Phone: (513)768-3120 > > Mobile: (513)225-8528 > > Web: http://www.convsys.com > > > > ----- End forwarded message ----- > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application > Developer's Conference > August 25-28 in Las Vegas - > http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com |