Page MenuHomePhabricator

Hooks on blocking, but not for unblocking.
Closed, ResolvedPublic


Currently there are two hooks for when a user is blocked in SpecialBlock, BlockIp and BlockIpComplete, but none for unblocking a user in SpecialUnblock. So if an extension needs to reliably add and remove information about user blocks that extension will never be able to hook in to see when a user block is removed through SpecialUnblock.

At a minimum a similar UnblockIpComplete hook would be ideal.

Version: 1.20.x
Severity: enhancement

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:41 AM
bzimport set Reference to bz48546.
bzimport added a subscriber: Unknown Object (MLST).

Were you hoping to be able to use this hook in any particular extension?
What parameters does it need? Just performer, target and reason?

I planned to use this in an authentication extension that obeys blocking rules. This could be useful in the OpenID extension and other people that need to spreading blocking rules across wiki farms.

Passing in $performer and $block should be ideal. The $block contains the target and other relevant data. I believe the new unblock reason would have to be passed in since the existing $block would contain the original reason for blocking.

Sample documentation:
'UnblockIpComplete': after an IP address or user is unblocked
$performer: The user performing the unblock
$block: The Block object that was modified or deleted
$reason: The new reason to unblocking the block target.

Change 329725 had a related patch set uploaded (by MtDu):
Add 'UnblockUser' and 'UnblockUserComplete' hooks to Special:Unblock

Change 329725 merged by jenkins-bot:
Add 'UnblockUser' and 'UnblockUserComplete' hooks to Special:Unblock

TTO assigned this task to MtDu.
TTO edited projects, added Google-Code-In-2016; removed Patch-For-Review.
TTO added a subscriber: TTO.

Added UnblockUser and UnblockUserComplete hooks.