Page MenuHomeWickedGov Phorge

ApiFancyCaptchaReload.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

ApiFancyCaptchaReload.php

<?php
namespace MediaWiki\Extension\ConfirmEdit\FancyCaptcha;
use MediaWiki\Api\ApiBase;
/**
* Api module to reload FancyCaptcha
*
* @ingroup API
* @ingroup Extensions
*/
class ApiFancyCaptchaReload extends ApiBase {
public function execute() {
$result = $this->getResult();
if ( $this->getUser()->pingLimiter( 'badcaptcha', 1 ) ) {
$result->addValue( null, $this->getModuleName(), [ 'index' => 0 ] );
return;
}
# Get a new FancyCaptcha form data
$captcha = new FancyCaptcha();
$info = $captcha->getCaptcha();
$captchaIndex = $captcha->storeCaptcha( $info );
$result->addValue( null, $this->getModuleName(), [ 'index' => $captchaIndex ] );
}
/**
* @inheritDoc
* @codeCoverageIgnore Merely declarative
*/
public function isInternal() {
return true;
}
/**
* @inheritDoc
* @codeCoverageIgnore Merely declarative
*/
public function getAllowedParams() {
return [];
}
/**
* @see ApiBase::getExamplesMessages()
* @return array
* @codeCoverageIgnore Merely declarative
*/
protected function getExamplesMessages() {
return [
'action=fancycaptchareload'
=> 'apihelp-fancycaptchareload-example-1',
];
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Nov 23, 04:19 (3 d, 6 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9c/d2/8972166f8100cc6c820fde79626c
Default Alt Text
ApiFancyCaptchaReload.php (1 KB)

Event Timeline