From 4182a9001e32819d83e8cda4209d07cb6860267f Mon Sep 17 00:00:00 2001 From: Dmaza Date: Wed, 10 Jan 2018 21:23:33 +0000 Subject: [PATCH] Revert "Prevent new users from being sent emails" This reverts commit b52421dedd45fc035a2993d10ea90c878cd77453. Bug: T184470 Change-Id: I2f5fe8993c6e186cd2df0841292653f8fecc0254 --- includes/DefaultSettings.php | 1 - includes/specials/SpecialEmailuser.php | 27 ++------------------------ includes/user/User.php | 1 - languages/i18n/en.json | 1 - languages/i18n/qqq.json | 1 - 5 files changed, 2 insertions(+), 29 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index ee10a6d340..ab01c5f4d0 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5158,7 +5158,6 @@ $wgGroupPermissions['user']['sendemail'] = true; $wgGroupPermissions['user']['applychangetags'] = true; $wgGroupPermissions['user']['changetags'] = true; $wgGroupPermissions['user']['editcontentmodel'] = true; -$wgGroupPermissions['user']['sendemail-new-users'] = true; // Implicit group for accounts that pass $wgAutoConfirmAge $wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true; diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index 06ca04f5cd..f322ac40ef 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -238,35 +238,12 @@ class SpecialEmailUser extends UnlistedSpecialPage { return 'nowikiemail'; } - if ( $target->getEditCount() === 0 && - ( $sender === null || !$sender->isAllowed( 'sendemail-new-users' ) ) - ) { - // Determine if target has any other logged actions. - $dbr = wfGetDB( DB_REPLICA ); - $log_id = $dbr->selectField( - 'logging', - 'log_id', - [ - 'log_user' => $target->getId(), - "NOT (log_type = 'newusers' AND log_action = 'autocreate')", - ], - __METHOD__, - [ 'LIMIT' => 1 ] - ); - - if ( !$log_id ) { - wfDebug( "User has no logged actions on this wiki.\n" ); - - return 'nowikiemail'; - } - } - if ( $sender !== null && !$target->getOption( 'email-allow-new-users' ) && $sender->isNewbie() ) { - wfDebug( "User does not allow user emails from new users.\n" ); + wfDebug( "User does not allow user emails from new users.\n" ); - return 'nowikiemail'; + return 'nowikiemail'; } if ( $sender !== null ) { diff --git a/includes/user/User.php b/includes/user/User.php index b26a577292..390c4b8105 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -179,7 +179,6 @@ class User implements IDBAccessObject, UserIdentity { 'reupload-shared', 'rollback', 'sendemail', - 'sendemail-new-users', 'siteadmin', 'suppressionlog', 'suppressredirect', diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 2b48338e8c..42ea35cd35 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1240,7 +1240,6 @@ "right-siteadmin": "Lock and unlock the database", "right-override-export-depth": "Export pages including linked pages up to a depth of 5", "right-sendemail": "Send email to other users", - "right-sendemail-new-users": "Send email to users with no logged actions", "right-managechangetags": "Create and (de)activate [[Special:Tags|tags]]", "right-applychangetags": "Apply [[Special:Tags|tags]] along with one's changes", "right-changetags": "Add and remove arbitrary [[Special:Tags|tags]] on individual revisions and log entries", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 8a6f8ee3fd..e7e0f42d69 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -1435,7 +1435,6 @@ "right-siteadmin": "{{doc-right|siteadmin}}", "right-override-export-depth": "{{doc-right|override-export-depth}}", "right-sendemail": "{{doc-right|sendemail}}", - "right-sendemail-new-users": "{{doc-right|sendemail-new-users}}", "right-managechangetags": "{{doc-right|managechangetags}}", "right-applychangetags": "{{doc-right|applychangetags}}", "right-changetags": "{{doc-right|changetags}}", -- 2.20.1