Poke the captcha image & help interface specials into $wgWhitelistRead if necessary

This commit is contained in:
Brion Vibber 2007-05-14 14:23:25 +00:00
parent 4cccd1b561
commit 5d072acbb9

View 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();
}
}
/**