X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FCookbook.pod;h=7d7c103e9d4cb5071f2f1f3bc960d76608cb0755;hb=9bee7d3734adfe39c748712670ced0f2b5c90f84;hp=7c6dcf621c25bc8f6294a05311e83a8356fa53c8;hpb=fd59198f81df808d08ec0720d6ef667ef34921ab;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index 7c6dcf6..7d7c103 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -208,7 +208,7 @@ To log in a user you might use an action like this: $c->session_login($c->req->params->{username}, $c->req->params->{password} ); if ($c->req->{user}) { - $c->forward('?restricted_area'); + $c->forward('/restricted_area'); } } } @@ -275,13 +275,13 @@ with: One thing you might need is to forward non-authenticated users to a login form if they try to access restricted areas. If you want to do this controller-wide (if you have one controller for your admin section) then it's -best to add a user check to a '!begin' action: +best to add a user check to a 'begin' action: sub begin : Private { my ($self, $c) = @_; unless ($c->req->{user}) { $c->req->action(undef); ## notice this!! - $c->forward('?login'); + $c->forward('/user/login'); } }