Catalyst::ActionRole::NeedsLogin man page on Pidora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Pidora logo
[printable version]

Catalyst::ActionRole::UsersContributed PerlCatalyst::ActionRole::NeedsLogin(3)

NAME
       Catalyst::ActionRole::NeedsLogin - checks if a user is logged in and if
       not redirects him to login page

SYNOPSIS
	   package MyApp::Controller::NeedsAuth;

	   use Moose;
	   use namespace::autoclean;

	   # One needs to inherit from Catalyst::Controller::ActionRole in order
	   # to get the Does('NeedsLogin') functionality.
	   BEGIN { extends 'Catalyst::Controller::ActionRole'; }

	   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'] });

DESCRIPTION
       Provides a ActionRole for forcing the user to login.

WRAPPED METHODS
   execute
       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 ALSO
       CatalystX::SimpleLogin::ControllerRole::Login::WithRedirect
       CatalystX::SimpleLogin::ControllerRole::Login
       CatalystX::SimpleLogin::Form::Login

AUTHORS
       See CatalystX::SimpleLogin for authors.

LICENSE
       See CatalystX::SimpleLogin for license.

perl v5.14.1			  2011-09-0Catalyst::ActionRole::NeedsLogin(3)
[top]

List of man pages available for Pidora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net