NAME

Egg::Plugin::SessionKit::Auth::File - It authentication it based on the data of the file.

SYNOPSIS

package MYPROJECT;
use strict;
use Egg qw/Plugin::SessionKit::Auth::File/;

Configuration.

plugin_session=> {
  ...
  ...
  auth=> {
    ...
    ...
    data_path      => '/path/to/user_data',
    uid_db_field   => 'user_id',
    psw_db_field   => 'password',
    active_db_field=> 'active',
    separator      => ':',
    constant=> [qw/user_id password active email nickname ... etc. /],
  },
},

DESCRIPTION

It authentication it based on the data managed with the file.

For instance, data structures of the following TSV types are assumed.

foo	12345	1	foo@domain	foofoo
baa	12345	1	baa@domain	baabaa
zuu	12345	0	zuu@domain	zuuzuu

CONFIGURATION

data_path

Path of data file.

Default is none., Undefined is an error.

separator

Delimiter of each data.

Default is "\t"

constant

ARRAY divided by 'separator' ties by the name.

foo	12345	1	foo@domain	foofoo

constant=> [qw/uid psw active email nickname/],

This is developed as follows.

$user->{uid}       -> foo
$user->{psw}       -> 12345
$user->{active}    -> 1
$user->{email}     -> foo@domain
$user->{nickname}  -> foofoo

Default is none., Undefined is an error.

uid_db_field

Name of id field

Default is none., Undefined is an error.

psw_db_field

Default is none., Undefined is an error.

active_db_field

Field name to judge whether acquired data is effective. This is evaluated only when defined.

For instance, if this field is undefined even if succeeding in the acquisition of data because of the inquiry of $e->auth->login, false is returned.

Default is none.

METHODS

$e->auth->login

The login check is done.

Please see Egg::Plugin::SessionKit::Auth in detail.

$e->auth->restore([USER_ID]);

The attestation data corresponding to specified ID is returned by the HASH reference.

setup

It is a method for the start preparation that is called from the controller of the project. * Do not call it from the application.

SEE ALSO

Egg::SessionKit, Egg::SessionKit::Auth, Egg::Release,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT

Copyright (C) 2007 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.