blib/lib/Lemonldap/NG/Portal/Main/UserDB.pm

filter: Statementstmt 85.0% 17 / 20 Branchbran 50.0% 2 / 4 Conditioncond 58.3% 7 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 63.8% 30 / 47 CC 8 SCAR 22.5
CC
8
Cov
72%
setGroups
12.6
BEGIN
1.0
BEGIN
1.0
CRAP 9.5
« blib/lib/Lemonldap/NG/Portal/Lib/Remote.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Plugins/StayConnected.pm »
1 package Lemonldap::NG::Portal::Main::UserDB;
2  
3 342 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 342 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 342 ▶use Lemonldap::NG::Portal::Main::Constants;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 342 our $VERSION = '2.23.0';
8  
9 342 extends 'Lemonldap::NG::Portal::Main::Plugin';
10  
11 # This method is meant to be used in cases where UserDB/Auth imports $groups
12 # from another system (SAML, etc)
13 24 ▶sub setGroups {
Subroutine setGroups: called CC=8 SCAR=25.4
Pod undocumented
14 24 my ( $self, $req ) = @_;
15  
16 24 my $groups = $req->sessionInfo->{groups};
17 24 my $hGroups = $req->sessionInfo->{hGroups};
18  
19 # Populate $hGroups from $groups
20 24 ▶ if ( $groups and not( $hGroups and keys %$hGroups ) ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($groups and not $hGroups && keys %$hGroups) { } 0 24 24
elsif ($hGroups and keys %$hGroups and not $groups) { } 0 40 40
Condition50%3/6
$groups and not $hGroups && keys %$hGroups
!ll&&!rl&&r
1680
$hGroups && keys %$hGroups
!ll&&!rl&&r
008
MC/DC0%0/3
$groups and not $hGroups && keys %$hGroups
$groups $hGroups keys %$hGroups
Truth table50%2/4
A and not(B && C)
A= $groupsB= $hGroupsC= keys %$hGroups
ABCresult
0XX0
1110
10X1
1101
21 0 for my $group ( split( $self->conf->{multiValuesSeparator}, $groups ) )
22 {
23 0 $req->sessionInfo->{hGroups}->{$group} = { name => $group };
24 }
25 }
26  
27 # Populate $groups from $hGroups
28 ▶ elsif ( ( $hGroups and keys %$hGroups ) and not $groups ) {
Condition66%4/6
$hGroups and keys %$hGroups and not $groups
!ll&&!rl&&r
1680
$hGroups and keys %$hGroups
!ll&&!rl&&r
1608
MC/DC0%0/3
$hGroups and keys %$hGroups and not $groups
$hGroups keys %$hGroups not $groups
Truth table50%2/4
A and B and not(C)
A= $hGroupsB= keys %$hGroupsC= not $groups
ABCresult
0XX0
10X0
1100
1111
29 $req->sessionInfo->{groups} =
30 0 join( $self->conf->{multiValuesSeparator}, keys %$hGroups );
31 }
32  
33 24 return PE_OK;
34 }
35  
36 342 1;
« blib/lib/Lemonldap/NG/Portal/Lib/Remote.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Plugins/StayConnected.pm »