Egg::Model::Auth::API::DBI - API component to access attestation data base by using DBI.


Egg-Release-Authorize documentation  | view source Contained in the Egg-Release-Authorize distribution.

Index


NAME

Top

Egg::Model::Auth::API::DBI - API component to access attestation data base by using DBI.

SYNOPSIS

Top

  package MyApp::Model::Auth::MyAuth;
  ..........

  __PACKAGE__->config(
    dbi => {
      dbname         => 'members',
      label          => 'dbi_label',
      prepare_cached => 1,
      user_id_regexp => qr{[a-z][a-z0-9]{3.16}},
      password_regexp=> .......
      id_field       => 'user_id',
      password_field => 'password',
      active_field   => 'active',
      group_field    => 'a_group',
      },
    );

  __PACKAGE__->setup_api('DBI');

DESCRIPTION

Top

It is API component to access the attestation data base by using Egg::Model::DBI.

The setting of 'dbi' is added to the configuration to use it and 'DBI' is set by 'setup_api' method.

CONFIGURATION

Top

Additionally, there is a common configuration to API class.

see Egg::Model::Auth::Base::API.

label

Label name to acquire data base handler of Egg::Model::DBI.

select_statement

SELECT statement to acquire attestation data.

The statement with one Prasfolda for login ID is set.

  statement => "SELECT * FROM members a LECT JOIN profile ON a.id = b.id WHERE a.id = ? ",

When this is set, 'dbname' is disregarded. It sets it when SQL complex though the attestation data is acquired is necessary.

Login ID and the password are at least necessary though it is also good to specify the acquired column. Additionally, please add columns of an effective flag and the group, etc. arbitrarily.

The acquired data becomes possible the reference to everything by 'data' method.

dbname

Table name of attestation data base.

If 'statement' is set, this setting is not used.

Default is 'members'.

The following SELECT statements are used by this.

  SELECT * FROM [dbname] WHERE [id_field] = ?

prepare_cached

'prepare_cached' comes to be used by the data base handler when keeping effective.

METHODS

Top

myname

Own API label name is returned.

restore_member ([LOGIN_ID])

The data of LOGIN_ID is acquired from the attestation data base, and the HASH reference is returned.

SEE ALSO

Top

Egg::Release, Egg::Model::Auth, Egg::Model::Auth::Base::API, Egg::Release::DBI,

AUTHOR

Top

Masatoshi Mizuno <lushe&64;cpan.org>

COPYRIGHT AND LICENSE

Top


Egg-Release-Authorize documentation  | view source Contained in the Egg-Release-Authorize distribution.