blib/lib/OpusVL/AppKit/Form/Login.pm

filter: Statementstmt 100% 27 / 27 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 97.3% 36 / 37 CC 3 SCAR 5.6
CC
3
Cov
97%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« blib/lib/OpusVL/AppKit/RolesFor/Model/LDAPAuth.pm ↑ Summary blib/lib/HTML/FormFu/Validator/OpusVL/AppKit/CurrentPasswordValidator.pm »
1 package OpusVL::AppKit::Form::Login;
2  
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 9 ▶use HTML::FormHandler::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 9 ▶use CatalystX::SimpleLogin::Form::Login;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 9 extends 'CatalystX::SimpleLogin::Form::Login';
10  
11 9 has_field '+password' => ( element_attr => { autocomplete => 'off' } );
12  
13 override 'validate' => sub
14 9 ▶{
Subroutine __ANON__: called CC=3 SCAR=11.0
15 9 my $self = shift;
16  
17 9 my %values = %{$self->values}; # copy the values
18 my $rs = $self->ctx->model('AppKitAuthDB::User')->search(
19 \[
20 9 'lower(username) = ?', [ dummy => lc ($self->values->{username}) ]
21 ]
22 );
23 9 ▶ unless (
Branch: 2 branches
BranchTrueFalseTotal
unless ($self->ctx->authenticate({"password", $self->values->{"password"}, "dbix_class", {"resultset", $rs}}, $self->has_authenticate_realm ? $self->authenticate_realm : ())) 1 8 9
$self->has_authenticate_realm ? : 0 9 9
24 $self->ctx->authenticate(
25 {
26 password => $self->values->{password},
27 dbix_class => {
28 resultset => $rs,
29 }
30 },
31 ($self->has_authenticate_realm ? $self->authenticate_realm : ()),
32 )
33 ) {
34 1 $self->add_auth_errors;
35 1 return;
36 }
37 8 return 1;
38 9 };
39  
40 9 1;
41  
42 __END__
« blib/lib/OpusVL/AppKit/RolesFor/Model/LDAPAuth.pm ↑ Summary blib/lib/HTML/FormFu/Validator/OpusVL/AppKit/CurrentPasswordValidator.pm »