r38796 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38795‎ | r38796 | r38797 >
Date:17:05, 7 August 2008
Author:brion
Status:old
Tags:
Comment:
* (bug 12142) CAPTCHA group exceptions only apply to edits
Applies the 'skipcaptcha' permission check also to the user creation form.
Patch by Emufarmers - https://bugzilla.wikimedia.org/attachment.cgi?id=5132
Modified paths:
  • /trunk/extensions/ConfirmEdit/ConfirmEdit_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/ConfirmEdit_body.php
@@ -145,8 +145,12 @@
146146 * @return bool true to keep running callbacks
147147 */
148148 function injectUserCreate( &$template ) {
149 - global $wgCaptchaTriggers, $wgOut;
 149+ global $wgCaptchaTriggers, $wgOut, $wgUser;
150150 if( $wgCaptchaTriggers['createaccount'] ) {
 151+ if( $wgUser->isAllowed( 'skipcaptcha' ) ) {
 152+ wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" );
 153+ return true;
 154+ }
151155 $template->set( 'header',
152156 "<div class='captcha'>" .
153157 $wgOut->parse( $this->getMessage( 'createaccount' ) ) .
@@ -513,8 +517,12 @@
514518 * @return bool true to continue, false to abort user creation
515519 */
516520 function confirmUserCreate( $u, &$message ) {
517 - global $wgCaptchaTriggers;
 521+ global $wgCaptchaTriggers, $wgUser;
518522 if( $wgCaptchaTriggers['createaccount'] ) {
 523+ if( $wgUser->isAllowed( 'skipcaptcha' ) ) {
 524+ wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" );
 525+ return true;
 526+ }
519527 $this->trigger = "new account '" . $u->getName() . "'";
520528 if( !$this->passCaptcha() ) {
521529 $message = wfMsg( 'captcha-createaccount-fail' );

Status & tagging log