lemonldap-ng/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Password/Choice.pm
2020-11-13 06:17:45 +01:00

36 lines
848 B
Perl

package Lemonldap::NG::Portal::Password::Choice;
use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_ERROR);
extends qw(
Lemonldap::NG::Portal::Lib::Choice
Lemonldap::NG::Portal::Password::Base
);
our $VERSION = '2.1.0';
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;
}
sub confirm {
my ( $self, $req, $pwd ) = @_;
$self->checkChoice($req) or return PE_ERROR;
return $req->data->{enabledMods2}->[0]->confirm( $req, $pwd );
}
sub modifyPassword {
my ( $self, $req, $pwd, $useMail ) = @_;
$self->checkChoice($req) or return PE_ERROR;
return $req->data->{enabledMods2}->[0]
->modifyPassword( $req, $pwd, $useMail );
}
1;