From fb95ba0b14c230c0cd354cf97cd03b19c1cc78d9 Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Sun, 4 Oct 2009 16:26:43 +0000 Subject: [PATCH] redoing r38040: two new hooks for email confirmation/invalidation, both are in User class now so they should work even if email is confirmed through password reset (etc.) --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 6 ++++++ includes/User.php | 2 ++ 3 files changed, 10 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c8a71ef035..159736d96a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -237,6 +237,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * New permission 'sendemail' added. Default right for all registered users. Can for example be used to prevent new accounts from sending spam. * (bug 16979) Tracking categories for __INDEX__ and __NOINDEX__ +* Two new hooks, ConfirmEmailComplete and InvalidateEmailComplete, which are + called after a user's email has been successfully confirmed or invalidated. === Bug fixes in 1.16 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 6e7d816068..ea24b0a4bd 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -564,6 +564,9 @@ $catpage: CategoryPage instance $unpatrolled: Whether or not we are showing unpatrolled changes. $watched: Whether or not the change is watched by the user. +'ConfirmEmailComplete': Called after a user's email has been confirmed successfully +&$user: user (object) whose email is being confirmed + 'ContribsPager::getQueryInfo': Before the contributions query is about to run &$pager: Pager object for contributions &queryInfo: The query for the contribs Pager @@ -844,6 +847,9 @@ but after noinclude/includeonly/onlyinclude and other processing. &$text: string containing partially parsed text &$this->mStripState: Parser's internal StripState object +'InvalidateEmailComplete': Called after a user's email has been invalidated successfully +&$user: user (object) whose email is being invalidated + 'IsFileCacheable': Override the result of Article::isFileCacheable() (if true) $article: article (object) being checked diff --git a/includes/User.php b/includes/User.php index 2c4592f6f1..cc74765449 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2946,6 +2946,7 @@ class User { */ function confirmEmail() { $this->setEmailAuthenticationTimestamp( wfTimestampNow() ); + wfRunHooks( 'ConfirmEmailComplete', array( &$this ) ); return true; } @@ -2960,6 +2961,7 @@ class User { $this->mEmailToken = null; $this->mEmailTokenExpires = null; $this->setEmailAuthenticationTimestamp( null ); + wfRunHooks( 'InvalidateEmailComplete', array( &$this ) ); return true; } -- 2.20.1