mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-27 17:40:11 +00:00
1cfba87b23
Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: I60968f9b735b27eaef20e5d42af322a8c2ecd257
46 lines
901 B
PHP
46 lines
901 B
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() {
|
|
# Get a new FancyCaptcha form data
|
|
$captcha = new FancyCaptcha();
|
|
$info = $captcha->getCaptcha();
|
|
$captchaIndex = $captcha->storeCaptcha( $info );
|
|
|
|
$result = $this->getResult();
|
|
$result->addValue( null, $this->getModuleName(), [ 'index' => $captchaIndex ] );
|
|
return true;
|
|
}
|
|
|
|
/** @inheritDoc */
|
|
public function isInternal() {
|
|
return true;
|
|
}
|
|
|
|
/** @inheritDoc */
|
|
public function getAllowedParams() {
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* @see ApiBase::getExamplesMessages()
|
|
* @return array
|
|
*/
|
|
protected function getExamplesMessages() {
|
|
return [
|
|
'action=fancycaptchareload'
|
|
=> 'apihelp-fancycaptchareload-example-1',
|
|
];
|
|
}
|
|
}
|