Name
CatalystX::Usul::Users - User domain model
Version
0.3.$Revision: 576 $
Synopsis
use CatalystX::Usul::Users;
Description
Implements the base class for user data stores. Each subclass that inherits from this should implement the required list of methods
Subroutines/Methods
new
Constructor initialises these attributes
- field_defaults
-
A hashref of the user object attributes and their default values
- sessdir
-
Path to the directory containing the user password history files and the count of failed login attempts
authenticate
Called by the "check_password" method via the factory subclass. The supplied password is encrypted and compared to the one in storage. Failures are counted and when max_login_trys are exceeded the account is disabled. Errors can be thrown for; unknown user, inactive account, expired password, maximum attempts exceeded and incorrect password
check_password
This method is required by the Catalyst::Authentication::Store API. It calls the factory method in the subclass to check that the supplied password is the correct one
disable_account
Calls update_password to set the users encrypted password to *DISABLED thereby preventing the user from logging in
encrypt_password
$enc_pass = $self->encrypt_password( $force, $user, $old, $new, $encrypted);
Encrypts the new password and returns it. If the encrypted flag is true then new is assumed to be already encrypted and is returned unchanged. The old password is used to authenticate the user unless the force flag is true
find_user
This method is required by the Catalyst::Authentication::Store API. It returns a user object even if the user is unknown. If the user is known a list of roles that the user belongs to is also returned
for_session
This method is required by the Catalyst::Authentication::Store API. Returns the self referential object
get
This method is required by the Catalyst::Authentication::Store API. Field accessor returns undef if the field does not exist, otherwise returns the value of the required field
get_new_user_id
Implements the algorithm that derives the username from the users first name and surname. The supplied prefix from the user profile is prepended to the generated value. If the prefix contains unique domain information then the generated username will be globally unique to the organisation
get_object
This method is required by the Catalyst::Authentication::Store API. Returns the self referential object
id
This method is required by the Catalyst::Authentication::Store API. Returns the username of the user object
is_user
Returns true if the given user exists, false otherwise
retrieve
Returns a user object for the selected user and a list of usernames
Diagnostics
None
Configuration and Environment
None
Dependencies
Incompatibilities
There are no known incompatibilities in this module
Bugs and Limitations
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Author
Peter Flanigan, <Support at RoxSoft.co.uk>
Acknowledgements
Larry Wall - For the Perl programming language
License and Copyright
Copyright (c) 2009 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE