|
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 | |
|---|
| 1 | package # hide from PAUSE |
|---|
| 2 | MyBlog::Controller::Root; |
|---|
| 3 | |
|---|
| 4 | use strict; |
|---|
| 5 | use warnings; |
|---|
| 6 | use 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 | |
|---|
| 14 | sub 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 | |
|---|
| 26 | sub default : Private { |
|---|
| 27 | my($self, $c) = @_; |
|---|
| 28 | $c->res->redirect('html'); |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | sub end : ActionClass('RenderView') {} |
|---|
| 32 | |
|---|
| 33 | 1; |
|---|