2024-05-04 20:28:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\ConfirmEdit\AbuseFilter;
|
|
|
|
|
|
|
|
use MediaWiki\Extension\AbuseFilter\Consequences\Consequence\Consequence;
|
2024-05-15 08:23:46 +00:00
|
|
|
use MediaWiki\Extension\ConfirmEdit\Hooks;
|
2024-05-04 20:28:51 +00:00
|
|
|
|
|
|
|
/**
|
2024-05-15 08:23:46 +00:00
|
|
|
* Show a CAPTCHA to the user before they can proceed with an action.
|
2024-05-04 20:28:51 +00:00
|
|
|
*/
|
|
|
|
class CaptchaConsequence extends Consequence {
|
|
|
|
|
|
|
|
public function execute(): bool {
|
2024-05-15 08:23:46 +00:00
|
|
|
// This consequence was triggered, so we need to set a flag
|
|
|
|
// on the SimpleCaptcha instance to force showing the CAPTCHA.
|
|
|
|
Hooks::getInstance()->setForceShowCaptcha( true );
|
2024-05-04 20:28:51 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|