Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Re How to update data of already logged-in user?

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


sergey.programmer at gmail

Jul 11, 2012, 11:18 PM

Post #1 of 6 (304 views)
Permalink
Re How to update data of already logged-in user?

Thank you Lu. BTW, set_authenticated is marked as internal method in
documentation, so it could be changed some day.


2012/7/12 鲁国庆(Jack Lu) <luguoqing [at] gmail>

> my $user = $c->find_user({ user_id => $c->user->user_id });
> $c->set_authenticated($user);
>
> $user->email will be the new email.
>
>
> On Thu, Jul 12, 2012 at 2:28 AM, Sergey Dmitriev <
> sergey.programmer [at] gmail> wrote:
>
>> Thank you David!
>>
>> 2012/7/11 David Schmidt <davewood [at] gmx>
>>
>>> The object returned by $c->user is not what you are looking for.
>>>
>>> I assume you are using DBIC.
>>>
>>> Get the "real" user object with $c->user->get_object()
>>>
>>>
>>> http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.10021/lib/Catalyst/Authentication/User.pm#get_object(_)
>>>
>>> cheers
>>> david
>>>
>>>
>>>
>>> On 11 July 2012 17:37, Sergey Dmitriev <sergey.programmer [at] gmail>
>>> wrote:
>>> > Hello,
>>> >
>>> > My question is simple. I have object of already authenticated user in
>>> $u by
>>> > using
>>> >
>>> > my $u = $c->user()
>>> >
>>> > So, getter $u->email reflects actual email. How then can I update
>>> already
>>> > loaded user object? E.g. i need something like:
>>> >
>>> > print $u->email; # old [at] emai
>>> >
>>> > $u->email = 'new [at] emai';
>>> >
>>> > print $u->email; # new [at] emai
>>> >
>>> > How to achieve this simple way? Do I need to update user rec in DB then
>>> > re-load user from DB? Then, which is the simplest way to re-trieve user
>>> > again?
>>> >
>>> > Thank you.
>>> > Sergey
>>> >
>>> >
>>> >
>>> > _______________________________________________
>>> > List: Catalyst [at] lists
>>> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>>> > Searchable archive:
>>> http://www.mail-archive.com/catalyst [at] lists/
>>> > Dev site: http://dev.catalyst.perl.org/
>>> >
>>>
>>> _______________________________________________
>>> List: Catalyst [at] lists
>>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>>> Searchable archive:
>>> http://www.mail-archive.com/catalyst [at] lists/
>>> Dev site: http://dev.catalyst.perl.org/
>>>
>>
>>
>> _______________________________________________
>> List: Catalyst [at] lists
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst [at] lists/
>> Dev site: http://dev.catalyst.perl.org/
>>
>>
>
>
> --
> Jack
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/
>
>


--
Love never fails.


bobtfish at bobtfish

Jul 12, 2012, 1:43 PM

Post #2 of 6 (287 views)
Permalink
Re: Re How to update data of already logged-in user? [In reply to]

On 12 Jul 2012, at 07:18, Sergey Dmitriev wrote:

> Thank you Lu. BTW, set_authenticated is marked as internal method in documentation, so it could be changed some day.
>

Well volunteered?

Cheers
t0m


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


sergey.programmer at gmail

Jul 13, 2012, 1:36 AM

Post #3 of 6 (283 views)
Permalink
Re: Re How to update data of already logged-in user? [In reply to]

What do you mean? Answers really helped me.

Sergey

2012/7/12 Tomas Doran <bobtfish [at] bobtfish>

>
> On 12 Jul 2012, at 07:18, Sergey Dmitriev wrote:
>
> > Thank you Lu. BTW, set_authenticated is marked as internal method in
> documentation, so it could be changed some day.
> >
>
> Well volunteered?
>
> Cheers
> t0m
>
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/
>


mitakaa at gmail

Jul 13, 2012, 2:15 AM

Post #4 of 6 (286 views)
Permalink
Re: Re How to update data of already logged-in user? [In reply to]

I think that the method is used by many people and it was discussed that
the set_authenticated shouldn't be documented as internal... so I guess
what Tom means is "well volunteered" for fixing the documentation :)

On Fri, Jul 13, 2012 at 10:36 AM, Sergey Dmitriev <
sergey.programmer [at] gmail> wrote:

> What do you mean? Answers really helped me.
>
> Sergey
>
>
> 2012/7/12 Tomas Doran <bobtfish [at] bobtfish>
>
>>
>> On 12 Jul 2012, at 07:18, Sergey Dmitriev wrote:
>>
>> > Thank you Lu. BTW, set_authenticated is marked as internal method in
>> documentation, so it could be changed some day.
>> >
>>
>> Well volunteered?
>>
>> Cheers
>> t0m
>>
>>
>> _______________________________________________
>> List: Catalyst [at] lists
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst [at] lists/
>> Dev site: http://dev.catalyst.perl.org/
>>
>
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/
>
>


sergey.programmer at gmail

Jul 13, 2012, 3:51 AM

Post #5 of 6 (282 views)
Permalink
Re: Re How to update data of already logged-in user? [In reply to]

Ok, if so, no problem, i just need hint like 'how to do it right way'. :)

2012/7/13 Dimitar Petrov <mitakaa [at] gmail>

> I think that the method is used by many people and it was discussed that
> the set_authenticated shouldn't be documented as internal... so I guess
> what Tom means is "well volunteered" for fixing the documentation :)
>
>
> On Fri, Jul 13, 2012 at 10:36 AM, Sergey Dmitriev <
> sergey.programmer [at] gmail> wrote:
>
>> What do you mean? Answers really helped me.
>>
>> Sergey
>>
>>
>> 2012/7/12 Tomas Doran <bobtfish [at] bobtfish>
>>
>>>
>>> On 12 Jul 2012, at 07:18, Sergey Dmitriev wrote:
>>>
>>> > Thank you Lu. BTW, set_authenticated is marked as internal method in
>>> documentation, so it could be changed some day.
>>> >
>>>
>>> Well volunteered?
>>>
>>> Cheers
>>> t0m
>>>
>>>
>>> _______________________________________________
>>> List: Catalyst [at] lists
>>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>>> Searchable archive:
>>> http://www.mail-archive.com/catalyst [at] lists/
>>> Dev site: http://dev.catalyst.perl.org/
>>>
>>
>>
>> _______________________________________________
>> List: Catalyst [at] lists
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst [at] lists/
>> Dev site: http://dev.catalyst.perl.org/
>>
>>
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/
>
>


bobtfish at bobtfish

Jul 13, 2012, 10:30 AM

Post #6 of 6 (284 views)
Permalink
Re: Re How to update data of already logged-in user? [In reply to]

On 13 Jul 2012, at 11:51, Sergey Dmitriev wrote:

> Ok, if so, no problem, i just need hint like 'how to do it right way'. :)

Clone the git repository, make a patch, mail it to the list :)

Cheers
t0m


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.