2013-06-28 23:18:10 +00:00
|
|
|
<?php
|
2013-01-17 02:00:09 +00:00
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
|
2014-10-28 19:08:41 +00:00
|
|
|
/**
|
|
|
|
* @deprecated since MediaWiki core 1.25
|
|
|
|
*/
|
2013-01-17 02:00:09 +00:00
|
|
|
public function getDescription() {
|
|
|
|
return 'Get a new FancyCaptcha.';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getAllowedParams() {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
2014-10-28 19:08:41 +00:00
|
|
|
/**
|
|
|
|
* @deprecated since MediaWiki core 1.25
|
|
|
|
*/
|
2013-01-17 02:00:09 +00:00
|
|
|
public function getExamples() {
|
|
|
|
return array( 'api.php?action=fancycaptchareload&format=xml' );
|
|
|
|
}
|
2014-10-28 19:08:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see ApiBase::getExamplesMessages()
|
|
|
|
*/
|
|
|
|
protected function getExamplesMessages() {
|
|
|
|
return array(
|
|
|
|
'action=fancycaptchareload'
|
|
|
|
=> 'apihelp-fancycaptchareload-example-1',
|
|
|
|
);
|
|
|
|
}
|
2013-01-17 02:00:09 +00:00
|
|
|
}
|