| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | use MediaWiki\Session\Session; |
| 6 | use MediaWiki\User\UserIdentity; |
| 7 | |
| 8 | /** |
| 9 | * This is a hook handler interface, see docs/Hooks.md. |
| 10 | * Use the hook name "TempUserCreatedRedirect" to register handlers implementing this interface. |
| 11 | * |
| 12 | * @stable to implement |
| 13 | * @ingroup Hooks |
| 14 | */ |
| 15 | interface TempUserCreatedRedirectHook { |
| 16 | /** |
| 17 | * This hook is called after an action causes a temporary user to be |
| 18 | * created or after the first successful edit for a temporary account. |
| 19 | * The handler may modify the redirect URL. |
| 20 | * |
| 21 | * To differentiate between invocations of this hook where a) the account |
| 22 | * was created in the current request and b) the account existed, but made |
| 23 | * a first successful edit, one can examine the registration date of the |
| 24 | * account. |
| 25 | * |
| 26 | * @since 1.39 |
| 27 | * |
| 28 | * @param Session $session |
| 29 | * @param UserIdentity $user |
| 30 | * @param string $returnTo The prefixed DB key of the title to redirect to |
| 31 | * @param string $returnToQuery An extra query part |
| 32 | * @param string $returnToAnchor Either an empty string or a fragment beginning with "#" |
| 33 | * @param string &$redirectUrl The URL to redirect to |
| 34 | * @return bool|null |
| 35 | */ |
| 36 | public function onTempUserCreatedRedirect( |
| 37 | Session $session, |
| 38 | UserIdentity $user, |
| 39 | string $returnTo, |
| 40 | string $returnToQuery, |
| 41 | string $returnToAnchor, |
| 42 | &$redirectUrl |
| 43 | ); |
| 44 | } |