Apache::Wyrd::Interfaces::GetUser - Get User data from Auth service/Auth Cookies
[in a subclass of Apache::Wyrd::Handler]
sub process { my ($self) =@_; $self->{init}->{user} = $self->user('BASENAME::User'); return FORBIDDEN unless ($self->check_auth($self->{init}->{user})); return; }
Provides a User method that will check both the Apache notes table and the available cookies for a User created by the Apache::Wyrd::Services::Auth module. This is needed by any handler which will need to be informed as to the findings of a stacked Apache::Wyrd::Services::Auth handler.
Apache::Wyrd::Services::Auth
But this method is not limited only to stacked Auth handlers. When the AuthPath SetPerlVar directive of the Apache::Wyrd::Services::Auth module is beyond the scope of the area where the authorization was checked (in other words, the cookie is returned to areas of the site where authorization is not required), this interface is useful for finding what user is browsing the site.
The SYNOPSIS shows the typical use of this interface in a subclass of Apache::Wyrd::Handler.
Apache::Wyrd::Handler
(format: (returns) name (arguments after self))
user
Given a User object classname (such as BASENAME::User), this method revives any User object found by an Auth handler and either placed into the Apache notes table of the current session or in a cookie provided by the browser.
null_user_spec
Because the Apache::Wyrd:Services::Auth framework requires that there must be a user object defined even when no user has logged in, this is a "hook" method for providing minimum initialization of the non-user user object. It is passed the class name of the type of user object being created. Return value is a hashref, defaulting to the empty hash. When there is no login, this method's return value will be passed directly to the new method of the user object as if it were a new login.
new
UNKNOWN
Barry King <wyrd@nospam.wyrdwright.com>
General-purpose HTML-embeddable perl object
Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.
See LICENSE under the documentation for Apache::Wyrd.
Apache::Wyrd
To install Apache::Wyrd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::Wyrd
CPAN shell
perl -MCPAN -e shell install Apache::Wyrd
For more information on module installation, please visit the detailed CPAN module installation guide.