]> ToastFreeware Gitweb - toast/cookiecaptcha.git/blobdiff - FancyCaptcha.class.php
Localisation updates for extension messages from Betawiki (2008-09-29 09:31 CEST)
[toast/cookiecaptcha.git] / FancyCaptcha.class.php
index abdb2f8842bfa2f25a3b5b3c972d3d563197e59a..cf723d76315704bd67b4c4bbe1ab153059ace8ac 100644 (file)
@@ -24,6 +24,20 @@ class FancyCaptcha extends SimpleCaptcha {
                }
        }
 
+       function addCaptchaAPI(&$resultArr) {
+               $info = $this->pickImage();
+               if( !$info ) {
+                       $resultArr['captcha']['error'] = 'Out of images';
+                       return;
+               }
+               $index = $this->storeCaptcha( $info );
+               $title = Title::makeTitle( NS_SPECIAL, 'Captcha/image' );
+               $resultArr['captcha']['type'] = 'image';
+               $resultArr['captcha']['mime'] = 'image/png';
+               $resultArr['captcha']['id'] = $index;
+               $resultArr['captcha']['url'] = $title->getLocalUrl( 'wpCaptchaId=' . urlencode( $index ) );             
+       }
+
        /**
         * Insert the captcha prompt into the edit form.
         */