OpenFrame::WebApp::User - users for OpenFrame-WebApp


OpenFrame-WebApp documentation Contained in the OpenFrame-WebApp distribution.

Index


Code Index:

NAME

Top

OpenFrame::WebApp::User - users for OpenFrame-WebApp

SYNOPSIS

Top

  use OpenFrame::WebApp::User;

  my $user = new OpenFrame::WebApp::User()->id('fred2003');

DESCRIPTION

Top

The OpenFrame::WebApp::User class implements a very basic user with an identifier, and nothing more. This class exists to be sub-classed to suit your application's needs.

This class was meant to be used with OpenFrame::WebApp::User::Factory.

METHODS

Top

$user->id

set/get the user id. chosen over 'login' and 'name' as these can have other menaings & actions associated with them.

SUB-CLASSING

Top

Read through the source of this package and the known sub-classes first. The minumum you need to do is this:

  use base qw( OpenFrame::WebApp::User );

  OpenFrame::WebApp::User->types->{my_type} = __PACKAGE__;

You must register your user type if you want to use the User::Factory.

AUTHOR

Top

Steve Purkis <spurkis@epn.nu>

COPYRIGHT

Top

SEE ALSO

Top

OpenFrame::WebApp::User::Factory, OpenFrame::WebApp::Segment::User::Loader


OpenFrame-WebApp documentation Contained in the OpenFrame-WebApp distribution.
package OpenFrame::WebApp::User;

use strict;
use warnings::register;

our $VERSION = (split(/ /, '$Revision: 1.5 $'))[1];

use base qw( OpenFrame::Object );

our $TYPES = { webapp => __PACKAGE__ };

sub types {
    my $self = shift;
    if (@_) {
	$TYPES = shift;
	return $self;
    } else {
	return $TYPES;
    }
}

sub id {
    my $self = shift;
    if (@_) {
	$self->{user_id} = shift;
	return $self;
    } else {
	return $self->{user_id};
    }
}

1;