Pangloss::Segment::GetUser - get user.


Pangloss documentation Contained in the Pangloss distribution.

Index


Code Index:

NAME

Top

Pangloss::Segment::GetUser - get user.

SYNOPSIS

Top

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

DESCRIPTION

Top

This class inherits its interface from Pipeline::Segment.

On dispatch(), if the request has a 'get_user' argument, attempts to get the user specified by 'selected_user' and return the resulting view or error.

AUTHOR

Top

Steve Purkis <spurkis@quiup.com>

SEE ALSO

Top

Pangloss::Application::UserEditor


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

use Pangloss::User;

use base qw( Pipeline::Segment );

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

sub dispatch {
    my $self    = shift;
    my $request = $self->store->get('OpenFrame::Request') || return;
    my $app     = $self->store->get('Pangloss::Application') || return;
    my $view    = $self->store->get('Pangloss::Application::View');
    my $args    = $request->arguments;

    if ($args->{get_user}) {
	return $app->user_editor->get( $args->{selected_user}, $view );
    }
}

1;

__END__

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