GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CATALYST::ACTIONROLE::NEEDSLOGIN (3)

.ds Aq ’

NAME

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

CONTENTS

SYNOPSIS



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



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::TraitFor::Controller::Login::WithRedirect
CatalystX::SimpleLogin::Controller::Login
CatalystX::SimpleLogin::Form::Login

AUTHORS

See CatalystX::SimpleLogin for authors.

LICENSE

See CatalystX::SimpleLogin for license.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CATALYST::ACTIONROLE::NEEDSLOGIN (3) 2012-07-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.