Add an option to force getUser before LDAP password change (#714)
This commit is contained in:
parent
9d24e5f0d5
commit
6517718f26
|
@ -30,6 +30,12 @@ sub confirm {
|
||||||
|
|
||||||
sub modifyPassword {
|
sub modifyPassword {
|
||||||
my ( $self, $req, $pwd, $useMail ) = @_;
|
my ( $self, $req, $pwd, $useMail ) = @_;
|
||||||
|
|
||||||
|
# If the password change is done in a different backend,
|
||||||
|
# we need to reload the correct DN
|
||||||
|
$self->getUser( $req, useMail => $useMail )
|
||||||
|
if $self->conf->{ldapGetUserBeforePasswordChange};
|
||||||
|
|
||||||
my $dn = $req->data->{dn} || $req->sessionInfo->{_dn};
|
my $dn = $req->data->{dn} || $req->sessionInfo->{_dn};
|
||||||
unless ($dn) {
|
unless ($dn) {
|
||||||
$self->logger->error('"dn" is not set, abort password modification');
|
$self->logger->error('"dn" is not set, abort password modification');
|
||||||
|
|
|
@ -32,6 +32,11 @@ sub modifyPassword {
|
||||||
my $dn;
|
my $dn;
|
||||||
my $requireOldPassword;
|
my $requireOldPassword;
|
||||||
|
|
||||||
|
# If the password change is done in a different backend,
|
||||||
|
# we need to reload the correct DN
|
||||||
|
$self->getUser( $req, useMail => $useMail )
|
||||||
|
if $self->conf->{ldapGetUserBeforePasswordChange};
|
||||||
|
|
||||||
if ( $req->data->{dn} ) {
|
if ( $req->data->{dn} ) {
|
||||||
$dn = $req->data->{dn};
|
$dn = $req->data->{dn};
|
||||||
$requireOldPassword = $self->requireOldPwdRule->( $req, $req->userData );
|
$requireOldPassword = $self->requireOldPwdRule->( $req, $req->userData );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user