Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1819
emailuser_hide.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 8:11 PM
2014-11-21 20:11:18 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
emailuser_hide.patch
View Options
Index: User.php
===================================================================
--- User.php (revision 41858)
+++ User.php (working copy)
@@ -2369,6 +2369,7 @@
);
wfRunHooks( 'UserSaveSettings', array( $this ) );
$this->clearSharedCache();
+ $this->getUserPage()->invalidateCache();
}
/**
@@ -2902,6 +2903,10 @@
* @return \type{\bool} True if allowed
*/
function canSendEmail() {
+ global $wgEnableEmail, $wgEnableUserEmail;
+ if( !wgEnableEmail || !$wgEnableUserEmail ) {
+ return false;
+ }
$canSend = $this->isEmailConfirmed();
wfRunHooks( 'UserCanSendEmail', array( &$this, &$canSend ) );
return $canSend;
Index: Skin.php
===================================================================
--- Skin.php (revision 41858)
+++ Skin.php (working copy)
@@ -1569,14 +1569,10 @@
}
function showEmailUser( $id ) {
- global $wgEnableEmail, $wgEnableUserEmail, $wgUser;
- return $wgEnableEmail &&
- $wgEnableUserEmail &&
- $wgUser->isLoggedIn() && # show only to signed in users
- 0 != $id; # we can only email to non-anons ..
-# '' != $id->getEmail() && # who must have an email address stored ..
-# 0 != $id->getEmailauthenticationtimestamp() && # .. which is authenticated
-# 1 != $wgUser->getOption('disablemail'); # and not disabled
+ global $wgUser;
+ $targetUser = User::newFromId( $id );
+ return $wgUser->canSendEmail() && # the sending user must have a confirmed email address
+ $targetUser->canReceiveEmail(); # the target user must have a confirmed email address and allow emails from users
}
function emailUserLink() {
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1402
Default Alt Text
emailuser_hide.patch (1 KB)
Attached To
Mode
T3306: Suppress the "email this user" link in the toolbox if said user has opted not to/can't receive emails
Attached
Detach File
Event Timeline
Log In to Comment