CatalystX::Usul::Model::Users - Catalyst user model
Describes v0.16.$Rev: 1 $
package YourApp; use Catalyst qw(ConfigComponents...); __PACKAGE__->config( 'Model::UsersDBIC' => { parent_classes => 'CatalystX::Usul::Model::Users', domain_attributes => { dbic_user_class => 'Authentication::Users', dbic_role_class => 'Authentication::Roles', dbic_user_roles_class => 'Authentication::UserRoles', role_class => 'CatalystX::Usul::Roles::DBIC', }, domain_class => 'CatalystX::Usul::Users::DBIC', role_model_class => 'RolesDBIC', template_attributes => { COMPILE_DIR => '__appldir(var/tmp)__', INCLUDE_PATH => '__appldir(var/root/templates)__', }, }, );
Forms and actions for user maintenance
Defines the following list of attributes;
default_realm
A required non-empty simple string. The name of the default authentication realm
email_attributes
A hash ref used to provide static config for the user registration email
register_authorise
A boolean which defaults to false. If true then new user registrations require authorisation before the account is created
register_queue_path
Pathname to the file which contains the list of pending user registrations
role_model_class
Class of the role model
rprtdir
Directory location in the filesystem of the user reports
template_dir
Path to the directory which contains the user registration email template
user_model_classes
Hash ref containing the map between realm names and storage model classes. Initialised by "COMPONENT"
Constructor initialises default attribute values
Completes the initialisation process on a per request basis
$self->activate_account_form( $filename );
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
$self->authenticate;
Calls authenticate in the domain model.
Authenticate the user. If another controller was wanted and the user was forced to authenticate first, redirect the session to the originally requested controller. This was stored in the session by the auto method prior to redirecting to the authentication controller which forwarded to here
Redirects to the change password form it the users password has expired
$self->authentication_form( $username );
Adds fields to the stash for the login screen
$bool = $self->change_password;
Method to change the users password. Throws exceptions for field constraint failures and if the passwords entered are not the same
$self->change_password_form( $username );
Adds field data to the stash for the change password screen. Allows users to change their own password
$username = $self->create_or_update;
Method to create a new account or update an existing one. Throws exceptions for field constraint failures. Calls methods on the domain model to do the actual work
$bool = $self->delete;
Deletes the selected account
$user_object = $self->find_user( $username, $verbose );
Calls find_user on the domain model. The verbose flag maximises the information returned about the user
($model_class, $realm) = $self->get_user_model_class( $default, $realm );
Return the user model class for the specified realm. If not found return the default user model
$self->invalidate_cache;
Invalidates the user cache in the domain model
$bool = $self->is_user( $username );
Calls is_user in the domain model
Proxy the call to the domain method
$bool = $self->logout( $args );
Expires the user object on the session store. The $args hash takes an optional message attribute and an optional no_redirect attribute
$args
message
no_redirect
$profile_object = $self->profiles;
Returns the domain model's profiles object
$bool = $self->purge;
Delete the list of selected accounts
$bool = $self->register( [ $path ] );
Create the self registered account. The account is created in an inactive state and a confirmation email is sent
$self->register_form( $captcha_action_path );
Added the fields to the stash for the self registration screen. Users can use this screen to create their own accounts
$bool = $self->set_password;
Sets the users password to a given value
$bool = $self->user_fill;
Sets the fill attribute of the stash in response to clicking the auto fill button
$self->user_manager_form( $username );
Adds fields to the stash for the user management screen. Administrators can create new accounts or modify the details of existing ones
$bool = $self->user_report( $type );
Creates a report of the user accounts in this realm
$self->user_report_form( $id );
View either the list of available account reports or the contents of a specific report
$self->user_security_form( $username );
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
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
<Support at RoxSoft.co.uk>
Larry Wall - For the Perl programming language
Copyright (c) 2014 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
To install CatalystX::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Usul
CPAN shell
perl -MCPAN -e shell install CatalystX::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.