Wednesday, April 28, 2010

Re: Updating user values in Auth component

Without changing anything in the Auth component, I do think that you
could redo the login of the current user, when you have updated the
users information - for example:

[code]
$this->Auth->login( $this->Auth->user() );
[/code]

That should update the user information in the Auth session key.
I haven't tested it, but give it a try :)
Enjoy,
John

Ps. the only issue I could see, is that the password may not be
available!

On Apr 28, 5:16 pm, WhyNotSmile <sharongilmor...@googlemail.com>
wrote:
> I'm using the built-in Auth component with CakePHP.  In part of my
> site, I allow my user to update their details (e.g. email address).
> When I then retrieve the user information from the Auth component
> (using $this->Auth->user()), the details are still the old ones.
>
> Is there a way to update the values in the Auth component?  I know
> that the fact I have a problem with this indicates that I'm probably
> doing it wrong, so I'm going to change the way it's finding the data,
> but I'm just curious as to whether the Auth values can be changed.
>
> Thanks
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: