From: Arne G. G. <ar...@li...> - 2002-07-12 14:42:16
|
* Graham Barr > When the last person asked about this I posted the attached module. > > Install it as Net/LDAP/Extension/SetPassword.pm and then you > should be able todo > > use Net::LDAP::Extension::SetPassword; > > $result = $ldap->set_password( > user => $user, > oldpasswd => $old, > newpasswd => $new > ); > > And if you are expecting the server to generate a new password > > $result->gen_password; # Need a better name ?? > > But nobody got back to say if it worked (I cannot test it) How ungrateful. This works as a charm for me, both supplying a new password and letting slapd generate one for me, with and without the user dn explicitly given. (Supplying a value for old password yields the error message "use bind to verify old password", but that's probably server specific and perfectly acceptable.) Of course, I still need to patch Net/LDAP.pm: --- Net/LDAP.pm~ Fri Jul 12 16:33:53 2002 +++ Net/LDAP.pm Fri Jul 12 16:34:06 2002 @@ -566,7 +566,7 @@ if $ldap->{net_ldap_version} < 3; $mesg->encode( - extendedRequest => { + extendedReq => { requestName => $arg->{name}, requestValue => $arg->{value} }, But that's no surprise. Thanks, Arne. |