I have been bugged for some time by a problem with getting access denied messages when attempting to switch back. I had a look and it has to do with menu caching. Since the access property makes use of the $GLOBALS['masquerading'] for almost all of the menu items provided by the module they should not be cached. If the user has actually logged in recently and has a cached menu it will not have the masquerade menu items in it, making it impossible to switch back. I have attached a patch which fixes this. I figure that all of the other menu items using this GLOBAL should be non-cached as well. Perhaps the cache_clear_all at logout and switchback are an attempt to fix this and can now be removed as well?
Comment | File | Size | Author |
---|---|---|---|
#3 | masquerade.module_4.patch | 1.89 KB | amowafy |
masquerade.module_3.patch | 1.54 KB | zarko | |
Comments
Comment #1
zarko CreditAttribution: zarko commentedHEAD seems to still point to 1.15 of this filem so I suppose that this is a patch against 5.x-1.x-dev really.
Comment #2
melsawy CreditAttribution: melsawy commented+1
Comment #3
amowafy CreditAttribution: amowafy commentedThis patch for 5.x-1.1 but also for switching to user
Comment #4
btully CreditAttribution: btully commentedamowafy -
Thanks a bunch for this patch. I've applied it to 5.x-1.1 and it seems to fix the access denied bug like a charm. I can now actually switch back! Hopefully the author will include this patch in the next release as without it Masquerade becomes unusable.
cheers,
brian
Comment #5
Gurpartap Singh CreditAttribution: Gurpartap Singh commentedThanks amowafy! But I did not include your changes to
drupal_goto()
, as it is unrelated to the issue; and works great as well.Thanks!
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.