Line | |
---|
1 | package LATMOS::Accounts::Web::Controller::Login; |
---|
2 | use Moose; |
---|
3 | use namespace::autoclean; |
---|
4 | |
---|
5 | BEGIN { extends 'Catalyst::Controller'; } |
---|
6 | |
---|
7 | =head1 NAME |
---|
8 | |
---|
9 | LATMOS::Accounts::Web::Controller::Login - Catalyst Controller |
---|
10 | |
---|
11 | =head1 DESCRIPTION |
---|
12 | |
---|
13 | Catalyst Controller. |
---|
14 | |
---|
15 | =head1 METHODS |
---|
16 | |
---|
17 | =cut |
---|
18 | |
---|
19 | sub begin : Private { |
---|
20 | return 1; |
---|
21 | } |
---|
22 | |
---|
23 | =head2 index |
---|
24 | |
---|
25 | =cut |
---|
26 | |
---|
27 | sub index :Path :Args(0) { |
---|
28 | my ( $self, $c ) = @_; |
---|
29 | |
---|
30 | my $sslid = $c->config->{ssl}->{SSL_ID} || 'HTTP_SSL_CLIENT_S_DN_EMAIL'; |
---|
31 | $c->stash->{sslid} = $ENV{$sslid}; |
---|
32 | |
---|
33 | if ($c->req->param('username')) { |
---|
34 | if ($c->authenticate({ |
---|
35 | username => $c->req->param('username') || '', |
---|
36 | password => $c->req->param('password') || '', |
---|
37 | ssl => $c->req->param('use_ssl') || '', |
---|
38 | })) { |
---|
39 | my $redirurl = $c->session->{redirurl}; |
---|
40 | $redirurl->query_form(%{ $c->session->{redirparam} || {}}); |
---|
41 | $c->session->{redirurl} = undef; |
---|
42 | $c->session->{redirparam} = undef; |
---|
43 | $c->res->redirect($redirurl || $c->uri_for('/'), ); |
---|
44 | } else { |
---|
45 | # invalid login... |
---|
46 | } |
---|
47 | } |
---|
48 | } |
---|
49 | |
---|
50 | =encoding utf8 |
---|
51 | |
---|
52 | =head1 AUTHOR |
---|
53 | |
---|
54 | Olivier Thauvin,Guyancourt - B1428,+33 1 80285052, |
---|
55 | |
---|
56 | =head1 LICENSE |
---|
57 | |
---|
58 | This library is free software. You can redistribute it and/or modify |
---|
59 | it under the same terms as Perl itself. |
---|
60 | |
---|
61 | =cut |
---|
62 | |
---|
63 | __PACKAGE__->meta->make_immutable; |
---|
64 | |
---|
65 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.