Konstrukt::Plugin::usermanagement::personal - Personal information about the user.
<& usermanagement::personal / &>
#get some data: my $user_personal = use_plugin 'usermanagement::personal' or die; $user_personal->firstname(); $user_personal->homepage(); ...
This plugin offers functionality to let each user manage some personal data of itself.
If the HTTP parameter id
is set, the personal information page of the user with that id will be shown.
Otherwise a form to change the personal information of the user, which is currently logged in, will be shown.
This plugin create a new entry for every newly registered user and deletes it when the user deregisters.
To know when a user (de)registers, this plugin has to register itself for the registered
and deregistered
events, that the basic usermanagement plugin fires.
So this plugin must be initialized before the basic user management plugin is executed. For this to happen, you can preload this plugin like this on the page, where the basic usermanagement is executed:
<& perl &> #preload plugins, which will react on events (register, deregister) use_plugin 'usermanagement::personal'; <& / &> <& usermanagement::basic show="login, changepass, register, sendpass" / &>
You have to do some konstrukt.settings-configuration to let the plugin know where to get its data and which layout to use. Defaults:
#backend usermanagement/basic/backend DBI
See the documentation of the backend modules (e.g. "CONFIGURATION" in Konstrukt::Plugin::usermanagement::basic::DBI) for their configuration.
#layout usermanagement/personal/template_path /templates/usermanagement/personal/
Initializes this object. Sets $self->{backend} and $self->{template_path}
init()
will be called the first time this plugin is needed each request.
Installs the templates.
Parameters:
none
Yes, this plugin may return dynamic nodes (i.e. template nodes).
Prepare method
Parameters:
Execute method
Parameters:
Returns all relevant user data as an anonymous hash, if uid exists:
{ nick => .., firstname => .., lastname => .., sex => .., birth_year => .., birth_month => .., birth_day => .., email => .., jabber => .., icq => .., aim => .., msn => .., yahoo => .., homepage => ...}
Returns an empty hash if the uid doesn't exist.
Parameters (optional):
Returns a specified personal information field for a specified user, if the uid exists, undef otherwise.
Parameters:
For an easier access to the data fields of an user you may also use these wapper methods:
Sets the data specified in the passed hash in the database
Parameters:
Creates a new entry for the given user id.
Parameters:
Deletes an entry with the given user id.
Parameters:
Shows the personal information of the user, whose id has been specified via HTTP, or of the current user, if no user id is specified. Only the user itself may change the user data.
Displays the form with the personal user information.
Changes the personal information specified in an HTTP POST request.
Returns a confirmation of the successful userdata change or error messages otherwise.
Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.
This document is free software. It is distributed under the same terms as Perl itself.
Konstrukt::Plugins::usermanagement::personal::DBI, Konstrukt::Plugin, Konstrukt