mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-24 00:04:15 +00:00
b2b1fd4c98
Change-Id: I3477f762309ff6e276afee0c38d731cb05ed8ed6
46 lines
887 B
PHP
46 lines
887 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\ConfirmEdit\FancyCaptcha;
|
|
|
|
use 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',
|
|
];
|
|
}
|
|
}
|