From eb607f9b2f8b223327e7af7d83ddfc28ab6ea2dc Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Tue, 12 Feb 2013 22:57:56 +0100 Subject: [PATCH] Now the simple math captcha is combined with the cookie captcha. --- CookieCaptcha.class.php | 55 +++-------------------------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/CookieCaptcha.class.php b/CookieCaptcha.class.php index b96ac4c..46b0deb 100644 --- a/CookieCaptcha.class.php +++ b/CookieCaptcha.class.php @@ -1,51 +1,22 @@ pickImage(); - if ( !$info ) { - $resultArr['captcha']['error'] = 'Out of images'; - return; - } - $index = $this->storeCaptcha( $info ); - $title = SpecialPage::getTitleFor( '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. - */ function getForm() { global $wgCaptchaCookieName, $wgCaptchaCookieImage, $wgCaptchaCookieAlt, $wgCaptchaCookieStyle; - return "

" . + return parent::getForm() . "

" . Html::element( 'img', array( 'src' => $wgCaptchaCookieImage, 'alt' => $wgCaptchaCookieAlt, @@ -53,22 +24,4 @@ class CookieCaptcha extends SimpleCaptcha { "

\n"; } - /** - * Show a message asking the user to enter a captcha on edit - * The result will be treated as wiki text - * - * @param $action string Action being performed - * @return string - */ - /* - function getMessage( $action ) { - $name = 'fancycaptcha-' . $action; - $text = wfMessage( $name )->text(); - # Obtain a more tailored message, if possible, otherwise, fall back to - # the default for edits - return wfMessage( $name, $text )->isDisabled() ? - wfMessage( 'fancycaptcha-edit' )->text() : $text; - } - */ - } -- 2.39.5