| 1 | =head1 NAME | ||||||||||||
| 2 | |||||||||||||
| 3 | OpenFrame::WebApp::Segment::Decline::UserInSession - decline if User found in | ||||||||||||
| 4 | Session | ||||||||||||
| 5 | |||||||||||||
| 6 | =head1 SYNOPSIS | ||||||||||||
| 7 | |||||||||||||
| 8 | # see OpenFrame::WebApp::Segment::Decline | ||||||||||||
| 9 | |||||||||||||
| 10 | $OpenFrame::WebApp::Segment::Decline::UserInSession::USER_KEY = 'user'; | ||||||||||||
| 11 | |||||||||||||
| 12 | =cut | ||||||||||||
| 13 | |||||||||||||
| 14 | package OpenFrame::WebApp::Segment::Decline::UserInSession; | ||||||||||||
| 15 | |||||||||||||
| 16 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 17 | 1 | ▶ | use warnings::register; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | |||||||||||||
| 19 | 1 | ▶ | use Pipeline::Production; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | 1 | ▶ | use OpenFrame::WebApp::Error::Abstract; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 21 | |||||||||||||
| 22 | 1 | our $VERSION = (split(/ /, '$Revision: 1.1 $'))[1]; | |||||||||||
| 23 | |||||||||||||
| 24 | 1 | ▶ | use base qw( OpenFrame::WebApp::Segment::Decline | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 25 | 1 | OpenFrame::WebApp::Segment::Session ); | |||||||||||
| 26 | |||||||||||||
| 27 | 1 | ▶ | use constant message => 'declined: user in session'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 28 | 1 | our $USER_KEY = 'user'; | |||||||||||
| 29 | |||||||||||||
| 30 | 2 | ▶ | sub should_decline { | ||||||||||
|
Subroutine
should_decline: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||
| 31 | 2 | my $self = shift; | |||||||||||
| 32 | 2 | ▶ | return $self->get_user_from_session ? 1 : 0; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 2 | ▶ | sub get_user_from_session { | ||||||||||
|
Subroutine
get_user_from_session: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||
| 36 | 2 | my $self = shift; | |||||||||||
| 37 | 2 | ▶ | my $session = $self->get_session_from_store || return; | ||||||||||
|
Condition50%1/2
$self->get_session_from_store || (return)
MC/DC0%0/1
$self->get_session_from_store || (return)
$self->get_session_from_store
Truth table50%1/2
A
A= $self->get_session_from_store
| |||||||||||||
| 38 | 2 | return $session->get( $USER_KEY ); | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | 1 | 1; | |||||||||||
| 42 | |||||||||||||
| 43 | __END__ | ||||||||||||