mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-24 08:13:53 +00:00
12361c5f31
This adds HTML, CSS, and JS to FancyCaptcha output to refresh the image, which requests it via a new fancycaptchareload API. It also cleans up the Asirra class a little. Bug: 14230 Change-Id: I4e476f32de199534c9798fc78e8490b3ef91dd45
35 lines
726 B
PHP
35 lines
726 B
PHP
<?
|
|
/**
|
|
* 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();
|
|
$captchaIndex = $captcha->getCaptchaIndex();
|
|
|
|
$result = $this->getResult();
|
|
$result->addValue( null, $this->getModuleName(), array ( 'index' => $captchaIndex ) );
|
|
return true;
|
|
}
|
|
|
|
public function getDescription() {
|
|
return 'Get a new FancyCaptcha.';
|
|
}
|
|
|
|
public function getAllowedParams() {
|
|
return array();
|
|
}
|
|
|
|
public function getParamDescription() {
|
|
return array();
|
|
}
|
|
|
|
public function getExamples() {
|
|
return array( 'api.php?action=fancycaptchareload&format=xml' );
|
|
}
|
|
}
|