« blib/lib/Lemonldap/NG/Portal/Lib/LazyLoadedConfiguration.pm
↑ Summary
blib/lib/Lemonldap/NG/Portal/Captcha/CaptchEtat.pm »
| 1 | package Lemonldap::NG::Portal::Auth::Choice; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 28 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 28 | ▶ | use Mouse; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 28 | ▶ | use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_FIRSTACCESS PE_ERROR); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 27 | our $VERSION = '2.21.0'; | |||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 27 | extends 'Lemonldap::NG::Portal::Lib::Choice'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | # INITIALIZATION | ||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 58 | ▶ | sub init { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 58 | return $_[0]->SUPER::init(0); | |||||||||||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | # RUNNING METHODS | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | sub _authCancel { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_authCancel: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | my ( $self, $req ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | delete $req->pdata->{_choice}; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | return $self->SUPER::_authCancel($req); | |||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | 48 | ▶ | sub extractFormInfo { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
extractFormInfo: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 48 | my ( $self, $req ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | $self->logger->debug( "Send init/script -> " . $req->data->{customScript} ) | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 48 | ▶ | if $req->data->{customScript}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 48 | ▶ | unless ( $self->checkChoice($req) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | 10 | $self->setSecurity($req); | |||||||||||||||||||||||||||||||||||||||||
| 32 | 10 | return PE_FIRSTACCESS; | |||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | 38 | my $res = $req->data->{enabledMods0}->[0]->extractFormInfo($req); | |||||||||||||||||||||||||||||||||||||||||
| 36 | 38 | ▶ | if ( $res > 0 ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | 8 | $self->setSecurity($req); | |||||||||||||||||||||||||||||||||||||||||
| 38 | 8 | delete $req->pdata->{_choice}; | |||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||
| 40 | 38 | return $res; | |||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | 17 | ▶ | sub authenticate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
authenticate: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | 17 | my $res = $_[1]->data->{enabledMods0}->[0]->authenticate( $_[1] ); | |||||||||||||||||||||||||||||||||||||||||
| 45 | 17 | ▶ | delete $_[1]->pdata->{_choice} if ( $res > 0 ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 17 | return $res; | |||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | 15 | ▶ | sub setAuthSessionInfo { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setAuthSessionInfo: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | 15 | my ( $self, $req ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 51 | 15 | ▶ | $self->checkChoice($req) unless ( $req->data->{enabledMods0} ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | 15 | my $res = $req->data->{enabledMods0}->[0]->setAuthSessionInfo($req); | |||||||||||||||||||||||||||||||||||||||||
| 53 | 15 | ▶ | delete $_[1]->pdata->{_choice} if ( $res > 0 ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | 15 | return $res; | |||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 9 | ▶ | sub authLogout { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
authLogout: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | 9 | ▶ | $_[0]->checkChoice( $_[1] ) or return PE_OK; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 59 | 8 | my $res = $_[1]->data->{enabledMods0}->[0]->authLogout( $_[1] ); | |||||||||||||||||||||||||||||||||||||||||
| 60 | 8 | delete $_[1]->pdata->{_choice}; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 8 | delete $_[1]->data->{_authChoice}; | |||||||||||||||||||||||||||||||||||||||||
| 62 | 8 | return $res; | |||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | 25 | ▶ | sub setSecurity { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setSecurity: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 66 | 25 | my ( $self, $req ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 67 | 25 | foreach my $mod ( values %{ $self->modules } ) { | |||||||||||||||||||||||||||||||||||||||||
| 68 | 36 | ▶ | if ( $mod->can('setSecurity') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 18 | $mod->setSecurity($req); | |||||||||||||||||||||||||||||||||||||||||
| 70 | 18 | last; | |||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | 3 | ▶ | sub isCallback { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
isCallback: called CC=5 SCAR=27.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 76 | 3 | my ( $self, $req ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 77 | 3 | ▶ | if ( my $choice = $req->pdata->{_choice} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | my $mod = $self->modules->{$choice}; | |||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | if ( $mod and $mod->can('isCallback') and $mod->isCallback($req) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$mod and $mod->can("isCallback") and $mod->isCallback($req)
$mod and $mod->can("isCallback")
MC/DC0%0/3
$mod and $mod->can("isCallback") and $mod->isCallback($req)
$mod
$mod->can("isCallback")
$mod->isCallback($req)
Truth table0%0/4
A and B and C
A= $modB= $mod->can("isCallback")C= $mod->isCallback($req)
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | $self->logger->debug("Detected callback for $choice"); | |||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 3 | return; | |||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | 27 | 1; | |||||||||||||||||||||||||||||||||||||||||