[Catalyst] $c->user and session questions
Kenneth S Mclane
ksmclane at us.ibm.com
Thu May 31 13:40:38 GMT 2012
I found that I can simply reference $c->user->hrfirstname.
As to the role info, that comes from a different source (an sqlite db just
for this info). I found that $c->session(role => $role); works to insert
the value in the session, so I just need to pull the data from the table
into the variable and then I'm good. Thanks for the suggestions.
Tomas Doran <bobtfish at bobtfish.net> wrote on 05/31/2012 08:31:31 AM:
> Tomas Doran <bobtfish at bobtfish.net>
> The elegant MVC web framework <catalyst at lists.scsys.co.uk>
> 05/31/2012 08:32 AM
> Re: [Catalyst] $c->user and session questions
> On 31 May 2012, at 14:00, Kenneth S Mclane wrote:
> > I have an LDAP server authenticating my users. The look up returns
> a ton of fields in a hash. My questions are as follows:
> > 1. What happens to this data/information? Is it stored in the
> $c->user object?
> > 2. If it is, how do I access it?
> Like that. Specifically the ->ldap_entry method is probably what you're
> > 3. Is there a simple way to look at what is stored in the user object?
> Data::Dumper::Dumper($c->user) ?
> > 4. I would like to store the users role in the session object so
> it can be accessed for authorization purposes. The docs only have an
> example of storing stuff in a shopping cart, which is a bit more
> than I need, but there isn't enough there for me to figure out how
> to store just one thing, and retrieve it, of course. Can someone
> show me how to do this?
> You need to override the user class, and implement the for_session
> and from_session methods to get additionally stuff serialized.
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> Dev site: http://dev.catalyst.perl.org/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Catalyst