From: Sam Reed Date: Sun, 11 Dec 2011 15:31:17 +0000 (+0000) Subject: * (bug 32960) remove EmailAuthenticationTimestamp from database when a X-Git-Tag: 1.31.0-rc.0~26086 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=b5f11fa813cf0784af22799cbdb7f69d33ee71a0;p=lhc%2Fweb%2Fwiklou.git * (bug 32960) remove EmailAuthenticationTimestamp from database when a email address is removed In Preferences::trySetUserEmail no point trying to reset the users email if it's the same Same for User::setEmail After setting the email though, invalidate email auth tokens --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index a98a6b6bc8..da9ca28375 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -176,6 +176,8 @@ production. * (bug 31212) History tab not collapsed when the screen is narrow * (bug 15521) Use new section summary when the action of adding a new section also happens to create the page +* (bug 32960) remove EmailAuthenticationTimestamp from database when a + email address is removed === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/Preferences.php b/includes/Preferences.php index 27603cb34f..c77e9eabb8 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1428,8 +1428,6 @@ class Preferences { # The user has supplied a new email address on the login page # new behaviour: set this new emailaddr from login-page into user database record $user->setEmail( $newaddr ); - # But flag as "dirty" = unauthenticated - $user->invalidateEmail(); if ( $wgEmailAuthentication ) { # Mail a temporary password to the dirty address. # User can come back through the confirmation URL to re-enable email. @@ -1440,7 +1438,7 @@ class Preferences { } $info = 'eauth'; } - } else { + } elseif ( $newaddr != $oldaddr ) { // if the address is the same, don't change it $user->setEmail( $newaddr ); } if ( $oldaddr != $newaddr ) { @@ -1474,7 +1472,7 @@ class Preferences { class PreferencesForm extends HTMLForm { // Override default value from HTMLForm protected $mSubSectionBeforeFields = false; - + private $modifiedUser; public function setModifiedUser( $user ) { @@ -1553,7 +1551,7 @@ class PreferencesForm extends HTMLForm { function getBody() { return $this->displaySection( $this->mFieldTree, '', 'mw-prefsection-' ); } - + /** * Get the for a given section key. Normally this is the * prefs-$key message but we'll allow extensions to override it. diff --git a/includes/User.php b/includes/User.php index 53b8fd970b..73bae4a1db 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2110,7 +2110,11 @@ class User { */ public function setEmail( $str ) { $this->load(); + if( $str == $this->mEmail ) { + return; + } $this->mEmail = $str; + $this->invalidateEmail(); wfRunHooks( 'UserSetEmail', array( $this, &$this->mEmail ) ); }