lemonldap-ng/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Password/Choice.pm

36 lines
849 B
Perl
Raw Normal View History

2017-01-13 06:48:21 +01:00
package Lemonldap::NG::Portal::Password::Choice;
use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_ERROR);
2020-11-04 16:48:43 +01:00
extends qw(
Lemonldap::NG::Portal::Lib::Choice
Lemonldap::NG::Portal::Password::Base
);
2017-01-13 06:48:21 +01:00
2020-11-04 16:48:43 +01:00
our $VERSION = '2.0.10';
2017-01-13 06:48:21 +01:00
sub init {
my ($self) = @_;
return 0
unless ( $self->Lemonldap::NG::Portal::Password::Base::init()
and $self->Lemonldap::NG::Portal::Lib::Choice::init(2) );
$self->p->{_passwordDB} = $self;
2017-01-13 06:48:21 +01:00
}
sub confirm {
my ( $self, $req, $pwd ) = @_;
$self->checkChoice($req) or return PE_ERROR;
return $req->data->{enabledMods2}->[0]->confirm( $req, $pwd );
2017-01-13 06:48:21 +01:00
}
sub modifyPassword {
my ( $self, $req, $pwd, $useMail ) = @_;
2017-01-13 06:48:21 +01:00
$self->checkChoice($req) or return PE_ERROR;
return $req->data->{enabledMods2}->[0]
->modifyPassword( $req, $pwd, $useMail );
2017-01-13 06:48:21 +01:00
}
1;