Item9186: change function changePassword to use standart ldap api
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
This patch modify operation of ldap password change to use standart API.
This allow to use some overlays on ldap server to sync ldappassword to other attributes. For example smbk5pwd overlay witch work only with LDAP Password Modify operation rather than just updating the userPassword attribute directly
--- Foswiki/Contrib/LdapContrib.pm.orig 2010-06-17 16:19:23.000000000 +0000
+++ Foswiki/Contrib/LdapContrib.pm 2010-06-18 13:03:30.000000000 +0000
@@ -18,7 +18,9 @@
package Foswiki::Contrib::LdapContrib;
use strict;
+use Net::LDAP;
use Net::LDAP::Constant qw(LDAP_SUCCESS LDAP_SIZELIMIT_EXCEEDED LDAP_CONTROL_PAGED);
+use Net::LDAP::Extension::SetPassword;
use DB_File;
use vars qw($VERSION $RELEASE %sharedLdapContrib);
@@ -1770,9 +1772,7 @@
return undef unless $this->connect($dn, $oldPassword);
- my $msg = $this->{ldap}->modify( $dn,
- replace => { 'userPassword' => $newPassword }
- );
+ my $msg = $this->{ldap}->set_password( oldpasswd => $oldPassword, newpasswd => $newPassword);
my $errorCode = $this->checkError($msg);
--
AlexanderKriventsov - 23 Jun 2010
Thanks for the patch! Added to
LdapContrib 4.10
--
MichaelDaum - 09 Nov 2010