NAME

Konstrukt::Plugin::usermanagement::level::DBI - Konstrukt level userdata. DBI Backend Driver

SYNOPSIS

#TODO

DESCRIPTION

The DBI backend for the administration level.

CONFIGURATION

#backend
usermanagement/level/backend/DBI/source  dbi:mysql:database:host
usermanagement/level/backend/DBI/user    username
usermanagement/level/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_level to use this plugin. You may turn on the install 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. create tables).

Parameters:

none

add_user

Creates a row for a new user with the specified ID.

Parameters:

  • $uid - User id

delete_user

Deletes the level entry for a specified user.

Parameters:

  • $uid - User id

get_data

Returns an hash reference, if the uid exists: { level => <number> } Returns an emty hash ref if the uid doesn't exist.

Parameters:

  • $uid - User id

set_data

Sets the data specified in the passed hash in the database. { level => <number> } Returns an emty hash ref if the uid doesn't exist.

Parameters:

  • $uid - User id

  • $data - Hash reference with the data that should be set: { level => <number> }

set_level

Sets the user level for the specified uid.

Parameters:

  • $uid - User id

  • $level - The user level (integer).

get_all

Returns all registered users(/admins) as an array ref of hash references: [ { user => <ID>, level => 123 }, { user => <ID>, level => 456 }, ... ]

Should be ordered by user level.

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::Plugins::usermanagement::level, Konstrukt::Plugins::usermanagement, Konstrukt