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

Hernan Lopes hernanlopes at gmail.com
Tue Nov 30 15:18:47 GMT 2010


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 session, close window and logout and log back in
with adminfoologin on parent.window"


--Hernan

On Tue, Nov 30, 2010 at 1:01 PM, Peter Karman <peter at peknet.com> wrote:

> 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} =3D $new_id_here; # since "id" =3D 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?
> >
>
> I don't know that there is a canonical way. This is Perl.
>
> As I mentioned in my reply to this thread in July[0], one way is to
> login as the new user and store the original username in the new user's
> session. That way the app knows that the new user is allowed to revert
> to the original user, but otherwise the app treats the current session
> just as it would if the new user had logged in normally.
>
>
> [0] http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg09968.html
>
> --
> Peter Karman  .  http://peknet.com/  .  peter at peknet.com
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101130/15079=
f0d/attachment.htm


More information about the Catalyst mailing list