X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialEmailuser.php;h=06ca04f5cda0b24340fb2b9a6062bcbb97ec15c3;hp=d57ba094659cd2ca8a90d7d52e6b44dbb7a43d76;hb=08edb27f6ce31c676660a4ef89b87da79bde2cc2;hpb=2443406d3765e31dc734ea74985420773940c37d diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index d57ba09465..06ca04f5cd 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -238,9 +238,8 @@ class SpecialEmailUser extends UnlistedSpecialPage { return 'nowikiemail'; } - if ( - $target->getEditCount() === 0 - && ( $sender === null || !$sender->isAllowed( 'sendemail-new-users' ) ) + if ( $target->getEditCount() === 0 && + ( $sender === null || !$sender->isAllowed( 'sendemail-new-users' ) ) ) { // Determine if target has any other logged actions. $dbr = wfGetDB( DB_REPLICA ); @@ -262,6 +261,14 @@ class SpecialEmailUser extends UnlistedSpecialPage { } } + if ( $sender !== null && !$target->getOption( 'email-allow-new-users' ) && + $sender->isNewbie() + ) { + wfDebug( "User does not allow user emails from new users.\n" ); + + return 'nowikiemail'; + } + if ( $sender !== null ) { $blacklist = $target->getOption( 'email-blacklist', [] ); if ( $blacklist ) {