Re: [Catalyst] Re: superuser "switch-user" session function?

2011-09-25 Thread will trillich
Mwa ha ha! It was $c->SET_AUTHENTICATED all along! This is how you switch-user/become-user/super-user inside Catalyst. Try this on for size: sub su : Chained('/is_admin') PathPart('su') Args(1) { my ( $self, $c, $id ) = @_; my $user_was = $c->user; my $user_is = $c->find_user({ id =>

Re: [Catalyst] Re: superuser "switch-user" session function?

2010-11-30 Thread Hernan Lopes
Indeed, i think it should login as a new user not changing the actual session. maybe something like: admin clicks "login as joeuser">open a new browser window as admin>verify its admin and re-login as a new user. register on session user is admin so he can log back in. Then add button "terminate s

Re: [Catalyst] Re: superuser "switch-user" session function?

2010-11-30 Thread Peter Karman
will trillich wrote on 11/29/2010 05:37 PM: > Aha! It looks like a sneaky, evil, wrong, mean, horrid way to > switch-user in the middle of a session is to > > $c->session->{__user}{id} = $new_id_here; # since "id" = PK > > But that's undoubtedly bad form of the worst kind. > > What's the canonic

Re: [Catalyst] Re: superuser "switch-user" session function?

2010-11-29 Thread Denny
On Mon, 2010-11-29 at 17:37 -0600, will trillich wrote: > Aha! It looks like a sneaky, evil, wrong, mean, horrid way to > switch-user in the middle of a session is to > > $c->session->{__user}{id} = $new_id_here; # since "id" = PK > > But that's undoubtedly bad form of the worst kind. > > What's

[Catalyst] Re: superuser "switch-user" session function?

2010-11-29 Thread will trillich
Aha! It looks like a sneaky, evil, wrong, mean, horrid way to switch-user in the middle of a session is to $c->session->{__user}{id} = $new_id_here; # since "id" = PK But that's undoubtedly bad form of the worst kind. What's the canonical non-sneaky above-board friendly golden way to do this?