4 SGN::Authentication::Store - a Catalyst compatible store class
8 Implemented according to Catalyst::Plugin::Authentication::Internals
12 Lukas Mueller <lam87@cornell.edu>
19 package SGN
::Authentication
::Store
;
21 use SGN
::Authentication
::User
;
22 use CXGN
::People
::Person
;
25 my ( $class, $conf, $c, $realm ) = @_;
27 my $self = bless {}, $class;
34 my ( $self, $authinfo, $c ) = @_;
36 $c->log->debug("find_user: $authinfo->{username}") if $c->debug;
37 my $sp_person_id = CXGN
::People
::Person
->get_person_by_username( $c->dbc->dbh, $authinfo->{username
});
40 my $sp_person = CXGN
::People
::Person
->new( $c->dbc->dbh, $sp_person_id);
41 if (ref($sp_person) eq 'CXGN::People::Person') {
42 $c->log->debug("Obtained sp_person ".$sp_person->get_sp_person_id()) if $c->debug;
43 my $user = SGN
::Authentication
::User
->new();
45 $c->log->debug("USER ".$sp_person->get_username()." FOUND!") if $c->debug;
46 $user->set_object($sp_person);
50 $c->log->debug("USER $authinfo->{username} NOT FOUND!") if $c->debug;