| 1 | package Lemonldap::NG::Portal::UserDB::Facebook; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Mouse; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_MISSINGREQATTR); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | extends 'Lemonldap::NG::Portal::Main::UserDB'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 1 | our $VERSION = '2.19.0'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | has vars => ( | ||||||||||||||||||||||||||||
| 12 | is => 'rw', | ||||||||||||||||||||||||||||
| 13 | lazy => 1, | ||||||||||||||||||||||||||||
| 14 | 0 | ▶ | builder => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 15 | return { | ||||||||||||||||||||||||||||
| 16 | 0 | %{ $_[0]->conf->{exportedVars} }, | |||||||||||||||||||||||||||
| 17 | 0 | %{ $_[0]->conf->{facebookExportedVars} } | |||||||||||||||||||||||||||
| 18 | }; | ||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | 1 | ); | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | # INITIALIZATION | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub init { | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 25 | 0 | return 1; | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | # RUNNING METHODS | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | sub getUser { | ||||||||||||||||||||||||||
|
Subroutine
getUser: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | # All is done by Auth::Facebook | ||||||||||||||||||||||||||||
| 33 | 0 | return PE_OK; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | ▶ | sub findUser { | ||||||||||||||||||||||||||
|
Subroutine
findUser: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | # Nothing to do here | ||||||||||||||||||||||||||||
| 39 | 0 | return PE_OK; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 0 | ▶ | sub setSessionInfo { | ||||||||||||||||||||||||||
|
Subroutine
setSessionInfo: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 43 | 0 | my ( $self, $req ) = @_; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 0 | foreach my $k ( keys %{ $self->vars } ) { | |||||||||||||||||||||||||||
| 46 | 0 | my $v = $self->{vars}->{$k}; | |||||||||||||||||||||||||||
| 47 | 0 | my $attr = $k; | |||||||||||||||||||||||||||
| 48 | 0 | ▶ | my $required = ( $attr =~ s/^!// ) ? 1 : 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | 0 | $req->{sessionInfo}->{$attr} = $req->data->{_facebookData}->{$v}; | |||||||||||||||||||||||||||
| 50 | 0 | ▶ | if ( $required and not( defined $req->{sessionInfo}->{$attr} ) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$required and not defined $req->{"sessionInfo"}{$attr}
MC/DC0%0/2
$required and not defined $req->{"sessionInfo"}{$attr}
$required
not defined $req->{"sessionInfo"}{$attr}
Truth table0%0/3
A and not(B)
A= $requiredB= not defined $req->{"sessionInfo"}{$attr}
| |||||||||||||||||||||||||||||
| 51 | 0 | $self->logger->warn( | |||||||||||||||||||||||||||
| 52 | "Required parameter $v is not provided by Facebook server, aborted" | ||||||||||||||||||||||||||||
| 53 | ); | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | $req->mustRedirect(0); | |||||||||||||||||||||||||||
| 56 | 0 | return PE_MISSINGREQATTR; | |||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 0 | return PE_OK; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 1 | 1; | |||||||||||||||||||||||||||