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 commentedNoticed a minor documentation mistake. I should be accessing parameters by reference. But easy fix. See attached.
Comment #2
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 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 commentedI also noticed your version of the patch is missing the .api.php documentation file.
Comment #5
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
Comment #7
ressaThanks for working on this. In an attempt to help the maintainers, I am going through some of the Drupal 7 issues, and closing them, since Drupal 7 is EOL.
Maintainers should grant credit for the great work to the relevant users, even if the patch did not get committed: https://www.drupal.org/docs/develop/issues/issue-procedures-and-etiquett....
Since Drupal 7 is EOL, we can probably close this issue, but feel free to re-open if this is still relevant, and we should consider adding this to the Drupal 11 version?