-
Improvement
-
Resolution: Fixed
-
Minor
-
3.1.5
-
None
I'm developing a custom discussion system for bans, warnings and username changes and would like to know when someone gets unbanned manually. Therefore, I added
{{ /**
- Use this event to perform actions after the unban has been performed
* - @event core.acp_unban_after
- @var string mode One of the following: user, ip, email
- @var string user_ids_ary Array with user_ids
- @since
*/
$vars = array(
'mode',
'user_ids_ary',
);
extract($phpbb_dispatcher->trigger_event('core.user_unban', compact($vars)));}}
to the end of user_unban() in includes/functions_user.php. I also added a similar event to user_ban().
In phpBB 3.1.5 the events core.acp_ban_after and core.mcp_ban_after are available, but there are no events for unbans.
I prefer adding events for user bans and unbans in includes/functions_user.php above using events in the mcp and acp files. At the locations in functions_user.php more checks and computations have been done. In the case of the user_ban function, I did need the end date of the ban instead of 'ban of 30 minutes'. However, I would be satisfied too if the mcp and acp get events for unbans.