summaryrefslogtreecommitdiff
path: root/GroLUG/lib/GroLUG.pm
blob: bfc79861606a02345a124dc17b04f2b1242eb3b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package GroLUG; 
use strict;
use warnings;
 
use Catalyst qw{
                ConfigLoader Static::Simple DefaultEnd
                Session Session::Store::DBI Session::State::Cookie
                Authentication Authentication::Store::Htpasswd Authentication::Credential::Password
                Authorization::Roles
                HTML::Widget Unicode
            };
use Catalyst::Log::Log4perl;
 
our $VERSION = '0.01';
 
__PACKAGE__->config->{authentication}->{htpasswd}=__PACKAGE__->path_to('usersfile')->stringify;
__PACKAGE__->setup;
__PACKAGE__->log(Catalyst::Log::Log4perl->new(__PACKAGE__->path_to('logger.conf')->stringify));
 
sub index : Private {
    my ( $self$c ) = @_;
 
    if ($c->user_exists) {
        $c->res->redirect($c->uri_for('/iscritti'));
    }
    else {
        $c->res->redirect($c->uri_for('/login'))
    }
}
 
sub strdate {
    my ($self,$date)=@_;
 
    return (ref $date) ? $date->strftime('%F') : '';
}
 
1;