Re: $this-Auth-user not refreshing after edit

2009-01-03 Thread webjay
Here's how I do it: private function reload () { $this-Auth-login($this-User-read()); } So just call $this-reload() from your controller. -- View this message in context:

Re: $this-Auth-user not refreshing after edit

2008-07-17 Thread Jonathan Snook
On Wed, Jul 16, 2008 at 11:33 PM, Baz L [EMAIL PROTECTED] wrote: BTW, what 'critical' data could you possibly need in the User session? If you're displaying stuff on the website, why don't you read the user_id from Auth and then the rest of the data from the actual table, if it's critical? If

Re: $this-Auth-user not refreshing after edit

2008-07-17 Thread RichardAtHome
The $this-Auth-reload() solution looks like a winner to me. No unnecessary database reads, and you can keep the Auth user up to date in responce to changes made by the user. Thanks for all the great feedback folks :-) --~--~-~--~~~---~--~~ You received this

Re: $this-Auth-user not refreshing after edit

2008-07-16 Thread [EMAIL PROTECTED]
Richard, I have a patch which will allow you to do $this-Auth-reload() which will pull user details in there. https://trac.cakephp.org/ticket/5036 Good luck. -- Sincerely, ~Andrew Allen On Jul 13, 5:01 pm, RichardAtHome [EMAIL PROTECTED] wrote: Hi all :-) I'm using Cake 1.2 and the Auth

Re: $this-Auth-user not refreshing after edit

2008-07-16 Thread Baz L
I would avoid writing directly to the Auth's session. Again, this is generally how Authentication systems work. User information used by the application is stored in memory (session in this case). You could force a logout, but I think that you're users will find this more annoying to be logged

Re: $this-Auth-user not refreshing after edit

2008-07-14 Thread RichardAtHome
How can this be the preferred behaviour? What do you do if you get a 'bad' user? Even if you delete his user record you are helpless to stop him until he voluntarily logs out! Or, what if you have a regular user who needs his 'role' changing? Granted, profile edits and changes in roles are

Re: $this-Auth-user not refreshing after edit

2008-07-14 Thread AD7six
On Jul 14, 10:24 am, RichardAtHome [EMAIL PROTECTED] wrote: How can this be the preferred behaviour? What do you do if you get a 'bad' user? Even if you delete his user record you are helpless to stop him until he voluntarily logs out! Or, what if you have a regular user who needs his

Re: $this-Auth-user not refreshing after edit

2008-07-14 Thread RichardAtHome
Yes, but that 1% where it IS needed is critical ;-) I agree that a refresh method would be useful, and if present would allow me to add it to the App Controller to get the effect I'm after. That way everyone is happy :-) Anyone know how to refresh the user record? Is it simply a case of setting

Re: $this-Auth-user not refreshing after edit

2008-07-14 Thread AD7six
On Jul 14, 11:12 am, RichardAtHome [EMAIL PROTECTED] wrote: Yes, but that 1% where it IS needed is critical ;-) Why build something into a framework that does nothing (except soak up cycles) 99% of the time - and only might, for a few users, be useful. Why not try debug

Re: $this-Auth-user not refreshing after edit

2008-07-14 Thread Jonathan Snook
Anyone know how to refresh the user record? Is it simply a case of setting the Auth Session User var? Looking at the Auth source, it populates the key 'Auth.' . $this-userModel, or Auth.User by default. You may want to try just doing $this-Auth-login() again from the edit page (be sure to

Re: $this-Auth-user not refreshing after edit

2008-07-14 Thread RichardAtHome
Thanks for the feedback everyone. I'll give it a try today and post back my results :-) On Jul 14, 1:33 pm, Jonathan Snook [EMAIL PROTECTED] wrote:  Anyone know how to refresh the user record? Is it simply a case of  setting the Auth Session User var? Looking at the Auth source, it

Re: $this-Auth-user not refreshing after edit

2008-07-14 Thread RichardAtHome
Back again... Added the following to the save block of my edit function: $this-Session-write(Auth, $this-data); ($this-data is provided by the User edit form) Which fixed the problem but with a minor issue (which I can live with for now). On Jul 14, 2:57 pm, RichardAtHome [EMAIL PROTECTED]

$this-Auth-user not refreshing after edit

2008-07-13 Thread RichardAtHome
Hi all :-) I'm using Cake 1.2 and the Auth component. Everything is working fine (after a bit of fiddling and manual reading), but... It looks like the Users model is only being read once at login and the details stored in a session (not checked the cake code, but that would match the

Re: $this-Auth-user not refreshing after edit

2008-07-13 Thread Jonathan Snook
On 7/13/08, RichardAtHome [EMAIL PROTECTED] wrote: It looks like the Users model is only being read once at login and the details stored in a session (not checked the cake code, but that would match the behaviour I am experiencing). Basically, the edit is working (ie, database gets