[Catalyst] Is users table primary key available in $c->user?
Dennis Daupert
ddaupert at sbcglobal.net
Sat Jul 15 00:17:40 CEST 2006
I want to update my join table 'user_quotes' using the logged-in user's id. By 'id' I mean the integer primary key from the users table.
$c->user gives the username of the logged in user, so I could do a search on the users table by the unique username, but I'd rather not do that if it's already available.
This:
my $user = $c->user;
$c->stash->{details} = [$c->get_user("$user")];
just gives me back the username.
I use qw/Authentication Authentication::Store::DBIC Authentication::Credential::Password/ in my app.
In my yml file:
authentication:
dbic:
user_class: CatapultDB::Users
user_field: username
password_field: password
My user class:
package Catapult::Schema::CatapultDB::Users;
<snip>
__PACKAGE__->table('users');
__PACKAGE__->add_columns(qw/id fname lname address1 address2 city state zip email username password active /);
best,
/dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060714/02b0d960/attachment.htm
More information about the Catalyst
mailing list