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

31 lines
771 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);
extends 'Lemonldap::NG::Portal::Password::Base',
'Lemonldap::NG::Portal::Lib::Choice';
our $VERSION = '2.0.0';
sub init {
my ($self) = @_;
return ( $self->Lemonldap::NG::Portal::Password::Base::init()
2017-01-15 14:18:01 +01:00
and $self->Lemonldap::NG::Portal::Lib::Choice::init(2) );
2017-01-13 06:48:21 +01:00
}
sub confirm {
my ( $self, $req, $pwd ) = @_;
$self->checkChoice($req) or return PE_ERROR;
2017-11-01 08:38:47 +01:00
return $req->datas->{enabledMods2}->[0]->confirm( $req, $pwd );
2017-01-13 06:48:21 +01:00
}
sub modifyPassword {
my ( $self, $req, $pwd ) = @_;
$self->checkChoice($req) or return PE_ERROR;
2017-11-01 08:38:47 +01:00
return $req->datas->{enabledMods2}->[0]->modifyPassword( $req, $pwd );
2017-01-13 06:48:21 +01:00
}
1;