| 1 | package HTML::FormFu::Plugin::RequestToken; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | our $VERSION = '2.04'; # VERSION | |||||||||
| 6 | 1 | our $AUTHORITY = 'cpan:NIGELM'; # AUTHORITY | |||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use MooseX::Attribute::Chained; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | extends 'HTML::FormFu::Plugin'; | |||||||||
| 11 | |||||||||||
| 12 | 1 | has context => ( is => 'rw', traits => ['Chained'] ); | |||||||||
| 13 | 1 | has field_name => ( is => 'rw', traits => ['Chained'] ); | |||||||||
| 14 | 1 | has session_key => ( is => 'rw', traits => ['Chained'] ); | |||||||||
| 15 | 1 | has expiration_time => ( is => 'rw', traits => ['Chained'] ); | |||||||||
| 16 | |||||||||||
| 17 | 51 | ▶ | sub process { | ||||||||
|
Subroutine
process: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 18 | 51 | my ($self) = @_; | |||||||||
| 19 | |||||||||||
| 20 | 51 | ▶ | return if $self->form->get_all_element( { name => $self->field_name } ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | |||||||||||
| 22 | 26 | my $c = $self->form->stash->{'context'}; | |||||||||
| 23 | |||||||||||
| 24 | 26 | $self->form->elements( | |||||||||
| 25 | [ { type => 'RequestToken', | ||||||||||
| 26 | name => $self->field_name, | ||||||||||
| 27 | expiration_time => $self->expiration_time, | ||||||||||
| 28 | context => $self->context, | ||||||||||
| 29 | session_key => $self->session_key | ||||||||||
| 30 | } | ||||||||||
| 31 | ] | ||||||||||
| 32 | ); | ||||||||||
| 33 | |||||||||||
| 34 | 26 | return; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 1 | 1; | |||||||||
| 38 | |||||||||||
| 39 | __END__ | ||||||||||