Mailing List Archive

Auth::CDBI enhancements
>> 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?
>
>
> Don't take the the plugins i write as the one way to go, Catalyst is a
> component system, so they are mostly just examples, showing whats possible.
> Everybody is not just free to subclass and extend them, everybody is
> encouraged to do so! ;)

Putting the user object in req->{user} is a good idea, and I also think
my hashed password support patch is a good idea. ;) My question to
everyone is: does it make sense for everyone to release their own
subclass modules or just improve yours to make it better? I would bet
new folks will try out the more "standard" plugins (i.e. the ones with
your name on them) before trying other people's, so they might miss some
functionality. I say we should add these enhancements to your plugin. :)

--
Andy Grundman
Auth::CDBI enhancements [ In reply to ]
One thing about putting user in req->{user} --

I found that, at least under mod_perl, the user object was being cached by
CDBI because of this reference.

I had to put a call to clear_object_index in my !begin action..

$self->comp('MyApp::M::CDBI')->clear_object_index();

There may be another way to avoid this problem, but I went with that and it
did the trick ..

On 4/12/05 2:23 PM, "Andy Grundman" <andy@hybridized.org> 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?
>>
>>
>> Don't take the the plugins i write as the one way to go, Catalyst is a
>> component system, so they are mostly just examples, showing whats possible.
>> Everybody is not just free to subclass and extend them, everybody is
>> encouraged to do so! ;)
>
> Putting the user object in req->{user} is a good idea, and I also think
> my hashed password support patch is a good idea. ;) My question to
> everyone is: does it make sense for everyone to release their own
> subclass modules or just improve yours to make it better? I would bet
> new folks will try out the more "standard" plugins (i.e. the ones with
> your name on them) before trying other people's, so they might miss some
> functionality. I say we should add these enhancements to your plugin. :)
>
> --
> Andy Grundman
>
Auth::CDBI enhancements [ In reply to ]
Michael Reece wrote:
> One thing about putting user in req->{user} --
>
> I found that, at least under mod_perl, the user object was being cached by
> CDBI because of this reference.
>
> I had to put a call to clear_object_index in my !begin action..
>
> $self->comp('MyApp::M::CDBI')->clear_object_index();
>
> There may be another way to avoid this problem, but I went with that and it
> did the trick ..

I absolutely hate that problem... in another app I recently wrote I had
to disable the index completely because it was causing all kinds of
issues. No problems on any of your other CDBI objects though?

-Andy
Auth::CDBI enhancements [ In reply to ]
None that I noticed, but that clear_object_index gets run on every request
now, so if other tables were going to have problems, they aren't now. :)

On 4/12/05 3:12 PM, "Andy Grundman" <andy@hybridized.org> wrote:

> Michael Reece wrote:
>> One thing about putting user in req->{user} --
>>
>> I found that, at least under mod_perl, the user object was being cached by
>> CDBI because of this reference.
>>
>> I had to put a call to clear_object_index in my !begin action..
>>
>> $self->comp('MyApp::M::CDBI')->clear_object_index();
>>
>> There may be another way to avoid this problem, but I went with that and it
>> did the trick ..
>
> I absolutely hate that problem... in another app I recently wrote I had
> to disable the index completely because it was causing all kinds of
> issues. No problems on any of your other CDBI objects though?
>
> -Andy