mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-12 01:11:15 +00:00
* (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
This commit is contained in:
parent
9c9de7a021
commit
f1e64bbca8
|
@ -145,8 +145,12 @@ class SimpleCaptcha {
|
|||
* @return bool true to keep running callbacks
|
||||
*/
|
||||
function injectUserCreate( &$template ) {
|
||||
global $wgCaptchaTriggers, $wgOut;
|
||||
global $wgCaptchaTriggers, $wgOut, $wgUser;
|
||||
if( $wgCaptchaTriggers['createaccount'] ) {
|
||||
if( $wgUser->isAllowed( 'skipcaptcha' ) ) {
|
||||
wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" );
|
||||
return true;
|
||||
}
|
||||
$template->set( 'header',
|
||||
"<div class='captcha'>" .
|
||||
$wgOut->parse( $this->getMessage( 'createaccount' ) ) .
|
||||
|
@ -513,8 +517,12 @@ class SimpleCaptcha {
|
|||
* @return bool true to continue, false to abort user creation
|
||||
*/
|
||||
function confirmUserCreate( $u, &$message ) {
|
||||
global $wgCaptchaTriggers;
|
||||
global $wgCaptchaTriggers, $wgUser;
|
||||
if( $wgCaptchaTriggers['createaccount'] ) {
|
||||
if( $wgUser->isAllowed( 'skipcaptcha' ) ) {
|
||||
wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" );
|
||||
return true;
|
||||
}
|
||||
$this->trigger = "new account '" . $u->getName() . "'";
|
||||
if( !$this->passCaptcha() ) {
|
||||
$message = wfMsg( 'captcha-createaccount-fail' );
|
||||
|
|
Loading…
Reference in a new issue