CGI::Application::Plugin::Authentication::Driver::DBI is a DBI Authentication driver.
SYNOPSIS
use base qw(CGI::Application);
use CGI::Application::Plugin::Authentication;
__PACKAGE__->authen->config(
DRIVER => [ 'DBI',
DBH => ,
TABLE => 'user',
CONSTRAINTS => {
'user.name' => '__CREDENTIAL_1__',
'MD5:user.password' => '__CREDENTIAL_2__'
},
],
);
This Authentication driver uses the DBI module to allow you to authenticate against any database for which there is a DBD module. You can either provide an active database handle, or provide the parameters necesary to connect to the database.
When describing the database structure, you need to specify some or all of the following parameters: TABLE(S), JOIN_ON, COLUMNS and CONSTRAINTS.
DBH
The DBI database handle to use. Defaults to -dbh()>, which is provided and configured through CGI::Application::Plugin::DBH
TABLE(S) (required)
Provide either a single table name, or an array of table names. You can give the table names aliases which can be referenced in later columns.
TABLE => 'users',
- or -
TABLES => ['users U', 'domains D'],
JOIN_ON (conditionally required)
If you have specified multiple tables, then you need to provide an SQL expression that can be used to join those tables.
JOIN_ON => 'user.domainid = domain.id',
- or -
JOIN_ON => 'U.domainid = D.id',
Requirements:
· Perl