2020-03-03 22:50:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\User\Hook;
|
|
|
|
|
|
2023-09-19 12:13:45 +00:00
|
|
|
use MediaWiki\User\User;
|
2020-04-10 00:35:43 +00:00
|
|
|
|
2020-03-03 22:50:34 +00:00
|
|
|
/**
|
2020-09-26 13:18:43 +00:00
|
|
|
* This is a hook handler interface, see docs/Hooks.md.
|
|
|
|
|
* Use the hook name "UserAddGroup" to register handlers implementing this interface.
|
|
|
|
|
*
|
2020-07-13 09:05:49 +00:00
|
|
|
* @stable to implement
|
2020-03-03 22:50:34 +00:00
|
|
|
* @ingroup Hooks
|
|
|
|
|
*/
|
|
|
|
|
interface UserAddGroupHook {
|
|
|
|
|
/**
|
2022-05-09 09:09:00 +00:00
|
|
|
* This hook is called when adding a group or changing a group's expiry.
|
2020-03-03 22:50:34 +00:00
|
|
|
*
|
|
|
|
|
* @since 1.35
|
|
|
|
|
*
|
2020-04-22 05:11:50 +00:00
|
|
|
* @param User $user The user that is to have a group added
|
|
|
|
|
* @param string &$group The group to add; can be modified
|
|
|
|
|
* @param string|null &$expiry The expiry time in TS_MW format, or null if the group is not to
|
2020-03-03 22:50:34 +00:00
|
|
|
* expire; can be modified
|
2020-04-10 00:35:43 +00:00
|
|
|
* @return bool|void True or no return value to continue or false to abort (not add the group)
|
2020-03-03 22:50:34 +00:00
|
|
|
*/
|
|
|
|
|
public function onUserAddGroup( $user, &$group, &$expiry );
|
|
|
|
|
}
|