blib/lib/Lemonldap/NG/Portal/Auth/Demo.pm

filter: Statementstmt 86.3% 19 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 3 totaltotal 78.7% 26 / 33 CC 2 SCAR 3.6
CC
2
Cov
83%
authenticate
2.5
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« blib/lib/Lemonldap/NG/Portal/Auth/Null.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/UserDB/Remote.pm »
1 ##@file
2 # Demo authentication backend file
3  
4 ##@class
5 # Demo authentication backend class
6 package Lemonldap::NG::Portal::Auth::Demo;
7  
8 317 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 317 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 317 ▶use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_BADCREDENTIALS);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 317 extends qw(Lemonldap::NG::Portal::Auth::_WebForm);
13  
14 317 our $VERSION = '2.0.12';
15  
16 # INITIALIZATION
17  
18 # Initialize demo accounts
19 # @return Lemonldap::NG::Portal constant
20 652 ▶sub init {
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
21 652 my $self = shift;
22  
23 # Add warning in log
24 652 $self->logger->warn(
25 "Using demonstration mode, go to Manager to edit the configuration");
26  
27 652 return $self->Lemonldap::NG::Portal::Auth::_WebForm::init();
28 }
29  
30 # RUNNING METHODS
31  
32 107 ▶sub authenticate {
Subroutine authenticate: called CC=2 SCAR=9.2
Pod undocumented
33 107 my ( $self, $req ) = @_;
34  
35 107 ▶ unless ( $req->{user} eq $req->data->{password} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($req->{"user"} eq $req->data->{"password"}) 0 107 107
36 0 $self->userLogger->warn("Bad password for $req->{user}");
37 0 $self->setSecurity($req);
38 0 return PE_BADCREDENTIALS;
39 }
40  
41 107 return PE_OK;
42 }
43  
44 27 ▶sub authLogout {
Subroutine authLogout: called CC=1 SCAR=0.0
Pod undocumented
45 27 return PE_OK;
46 }
47  
48 317 1;
« blib/lib/Lemonldap/NG/Portal/Auth/Null.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/UserDB/Remote.pm »