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/View/PDF/Reuse.pm ↑ Summary blib/lib/OpusVL/AppKit/RolesFor/Schema/AppKitAuthDB.pm »
1 package OpusVL::AppKit::Form::Login;
2  
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 12 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use HTML::FormHandler::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 12 ▶use CatalystX::SimpleLogin::Form::Login;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 12 extends 'CatalystX::SimpleLogin::Form::Login';
10  
11 12 has_field '+password' => ( element_attr => { autocomplete => 'off' } );
12  
13 override 'validate' => sub
14 {
15 9 ▶ my $self = shift;
Subroutine __ANON__: called CC=3 SCAR=11.0
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 12 };
39  
40 12 1;
41  
42 __END__
43  
44 =pod
45  
46 =encoding UTF-8
47  
48 =head1 NAME
49  
50 OpusVL::AppKit::Form::Login
51  
52 =head1 VERSION
53  
54 version 2.24
55  
56 =head1 AUTHOR
57  
58 OpusVL - www.opusvl.com
59  
60 =head1 COPYRIGHT AND LICENSE
61  
62 This software is copyright (c) 2010 by OpusVL - www.opusvl.com.
63  
64 This is free software; you can redistribute it and/or modify it under
65 the same terms as the Perl 5 programming language system itself.
66  
67 =cut
« blib/lib/OpusVL/AppKit/View/PDF/Reuse.pm ↑ Summary blib/lib/OpusVL/AppKit/RolesFor/Schema/AppKitAuthDB.pm »