mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-14 19:30:11 +00:00
a0feac27b0
Change-Id: I2933639f9cb50db2101c4765ce9d8f9069d253b8
43 lines
822 B
PHP
43 lines
822 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 getAllowedParams() {
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* @see ApiBase::getExamplesMessages()
|
|
* @return array
|
|
*/
|
|
protected function getExamplesMessages() {
|
|
return [
|
|
'action=fancycaptchareload'
|
|
=> 'apihelp-fancycaptchareload-example-1',
|
|
];
|
|
}
|
|
}
|