Fixed POD syntax.
This commit is contained in:
parent
4481cbec49
commit
3e89b31e13
28 changed files with 2003 additions and 1657 deletions
|
|
@ -1,14 +1,20 @@
|
|||
package WebGUI::Authentication;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black LLC.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
WebGUI is Copyright 2001-2002 Plain Black LLC.
|
||||
-------------------------------------------------------------------
|
||||
Please read the legal notices (docs/legal.txt) and the license
|
||||
(docs/license.txt) that came with this distribution before using
|
||||
this software.
|
||||
-------------------------------------------------------------------
|
||||
http://www.plainblack.com info@plainblack.com
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
|
||||
use strict qw(vars subs);
|
||||
use WebGUI::ErrorHandler;
|
||||
|
|
@ -16,6 +22,49 @@ use WebGUI::Session;
|
|||
use WebGUI::SQL;
|
||||
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Authentication
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use WebGUI::Authentication;
|
||||
|
||||
$html = WebGUI::Authentication::adminForm($userId,$authMethod);
|
||||
WebGUI::Authentication::adminFormSave($userId,$authMethod);
|
||||
$error = WebGUI::Authentication::adminFormValidate($authMethod);
|
||||
|
||||
$result = WebGUI::Authentication::authenticate($userId,$identifier,$authMethod);
|
||||
|
||||
WebGUI::Authentication::deleteParams($userId);
|
||||
$params = WebGUI::Authentication::getParams($userId,$authMethod);
|
||||
WebGUI::Authentication::saveParams($userId,$authMethod,\%data);
|
||||
|
||||
$label = WebGUI::Authentication::optionsLabel($authMethod);
|
||||
|
||||
$html = WebGUI::Authentication::settingsForm($authMethod);
|
||||
|
||||
$html = WebGUI::Authentication::registrationForm();
|
||||
WebGUI::Authentication::registrationFormSave($userId);
|
||||
$error = WebGUI::Authentication::registrationFormValidate();
|
||||
|
||||
$html = WebGUI::Authentication::userForm();
|
||||
WebGUI::Authentication::userFormSave();
|
||||
$error = WebGUI::Authentication::userFormValidate();
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This package is used to access WebGUI's pluggable authentication system.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These functions are available from this package:
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _execute {
|
||||
my ($authMethod, $function, $params) = @_;
|
||||
|
|
@ -27,17 +76,21 @@ sub _execute {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head adminForm ( userId, authMethod )
|
||||
=head2 adminForm ( userId, authMethod )
|
||||
|
||||
Returns the admin form for the specified authentication method.
|
||||
Returns the admin form for the specified authentication method.
|
||||
|
||||
=over
|
||||
|
||||
=item userId
|
||||
|
||||
This user's id.
|
||||
This user's id.
|
||||
|
||||
=item authMethod
|
||||
|
||||
Specify the authentication method.
|
||||
Specify the authentication method.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -49,17 +102,21 @@ sub adminForm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head adminFormSave ( userId, authMethod )
|
||||
=head2 adminFormSave ( userId, authMethod )
|
||||
|
||||
Saves the specified user's authentication information to the database.
|
||||
Saves the specified user's authentication information to the database.
|
||||
|
||||
=over
|
||||
|
||||
=item userId
|
||||
|
||||
The user id to save the information for.
|
||||
The user id to save the information for.
|
||||
|
||||
=item authMethod
|
||||
|
||||
Specify the authentication method.
|
||||
Specify the authentication method.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -71,13 +128,17 @@ sub adminFormSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head adminFormValidate ( authMethod )
|
||||
=head2 adminFormValidate ( authMethod )
|
||||
|
||||
Returns an error string if there are any problems with the form data.
|
||||
Returns an error string if there are any problems with the form data.
|
||||
|
||||
=over
|
||||
|
||||
=item authMethod
|
||||
|
||||
Specify the authentication method.
|
||||
Specify the authentication method.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -88,23 +149,25 @@ sub adminFormValidate {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head authenticate ( userId, identifier, authMethod )
|
||||
=head2 authenticate ( userId, identifier, authMethod )
|
||||
|
||||
Check to see that the user supplied information is correct. Returns
|
||||
"1" if successful otherwise it returns an error message.
|
||||
Check to see that the user supplied information is correct. Returns "1" if successful otherwise it returns an error message.
|
||||
|
||||
=over
|
||||
|
||||
=item userId
|
||||
|
||||
The user to authenticate.
|
||||
The user to authenticate.
|
||||
|
||||
=item identifier
|
||||
|
||||
The password, pass phrase, PIN, or other unique identifier to
|
||||
verify this user.
|
||||
The password, pass phrase, PIN, or other unique identifier to verify this user.
|
||||
|
||||
=item authMethod
|
||||
|
||||
The type of authentication to use to authenticate this user.
|
||||
The type of authentication to use to authenticate this user.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -115,15 +178,17 @@ sub authenticate {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head deleteParams ( userId )
|
||||
=head2 deleteParams ( userId )
|
||||
|
||||
Removes the specified user's authentication parameters from the
|
||||
database for all authentication methods. This is primarily useful
|
||||
when deleting the user's account.
|
||||
Removes the specified user's authentication parameters from the database for all authentication methods. This is primarily useful when deleting the user's account.
|
||||
|
||||
=over
|
||||
|
||||
=item userId
|
||||
|
||||
The user id for the user to have the parameters deleted.
|
||||
The user id for the user to have the parameters deleted.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -137,18 +202,21 @@ sub deleteParams {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head getParams ( userId [ , authMethod ] )
|
||||
=head2 getParams ( userId [ , authMethod ] )
|
||||
|
||||
Returns an error string if there are any problems with the form data.
|
||||
Returns a hash reference with the user's authentication information.
|
||||
|
||||
=over
|
||||
|
||||
=item userId
|
||||
|
||||
Specify a user id.
|
||||
Specify a user id.
|
||||
|
||||
=item authMethod
|
||||
|
||||
Optionally specify the authentication method. Defaults to the system-wide
|
||||
authentication method.
|
||||
Optionally specify the authentication method. Defaults to the system-wide authentication method.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -163,14 +231,17 @@ sub getParams {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head optionsLabel ( authMethod )
|
||||
=head2 optionsLabel ( authMethod )
|
||||
|
||||
Returns a label that can be displayed to describe the settings for
|
||||
this auth method.
|
||||
Returns a label that can be displayed to describe the settings for this auth method.
|
||||
|
||||
=over
|
||||
|
||||
=item authMethod
|
||||
|
||||
The authentication method.
|
||||
The authentication method.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -182,9 +253,9 @@ sub optionsLabel {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head registrationForm ( )
|
||||
=head2 registrationForm ( )
|
||||
|
||||
Returns the user registration form for the default auth method.
|
||||
Returns the user registration form for the default auth method.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -195,14 +266,17 @@ sub registrationForm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head registrationFormSave ( userId )
|
||||
=head2 registrationFormSave ( userId )
|
||||
|
||||
Creates the appropriate values in the database for this user based
|
||||
upon their registration information.
|
||||
Creates the appropriate values in the database for this user based upon their registration information.
|
||||
|
||||
=over
|
||||
|
||||
=item userId
|
||||
|
||||
The user id to store with the registration data.
|
||||
The user id to store with the registration data.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -213,9 +287,9 @@ sub registrationFormSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head registrationFormValidate ( )
|
||||
=head2 registrationFormValidate ( )
|
||||
|
||||
Returns an error string if there are any problems with the form data.
|
||||
Returns an error string if there are any problems with the form data.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -227,13 +301,17 @@ sub registrationFormValidate {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head settingsForm ( authMethod )
|
||||
=head2 settingsForm ( authMethod )
|
||||
|
||||
Returns a form for the WebGUI settings area.
|
||||
Returns a form for the WebGUI settings area.
|
||||
|
||||
=over
|
||||
|
||||
=item authMethod
|
||||
|
||||
The authentication method to display the form for.
|
||||
The authentication method to display the form for.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -245,21 +323,25 @@ sub settingsForm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head saveParams ( userId, authMethod, data )
|
||||
=head2 saveParams ( userId, authMethod, data )
|
||||
|
||||
Saves the user's authentication parameters to the database.
|
||||
Saves the user's authentication parameters to the database.
|
||||
|
||||
=over
|
||||
|
||||
=item userId
|
||||
|
||||
Specify a user id.
|
||||
Specify a user id.
|
||||
|
||||
=item authMethod
|
||||
|
||||
Specify the authentication method to save these paramaters under.
|
||||
Specify the authentication method to save these paramaters under.
|
||||
|
||||
=item data
|
||||
|
||||
A hash reference containing parameter names and values to be saved.
|
||||
A hash reference containing parameter names and values to be saved.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -276,9 +358,9 @@ sub saveParams {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head userForm ( )
|
||||
=head2 userForm ( )
|
||||
|
||||
Returns the user authentication data form.
|
||||
Returns the user authentication data form.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -290,9 +372,9 @@ sub userForm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head userFormSave ( )
|
||||
=head2 userFormSave ( )
|
||||
|
||||
Saves user form data to the database.
|
||||
Saves user form data to the database.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -303,9 +385,9 @@ sub userFormSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head userFormValidate ( )
|
||||
=head2 userFormValidate ( )
|
||||
|
||||
Returns an error string if there are any problems with the form data.
|
||||
Returns an error string if there are any problems with the form data.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue