Pangloss::Segment::UserLoader - load current user.


Pangloss documentation Contained in the Pangloss distribution.

Index


Code Index:

NAME

Top

Pangloss::Segment::UserLoader - load current user.

SYNOPSIS

Top

  $pipe->add_segment( Pangloss::Segment::UserLoader->new )

DESCRIPTION

Top

This class inherits its interface from Pipeline::Segment.

On dispatch(), tries to load the user from the request. If found, it checks with pangloss to make sure the user is valid, and saves the object in the session.

AUTHOR

Top

Steve Purkis <spurkis@quiup.com>

SEE ALSO

Top

Pangloss::Application::UserEditor


Pangloss documentation Contained in the Pangloss distribution.
package Pangloss::Segment::UserLoader;

use Pangloss::User;

use base qw( OpenFrame::WebApp::Segment::User::RequestLoader
	     OpenFrame::WebApp::Segment::Session );

our $VERSION  = ((require Pangloss::Version), $Pangloss::VERSION)[1];
our $REVISION = (split(/ /, ' $Revision: 1.8 $ '))[2];

sub dispatch {
    my $self    = shift;
    my $app     = $self->store->get('Pangloss::Application') || return;
    my $userid  = $self->look_in_request || return;

    $self->emit("getting user: $userid");

    my $view = $app->user_editor->get( $userid );
    return( $view->{user} );
}

1;

__END__

#------------------------------------------------------------------------------