diff -urN -X wiki-diff.excluded Wiki.orig/includes/SpecialUserlogin.php Wiki.Captcha/includes/SpecialUserlogin.php --- Wiki.orig/includes/SpecialUserlogin.php 2006-05-03 06:39:01.000000000 +0200 +++ Wiki.Captcha/includes/SpecialUserlogin.php 2006-05-07 20:18:53.000000000 +0200 @@ -5,6 +5,9 @@ * @subpackage SpecialPage */ +/* currently in extension, should be moved to includes ?! */ +require_once('extensions/captcha/captcha-class.php'); + /** * constructor */ @@ -27,7 +30,7 @@ class LoginForm { var $mName, $mPassword, $mRetype, $mReturnTo, $mCookieCheck, $mPosted; var $mAction, $mCreateaccount, $mCreateaccountMail, $mMailmypassword; - var $mLoginattempt, $mRemember, $mEmail, $mDomain; + var $mLoginattempt, $mRemember, $mEmail, $mDomain, $mCaptcha; /** * Constructor @@ -39,6 +42,7 @@ $this->mType = $request->getText( 'type' ); $this->mName = $request->getText( 'wpName' ); + $this->mCaptcha = $request->getText( 'wpCaptcha' ); $this->mPassword = $request->getText( 'wpPassword' ); $this->mRetype = $request->getText( 'wpRetype' ); $this->mDomain = $request->getText( 'wpDomain' ); @@ -235,6 +239,15 @@ return false; } + // 2005-12-30 /TR + $cap = new captcha(); + if ($cap->verify($this->mCaptcha) != true) { + /* there should be a new message for i18n @ LanguageXX.php */ + $this->mainLoginForm( "Additional captcha authentication failed!" ); + return false; + } + unset($cap); + if ( !$wgUser->isValidPassword( $this->mPassword ) ) { $this->mainLoginForm( wfMsg( 'passwordtooshort', $wgMinimalPasswordLength ) ); return false; diff -urN -X wiki-diff.excluded Wiki.orig/includes/templates/Userlogin.php Wiki.Captcha/includes/templates/Userlogin.php --- Wiki.orig/includes/templates/Userlogin.php 2006-04-28 21:32:12.000000000 +0200 +++ Wiki.Captcha/includes/templates/Userlogin.php 2006-05-07 20:15:20.000000000 +0200 @@ -89,6 +89,7 @@ class UsercreateTemplate extends QuickTemplate { function execute() { + global $wgScriptPath; if( $this->data['message'] ) { ?>
@@ -163,6 +164,26 @@ + + Captcha: + + + You will need a browser, which can display images. + + + + + + + + + + +