Name

CatalystX::Usul::Model::Identity::Users - Manager user data stores

Version

0.1.$Revision: 418 $

Synopsis

use CatalystX::Usul::Model::Identity::Users::DBIC;

my $class    = CatalystX::Usul::Model::Identity::Users::DBIC;
my $user_obj = $class->new( $app, $config );

Description

Implements the base class for user data stores. Each factory subclass should inherit from this and implement the required list of methods

Subroutines/Methods

new

Constructor initialises these attributes

app_name

Name of the application using this identity model. Prefixes the subject line of the account activation email sent to users who create an account via the registration method

field_defaults

A hashref of the user object attributes and their default values

fs_model

An instance of CatalystX::Usul::FileSystem used by the "user_report_form" method to list the available user reports

mail_domain

The default email domain used when users are created and a specific email address is not supplied

rprtdir

Location in the filesystem of the user reports

sessdir

Location in the filesystem of used user passwords and account activation keys

activate_account

Checks for the existence of the file created by the "register" method. If it exists it contains the username of a recently created account. The accounts active attribute is set to true, enabling the account

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

authentication_form

Adds fields to the stash for the login screen

authentication_reminder

If the user is unknown this method adds a label field to the stash reminding the user to login

change_password

Method to change the users password. Throws exceptions for field constraint failures and if the passwords entered are not the same

change_password_form

Adds field data to the stash for the change password screen. Allows users to change their own 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

create_or_update

Method to create a new account or update an existing one. Throws exceptions for field constraint failures. Calls methods in the subclass to do the actual work

delete

Deletes the selected account

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. A weakened copy of the self referential object is included in the returned object so that the Catalyst::Authentication plugin can call the "check_password" method

for_session

This method is required by the Catalyst::Authentication::Store API. Removes the copy of the self referential object so that the user object can be serialized for the session store

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 algorithmn 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

get_primary_rid

Returns the primary role id for the given user. Note not all storage models support primary_role ids

get_users_by_rid

Returns the list of users that share the given primary role id

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

purge

Delete the list of selected accounts

register

Create the self registered account. The account is created in an inactive state and a confirmation email is sent

register_form

Added the fields to the stash for the self registration screen. Users can use this screen to create their own accounts

retrieve

Returns a user object for the selected user and a list of usernames

set_password

Sets the users password to a given value

update_password

Updates the users password only if the new one has not been used before or there is an administrative override

user_fill

Sets the fill attribute of the stash in response to clicking the auto fill button

user_manager_form

Adds fields to the stash for the user management screen. Adminstrators can create new accounts or modify the details of existing ones

user_report_execute

Creates a report of the user accounts in this realm

user_report_form

View either the list of available account reports or the contents of a specific report

user_security_form

Add fields to the stash for the security administration screen. From here administrators can reset passwords and change the list of roles to which the selected user belongs

Diagnostics

None

Configuration and Environment

None

Dependencies

CatalystX::Usul::Model
CatalystX::Usul::Model::FileSystem
Class::Null
Crypt::PasswdMD5
Scalar::Util
Sys::Hostname
XML::Simple

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>

License and Copyright

Copyright (c) 2008 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