diff options
Diffstat (limited to 'GroLUG/lib/GroLUG/C/Iscritti.pm')
-rw-r--r-- | GroLUG/lib/GroLUG/C/Iscritti.pm | 58 |
1 files changed, 17 insertions, 41 deletions
diff --git a/GroLUG/lib/GroLUG/C/Iscritti.pm b/GroLUG/lib/GroLUG/C/Iscritti.pm index d79aea6..3afc852 100644 --- a/GroLUG/lib/GroLUG/C/Iscritti.pm +++ b/GroLUG/lib/GroLUG/C/Iscritti.pm @@ -4,46 +4,22 @@ use strict; use warnings; use base 'Catalyst::Controller'; -=head1 NAME - -GroLUG::C::Iscritti - Catalyst Controller - -=head1 SYNOPSIS - -See L<GroLUG> - -=head1 DESCRIPTION - -Catalyst Controller. - -=head1 METHODS - -=cut - -# -# Uncomment and modify this or add new actions to fit your needs -# -#=head2 default -# -#=cut -# -#sub default : Private { -# my ( $self, $c ) = @_; -# -# # Hello World -# $c->response->body('GroLUG::C::Iscritti is on Catalyst!'); -#} - - -=head1 AUTHOR - -A clever guy - -=head1 LICENSE - -This library is free software, you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut +sub login :Global { + my ( $self, $c ) = @_; + + if ($c->login) { + $c->res->redirect($c->uri_for('/iscritti')); + } + else { + $c->stash->{template}='login.tt2'; + } +} + +sub index :Private { + my ( $self, $c ) = @_; + + $c->stash->{iscritti}=GroLUG::M::DB->resultset('Iscritto')->search({attivo=>1}); + $c->stash->{template}='lista-iscritti.tt2'; +} 1; |