1

A client uses the 'Login as user' behaviour to be able to see what users of the site are seeing, useful as it's an e-learning site and each user can see different content based on their progress. The users however, are only allowed to view the public site and not anything in the CP which means when the 'Login as user' is invoked the client is presented with the 'Unauthorized You don’t have the proper credentials to access this page' message.

Is this right? Looking through the code it seems the function _handleSuccessfulLogin() is called and if the user cannot access the CP then they should be redirected to the postLoginRedirect which in the case of this site is not set, so the user should be redirected to the homepage if I understand correctly.

closed as off-topic by Lindsey D Nov 30 '14 at 4:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Bug reports in Craft CMS or in a plugin are off-topic as they are unlikely to help others and can't easily be found by those who can fix them. Instead, submit bug reports directly to the vendor of the product being used. See: How do I submit a bug/issue with Craft?" – Lindsey D
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Per Brad's answer, this was a bug and has been fixed. Since this question no longer has any historical value, it will be closed as a "bug report". – Lindsey D Nov 30 '14 at 4:41
1

You're correct... it should be sending to postLoginRedirect, but there is actually a bug where after impersonating:

// Get the current user
$currentUser = craft()->userSession->getUser();

is returning a cached copy of the previous user (who had CP access).

Will get that fixed for the next release.

Update:

Fixed for the next post 2.2.2596 release!

Not the answer you're looking for? Browse other questions tagged or ask your own question.