Commit abf8aba0 authored by Xavier Guimard's avatar Xavier Guimard

Rewrite Password/Choice (#595)

parent 5a4d27bc
......@@ -91,10 +91,10 @@ lib/Lemonldap/NG/Portal/Main/Request.pm
lib/Lemonldap/NG/Portal/Main/Run.pm
lib/Lemonldap/NG/Portal/Menu.pm
lib/Lemonldap/NG/Portal/Password/Base.pm
lib/Lemonldap/NG/Portal/Password/Choice.pm
lib/Lemonldap/NG/Portal/Password/DBI.pm
lib/Lemonldap/NG/Portal/Password/Demo.pm
lib/Lemonldap/NG/Portal/Password/LDAP.pm
lib/Lemonldap/NG/Portal/PasswordDBChoice.pm
lib/Lemonldap/NG/Portal/Plugins/CDA.pm
lib/Lemonldap/NG/Portal/Plugins/ForceAuth.pm
lib/Lemonldap/NG/Portal/Plugins/Notifications.pm
......
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;
##@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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment