Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
identify if user is only impersonated
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
phiamo  
View profile  
 More options Oct 17 2011, 10:34 pm
From: phiamo <phi...@googlemail.com>
Date: Mon, 17 Oct 2011 19:34:04 -0700 (PDT)
Local: Mon, Oct 17 2011 10:34 pm
Subject: identify if user is only impersonated
Hi,
i just tried the impersonating a user from security chapter.

Now i was wondering while i impersonate a user is there a easy way to
find out in twig that i am doing so?
e.g. to generat an _exit link ?

cheers phil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jordi Boggiano  
View profile  
 More options Oct 18 2011, 3:57 am
From: Jordi Boggiano <j.boggi...@seld.be>
Date: Tue, 18 Oct 2011 09:57:59 +0200
Local: Tues, Oct 18 2011 3:57 am
Subject: Re: [Symfony2] identify if user is only impersonated
On 18.10.2011 04:34, phiamo wrote:

> Now i was wondering while i impersonate a user is there a easy way to
> find out in twig that i am doing so?
> e.g. to generat an _exit link ?

You should be able to use this to check:

{% if has_role('ROLE_PREVIOUS_ADMIN') %}

The ROLE_PREVIOUS_ADMIN is assigned to users that are impersonating
others, which you can see in the Security panel of the Symfony Profiler
by the way :)

Cheers

--
Jordi Boggiano
@seldaek - http://nelm.io/jordi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
phiamo  
View profile  
 More options Oct 18 2011, 7:06 am
From: phiamo <phi...@googlemail.com>
Date: Tue, 18 Oct 2011 04:06:47 -0700 (PDT)
Local: Tues, Oct 18 2011 7:06 am
Subject: Re: identify if user is only impersonated
coo, thats probably exatly what i looked for!
where did you find that ?

thanks  lot!!

cheers phil

On 18 Okt., 09:57, Jordi Boggiano <j.boggi...@seld.be> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Maaswinkel  
View profile  
 More options Aug 10 2012, 8:40 am
From: Tom Maaswinkel <tom.maaswin...@12wiki.eu>
Date: Fri, 10 Aug 2012 05:40:02 -0700 (PDT)
Local: Fri, Aug 10 2012 8:40 am
Subject: Re: identify if user is only impersonated

Now I was working on this same thing, but I noticed that the ROLE_PREVIOUS_ADMIN gets lost.

I changed the config_dev.yml to intercept redirects (intercept_redirects: true). Whenever I go to a valid url and add '?_switch_user=<username here>' it wants to redirect me to the same page. At this point the user HAS the role ROLE_PREVIOUS_ADMIN. When I follow the redirect and check the user again (using the web profiler toolbar) this role is gone all of a sudden.

Anyone got any ideas here?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jesus Fernandez  
View profile  
 More options Aug 31 2012, 11:39 am
From: Jesus Fernandez <jesus.f...@gmail.com>
Date: Fri, 31 Aug 2012 08:39:03 -0700 (PDT)
Local: Fri, Aug 31 2012 11:39 am
Subject: Re: identify if user is only impersonated

After spending about 6 hours debugging ROLE_PREVIOUS_ADMIN getting lost
after redirect, I finally figured out what *MY *problem was. Tom maybe this
will help you out. I am not sure which one of this triggered the fix for me
but I had to do the following to my User Entity and UserRepository files:

   1. User entity implements Serializable ( I created this entity before
   the docs where ready and I was using public function __sleep() I found on
   google to handle this. )
   2. User entity public function equals(UserInterface $user) only
   validates return $this->id == $user->getId(); ( Before I was validating a
   bunch of others including $this->credentialsNonExpired !==
   $user->isCredentialsNonExpired())
   3. My User Repository now implements UserProviderInterface

Again I am not sure which change triggered the fix, but it now works for me.

On Friday, August 10, 2012 8:40:02 AM UTC-4, Tom Maaswinkel wrote:

Now I was working on this same thing, but I noticed that the


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Maaswinkel  
View profile  
 More options Aug 31 2012, 1:43 pm
From: Tom Maaswinkel <tom.maaswin...@12wiki.eu>
Date: Fri, 31 Aug 2012 19:43:22 +0200
Local: Fri, Aug 31 2012 1:43 pm
Subject: Re: [Symfony2] Re: identify if user is only impersonated

Hey Jesus,

Thanks for your reply, I finally fixed it myself too. It seems that when
you unserialize a user, you also need to (re)store its username. So it is
wise not only to serialize the user's ID, but also its username!

Met vriendelijke groet / Yours sincerely,
Tom Maaswinkel

2012/8/31 Jesus Fernandez <jesus.f...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »