Query: catalyst::actionrole::needslogin
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Catalyst::ActionRole::NeedsLogin(3pm) User Contributed Perl Documentation Catalyst::ActionRole::NeedsLogin(3pm)NAMECatalyst::ActionRole::NeedsLogin - checks if a user is logged in and if not redirects him to login pageSYNOPSISpackage MyApp::Controller::NeedsAuth; use Moose; use namespace::autoclean; # One needs to inherit from Catalyst::Controller in order # to get the Does('NeedsLogin') functionality. BEGIN { extends 'Catalyst::Controller'; } sub inbox : Path Does('NeedsLogin') { # Redirects to /login if not logged in my ($self, $c) = @_; $c->stash->{template} = "inbox.tt2"; return; } sub inbox : Path Does('NeedsLogin') :LoginRedirectMessage('Your custom Message') { # Redirects to /login if not logged in- } # Turn on in config MyApp->config('Contoller::Login' => { traits => ['WithRedirect'] });DESCRIPTIONProvides a ActionRole for forcing the user to login.WRAPPED METHODSexecute If there is no logged-in user, call the login_redirect() method in the 'Login' controller with the Catalyst context object, $c, and the message specified by the ":LoginRedirectMessage('Message here')" method attribute (see the synopsis). If there is a user logged-in (i.e: "$c->user" is true), execute the body of the action as it is.SEE ALSOCatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect CatalystX::SimpleLogin::Controller::Login CatalystX::SimpleLogin::Form::LoginAUTHORSSee CatalystX::SimpleLogin for authors.LICENSESee CatalystX::SimpleLogin for license. perl v5.14.2 2012-07-15 Catalyst::ActionRole::NeedsLogin(3pm)
Similar Topics in the Unix Linux Community |
---|
Login User |
Duplex Settings |
How to Create Banner/Login Messages in Solaris. |
dtlogin problem? Login incorrect; please try again error |
Need Help in Cutting a word |