diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm index c68373542..edab6f557 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm @@ -12,7 +12,7 @@ use Lemonldap::NG::Portal::_LibAccess; use base qw(Lemonldap::NG::Portal::_LibAccess); use Clone qw(clone); -our $VERSION = '1.3.0'; +our $VERSION = '1.4.0'; our $catlevel = 0; ## @method void menuInit() @@ -57,6 +57,7 @@ sub menuInit { scalar( grep { $_ == $self->{menuError} } ( 25, #PE_PP_CHANGE_AFTER_RESET + 26, #PE_PP_PASSWORD_MOD_NOT_ALLOWED 27, #PE_PP_MUST_SUPPLY_OLD_PASSWORD 28, #PE_PP_INSUFFICIENT_PASSWORD_QUALITY 29, #PE_PP_PASSWORD_TOO_SHORT diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm index 3a00475fa..5398b45cb 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LDAP.pm @@ -302,13 +302,13 @@ sub userModifyPassword { # AD specific # Change password as user with a delete/add modification if ( $ad and $oldpassword and $asUser ) { - $mesg = $self->modify( $dn, - delete => { $passwordAttribute => $oldpassword }, - add => { $passwordAttribute => $newpassword } + changes => [ + delete => [ $passwordAttribute => $oldpassword ], + add => [ $passwordAttribute => $newpassword ] + ] ); - } else { @@ -339,6 +339,8 @@ sub userModifyPassword { if ( $mesg->code == 50 || $mesg->code == 8 ); return PE_PP_INSUFFICIENT_PASSWORD_QUALITY if ( $mesg->code == 53 && $ad ); + return PE_PP_PASSWORD_MOD_NOT_ALLOWED + if ( $mesg->code == 19 && $ad ); return PE_LDAPERROR unless ( $mesg->code == 0 ); $self->{portal} ->_sub( 'userNotice', "Password changed $self->{portal}->{user}" );