Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/171456
Change subject: Unconfirm the local user email in addition to the central one ...................................................................... Unconfirm the local user email in addition to the central one * Also added a sanity check to make sure the User class calls make sense Change-Id: Ifeca2a407855e9d284b6216e017d8ca290d07ddc --- M includes/BounceHandlerActions.php 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BounceHandler refs/changes/56/171456/1 diff --git a/includes/BounceHandlerActions.php b/includes/BounceHandlerActions.php index f4cd92c..d1049b7 100644 --- a/includes/BounceHandlerActions.php +++ b/includes/BounceHandlerActions.php @@ -31,6 +31,11 @@ * @param bool $bounceHandlerUnconfirmUsers Enable/Disable user un-subscribe action */ public function __construct( $wikiId, $bounceRecordPeriod, $bounceRecordLimit, $bounceHandlerUnconfirmUsers ) { + if ( $wikiId !== wfWikiID() ) { + // We want to use the User class methods, which make no sense on the wrong wiki + throw new MWException( "BounceHandlerActions constructed for a foreign wiki." ); + } + $this->wikiId = $wikiId; $this->bounceRecordPeriod = $bounceRecordPeriod; $this->bounceRecordLimit = $bounceRecordLimit; @@ -77,6 +82,7 @@ $bounceUserId = $failedUser['rawUserId']; $user = User::newFromId( $bounceUserId ); + // Handle the central account email status (if applicable) if ( class_exists( 'CentralAuthUser') ) { $caUser = CentralAuthUser::getInstance( $user ); if ( $caUser->isAttached( $this->wikiId ) ) { @@ -85,9 +91,9 @@ wfDebugLog( 'BounceHandler', "Un-subscribed global user $originalEmail for exceeding Bounce Limit $this->bounceRecordLimit" ); - return; } } + // Handle the local account email status $this->unConfirmUserEmail( $user ); } -- To view, visit https://gerrit.wikimedia.org/r/171456 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifeca2a407855e9d284b6216e017d8ca290d07ddc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BounceHandler Gerrit-Branch: master Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits