NAME

Schema::RDBMS::AUS - Authentication, Users and Sessions in an SQL schema

SYNOPSIS

$ migrate-database-schema --dsn DBI:Pg: --verbose Schema::RDBMS::AUS

DESCRIPTION

The Schema::RDBMS::AUS distribution provides a complete transactional, mid-level interface to users, groups, and sessions, including:

This package only supplies an API for the management of users and sessions, it does not integrate them with any particular user interface.

If you are developing a web application that needs authentication, users, and sessions, see Apache2::AUS. Apache2::AUS provides a mod_perl2 handler over top of Schema::RDBMS::AUS that manages users and sessions, which can then be used by other mod_perl2 modules, CGI scripts, or even PHP/Ruby/Python.

INSTALLING THE DATABASE SCHEMA

To install the database schema, use the migrate-database-schema utility, supplied by the DBIx::Migration::Directories distribution. For example, the following line would install the schema into the MySQL database 'joe':

$ migrate-database-schema --dsn DBI:mysql:dbname=joe --verbose Schema::RDBMS::AUS

MANAGING SESSIONS

See CGI::Session::AUS.

MANAGING USERS, GROUPS, AND PERMISSIONS

See Schema::RDBMS::AUS::User.

ENVIRONMENT

The following environment variables are used by Schema::RDBMS::AUS:

AUS_DB_DSN
AUS_DB_USER
AUS_DB_PASS

The DBI Data Source Name, Username, and Password to connect to the database with. If any of these environment variables are not specified, the DBI standard DBI_DSN, DBI_USER, and DBI_PASS variables are checked as well.

AUS_SESSION_ID

If this environment variable is specified, it is used as the default session id for CGI::Session::AUS.

METHODS

Most of the methods you would be interested in are probably in Schema::RDBMS::AUS::User or CGI::Session::AUS. However, Schema::RDBMS::AUS itself provides a few class methods:

dbh

Returns a DBIx::Transaction database handle connected to the authentication, users, and sessions database. It acceps the same arguments as connect() in the DBI distribution. If any parameters are not specified, their default values are taken from the environment as described above.

sdbh

Obtains a database handle from dbh(), then asks DBIx::Migration::Directories if our SQL schema is installed there. If it is, the database handle is returned. If not, sbdh will die() with a useful error message.

THANKS

Mischa Sandberg <mischa.sandberg@telus.net>

Mischa has taught me quite a bit about Postgres in general, and wrote the prototypical versions of the triggers and views that are used to support heiarchial user/group membership.

AUTHOR

Tyler "Crackerjack" MacDonald <japh@crackerjack.net>

LICENSE

Copyright 2006 Tyler "Crackerjack" MacDonald <japh@crackerjack.net>

This is free software; You may distribute it under the same terms as perl itself.