From 5d072acbb99cfd6f5d64021d4adcefaf4d6569a9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 14 May 2007 14:23:25 +0000 Subject: [PATCH] Poke the captcha image & help interface specials into $wgWhitelistRead if necessary --- ConfirmEdit.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ConfirmEdit.php b/ConfirmEdit.php index 729322b99..0b0677a31 100644 --- a/ConfirmEdit.php +++ b/ConfirmEdit.php @@ -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(); + } } /**