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 322 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 322 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 322 ▶use Lemonldap::NG::Portal::Main::Constants;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 322 our $VERSION = '2.19.0';
8  
9 322 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 sub setGroups {
14 5 ▶ my ( $self, $req ) = @_;
Subroutine setGroups: called CC=8 SCAR=25.4
Pod undocumented
15  
16 5 my $groups = $req->sessionInfo->{groups};
17 5 my $hGroups = $req->sessionInfo->{hGroups};
18  
19 # Populate $hGroups from $groups
20 5 ▶ if ( $groups and not( $hGroups and keys %$hGroups ) ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($groups and not $hGroups && keys %$hGroups) { } 0 5 5
elsif ($hGroups and keys %$hGroups and not $groups) { } 0 6 6
Condition50%3/6
$groups and not $hGroups && keys %$hGroups
!ll&&!rl&&r
140
$hGroups && keys %$hGroups
!ll&&!rl&&r
004
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 # Populate $groups from $hGroups
27 ▶ elsif ( ( $hGroups and keys %$hGroups ) and not $groups ) {
Condition66%4/6
$hGroups and keys %$hGroups and not $groups
!ll&&!rl&&r
140
$hGroups and keys %$hGroups
!ll&&!rl&&r
104
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
28 $req->sessionInfo->{groups} =
29 0 join( $self->conf->{multiValuesSeparator}, keys %$hGroups );
30 }
31  
32 5 return PE_OK;
33 }
34  
35 322 1;
« blib/lib/Lemonldap/NG/Portal/Lib/Remote.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Plugins/StayConnected.pm »