Page MenuHomePhabricator

$wgProxyList blocking broken since 1.18
Closed, ResolvedPublic

Description

In User::getBlockedStatus(), proxy detection sets $this->mBlockedReason and $this->mBlockedby but doesn't set $this->mBlock, so getBlock/isBlocked don't see it.

Should probably synthesize a Block object here...?


Version: unspecified
Severity: normal

Details

Reference
bz34385

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:13 AM
bzimport set Reference to bz34385.
bzimport added a subscriber: Unknown Object (MLST).
brion created this task.Feb 13 2012, 11:52 PM

c_b_dvs wrote:

This may not be the best way to fix it, but I've found that modifying ./includes/specials/SpecialUserlogin.php to include a check for $wgUser->blockedBy() is able to get things working again.

The specific problem I was running into was that $wgProxyList seems to allow banned IPs to create accounts, but prevents them from editing. By setting up a bannedips.php file as specified on http://www.mediawiki.org/wiki/Manual:Combating_spam, I was able to prevent spam edits, but my Recent Changes were becoming bloated with a lot of bogus accounts.

Old:
if ( !$wgUser->isAllowed( 'createaccount' ) ) {

$wgOut->permissionRequired( 'createaccount' );
return false;

} elseif ( $wgUser->isBlockedFromCreateAccount() ) {

$this->userBlockedMessage();
return false;

}

New:
if ( $wgUser->blockedBy()){

$this->userBlockedMessage();
return false;

} elseif ( !$wgUser->isAllowed( 'createaccount' ) ) {

$wgOut->permissionRequired( 'createaccount' );
return false;

} elseif ( $wgUser->isBlockedFromCreateAccount() ) {

$this->userBlockedMessage();
return false;

}

This was fixed in bug 35303 / https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=commitdiff;h=eb5e031f310ddd8ba871219dd7fa939a904ea638

  • This bug has been marked as a duplicate of bug 35303 ***