Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1426075
CaptchaConsequence.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1006 B
Referenced Files
None
Subscribers
None
CaptchaConsequence.php
View Options
<?php
namespace
MediaWiki\Extension\ConfirmEdit\AbuseFilter
;
use
MediaWiki\Extension\AbuseFilter\Consequences\Consequence\Consequence
;
use
MediaWiki\Extension\ConfirmEdit\CaptchaTriggers
;
use
MediaWiki\Extension\ConfirmEdit\Hooks
;
use
MediaWiki\Logger\LoggerFactory
;
/**
* Show a CAPTCHA to the user before they can proceed with an action.
*/
class
CaptchaConsequence
extends
Consequence
{
public
function
execute
():
bool
{
$action
=
$this
->
parameters
->
getAction
();
if
(
!
in_array
(
$action
,
CaptchaTriggers
::
CAPTCHA_TRIGGERS
)
)
{
LoggerFactory
::
getInstance
(
'ConfirmEdit'
)->
error
(
'Filter {filter}: {action} is not defined in the list of triggers known to ConfirmEdit'
,
[
'action'
=>
$action
,
'filter'
=>
$this
->
parameters
->
getFilter
()->
getID
()
]
);
return
true
;
}
// This consequence was triggered, so we need to set a flag
// on the SimpleCaptcha instance to force showing the CAPTCHA.
Hooks
::
getInstance
(
$action
)->
setForceShowCaptcha
(
true
);
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 12:31 (1 d, 1 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
75/a7/c37951829cfde11b6cae642aaba9
Default Alt Text
CaptchaConsequence.php (1006 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment