php - Impersonate a user when I'm already impersonating another user? -


i want able impersonate user in app, followed tutorial website

if try change user user "a" user "b", works, if try change user "c" while i'm impersonating user "b", attemptswitchuser method throws excepcion:

you switched "b" user. 500 internal server error - logicexception 

this because method checks wether current user name (b) equals user name want impersonate (c)

$token = $this->securitycontext->gettoken(); $originaltoken = $this->getoriginaltoken($token);  if (false !== $originaltoken) {     if ($token->getusername() === $request->get($this->usernameparameter)) {         return $token;     } else {         throw new \logicexception(sprintf('you switched "%s" user.', $token->getusername()));     } } 

but can't never case, don't know if bug in symfony's code or if there's else i'm missing.

is bug? can achieve functionality without commenting out block of code?

switched user cannot switch other. before can need switch original user ( ?_switch_user=_exit )


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -