| 1 | package # hide from PAUSE | ||||||||||
| 2 | Hopkins::Plugin::HMI::Catalyst::Controller::Root; | ||||||||||
| 3 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | $Hopkins::Plugin::HMI::Catalyst::Controller::Root::VERSION = '0.900'; | |||||||||
| 5 | } | ||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | =head1 DESCRIPTION | ||||||||||
| 14 | |||||||||||
| 15 | =cut | ||||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | use Sys::Hostname::FQDN 'fqdn'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | 1 | ▶ | use base 'Hopkins::Plugin::HMI::Catalyst::Controller'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | 1 | __PACKAGE__->config->{namespace} = ''; | |||||||||
| 22 | |||||||||||
| 23 | =head1 METHODS | ||||||||||
| 24 | |||||||||||
| 25 | =cut | ||||||||||
| 26 | |||||||||||
| 27 | =over 4 | ||||||||||
| 28 | |||||||||||
| 29 | =item new | ||||||||||
| 30 | |||||||||||
| 31 | =cut | ||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub auto : Private | ||||||||
|
Subroutine
auto: not called CC=2 SCAR=17.9
| |||||||||||
| 34 | { | ||||||||||
| 35 | 0 | my $self = shift; | |||||||||
| 36 | 0 | my $c = shift; | |||||||||
| 37 | |||||||||||
| 38 | 0 | $c->stash->{host} = fqdn; | |||||||||
| 39 | 0 | $c->stash->{now} = DateTime->now(time_zone => 'local'); | |||||||||
| 40 | |||||||||||
| 41 | $c->stash->{version} = | ||||||||||
| 42 | { | ||||||||||
| 43 | 0 | hopkins => $Hopkins::VERSION, | |||||||||
| 44 | plugin => { hmi => $Hopkins::Plugin::HMI::VERSION } | ||||||||||
| 45 | }; | ||||||||||
| 46 | |||||||||||
| 47 | 0 | ▶ | $c->detach('login') if not defined $c->user; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | |||||||||||
| 49 | 0 | 1; | |||||||||
| 50 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | sub default : Private | ||||||||
|
Subroutine
default: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 53 | { | ||||||||||
| 54 | 0 | my $self = shift; | |||||||||
| 55 | 0 | my $c = shift; | |||||||||
| 56 | |||||||||||
| 57 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 58 | |||||||||||
| 59 | 0 | ▶ | sub login : Local | ||||||||
|
Subroutine
login: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 60 | { | ||||||||||
| 61 | 0 | my $self = shift; | |||||||||
| 62 | 0 | my $c = shift; | |||||||||
| 63 | 0 | my $method = $c->req->method; | |||||||||
| 64 | |||||||||||
| 65 | 0 | $c->detach("login_$method"); | |||||||||
| 66 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 67 | |||||||||||
| 68 | 0 | ▶ | sub login_GET : Private | ||||||||
|
Subroutine
login_GET: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 69 | { | ||||||||||
| 70 | 0 | my $self = shift; | |||||||||
| 71 | 0 | my $c = shift; | |||||||||
| 72 | |||||||||||
| 73 | 0 | $c->stash->{template} = 'login.tt'; | |||||||||
| 74 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 75 | |||||||||||
| 76 | 0 | ▶ | sub login_POST : Private | ||||||||
|
Subroutine
login_POST: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 77 | { | ||||||||||
| 78 | 0 | my $self = shift; | |||||||||
| 79 | 0 | my $c = shift; | |||||||||
| 80 | |||||||||||
| 81 | 0 | my $credentials = {}; | |||||||||
| 82 | |||||||||||
| 83 | 0 | $credentials->{username} = scalar $c->req->params->{username}; | |||||||||
| 84 | 0 | $credentials->{password} = scalar $c->req->params->{password}; | |||||||||
| 85 | |||||||||||
| 86 | 0 | ▶ | $c->detach('/default') if $c->authenticate($credentials); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 87 | |||||||||||
| 88 | 0 | $c->stash->{error} = 'login incorrect'; | |||||||||
| 89 | |||||||||||
| 90 | 0 | $c->detach('/login_GET'); | |||||||||
| 91 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 92 | |||||||||||
| 93 | 0 | ▶ | sub status : Local | ||||||||
|
Subroutine
status: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 94 | { | ||||||||||
| 95 | 0 | my $self = shift; | |||||||||
| 96 | 0 | my $c = shift; | |||||||||
| 97 | |||||||||||
| 98 | 0 | $c->stash->{hopkins} = $c->config->{hopkins}; | |||||||||
| 99 | 0 | $c->stash->{template} = 'status.tt'; | |||||||||
| 100 | 1 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 101 | |||||||||||
| 102 | 1 | ▶ | sub end : ActionClass('RenderView') { } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
end: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 103 | |||||||||||
| 104 | =back | ||||||||||
| 105 | |||||||||||
| 106 | =head1 AUTHOR | ||||||||||
| 107 | |||||||||||
| 108 | Mike Eldridge <diz@cpan.org> | ||||||||||
| 109 | |||||||||||
| 110 | =head1 LICENSE | ||||||||||
| 111 | |||||||||||
| 112 | This program is free software; you may redistribute it | ||||||||||
| 113 | and/or modify it under the same terms as Perl itself. | ||||||||||
| 114 | |||||||||||
| 115 | =cut | ||||||||||
| 116 | |||||||||||
| 117 | 1 | 1; | |||||||||