Line | |
---|
1 | package LATMOS::Accounts::Web::Controller::Remote; |
---|
2 | use Moose; |
---|
3 | use namespace::autoclean; |
---|
4 | |
---|
5 | BEGIN { extends 'Catalyst::Controller'; } |
---|
6 | |
---|
7 | =head1 NAME |
---|
8 | |
---|
9 | LATMOS::Accounts::Web::Controller::Remote - Catalyst Controller |
---|
10 | |
---|
11 | =head1 DESCRIPTION |
---|
12 | |
---|
13 | Catalyst Controller. |
---|
14 | |
---|
15 | =head1 METHODS |
---|
16 | |
---|
17 | =cut |
---|
18 | |
---|
19 | sub begin : Private { } |
---|
20 | |
---|
21 | sub auto : Private { |
---|
22 | my ( $self, $c ) = @_; |
---|
23 | |
---|
24 | if ($c->user_exists) { |
---|
25 | # Set login user: |
---|
26 | $c->model('Accounts')->db->{_user} = $c->user->{username}; |
---|
27 | } |
---|
28 | |
---|
29 | return 1; |
---|
30 | } |
---|
31 | |
---|
32 | =head2 index |
---|
33 | |
---|
34 | =cut |
---|
35 | |
---|
36 | sub index :Path :Args(0) { |
---|
37 | my ( $self, $c ) = @_; |
---|
38 | |
---|
39 | $c->response->body('Matched LATMOS::Accounts::Web::Controller::Remote in Remote.'); |
---|
40 | } |
---|
41 | |
---|
42 | sub end : Private { |
---|
43 | my ( $self, $c ) = @_; |
---|
44 | $c->stash->{data} ||= {}; |
---|
45 | $c->forward($c->view('Json')); |
---|
46 | } |
---|
47 | |
---|
48 | =encoding utf8 |
---|
49 | |
---|
50 | =head1 AUTHOR |
---|
51 | |
---|
52 | Olivier Thauvin,Guyancourt - B1428,+33 1 80285052, |
---|
53 | |
---|
54 | =head1 LICENSE |
---|
55 | |
---|
56 | This library is free software. You can redistribute it and/or modify |
---|
57 | it under the same terms as Perl itself. |
---|
58 | |
---|
59 | =cut |
---|
60 | |
---|
61 | __PACKAGE__->meta->make_immutable; |
---|
62 | |
---|
63 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.