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.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wjaspers’s picture

Status: Active » Needs review
FileSize
5.14 KB

Noticed a minor documentation mistake. I should be accessing parameters by reference. But easy fix. See attached.

mrfelton’s picture

Patch 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.

wjaspers’s picture

@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.

wjaspers’s picture

Status: Needs review » Needs work

I also noticed your version of the patch is missing the .api.php documentation file.

wjaspers’s picture

andypost’s picture

Issue summary: View changes
Related issues: +#1547058: Add hooks when user starts or stops masquerading

I think it's not good idea to expose 4 hooks, in related issue only 2