Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Perhaps this would require significant functionality to accomplish in a secure manner, but I'm in a situation where I'd like certain users to be able to see a list of "active" users on the site, and temporarily become them. I don't like the masquerade block because there's too high a chance they'll mistype the username.
Comment | File | Size | Author |
---|---|---|---|
#4 | masquerade-1167744-7x.patch | 12.11 KB | wjaspers |
#3 | masquerade-add-views-functionality-1167744-7x.patch | 8.12 KB | wjaspers |
#1 | masquerade-add-views-functionality-1167744-7x.patch | 8.07 KB | wjaspers |
Comments
Comment #1
wjaspers CreditAttribution: wjaspers commentedHere you go.
I created a custom filter for views so you can generate a link directly from the user ID.
I don't know how secure generating links might be, but I went on as much code as made sense to me in the masquerade module itself.
This functionality also includes an access check before the link is generated to ensure the user is permitted to masquerade as another user (does not check if permitted to masquerade as admin). This also includes the option to specify a custom redirect URL--In my case, I wanted customer service people to be able to immediately jump from a view of open "carts" to a specific user's cart. The only caveat of this, is that Masquerade will forget where you left off.
Any further improvements or suggestions would be appreciated.
Comment #2
wjaspers CreditAttribution: wjaspers commentedComment #3
wjaspers CreditAttribution: wjaspers commentedSigh....once again, I didn't double check my filename headers closely enough.
Please review THIS patch, not the one above it.
Comment #4
wjaspers CreditAttribution: wjaspers commentedTry this one on for size.
Adds CTools Access support, and a Context module condition, as well as the views fields.
Comment #5
andypostGreat issue, I'd like it but it needs testing
PS: marked as duplicate #1089586: disable user search
Comment #6
andypostIs there any reviews? I'm going to include some changes in next realese
Also as I see there's Context, Ctools & Views plugins. I think it's hard to review all of them once
Comment #7
wjaspers CreditAttribution: wjaspers commentedI actually had a future idea for this too, where-in specific permissions could be restricted while masquerading .... (e.g. "Access Checkout" for Drupal commerce could be restricted, so customer service personnel could add something to a cart, but can't checkout for someone).
Comment #8
wjaspers CreditAttribution: wjaspers commentedDang laptop caused me to double post again.
Comment #9
andypostMostly everything great, except minor code-style; trailing whitespace and some formatting
Are you sure that version 2?
last 2 lines are useless
There's some trailing whitespace troubles in patch
Please leave this on one line
Comment #10
wjaspers CreditAttribution: wjaspers commentedSplitting into separate patchable issues:
#1305662: Add Views support
#1305668: Add Context module support
#1305672: Add CTools Plugins
Comment #11
vlooivlerke CreditAttribution: vlooivlerke commentedCould the Views Support work if I try and patch it against a D6 views 3 version?
Comment #12
wjaspers CreditAttribution: wjaspers commentedThe code would likely be the same, but the patch would start at a different line, and thus won't apply.
Shouldn't be too hard to port though.
Please post new comments on #1305662: Add Views support.