summaryrefslogtreecommitdiff
path: root/extensions/ConfirmEdit/ApiFancyCaptchaReload.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /extensions/ConfirmEdit/ApiFancyCaptchaReload.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'extensions/ConfirmEdit/ApiFancyCaptchaReload.php')
-rw-r--r--extensions/ConfirmEdit/ApiFancyCaptchaReload.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/extensions/ConfirmEdit/ApiFancyCaptchaReload.php b/extensions/ConfirmEdit/ApiFancyCaptchaReload.php
new file mode 100644
index 00000000..1de1947d
--- /dev/null
+++ b/extensions/ConfirmEdit/ApiFancyCaptchaReload.php
@@ -0,0 +1,34 @@
+<?
+/**
+ * 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' );
+ }
+}