#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package BookPub::User::Command::Show;

use lib '/app/tools/common/lib';
use RSApache::Response::XSLT;

use lib '/app/tools/bookpub/lib';
use BookPub::User::Form;
use base 'BookPub::Command';

sub cmd  { return "show"; }
sub area { return "user"; }

sub pageName { return 'View User'; }

sub _template() { return '/app/tools/bookpub/templates/user/show.xsl'; }

sub execute {
    my ($self) = @_;

    # Give any inherited methods the first crack at this.
    # (This checks for login and basic access permissions).
    #
    my $response = $self->SUPER::execute();
    return $response if $response;

    my $id = $self->getParam("UserID");
    my $form = BookPub::User::Form->new( userID => $id, accessLevel => $self->_getUser()->AccessLevel() );

    $self->{xml}{Form} = $form;

    $response = RSApache::Response::XSLT->new( $self->{xml}, $self->_template() );
    return $response;
}

1;
