Closed (fixed)
Project:
Masquerade
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 May 2010 at 02:56 UTC
Updated:
7 Jun 2014 at 20:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dman commentedWell, a quick answer would be that:
- when offline, the role you masquerade as would not be able to see anything.
So, um, it's being authentic as to what you can and cannot do. That's the logic.
I do see the reason for your feature request though. It would be a bit of a twist - behave like that user except for this extra condition which overrides the true masquerade behavior. Not sure what it would take to built special cases like that in though. In this case it would be useful.
It may be that offline mode is detected before masquerade ever bootstraps. Basic offline mode is admin-or-nobody.
Dunno really, but I can see why it's like this at the moment.
Comment #2
alberto56 commented@dman thanks for your answer, makes total sense. I was thinking of an "exception", but maybe it wouldn't be that elegant a solution.
Comment #3
alberto56 commentedWell, not really, users other than user 1 can access the site even when it is offline. Here is my specific usecase:
So, I don't see there being an exception here. I am curious as to why masquerade is incompatible with Offline mode.
Comment #4
alberto56 commentedAnother note on this: Devel's "Switch User" block allows you to switch users even when offline.
Devel's Switch User is much like Masquerade but I prefer the later because Switch User doesn't allow you to switch to the anonymous User.
Of course, maybe it is that functionality (switching to the anonymous user) which just doesn't make sense in Offline mode, because you wouldn't see anything. How about just preventing one from masquerading as anonymous in Offline mode, but allowing masquerading as any other user?
Comment #5
deviantintegral commentedDrupal 6 allows for any user with the "administer site configuration" permission to view the site while offline. You could give that permission to anonymous users... but that's not recommended for obvious reasons.
I've attached a patch which fixes a bug in that the API allows for appropriate users to switch while offline. I've also updated the error message text to indicate which users can switch while offline.
Comment #6
alberto56 commentedNice patch! I tested it on my site and it works perfectly. The error message is a lot clearer like this because it's far from obvious that the "administer site configuration" is required to view the site in offline mode.
Cheers,
Albert.
Comment #7
alberto56 commentedComment #8
deviantintegral commentedHere is a patch against HEAD. I'll be committing both of these in a moment.
Comment #9
deviantintegral commented