[Catalyst] tutorial problem : adding an auto action

Daniel McBrearty danielmcbrearty at gmail.com
Sun Mar 5 20:16:50 CET 2006


yes, that makes sense ... thanks Phaylon.


On 3/5/06, phaylon <phaylon at dunkelheit.at> wrote:
>
> Daniel McBrearty wrote:
>
> > sub auto : Private {
> >     my ( $self, $c ) = @_;
> >     if ( !$c->user ) {
> >     $c->res->redirect( '/users/login' ); # require login
> >     return 0; # abort request and go immediately to end()
> >     }
> >     return 1; # success; carry on to next action
> > }
>
> > 1. how to make the TT forwarding work without triggering an error if the
> > body of the page is empty? This should be possible, right?
>
> I'd recommend using the DefaultEnd plugin, which also checks
> $c->response->status for you.
>
> > 2. why I get this browser error about redirection limit, and how to fix
> it?
>
> Your auto action redirects *every* access to /users/login, which
> includes calls of /users/login. So a check for action or path should do
> the trick.
>
> hth, p
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>



--
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060305/0aaf5c57/attachment.htm 


More information about the Catalyst mailing list