| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\ConfirmEdit\AbuseFilter; |
| 4 | |
| 5 | use MediaWiki\Extension\AbuseFilter\Consequences\Consequence\Consequence; |
| 6 | use MediaWiki\Extension\ConfirmEdit\Hooks; |
| 7 | |
| 8 | /** |
| 9 | * Show a CAPTCHA to the user before they can proceed with an action. |
| 10 | */ |
| 11 | class CaptchaConsequence extends Consequence { |
| 12 | |
| 13 | public function execute(): bool { |
| 14 | // This consequence was triggered, so we need to set a flag |
| 15 | // on the SimpleCaptcha instance to force showing the CAPTCHA. |
| 16 | Hooks::getInstance()->setForceShowCaptcha( true ); |
| 17 | return true; |
| 18 | } |
| 19 | } |