dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Warn if stateful ParserOutput transforms are used"
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialEmailuser.php
diff --git
a/includes/specials/SpecialEmailuser.php
b/includes/specials/SpecialEmailuser.php
index
30eb38d
..
f322ac4
100644
(file)
--- a/
includes/specials/SpecialEmailuser.php
+++ b/
includes/specials/SpecialEmailuser.php
@@
-224,15
+224,29
@@
class SpecialEmailUser extends UnlistedSpecialPage {
wfDebug( "Target is invalid user.\n" );
return 'notarget';
wfDebug( "Target is invalid user.\n" );
return 'notarget';
- } elseif ( !$target->isEmailConfirmed() ) {
+ }
+
+ if ( !$target->isEmailConfirmed() ) {
wfDebug( "User has no valid email.\n" );
return 'noemail';
wfDebug( "User has no valid email.\n" );
return 'noemail';
- } elseif ( !$target->canReceiveEmail() ) {
+ }
+
+ if ( !$target->canReceiveEmail() ) {
wfDebug( "User does not allow user emails.\n" );
return 'nowikiemail';
wfDebug( "User does not allow user emails.\n" );
return 'nowikiemail';
- } elseif ( $sender !== null ) {
+ }
+
+ 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 ) {
$lookup = CentralIdLookup::factory();
$blacklist = $target->getOption( 'email-blacklist', [] );
if ( $blacklist ) {
$lookup = CentralIdLookup::factory();