1 package SMMID
::Controller
::Root
;
5 use parent
'Catalyst::Controller';
9 # Sets the actions in this controller to be registered with no prefix
10 # so they function identically to actions created in MyApp.pm
12 __PACKAGE__
->config->{namespace
} = '';
16 SMMID::Controller::Root - Root Controller for SMMID
20 [enter your description here]
36 #unless( $c->config->{'disable_login'} ) {
37 my $login = SMMID
::Login
->new( { schema
=> $c->model("SMIDDB")->schema() });
39 if (exists($c->req->cookies->{smmid_session_id
})) {
40 $login->cookie_string($c->req->cookies->{smmid_session_id
}->value());
43 if ( my $dbuser_id = $login->has_session()) {
45 print STDERR
"We have a logged in user! :-)\n";
46 my $dbuser = $c->model("SMIDDB")->resultset("SMIDDB::Result::Dbuser")->find( { dbuser_id
=> $dbuser_id });
47 print STDERR
"The logged in user is ".$dbuser->username()."\n";
49 my $user = SMMID
::Authentication
::User
->new();
51 $c->user()->set_object($dbuser);
53 # $self->authenticate($c, 'default', {
54 # username => $dbuser->username(),
55 # password => $dbuser->password(),
62 sub index :Path
:Args
(0) {
63 my ( $self, $c ) = @_;
66 $c->stash->{template
} = 'index.mas';
70 my ( $self, $c ) = @_;
71 $c->response->body( 'Page not found' );
72 $c->response->status(404);
76 sub contact
:Path
('/contact') :Args
(0) {
80 sub cite
: Path
('/cite') Args
(0) {
84 sub about
:Path
('/about') :Args
(0) {
88 sub download
:Path
('/download') Args
(0) {
92 $c->stash->{template
} = '/download.mas';
97 Attempt to render a view, if needed.
101 sub end
: ActionClass
('RenderView') {}
109 This library is free software, you can redistribute it and/or modify
110 it under the same terms as Perl itself.