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