Item9186: change function changePassword to use standart ldap api

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: LdapContrib
Branches:
Reported By: AlexanderKriventsov
Waiting For:
Last Change By: MichaelDaum
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
 

ItemTemplate edit

Summary change function changePassword to use standart ldap api
ReportedBy AlexanderKriventsov
Codebase 1.0.9
SVN Range
AppliesTo Extension
Component LdapContrib
Priority Normal
CurrentState Closed
WaitingFor
Checkins LdapContrib:d620f28277d1
TargetRelease n/a
ReleasedIn n/a
Topic revision: r4 - 09 Nov 2010, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy