File Coverage

blib/lib/OpenFrame/WebApp/User.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             OpenFrame::WebApp::User - users for OpenFrame-WebApp
4              
5             =head1 SYNOPSIS
6              
7             use OpenFrame::WebApp::User;
8              
9             my $user = new OpenFrame::WebApp::User()->id('fred2003');
10              
11             =cut
12              
13             package OpenFrame::WebApp::User;
14              
15 1     1   62026 use strict;
  1         3  
  1         48  
16 1     1   6 use warnings::register;
  1         2  
  1         477  
17              
18             our $VERSION = (split(/ /, '$Revision: 1.5 $'))[1];
19              
20 1     1   8 use base qw( OpenFrame::Object );
  1         3  
  1         1547  
21              
22             our $TYPES = { webapp => __PACKAGE__ };
23              
24             sub types {
25             my $self = shift;
26             if (@_) {
27             $TYPES = shift;
28             return $self;
29             } else {
30             return $TYPES;
31             }
32             }
33              
34             sub id {
35             my $self = shift;
36             if (@_) {
37             $self->{user_id} = shift;
38             return $self;
39             } else {
40             return $self->{user_id};
41             }
42             }
43              
44             1;
45              
46             =head1 DESCRIPTION
47              
48             The C class implements a I basic user with an
49             identifier, and nothing more. This class exists to be sub-classed to suit
50             your application's needs.
51              
52             This class was meant to be used with L.
53              
54             =head1 METHODS
55              
56             =over 4
57              
58             =item $user->id
59              
60             set/get the user id. chosen over 'login' and 'name' as these can have other
61             menaings & actions associated with them.
62              
63             =back
64              
65             =head1 SUB-CLASSING
66              
67             Read through the source of this package and the known sub-classes first.
68             The minumum you need to do is this:
69              
70             use base qw( OpenFrame::WebApp::User );
71              
72             OpenFrame::WebApp::User->types->{my_type} = __PACKAGE__;
73              
74             You must register your user type if you want to use the User::Factory.
75              
76             =head1 AUTHOR
77              
78             Steve Purkis
79              
80             =head1 COPYRIGHT
81              
82             Copyright (c) 2003 Steve Purkis. All rights reserved.
83             Released under the same license as Perl itself.
84              
85             =head1 SEE ALSO
86              
87             L,
88             L
89              
90             =cut