-
-
17 Dec 2015 02:49:35 UTC
- Distribution: Rubric
- Module version: 0.156
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (397 / 12 / 0)
- Kwalitee
Bus factor: 1- 77.46% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (75.24KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- App::Cmd
- App::Cmd::Command
- App::Cmd::Command::commands
- CGI::Application
- CGI::Carp
- CGI::Cookie
- Carp
- Class::Accessor
- Class::DBI
- Class::DBI::AbstractSearch
- Class::DBI::utf8
- Crypt::CBC
- Crypt::Rijndael
- DBI
- Date::Span
- DateTime
- Digest::MD5
- Email::Address
- Email::Sender::Simple
- Encode
- File::ShareDir
- File::Spec
- HTML::CalendarMonth
- HTML::TagCloud
- HTML::Widget::Factory
- JSON
- LWP::Simple
- MIME::Base64
- Scalar::Util
- String::TagString
- String::Truncate
- Sub::Exporter
- Template
- Template::Filters
- Template::Plugin::Class
- Time::Piece
- YAML::XS
- base
- parent
- strict
- warnings
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Rubric::WebApp::Login - web login processing
VERSION
version 0.156
DESCRIPTION
This module checks for information needed to confirm that a user is logged into the Rubric.
METHODS
Rubric::WebApp::Login->check_for_login($webapp)
This method is called by the WebApp's
cgiapp_init
, and checks for a login attempt in the submitted request.It looks for a login username by calling
get_login_username
, then converts the login name to a Rubric name by callingmap_username
and returns immediately if the name can't be shown valid by callingvalid_username
.It retrieves the User object by calling
get_login_user
or, if needed,autocreate_user
, and returns if it can't get a User object. It tries to authenticate by callingauthenticate_login
. If the user is authorized but isn't verified, he won't be logged in and theuser_pending
parameter will be set on the Rubric::WebApp object. Otherwise, he will be logged in withset_current_user
.Most of the methods above are virtual methods in this class, and should be implemented in subclasses. The bundled Rubric::WebApp::Login::Post (the default) and Rubric::WebApp::Login::HTTP serve as examples.
get_login_username($webapp)
This method returns the login username taken from the request. It is not necessarily the name of a Rubric user (see
map_username
).This must be implemented by the login subclass.
map_username($username)
This method returns the Rubric username to which the login name maps. By default, it returns the
$username
verbatim.valid_username($username)
Returns a true or false value, depending on whether the given username string is a valid username.
get_login_user($username)
Given a username, this method returns the Rubric::User object for the user.
autocreate_user($username)
If
get_login_user
can't find a user, this method is called to try to create the user automatically. By default, it always returns nothing. It may be subclassed for implementation. (For example, one could create domain users from a directory.)authenticate_login($webapp, $user)
This method attempts to authenticate the user's login, checking the given password or performing any other needed check. It returns true or false.
This must be implemented by the login subclass.
set_current_user($webapp, $user)
This method sets the current user on the WebApp by setting the WebApp's "current_user" attribute to the Rubric::User object.
AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2004 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Rubric, copy and paste the appropriate command in to your terminal.
cpanm Rubric
perl -MCPAN -e shell install Rubric
For more information on module installation, please visit the detailed CPAN module installation guide.