Poke the captcha image & help interface specials into $wgWhitelistRead if necessary
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 14 May 2007 14:23:25 +0000 (14:23 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 14 May 2007 14:23:25 +0000 (14:23 +0000)
ConfirmEdit.php

index 729322b9962cb3401f6173c40c04d4dd6a7fa2d8..0b0677a31ad695e3e2a851f022d1201ff1fea46b 100644 (file)
@@ -179,6 +179,18 @@ function ceSetup() {
        $wgHooks['LoginAuthenticateAudit'][] = array( &$wgCaptcha, 'triggerUserLogin' );
        $wgHooks['UserLoginForm'][] = array( &$wgCaptcha, 'injectUserLogin' );
        $wgHooks['AbortLogin'][] = array( &$wgCaptcha, 'confirmUserLogin' );
+       
+       global $wgGroupPermissions, $wgCaptchaTriggers;
+       if( !$wgGroupPermissions['*']['read'] && $wgCaptchaTriggers['badlogin'] ) {
+               // We need to ensure that the captcha interface is accessible
+               // so that unauthenticated users can actually get in after a
+               // mistaken password typing.
+               global $wgWhitelistRead;
+               $image = Title::makeTitle( NS_SPECIAL, 'Captcha/image' );
+               $help = Title::makeTitle( NS_SPECIAL, 'Captcha/help' );
+               $wgWhitelistRead[] = $image->getPrefixedText();
+               $wgWhitelistRead[] = $help->getPrefixedText();
+       }
 }
 
 /**