diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm index ce18c20d7..98fc0139d 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Process.pm @@ -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; } diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Password/DBI.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Password/DBI.pm new file mode 100644 index 000000000..15322865b --- /dev/null +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Password/DBI.pm @@ -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; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Password/Demo.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Password/Demo.pm index b2d463318..8cc5b2887 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Password/Demo.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Password/Demo.pm @@ -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;