Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F25243753
0001-Don-t-send-email-notifs-to-blocked-users-if-wgBlockD.patch
Catrope (Roan Kattouw)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Catrope
Aug 22 2018, 10:12 PM
2018-08-22 22:12:13 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
0001-Don-t-send-email-notifs-to-blocked-users-if-wgBlockD.patch
View Options
From ade0321c66bf8a221cd5e98e39f304249c7e8d80 Mon Sep 17 00:00:00 2001
From: Roan Kattouw <roan.kattouw@gmail.com>
Date: Wed, 22 Aug 2018 15:09:30 -0700
Subject: [PATCH] Don't send email notifs to blocked users if
$wgBlockDisablesLogin is true
Bug: T199993
Change-Id: I47ed3599d61ca8177cdd0820dea4089fdb087d82
---
includes/Notifier.php | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/includes/Notifier.php b/includes/Notifier.php
index fd5068cf..3d7ef59c 100644
--- a/includes/Notifier.php
+++ b/includes/Notifier.php
@@ -31,16 +31,22 @@ class EchoNotifier {
* @return bool
*/
public static function notifyWithEmail( $user, $event ) {
- global $wgEnableEmail;
-
- if ( !$wgEnableEmail ) {
- return false;
- }
- // No valid email address or email notification
- if ( !$user->isEmailConfirmed() || $user->getOption( 'echo-email-frequency' ) < 0 ) {
+ global $wgEnableEmail, $wgBlockDisablesLogin;
+
+ if (
+ // Email is globally disabled
+ !$wgEnableEmail ||
+ // User does not have a valid and confirmed email address
+ !$user->isEmailConfirmed() ||
+ // User has disabled Echo emails
+ $user->getOption( 'echo-email-frequency' ) < 0 ||
+ // User is blocked and cannot log in (T199993)
+ ( $wgBlockDisablesLogin && $user->isBlocked() )
+ ) {
return false;
}
+
// Final check on whether to send email for this user & event
if ( !Hooks::run( 'EchoAbortEmailNotification', [ $user, $event ] ) ) {
return false;
--
2.17.1
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6313690
Default Alt Text
0001-Don-t-send-email-notifs-to-blocked-users-if-wgBlockD.patch (1 KB)
Attached To
Mode
T199993: Indef blocked users can get information exposed per mail
Attached
Detach File
Event Timeline
Log In to Comment