Let's continue here so we stop hijacking of Return from Maintenance !

Is there a way to switch back is the user doesn't have masquerade permission ? Perhaps through a specific path ? masquerade/unswitch won't work without permissions.

DynV

That should have gone into another issue. However, for recovering from that kind of problem, you can clear your sessions and masquerade table in the sql database. And then login again as you would normally. Would recommend you to update your version of masquerade module to the latest from development branch; so that this situation doesn't happen again.

Gurpartap Singh

I can just delog and relog instead of doing all this but is there a way to do so from the module ? Some special path to switch back no matter what ? If not, I'll make this a feature request. I don't see a problem for a user without permissions trying to switch back !

Comments

Gurpartap Singh’s picture

Status: Active » Closed (won't fix)

The new module code doesn't let you masquerade when the next user doesn't have administration access. So you are in no way going to get trapped in off-line mode, and hence the code to switching back when trapped in masquerading mode is not needed.

In case you are using old masquerade module and trapped, just empty out the sessions and masquerade table and upgrade the module!

Thanks!

btully’s picture

Category: support » bug

just updated to 5.x-1.1 and it seems I can no longer switch back without getting an ACCESS DENIED error.

For example, as an admin, with admin masquerade perms, I use masquerade to switch to a normal non-admin user.

Once I'm done masquerading as the normal user, I click "switch back" to return to my initial admin user.

However, masquerade 5.x-1.1 no longer allows me to switch back and instead gives me an Access Denied page at /masquerade/unswitch.

Previous version didn't appear to do this. Bug?

btully’s picture

any follow up to this?

this definitely seems like a new bug. I thought the whole premise of the masquerade module was for "admins" to be able to switch users temporarily to view what they see/experience. But not being able to "switch back" seems like a major bug, no?

This did not occur in previous versions so I'm wondering if there's any clarification on what switch back is supposed to do since it doesn't work anymore. The one advantage masquerade had over the devel module's "switch users" is that it allowed one to switch back without having to log out and log back in again. This no longer seems the case which is a real shame.

Is this a new direction for the module, i.e., an intended consequence, or is there some way to revert back to the previous functionality?

greg.harvey’s picture

Status: Closed (won't fix) » Active

I have this issue too. It was a fresh install of the latest code, so I can't upgrade, unless the latest development snapshot contains new code to fix this? I'm not in the habit of installing development snapshots though, without a really good reason...

Setting status to active.

Suza415’s picture

"Is there a way to switch back if the user doesn't have masquerade permission ? Perhaps through a specific path ? masquerade/unswitch won't work without permissions."

I had this problem too, but none of the solutions seemed to work. I even deleted the masquerade module hoping that would at least let me log in again as admin, but it wouldn't because admin was still stuck in this user mode. I also didn't understand some of the technical solutions, (i.e. query on the database).

However, I did come up with a solution and it was quite simple. After trying to cache out the browser and even trying to login on another browser... I went to another computer (IP) and tried to log on as admin and was successful. I quickly went over to /admin/settings/site-maintenance and switched the site back to "online" then went over to /admin/user/user and made the masquerade user an admin.

Then I came back to my computer and refreshed the page (I still had one page open) but also was able to go straight to the front page and see it online now. I just logged out as that user (who was now an admin), then went back to the other computer and logged off, and then logged back online on my computer as the Admin.

Anyway, it worked for me, so I thought I would share it here.

Gurpartap Singh’s picture

Status: Active » Closed (fixed)

Can't reproduce this with latest code, as you no more can masquerade as a user who doesn't have offline mode access(when the site is in that mode).