Index: trunk/phase3/includes/User.php |
— | — | @@ -2381,6 +2381,7 @@ |
2382 | 2382 | ); |
2383 | 2383 | wfRunHooks( 'UserSaveSettings', array( $this ) ); |
2384 | 2384 | $this->clearSharedCache(); |
| 2385 | + $this->getUserPage()->invalidateCache(); |
2385 | 2386 | } |
2386 | 2387 | |
2387 | 2388 | /** |
— | — | @@ -2914,6 +2915,10 @@ |
2915 | 2916 | * @return \type{\bool} True if allowed |
2916 | 2917 | */ |
2917 | 2918 | function canSendEmail() { |
| 2919 | + global $wgEnableEmail, $wgEnableUserEmail; |
| 2920 | + if( !$wgEnableEmail || !$wgEnableUserEmail ) { |
| 2921 | + return false; |
| 2922 | + } |
2918 | 2923 | $canSend = $this->isEmailConfirmed(); |
2919 | 2924 | wfRunHooks( 'UserCanSendEmail', array( &$this, &$canSend ) ); |
2920 | 2925 | return $canSend; |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -1573,14 +1573,10 @@ |
1574 | 1574 | } |
1575 | 1575 | |
1576 | 1576 | function showEmailUser( $id ) { |
1577 | | - global $wgEnableEmail, $wgEnableUserEmail, $wgUser; |
1578 | | - return $wgEnableEmail && |
1579 | | - $wgEnableUserEmail && |
1580 | | - $wgUser->isLoggedIn() && # show only to signed in users |
1581 | | - 0 != $id; # we can only email to non-anons .. |
1582 | | -# '' != $id->getEmail() && # who must have an email address stored .. |
1583 | | -# 0 != $id->getEmailauthenticationtimestamp() && # .. which is authenticated |
1584 | | -# 1 != $wgUser->getOption('disablemail'); # and not disabled |
| 1577 | + global $wgUser; |
| 1578 | + $targetUser = User::newFromId( $id ); |
| 1579 | + return $wgUser->canSendEmail() && # the sending user must have a confirmed email address |
| 1580 | + $targetUser->canReceiveEmail(); # the target user must have a confirmed email address and allow emails from users |
1585 | 1581 | } |
1586 | 1582 | |
1587 | 1583 | function emailUserLink() { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -168,7 +168,9 @@ |
169 | 169 | lead to this hook being called (it was previously only called from within Article.php |
170 | 170 | * Maximum execution time for shell processes on linux is now configured with |
171 | 171 | $wgMaxShellTime (180 seconds by default) |
172 | | - |
| 172 | +* (bug 1306) 'Email user' link no longer shown on user page when emailing |
| 173 | + is not available due to lack of confirmed address or disabled preference |
| 174 | + |
173 | 175 | === Bug fixes in 1.14 === |
174 | 176 | |
175 | 177 | * (bug 14907) DatabasePostgres::fieldType now defined. |