source: trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Remote.pm @ 1690

Last change on this file since 1690 was 1644, checked in by nanardon, 8 years ago

Fix access to remote/ url

File size: 1.0 KB
Line 
1package LATMOS::Accounts::Web::Controller::Remote;
2use Moose;
3use namespace::autoclean;
4
5BEGIN { extends 'Catalyst::Controller'; }
6
7=head1 NAME
8
9LATMOS::Accounts::Web::Controller::Remote - Catalyst Controller
10
11=head1 DESCRIPTION
12
13Catalyst Controller.
14
15=head1 METHODS
16
17=cut
18
19sub begin : Private { }
20
21sub 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
36sub index :Path :Args(0) {
37    my ( $self, $c ) = @_;
38
39    $c->response->body('Matched LATMOS::Accounts::Web::Controller::Remote in Remote.');
40}
41
42sub 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
52Olivier Thauvin,Guyancourt - B1428,+33 1 80285052,
53
54=head1 LICENSE
55
56This library is free software. You can redistribute it and/or modify
57it under the same terms as Perl itself.
58
59=cut
60
61__PACKAGE__->meta->make_immutable;
62
631;
Note: See TracBrowser for help on using the repository browser.