jenkins-bot has submitted this change and it was merged.

Change subject: Adding UserInvalidateEmailComplete hook to CentralAuth.
......................................................................


Adding UserInvalidateEmailComplete hook to CentralAuth.

Change-Id: I6f3d284c3f6b23e4baa9f11134d6bcd318d5fabb
---
M CentralAuth.php
M CentralAuthHooks.php
M CentralAuthUser.php
3 files changed, 16 insertions(+), 1 deletion(-)

Approvals:
  Hoo man: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CentralAuth.php b/CentralAuth.php
index 9aaff35..0273bec 100644
--- a/CentralAuth.php
+++ b/CentralAuth.php
@@ -207,6 +207,7 @@
 $wgHooks['UserArrayFromResult'][] = 'CentralAuthHooks::onUserArrayFromResult';
 $wgHooks['UserGetEmail'][] = 'CentralAuthHooks::onUserGetEmail';
 $wgHooks['UserGetEmailAuthenticationTimestamp'][] = 
'CentralAuthHooks::onUserGetEmailAuthenticationTimestamp';
+$wgHooks['UserInvalidateEmailComplete'][] = 
'CentralAuthHooks::onUserInvalidateEmailComplete';
 $wgHooks['UserSetEmail'][] = 'CentralAuthHooks::onUserSetEmail';
 $wgHooks['UserSaveSettings'][] = 'CentralAuthHooks::onUserSaveSettings';
 $wgHooks['UserSetEmailAuthenticationTimestamp'][] = 
'CentralAuthHooks::onUserSetEmailAuthenticationTimestamp';
diff --git a/CentralAuthHooks.php b/CentralAuthHooks.php
index 6dc45d1..f89e1ce 100644
--- a/CentralAuthHooks.php
+++ b/CentralAuthHooks.php
@@ -708,6 +708,20 @@
 
        /**
         * @param $user
+        * @return bool
+        */
+       static function onUserInvalidateEmailComplete( $user ) {
+               $ca = CentralAuthUser::getInstance( $user );
+               if ( $ca->isAttached() ) {
+                       $ca->setEmail( '' );
+                       $ca->setEmailAuthenticationTimestamp( null );
+                       $ca->saveSettings();
+               }
+               return true;
+       }
+
+       /**
+        * @param $user
         * @param $email
         * @return bool
         */
diff --git a/CentralAuthUser.php b/CentralAuthUser.php
index 93c1294..0b6d1b5 100644
--- a/CentralAuthUser.php
+++ b/CentralAuthUser.php
@@ -1862,7 +1862,7 @@
        }
 
        /**
-        * @param  $email
+        * @param string $email
         * @return void
         */
        function setEmail( $email ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/61912
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6f3d284c3f6b23e4baa9f11134d6bcd318d5fabb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Pgehres <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to