[Catalyst] Engine/CGI and query+post params

Chisel Wright chisel at herlpacker.co.uk
Thu Apr 14 15:10:04 CEST 2005

On Tue, Apr 12, 2005 at 01:15:33PM -0800, Michael Reece wrote:
> In Cat4, C::Plugin::Authentication::CDBI sets $c->request->{user} to the
> username, rather than the user object ( from $user_class->search(..) ).  I
> found that to be ultimately useless, and changed it put the user object in
> there instead, so my templates can make use of the user's preferences and
> other bits from their db record.  Anything in the Authentication, such as
> that, changing in Cat5?

Yeah, as part of my journey into the realms of Cat5 I've realised that
I'd like to return a blob of user info, rather than just the username.

What's the 'proper' way of doing this?

At the moment I have a local module Catalyst::Plugin::Login that just
use base's C::Plugin::Authentication::CDBI, and I've copied the
session_login() function from CPA::CDBI and doctored the

  $c->stash->{'user'} = $user;

statement to be set to the result of a App::M::CDBI::Table->search

It seems to be doing what I intend, but my instincts are telling me that
this is wrong.

Any comments either way?

Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/

"This is not the greatest sig in the world, no, this is just a tribute."

More information about the Catalyst mailing list