summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GroLUG/grolug.yml2
-rw-r--r--GroLUG/lib/GroLUG.pm3
-rw-r--r--GroLUG/lib/GroLUG/C/Iscritto.pm10
3 files changed, 12 insertions, 3 deletions
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 ) = @_;