From a156daaa7cb3234ce878d5dc3dc0761f2cbf6a1e Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 12 Feb 2006 17:05:10 +0000 Subject: r1314@narval: dakkar | 2006-02-10 19:50:50 +0100 bugfix: ora trova il file degli utenti, qualunque sia CWD bugfix: un utente non loggato viene sempre redirected a /login git-svn-id: svn://luxion/repos/IscrittiGroLUG/trunk@182 fcb26f47-9200-0410-b104-b98ab5b095f3 --- GroLUG/grolug.yml | 2 -- GroLUG/lib/GroLUG.pm | 3 ++- GroLUG/lib/GroLUG/C/Iscritto.pm | 10 ++++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'GroLUG') diff --git a/GroLUG/grolug.yml b/GroLUG/grolug.yml index 5172eef..589c0f8 100644 --- a/GroLUG/grolug.yml +++ b/GroLUG/grolug.yml @@ -6,8 +6,6 @@ session: expires: 3600 dbi_dbh: 'GroLUG::M::DB' dbi_table: 'sessioni' -authentication: - htpasswd: usersfile iscrizione: prezzo: 50 durata: diff --git a/GroLUG/lib/GroLUG.pm b/GroLUG/lib/GroLUG.pm index 4561d00..65a76a5 100644 --- a/GroLUG/lib/GroLUG.pm +++ b/GroLUG/lib/GroLUG.pm @@ -13,8 +13,9 @@ 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)); +__PACKAGE__->log(Catalyst::Log::Log4perl->new(__PACKAGE__->path_to('logger.conf')->stringify)); sub index : Private { my ( $self, $c ) = @_; diff --git a/GroLUG/lib/GroLUG/C/Iscritto.pm b/GroLUG/lib/GroLUG/C/Iscritto.pm index 3e733ca..f3b9975 100644 --- a/GroLUG/lib/GroLUG/C/Iscritto.pm +++ b/GroLUG/lib/GroLUG/C/Iscritto.pm @@ -5,6 +5,16 @@ use warnings; use base 'Catalyst::Controller'; use DateTime; +sub auto :Private { + my ( $self, $c ) = @_; + + unless ($c->user_exists) { + $c->res->redirect($c->uri_for('/login')); + return; + } + return 1; +} + sub iscritti :Global { my ( $self, $c ) = @_; -- cgit v1.2.3