Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
After updating to rc7, I can no longer masquerade as the Anonymous User even if I have the 'masquerade as any user' permission.
I still have yet to learn how to create a patch file, but I add the following lines of code to the masquerade_block_1_validate function:
$to_uid = db_select('users', 'u')
->fields('u', array('uid'))
->condition('u.name', $name, '=')
->execute()
->fetchField();
+ if ($name == variable_get('anonymous',t("Anonymous"))) { //Added 3 lines starting at line 662
+ $to_uid = 0;
+ }
if ($to_uid !== FALSE) {
$allowed = user_access('masquerade as any user') ||
db_select('masquerade_users', 'm')
->fields('m', array('uid_to'))
->condition('m.uid_to', $to_uid, '=')
->condition('m.uid_from', $user->uid, '=')
->execute()
->fetchField();
}
This allows for masquerading as Anonymous.
Comment | File | Size | Author |
---|---|---|---|
#1 | masquerade-allow_masquerading_as_anonymous-2238927-1.patch | 549 bytes | cs_shadow |
Comments
Comment #1
cs_shadow CreditAttribution: cs_shadow commentedAttaching a patch as suggested in the description though not sure if this is the best way to fix this.
(@swamiman: Its fairly easy to make a patch. You can refer this documentation for the same if you wish: https://drupal.org/node/707484)
Comment #2
deekayen CreditAttribution: deekayen commentedPerhaps I need to be more blunt about this issue, since the request keeps popping up. If you want to test anonymous, log out. The solution to doing anonymous masquerading isn't as simple as 3 lines of code.
Comment #3
swamiman CreditAttribution: swamiman commentedForgive me for assuming that anonymous masquerading was part of the code. Prior to rc7 it was available. I used it, but if it wasn't suppose to happen, my mistake. I suggest that the anonymous user be removed from the masquerade autocomplete options.
Comment #4
spidersilk CreditAttribution: spidersilk commentedThis all seems a little strange, because masquerading as Anonymous was always possible before... I'm curious as to why it suddenly became impossible with rc7.
Comment #5
RaulMuroc CreditAttribution: RaulMuroc commentedThe same here with rc7 version no possibility to masquerade anonymous user.
Comment #6
deekayen CreditAttribution: deekayen commentedMasquerading as anonymous hasn't always worked. It depends on who the maintainer of the week is. 8.x won't support anonymous masquerading. Just logout if you want to be anonymous.
Comment #7
RaulMuroc CreditAttribution: RaulMuroc commentedThen this module has almost no sense because 90% of time what annoys us (Developers) is to Logout to see theming issues, css....
Is not a complain, is only to be aware that possibly this module will lose users if doesn't support Anonymous Masquerade. Me, the first who stops use it for now :S
Comment #8
alexverb CreditAttribution: alexverb commentedWhy not have a constructive discussion about this legitimate feature request instead of saying "just logout"? The biggest usage of this module is people doing role testing. As it happens to be, anonymous is a role and deserves to be supported by masquerade.
We don't actually care how difficult it may be to incorporate this functionality. If you lay out the problems for us we can try helping overcome those difficulties.
Comment #9
nvahalik CreditAttribution: nvahalik at Code and Salt commentedI'd like to add that now most browsers have a private browsing function and you're not even required to log out. Just create a private browsing window and do whatever you need.
Closing again, given that the request was already closed twice.