root/lang/perl/Catalyst-Controller-Atompub/trunk/samples/MyBlog/lib/MyBlog/Controller/Root.pm @ 8062

Revision 8062, 0.7 kB (checked in by takemaru, 5 years ago)

lang/perl/Catalyst-Controller-Atompub: 0.4.0 rc1. major refactoring etc., see Changes in details

Line 
1package # hide from PAUSE
2    MyBlog::Controller::Root;
3
4use strict;
5use warnings;
6use base qw(Catalyst::Controller);
7
8#
9# Sets the actions in this controller to be registered with no prefix
10# so they function identically to actions created in MyApp.pm
11#
12__PACKAGE__->config->{namespace} = '';
13
14sub auto :Private {
15    my($self, $c) = @_;
16
17    # authentication not required, if GET
18    return 1 if $c->req->method eq 'GET' || $c->req->method eq 'HEAD';
19
20    my $realm = $c->config->{authentication}{http}{realm};
21    $c->authorization_required(realm => $realm);
22
23    1;
24}
25
26sub default : Private {
27    my($self, $c) = @_;
28    $c->res->redirect('html');
29}
30
31sub end : ActionClass('RenderView') {}
32
331;
Note: See TracBrowser for help on using the browser.