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.

Comments

Status:Active» Needs review
StatusFileSize
new5.14 KB

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

StatusFileSize
new3.49 KB

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.

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

Status:Needs review» Needs work

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