r36918 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36917‎ | r36918 | r36919 >
Date:15:00, 2 July 2008
Author:demon
Status:old
Tags:
Comment:
(bug 13918), make CAPTCHA less obtrusive. Added a new global $wgCaptchaBadLoginAttempts which can be set to allow 1 (or more) failed attempts before triggering the captcha on login. Default is 0 (current behavior).
Modified paths:
  • /trunk/extensions/ConfirmEdit/ConfirmEdit.php (modified) (history)
  • /trunk/extensions/ConfirmEdit/ConfirmEdit_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/ConfirmEdit_body.php
@@ -204,8 +204,8 @@
205205 * @access private
206206 */
207207 function isBadLoginTriggered() {
208 - global $wgMemc;
209 - return intval( $wgMemc->get( $this->badLoginKey() ) ) > 0;
 208+ global $wgMemc, $wgCaptchaBadLoginAttempts;
 209+ return intval( $wgMemc->get( $this->badLoginKey() ) ) > $wgCaptchaBadLoginAttempts;
210210 }
211211
212212 /**
Index: trunk/extensions/ConfirmEdit/ConfirmEdit.php
@@ -149,6 +149,14 @@
150150 global $ceAllowConfirmedEmail;
151151 $ceAllowConfirmedEmail = false;
152152
 153+/**
 154+ * Number of bad login attempts allowed before triggering the captcha.
 155+ *
 156+ * Default is 0.
 157+ */
 158+global $wgCaptchaBadLoginAttempts;
 159+$wgCaptchaBadLoginAttempts = 0;
 160+
153161 /**
154162 * Regex to whitelist URLs to known-good sites...
155163 * For instance:

Status & tagging log