Florianschmidtwelzow has uploaded a new change for review.
https://gerrit.wikimedia.org/r/185674
Change subject: Hygiene: Set action for createuser and badlogin
......................................................................
Hygiene: Set action for createuser and badlogin
CAPTCHA classes should always be possible to detect the actual action,
which triggered the CAPTCHA. E.g. to add special fields in getForm().
Change-Id: Ie95305b2e6dcbf527a23c92613755092185e6a05
---
M Captcha.php
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ConfirmEdit
refs/changes/74/185674/1
diff --git a/Captcha.php b/Captcha.php
index b176096..8f7b650 100644
--- a/Captcha.php
+++ b/Captcha.php
@@ -134,6 +134,7 @@
function injectEmailUser( &$form ) {
global $wgCaptchaTriggers, $wgOut, $wgUser;
if ( $wgCaptchaTriggers['sendemail'] ) {
+ $this->action = 'sendemail';
if ( $wgUser->isAllowed( 'skipcaptcha' ) ) {
wfDebug( "ConfirmEdit: user group allows
skipping captcha on email sending\n" );
return true;
@@ -156,6 +157,7 @@
function injectUserCreate( &$template ) {
global $wgCaptchaTriggers, $wgOut, $wgUser;
if ( $wgCaptchaTriggers['createaccount'] ) {
+ $this->action = 'usercreate';
if ( $wgUser->isAllowed( 'skipcaptcha' ) ) {
wfDebug( "ConfirmEdit: user group allows
skipping captcha on account creation\n" );
return true;
@@ -179,6 +181,7 @@
function injectUserLogin( &$template ) {
if ( $this->isBadLoginTriggered() ) {
global $wgOut;
+ $this->action = 'badlogin';
$template->set( 'header',
"<div class='captcha'>" .
$wgOut->parse( $this->getMessage( 'badlogin' )
) .
--
To view, visit https://gerrit.wikimedia.org/r/185674
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie95305b2e6dcbf527a23c92613755092185e6a05
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits