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.
This will let other modules affect masquerade's behavior, and identify when masquerade events are about to take place, or when they do take place. See the attached patch.
This patch adds:
- HOOK_masquerade_to_begin(): Identifies when a masquerade is about to start.
- HOOK_masquerade_to_end(): Identifies when a masquerade is about to end.
- HOOK_masquerade_began(): Identifies when a masquerade has started.
- HOOK_masquerade_ended(): Identifies when a masquerade has ended.
Comment | File | Size | Author |
---|---|---|---|
#2 | masquerade-7x-add-api-1458418-2.patch | 3.49 KB | mrfelton |
Comments
Comment #1
wjaspers CreditAttribution: wjaspers commentedNoticed a minor documentation mistake. I should be accessing parameters by reference. But easy fix. See attached.
Comment #2
mrfelton CreditAttribution: mrfelton commentedPatch updated to apply to latest dev code. @wjaspers, is this implementation compatible with your 7.x-1.x-rules branch of masquerade_extras. Haven't actually tried it yet, but I assume you wrote the code in that branch with this patch installed since ti relies on the hooks defined here.
Comment #3
wjaspers CreditAttribution: wjaspers commented@mrfelton,
This is compatible with the 7.x-1.x branch.
All I need to do is drop in the submodule which contains the rules implementation needed.
Comment #4
wjaspers CreditAttribution: wjaspers commentedI also noticed your version of the patch is missing the .api.php documentation file.
Comment #5
wjaspers CreditAttribution: wjaspers commentedCross referencing #1547058: Add hooks when user starts or stops masquerading
Comment #6
andypostI think it's not good idea to expose 4 hooks, in related issue only 2