NAME
Konstrukt::Plugin::usermanagement::basic::DBI - Konstrukt basic userdata. DBI Backend Driver
SYNOPSIS
#TODO
DESCRIPTION
The DBI backend for the basic usermanagement.
CONFIGURATION
#backend
usermanagement/basic/backend/DBI/source dbi:mysql:database:host
usermanagement/basic/backend/DBI/user username
usermanagement/basic/backend/DBI/pass password
If no database settings are set the defaults from "CONFIGURATION" in Konstrukt::DBI will be used.
You have to create the database table user_basic
to use this plugin. As this plugin depends on the log-plugin, you also have to create a table log
(See "CONFIGURATION" in Konstrukt::Plugin::log). You may turn on the autoinstall
setting (see "CONFIGURATION" in Konstrukt::Handler) or use the KonstruktBackendInitialization.pl
script to accomplish this task.
METHODS
init
Initialization of this class
install
Installs the backend (e.g. delete/create tables).
Parameters:
none
check_login
Checks, if a email/password combination exists in the database
Returns the user id of this user in the database if the combination is valid, 0 otherwise.
Parameters:
$email - The email address of the user
$pass - The users password
register
Adds an user.
Returns the id of the added user if operation was successful, -1 if the user already exists and undef otherwise.
Parameters:
$email - The email address of the user
deregister
Removes an user
Returns the id of the added user if operation was successful, undef otherwise.
Parameters:
$uid - The ID of the user to remove.
get_data
Returns the user data as an hash reference, if the uid exists: { email => 'a@b.c', pass => '<hash>' } Returns an empty hash reference if the user doesn't exist.
Parameters:
$uid - The ID of the user
get_id_from_email
Returns the user id coresponding to a given email address, if the email address exists, undef otherwise.
Parameters:
$email - The email address of the user
set_data
Sets the data specified in the passed hash in the database
Parameters:
$uid - The ID of the user
$data - Hashreference with the data that should be set: { email => .., password => .. }
set_password
Sets the password for the specified user.
Parameters:
$uid - The ID of the user
$password - The new password
AUTHOR
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.
SEE ALSO
Konstrukt::Plugin::usermanagement::basic, Konstrukt::Plugin::usermanagement, Konstrukt