source: trunk/lib/Vote/Controller/Admin.pm @ 16

Last change on this file since 16 was 16, checked in by nanardon, 15 years ago
  • add admin interface
File size: 725 bytes
Line 
1package Vote::Controller::Admin;
2
3use strict;
4use warnings;
5use base 'Catalyst::Controller';
6
7=head1 NAME
8
9Vote::Controller::Admin - Catalyst Controller
10
11=head1 DESCRIPTION
12
13Catalyst Controller.
14
15=head1 METHODS
16
17=cut
18
19
20=head2 index
21
22=cut
23
24sub index : Private {
25    my ( $self, $c ) = @_;
26
27}
28
29sub default : Private {
30    my ( $self, $c, undef, $id ) = @_;
31    $c->stash->{voteid} = $id;
32
33    # can't modify vote after date
34    if ($c->model('Vote')->vote_status($id) ne 'BEFORE') {
35        $c->stash->{template} = 'admin/denied.tt';
36        return;
37    }
38}
39
40=head1 AUTHOR
41
42Thauvin Olivier
43
44=head1 LICENSE
45
46This library is free software, you can redistribute it and/or modify
47it under the same terms as Perl itself.
48
49=cut
50
511;
Note: See TracBrowser for help on using the repository browser.