Password/DBI skeleton

This commit is contained in:
Xavier Guimard 2016-07-12 05:15:26 +00:00
parent 03466042ae
commit 07c56321de
3 changed files with 31 additions and 1 deletions

View File

@ -48,6 +48,7 @@ sub importHandlerDatas {
my ( $self, $req ) = @_;
$req->{sessionInfo} = HANDLER->datas;
$req->id( $req->sessionInfo->{_session_id} );
$req->user( $req->sessionInfo->{ $self->conf->{whatToTrace} } );
PE_OK;
}

View File

@ -0,0 +1,27 @@
package Lemonldap::NG::Portal::Password::DBI;
use strict;
use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR);
extends 'Lemonldap::NG::Portal::Password::Base',
'Lemonldap::NG::Portal::Lib::DBI';
our $VERSION = '2.0.0';
sub init {
my ($self) = @_;
return $self->dbh;
}
sub confirm {
my ( $self, $req, $pwd ) = @_;
return $self->check_password( $req->user, $pwd );
}
sub modifyPassword {
my ( $self, $req ) = @_;
return $self->modify_password( $req->user, $pwd ) ? PE_OK : PE_ERROR;
}
1;

View File

@ -6,6 +6,8 @@ use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_ERROR);
extends 'Lemonldap::NG::Portal::Password::Base';
our $VERSION = '2.0.0';
sub init {
my ($self) = @_;
if ( $self->p->getModule(undef,'auth') eq 'Demo' ) {
@ -29,4 +31,4 @@ sub modifyPassword {
PE_OK;
}
1
1;