File Coverage

blib/lib/Tapper/Reports/Web/Controller/Tapper/User.pm
Criterion Covered Total %
statement 20 35 57.1
branch 0 4 0.0
condition n/a
subroutine 7 10 70.0
pod 2 2 100.0
total 29 51 56.8


line stmt bran cond sub pod time code
1             package Tapper::Reports::Web::Controller::Tapper::User;
2             our $AUTHORITY = 'cpan:TAPPER';
3             $Tapper::Reports::Web::Controller::Tapper::User::VERSION = '5.0.13';
4 10     10   5843 use strict;
  10         17  
  10         307  
5 10     10   38 use warnings;
  10         14  
  10         267  
6 10     10   242 use 5.010;
  10         25  
7 10     10   37 use parent 'Tapper::Reports::Web::Controller::Base';
  10         11  
  10         71  
8              
9              
10             sub index :Path :Args(0)
11             {
12 0     0   0 my ( $self, $c ) = @_;
13 10     10   1019 }
  10         15  
  10         48  
14              
15              
16              
17             sub login :Local :Args(0)
18             {
19 0     0 1 0 my ($self, $c) = @_;
20 0         0 $c->stash->{'template'} = 'tapper/user/login.mas';
21 0 0       0 if ( exists($c->req->params->{'username'})) {
22 0 0       0 if ( $c->authenticate({ username => $c->req->params->{'username'},
23             password => $c->req->params->{'password'},
24             })) {
25 0         0 $c->response->redirect('/tapper/start');
26 0         0 $c->detach();
27 0         0 return;
28             } else {
29 0         0 $c->stash->{message} = 'Invalid login';
30             }
31             }
32 10     10   77273 }
  10         17  
  10         48  
33              
34              
35             sub logout :Local :Args(0) {
36 0     0 1   my ($self, $c) = @_;
37 0           $c->stash->{template} = 'tapper/user/logout.mas';
38 0           $c->logout();
39 0           $c->response->redirect('/tapper/start');
40 0           $c->detach();
41 0           return;
42 10     10   7460 }
  10         16  
  10         38  
43              
44              
45              
46              
47             1;
48              
49             __END__
50              
51             =pod
52              
53             =encoding UTF-8
54              
55             =head1 NAME
56              
57             Tapper::Reports::Web::Controller::Tapper::User
58              
59             =head1 DESCRIPTION
60              
61             Catalyst Controller .
62              
63             =head1 NAME
64              
65             Tapper::Reports::Web::Controller::Tapper::User - Catalyst Controller for user handling
66              
67             =head1 METHODS
68              
69             All methods described in here expect the object (because they are
70             methods) and the catalyst context (because they are catalyst controller
71             methods) as the first two parameters. The method API documentation will
72             not name these two parameters explicitly.
73              
74             =head2 index
75              
76             =head2 login
77              
78             =head2 logout
79              
80             =head1 AUTHOR
81              
82             AMD OSRC Tapper Team, C<< <tapper at amd64.org> >>
83              
84             =head1 LICENSE
85              
86             This program is released under the following license: freebsd
87              
88             =head1 AUTHORS
89              
90             =over 4
91              
92             =item *
93              
94             AMD OSRC Tapper Team <tapper@amd64.org>
95              
96             =item *
97              
98             Tapper Team <tapper-ops@amazon.com>
99              
100             =back
101              
102             =head1 COPYRIGHT AND LICENSE
103              
104             This software is Copyright (c) 2017 by Advanced Micro Devices, Inc..
105              
106             This is free software, licensed under:
107              
108             The (two-clause) FreeBSD License
109              
110             =cut