Rewrite Password/Choice (#595)
parent
5a4d27bc9d
commit
abf8aba001
@ -0,0 +1,30 @@ |
||||
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() |
||||
and $self->Lemonldap::NG::Portal::Lib::Choice->init(2) ); |
||||
} |
||||
|
||||
sub confirm { |
||||
my ( $self, $req, $pwd ) = @_; |
||||
$self->checkChoice($req) or return PE_ERROR; |
||||
return $req->datas->{enabledMod2}->[0]->confirm( $req, $pwd ); |
||||
} |
||||
|
||||
sub modifyPassword { |
||||
my ( $self, $req, $pwd ) = @_; |
||||
$self->checkChoice($req) or return PE_ERROR; |
||||
return $req->datas->{enabledMod2}->[0]->modifyPassword( $req, $pwd ); |
||||
} |
||||
|
||||
1; |
@ -1,38 +0,0 @@ |
||||
##@file |
||||
# Choice user backend file |
||||
|
||||
##@class |
||||
# Choice user backend class |
||||
package Lemonldap::NG::Portal::PasswordDBChoice; |
||||
|
||||
use strict; |
||||
use Lemonldap::NG::Portal::_Choice; |
||||
use Lemonldap::NG::Portal::Simple; |
||||
|
||||
our $VERSION = '2.0.0'; |
||||
|
||||
## @apmethod int passwordDBInit() |
||||
# Does nothing |
||||
# @return Lemonldap::NG::Portal constant |
||||
sub passwordDBInit { |
||||
my $self = shift; |
||||
return $self->_choice->try( 'passwordDBInit', 2 ); |
||||
} |
||||
|
||||
## @apmethod int modifyPassword() |
||||
# Does nothing |
||||
# @return Lemonldap::NG::Portal constant |
||||
sub modifyPassword { |
||||
my $self = shift; |
||||
return $self->_choice->try( 'modifyPassword', 2 ); |
||||
} |
||||
|
||||
## @apmethod int passwordDBFinish() |
||||
# Does nothing |
||||
# @return Lemonldap::NG::Portal constant |
||||
sub passwordDBFinish { |
||||
my $self = shift; |
||||
return $self->_choice->try( 'passwordDBFinish', 2 ); |
||||
} |
||||
|
||||
1; |
Loading…
Reference in new issue