| Pangloss documentation | Contained in the Pangloss distribution. |
Pangloss::Segment::UserLoader - load current user.
$pipe->add_segment( Pangloss::Segment::UserLoader->new )
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.
Steve Purkis <spurkis@quiup.com>
| 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__ #------------------------------------------------------------------------------