| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\SpecialPage\Hook; |
| 4 | |
| 5 | use MediaWiki\Auth\AuthenticationRequest; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "AuthChangeFormFields" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface AuthChangeFormFieldsHook { |
| 15 | /** |
| 16 | * This hook is called after converting a field information array obtained |
| 17 | * from a set of AuthenticationRequest classes into a form descriptor; hooks |
| 18 | * can tweak the array to change how login etc. forms should look. |
| 19 | * |
| 20 | * @since 1.35 |
| 21 | * |
| 22 | * @param AuthenticationRequest[] $requests Array of AuthenticationRequests the fields |
| 23 | * are created from |
| 24 | * @param array $fieldInfo Field information array (union of all |
| 25 | * AuthenticationRequest::getFieldInfo() responses) |
| 26 | * @param array &$formDescriptor HTMLForm descriptor. The special key 'weight' can be set |
| 27 | * to change the order of the fields. |
| 28 | * @param string $action One of the AuthManager::ACTION_* constants |
| 29 | * @return bool|void True or no return value to continue or false to abort |
| 30 | */ |
| 31 | public function onAuthChangeFormFields( $requests, $fieldInfo, |
| 32 | &$formDescriptor, $action |
| 33 | ); |
| 34 | } |